summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Rosenkraenzer <bero@arklinux.org>2001-09-25 18:34:11 +0000
committerBernhard Rosenkraenzer <bero@arklinux.org>2001-09-25 18:34:11 +0000
commitffc15b1799ac9ec3d8979d61d16f8d9169bd5c4f (patch)
treeb35d7b7df63f4fb6a24fee15a35f588979ad646e
parent559e7ad1ab14aafe58fbbdd3b96c9120fd1ef923 (diff)
downloadgrep-ffc15b1799ac9ec3d8979d61d16f8d9169bd5c4f.tar.gz
Autoconf 2.1x support
-rw-r--r--ChangeLog7
-rwxr-xr-xautogen.sh31
-rw-r--r--configure.in2
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 <stdlib.h>], strtoul strtoull)
+jm_CHECK_DECLARATIONS([#include <stdlib.h>], [strtoul strtoull])
test $jm_cv_func_decl_strtoul != yes
AC_DEFINE_UNQUOTED([HAVE_DECL_STRTOUL], $?,
[Define if <stdlib.h> declares strtoul.])