From ffc15b1799ac9ec3d8979d61d16f8d9169bd5c4f Mon Sep 17 00:00:00 2001 From: Bernhard Rosenkraenzer Date: Tue, 25 Sep 2001 18:34:11 +0000 Subject: Autoconf 2.1x support --- ChangeLog | 7 +++---- autogen.sh | 31 ++++++++++++++++++++++++++++++- configure.in | 2 +- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a3dd1ca..737c3c8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,10 +9,9 @@ m4/init.m4, m4/install.m4, m4/largefile.m4, m4/lcmessage.m4, m4/header.m4, m4/isc-posix.m4, m4/missing.m4, m4/progtest.m4, m4/sanity.m4: - Fix build with autoconf 2.5x, try to retain 2.1x compatibility - for now - * autogen.sh: Use aclocal -I rather than the crude - cat m4/* >acinclude.m4 hack + Fix build with autoconf 2.5x, retain 2.1x compatibility for now + * autogen.sh: Add some crude hacks to make it possible to build with + both autoconf 2.5x and 2.1x * acconfig.h: removed (no longer required) * Makefile.am: add cvs-clean target * doc/grep.texi, doc/grep.1, NEWS: Document changes 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 diff --git a/configure.in b/configure.in index 2b012574..f773a0d8 100644 --- a/configure.in +++ b/configure.in @@ -54,7 +54,7 @@ AC_REPLACE_FUNCS(memchr stpcpy strtoul atexit fnmatch) jm_AC_PREREQ_XSTRTOUMAX dnl Replace this with jm_CHECK_DECLS once autoconf 2.15 is out. -jm_CHECK_DECLARATIONS([#include ], strtoul strtoull) +jm_CHECK_DECLARATIONS([#include ], [strtoul strtoull]) test $jm_cv_func_decl_strtoul != yes AC_DEFINE_UNQUOTED([HAVE_DECL_STRTOUL], $?, [Define if declares strtoul.]) -- cgit v1.2.1