]> jfr.im git - irc/rizon/znc.git/blob - autogen.sh
Write forceserver and webircpassword to conf
[irc/rizon/znc.git] / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3 # This is based on various examples which can be found everywhere.
4 set -e
5
6 FLAGS=${FLAGS--Wall}
7 ACLOCAL=${ACLOCAL-aclocal}
8 AUTOHEADER=${AUTOHEADER-autoheader}
9 AUTOCONF=${AUTOCONF-autoconf}
10 AUTOMAKE=${AUTOMAKE-automake}
11 ACLOCAL_FLAGS="${ACLOCAL_FLAGS--I m4} ${FLAGS}"
12 AUTOHEADER_FLAGS="${AUTOHEADER_FLAGS} ${FLAGS}"
13 AUTOCONF_FLAGS="${AUTOCONF_FLAGS} ${FLAGS}"
14 AUTOMAKE_FLAGS="${AUTOMAKE_FLAGS---add-missing} ${FLAGS}"
15
16 die() {
17 echo "$@"
18 exit 1
19 }
20 do_cmd() {
21 echo "Running '$@'"
22 $@
23 }
24
25 test -f configure.ac || die "No configure.ac found."
26
27 # Generate aclocal.m4 for use by autoconf
28 do_cmd $ACLOCAL $ACLOCAL_FLAGS
29 # Generate zncconfig.h.in for configure
30 do_cmd $AUTOHEADER $AUTOHEADER_FLAGS
31 # Generate configure
32 do_cmd $AUTOCONF $AUTOCONF_FLAGS
33
34 if grep PKG_CHECK_MODULES configure > /dev/null
35 then
36 rm configure
37 die "ERROR: pkg-config not found. Install pkg-config and run $0 again"
38 fi
39
40 # Copy config.sub, config.guess, install.sh, ...
41 # This will complain that we don't use automake, let's just ignore that
42 do_cmd $AUTOMAKE $AUTOMAKE_FLAGS || true
43 test -f config.guess -a -f config.sub -a -f install-sh ||
44 die "Automake didn't install config.guess, config.sub and install-sh!"
45
46 echo "(Yes, automake is supposed to fail, ignore that)"
47 echo
48
49 echo "You may now run ./configure."