Mike Dodd | 8cfa702 | 2010-11-17 11:12:26 -0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # run to generate needed files not in CVS |
| 4 | |
| 5 | # NB: if you run this file with AUTOMAKE, AUTOCONF, etc. environment |
| 6 | # variables set, you *must* run "configure" with the same variables |
| 7 | # set. this is because "configure" will embed the values of these variables |
| 8 | # into the generated Makefiles, as @AUTOMAKE@, @AUTOCONF@ etc. and it will |
| 9 | # trigger regeneration of configuration state using those programs when any |
| 10 | # of Makefile.am etc. change. |
| 11 | |
| 12 | run() { |
| 13 | echo "Running $1 ..." |
| 14 | $1 |
| 15 | } |
| 16 | |
| 17 | set -e |
| 18 | |
| 19 | ACLOCAL=${ACLOCAL:-aclocal} |
| 20 | AUTOHEADER=${AUTOHEADER:-autoheader} |
| 21 | AUTOMAKE=${AUTOMAKE:-automake} |
| 22 | AUTOCONF=${AUTOCONF:-autoconf} |
| 23 | |
| 24 | if $AUTOMAKE --version | grep -q 1.4 |
| 25 | then |
| 26 | echo "" |
| 27 | echo "Automake 1.4 not supported. please set \$AUTOMAKE" |
| 28 | echo "to point to a newer automake, or upgrade." |
| 29 | echo "" |
| 30 | exit 1 |
| 31 | fi |
| 32 | |
| 33 | if test -n "$1"; then |
| 34 | echo "autogen.sh doesn't take any options" >&2 |
| 35 | exit 1 |
| 36 | fi |
| 37 | |
| 38 | libtoolize --automake -c |
| 39 | run "$ACLOCAL -I m4" |
| 40 | run $AUTOHEADER |
| 41 | run "$AUTOMAKE --foreign --add-missing --copy" |
| 42 | run $AUTOCONF |