Drop AC_COPYRIGHT call; clean up a bit.
[seven-1.x.git] / ircd / bootstrap
blob9e54494b9ecba3b81879c9f0c9b8087aaeed3a1f
1 #!/bin/bash
4 prog="$(basename $0)"
6 force=no
7 configure=no
9 # {{{ usage()
10 usage() {
11 echo "Usage: $prog [options...]"
12 echo " -f, --force Force run of \`autoconf' and \`autoheader'"
13 echo " -c, --conf Run \`configure' after bootstrapping"
14 echo " -h, --help Display usage information"
15 exit 0
17 # }}}
19 # {{{ die()
20 die() {
21 echo "${prog}: error: $*" >&2
22 exit 1
24 # }}}
26 while [[ $# > 0 ]]; do
27 arg="$1"
28 shift
30 case "${arg}" in
31 -f|--force)
32 force=yes
35 -c|--conf)
36 configure=yes
37 break 2
40 -h|--help)
41 usage
45 die "invalid argument \`${arg}'"
47 esac
48 done
50 [[ -e configure.ac ]] || \
51 die "this script must be run from top-level source directory"
53 if [[ ${force} == yes || ! -e configure || configure.ac -nt configure ]]; then
54 echo "bootstrapping..."
55 for tool in auto{conf,header}; do
56 ${tool} || die "${tool} failed"
57 done
60 if [[ ${configure} == yes ]]; then
61 echo "configuring..."
62 ./configure "$@" || die "configure failed"
65 exit 0
68 # vim: ts=8 sw=8 noet fdm=marker tw=80