-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap
More file actions
executable file
·72 lines (64 loc) · 1.35 KB
/
Copy pathbootstrap
File metadata and controls
executable file
·72 lines (64 loc) · 1.35 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env bash
set -euo pipefail
do_configure=0
prefix="${HOME}/CUnitHome"
configure_args=()
usage() {
cat <<'EOF'
Usage: ./bootstrap [--configure] [--prefix PATH] [-- CONFIGURE_ARGS...]
Regenerates Autotools files using autoreconf.
By default this does not run ./configure.
Options:
--configure Run ./configure after autoreconf.
--prefix PATH Prefix used when --configure is set.
--help Show this help.
Backward compatibility:
A single positional argument is treated as --prefix PATH and implies --configure.
EOF
}
while [ $# -gt 0 ]; do
case "$1" in
--configure)
do_configure=1
shift
;;
--prefix)
shift
if [ $# -eq 0 ]; then
echo "ERROR: --prefix requires a value." >&2
exit 1
fi
prefix="$1"
shift
;;
--help|-h)
usage
exit 0
;;
--)
shift
configure_args+=("$@")
break
;;
-*)
echo "ERROR: unknown option '$1'." >&2
usage >&2
exit 1
;;
*)
prefix="$1"
do_configure=1
shift
;;
esac
done
mkdir -p m4
autoreconf -fvi
if [ "$do_configure" -eq 1 ]; then
mkdir -p "$prefix"
./configure --srcdir="$(pwd)" --prefix="$prefix" "${configure_args[@]}"
else
echo
echo "Bootstrap complete."
echo "Next step: ./configure --prefix=\$HOME/.local [options]"
fi