-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap
executable file
·52 lines (45 loc) · 1.48 KB
/
bootstrap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
URL="http://stout.crest.iu.edu/hpx"
DIR=$(mktemp -d "${TMPDIR:-/tmp}"/hpx.XXXXXXX)
CONTRIB=contrib
# set the array of tarball deps here
contrib_tars=("photon-1.1.tar.bz2" "libcuckoo-59bfd4b.tar.gz"
"jemalloc-4.1.0.tar.bz2" "libffi-e9de7e3.tar.gz")
# set matching md5sums for each tarball
contrib_md5=("7698b85a6952ac3a99131af0b6f7d4b3" "0fef91a953a04977e8f7d58ce395a2e0"
"c4e53c947905a533d5899e5cc3da1f94" "c3f381d8fd2fd611b472fb4971c4f546")
# and matching target contrib directories
contrib_dirs=("photon" "libcuckoo" "jemalloc" "libffi")
# set the command to fetch the tarballs
CMD="wget --quiet -O"
if ! type "wget" > /dev/null; then
CMD="curl --silent -o"
fi
echo -n "Downloading and extracting contrib tarballs..."
for ((i=0; i<${#contrib_tars[@]}; i++)); do
dir=${contrib_dirs[$i]}
file=${contrib_tars[$i]}
md5=${contrib_md5[$i]}
if [ -f ${CONTRIB}/$dir/.md5 ]; then
omd5=`cat ${CONTRIB}/$dir/.md5`
else
omd5=""
fi
if [ ! -f ${CONTRIB}/$dir/configure ] || [ ! "$omd5" == "$md5" ]; then
echo -n "$dir..."
$CMD ${DIR}/$file ${URL}/$dir/$md5/$file
if [ $? -ne 0 ]; then
echo
echo "!!! Error downloading $dir contrib with md5sum $md5"
continue
fi
mkdir -p ${CONTRIB}/$dir
tar --strip-components=1 -xf ${DIR}/$file -C ${CONTRIB}/$dir
echo -n $md5 > ${CONTRIB}/$dir/.md5
fi
done
rm -rf ${DIR}
echo "DONE"
set -e
autoreconf --force --install -I config || exit 1
rm -rf autom4te.cache