3 # Before using, you should figure out all the .m4 macros that your
4 # configure.m4 script needs and make sure they exist in the autoconf/
7 # These are the files that this script might edit:
8 # aclocal.m4 configure Makefile.in src/config.h.in \
9 # depcomp config.guess config.sub install-sh missing mkinstalldirs \
12 # Here's a command you can run to see what files aclocal will import:
13 # aclocal -I ../autoconf --output=- | sed -n 's/^m4_include..\([^]]*\).*/\1/p'
18 trap 'rm -f aclocal.m4.tmp' EXIT
20 # Use version 1.9 of aclocal and automake if available.
22 if test -z `which "$ACLOCAL"`; then
27 if test -z `which "$AUTOMAKE"`; then
31 # glibtoolize is used for Mac OS X
33 if test -z `which "$LIBTOOLIZE"`; then
34 LIBTOOLIZE=glibtoolize
37 # aclocal tries to overwrite aclocal.m4 even if the contents haven't
38 # changed, which is annoying when the file is not open for edit (in
39 # p4). We work around this by writing to a temp file and just
40 # updating the timestamp if the file hasn't change.
41 "$ACLOCAL" --force -I m4 --output=aclocal.m4.tmp
42 if cmp aclocal.m4.tmp aclocal.m4; then
43 touch aclocal.m4 # pretend that we regenerated the file
46 mv aclocal.m4.tmp aclocal.m4 # we did set -e above, so we die if this fails
49 grep -q LIBTOOL configure.ac && "$LIBTOOLIZE" -c -f
50 autoconf -f -W all,no-obsolete
52 "$AUTOMAKE" -a -c -f -W all