-
Notifications
You must be signed in to change notification settings - Fork 2
/
bootstrap
executable file
·49 lines (41 loc) · 893 Bytes
/
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
#!/bin/bash
usage() {
cat <<EOF 1>&2
Usage: $0 $@
Parameters:
--help: This!
--libtool: run libtoolize (with parameters \$LIBTOOL).
--gnulibtool: run gnulib-tool (with parameters \$GNULIBTOOL).
Rebuilds the entire configure infrastructure.
Autoreconf is run with parameters \$AUTORECONF.
EOF
exit -1
}
runif() {
local test=$1
shift
if ${!test}; then
echo "Running: $@"
"$@"
local r=$?
[[ $r != 0 ]] && exit $r
fi
return 0
}
autoreconf=:
libtool=false
gnulibtool=false
for i ; do
case "$i" in
--libtool) libtool=: ;;
--gnulibtool) gnulibtool=: ;;
--help) usage ;;
*=*) eval "$i" ;;
*) break ;;
esac
shift
done
[[ $# != 0 ]] && usage
runif gnulibtool gnulib-tool --import $GNULIBTOOL
runif libtool libtoolize -c --ltdl $LIBTOOL
runif autoreconf autoreconf -v --install $AUTORECONF