Remove spy hooks.
[seven.git] / bootstrap
bloba54145058cc394c370c9c5447b14cee945d34332
1 #!/bin/bash
3 prog="$(basename $0)"
5 force=no
6 configure=no
8 # {{{ usage()
9 usage() {
10 echo "Usage: $prog [options...]"
11 echo " -f, --force Force run of \`autoconf' and \`autoheader'"
12 echo " -c, --conf Run \`configure' after bootstrapping"
13 echo " -h, --help Display usage information"
14 exit 0
16 # }}}
18 # {{{ die()
19 die() {
20 echo "${prog}: error: $*" >&2
21 exit 1
23 # }}}
25 while [[ $# > 0 ]]; do
26 arg="$1"
27 shift
29 case "${arg}" in
30 -f|--force)
31 force=yes
34 -c|--conf)
35 configure=yes
36 break 2
39 -h|--help)
40 usage
44 die "invalid argument \`${arg}'"
46 esac
47 done
49 [[ -e configure.ac ]] || \
50 die "this script must be run from top-level source directory"
52 if [[ ${force} == yes || ! -e configure || configure.ac -nt configure ]]; then
53 echo "bootstrapping..."
54 for tool in auto{conf,header}; do
55 ${tool} || die "${tool} failed"
56 done
59 if [[ ${configure} == yes ]]; then
60 echo "configuring..."
61 ./configure "$@" || die "configure failed"
64 exit 0
67 # vim: ts=8 sw=8 noet fdm=marker tw=80