libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 7/6] remove dependency on Autoconf 2.62


From: Paolo Bonzini
Subject: [PATCH 7/6] remove dependency on Autoconf 2.62
Date: Fri, 7 Nov 2008 14:54:40 +0100

This patch is just a proposal, I don't really think it is needed to
apply it.  It removes the build dependency on Autoconf 2.62, but
at the price of requiring a working `printf' to be either a
builtin of a shell in the path, or the first `printf' in the
path.

In addition, there is some duplicate code in the patch, and it relies
on some M4sh internals, so I'm not really convinced it is the best thing
to do.

* configure.ac: Lower requisites.
* libltdl/config/general.m4sh: Look for a shell with a good printf.
Use printf instead of $as_echo.
* libltdl/config/ltmain.m4sh: Disable _AS_DETECT_BETTER_SHELL and
related macros.
* tests/testsuite.at: Look for a shell with a good printf.
Use printf instead of $as_echo.

---
 configure.ac                |    2 +-
 libltdl/config/general.m4sh |   17 ++++++++++++++++-
 libltdl/config/ltmain.m4sh  |    5 +++++
 tests/testsuite.at          |   14 +++++++++++++-
 4 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 56325f7..c1eb1c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 ####
 
 
-AC_PREREQ(2.62)dnl Some m4sh scripts use $as_echo
+AC_PREREQ(2.60)dnl We use _AS_DETECT_BETTER_SHELL
 dnl Oldest automake required for bootstrap is below in AM_INIT_AUTOMAKE.
 
 
diff --git a/libltdl/config/general.m4sh b/libltdl/config/general.m4sh
index bd740fd..4a8f608 100644
--- a/libltdl/config/general.m4sh
+++ b/libltdl/config/general.m4sh
@@ -43,9 +43,24 @@ M4SH_IN_HEADER([dnl
 progpath="$0"
 ])
 
+m4_ifndef([_AS_DETECT_BETTER_SHELL],
+[m4_fatal([M4sh from Autoconf 2.60+ required])])
+
+m4_define([M4SH_ECHO_TEST],
+  
[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+  ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+  ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+  test "X`printf %s $ECHO`" = "X$ECHO"])
+
+_AS_DETECT_SUGGESTED([
+  PATH=/tmp/nonexistent; export PATH;
+  FPATH=$PATH; export FPATH;
+  M4SH_ECHO_TEST])
+_AS_DETECT_REQUIRED([M4SH_ECHO_TEST])
+
 M4SH_VERBATIM([[
 : ${CP="cp -f"}
-: ${ECHO=$as_echo}
+: ${ECHO="printf %s\\n"}
 : ${EGREP="@EGREP@"}
 : ${FGREP="@FGREP@"}
 : ${GREP="@GREP@"}
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index e3627b0..3d71e36 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -118,6 +118,11 @@ dnl This script is generated by config.status, so we 
cannot put things
 dnl in the header.
 m4_define([M4SH_IN_HEADER], [$1])dnl
 
+dnl This script is generated by config.status, so we already know
+dnl a "good enough" shell.
+m4_define([_AS_DETECT_BETTER_SHELL], [])
+m4_define([_AS_DETECT_SUGGESTED], [])
+m4_define([_AS_DETECT_REQUIRED], [])
 m4_include([getopt.m4sh])
 
 M4SH_VERBATIM([[
diff --git a/tests/testsuite.at b/tests/testsuite.at
index e8b75c3..14995f3 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -25,6 +25,18 @@
 
 AT_INIT
 
+m4_define([M4SH_ECHO_TEST],
+  
[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+  ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+  ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+  test "X`printf %s $ECHO`" = "X$ECHO"])
+
+_AS_DETECT_SUGGESTED([
+  PATH=/tmp/nonexistent; export PATH;
+  FPATH=$PATH; export FPATH;
+  M4SH_ECHO_TEST])
+_AS_DETECT_REQUIRED([M4SH_ECHO_TEST])
+
 m4_divert_push([PREPARE_TESTS])dnl
 : ${tst_dist=dist}
 : ${ACLOCAL=aclocal}
@@ -32,7 +44,7 @@ m4_divert_push([PREPARE_TESTS])dnl
 : ${AUTOCONF=autoconf}
 : ${AUTOMAKE=automake}
 : ${AUTORECONF=autoreconf}
-: ${ECHO=$as_echo}
+: ${ECHO="printf %s\\n"}
 for tool in ACLOCAL AUTOHEADER AUTOCONF AUTOMAKE AUTORECONF; do
   if eval \$$tool --version >/dev/null 2>&1; then :; else eval $tool=no; fi
 done
-- 
1.5.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]