summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh31
1 files changed, 30 insertions, 1 deletions
diff --git a/autogen.sh b/autogen.sh
index 6740c04d..cc22725f 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,5 +1,34 @@
#!/bin/sh
-aclocal -I `dirname $0`/m4
+# We want to support both legacy and current autoconf - this is a bit ugly...
+AC_VERSION=`autoconf --version 2>&1 |cut -d' ' -f3 |sed -e "s/\.//;s/[a-z]//"`
+if test -z "$AC_VERSION"; then
+ echo "Warning: Couldn't determine autoconf version. Assuming a current version."
+ AC_VERSION=252
+fi
+if test "$AC_VERSION" -lt 250; then
+ rm -f acinclude.m4
+ echo "#undef ssize_t" >acconfig.h
+ for i in m4/*.m4; do
+ if cat $i |grep -q "jm_"; then
+ cat $i >>acinclude.m4
+ elif test ! -e /usr/share/aclocal/`basename $i`; then
+ cat $i >>acinclude.m4
+ fi
+ done
+ aclocal
+else
+ aclocal -I m4
+fi
autoheader
automake -a
+if test "$AC_VERSION" -lt 250; then
+ # Workaround for a bug in ancient versions of autoheader
+ sed -e 's,#undef $,/* your autoheader is buggy */,g' config.hin >config.hin.new
+ rm config.hin
+ mv config.hin.new config.hin
+ # Make sure config.hin doesn't get rebuilt after the workaround
+ sed -e 's,@AUTOHEADER@,true,' Makefile.in >Makefile.in.new
+ rm Makefile.in
+ mv Makefile.in.new Makefile.in
+fi
autoconf