From 2e9a9f29e669c1e87156a41b5de6c0a3b5a7d816 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Thu, 17 Jan 2008 05:36:21 +0000 Subject: [PATCH] * libtoolize.m4sh (func_scan_files): Avoid matching our own macro code when scanning configure.ac and aclocal.m4. Don't produce spurious output if AC_PROG_RANLIB is found. * tests/old-m4-iface.at (AM_PROG_LIBTOOL): Add a (weak) check that we don't match our own macro code when searching for user code calling us. * TODO: Updated. --- ChangeLog | 10 ++++++++++ TODO | 4 +++- libtoolize.m4sh | 6 +++++- tests/old-m4-iface.at | 11 +++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2ee274a27..83584419a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-01-17 Ralf Wildenhues + + * libtoolize.m4sh (func_scan_files): Avoid matching our own + macro code when scanning configure.ac and aclocal.m4. + Don't produce spurious output if AC_PROG_RANLIB is found. + * tests/old-m4-iface.at (AM_PROG_LIBTOOL): Add a (weak) check + that we don't match our own macro code when searching for user + code calling us. + * TODO: Updated. + 2008-01-17 Ralf Wildenhues New variable LTDLDEPS for use in output_DEPENDENCIES. diff --git a/TODO b/TODO index 633cccb4f..8a9ed7e87 100644 --- a/TODO +++ b/TODO @@ -103,6 +103,8 @@ GNU Libtool processes per copied file, a list of files to copy is built and all files copied with a single pair of tar processes. +* Write test case that adds libtool macros to aclocal.m4. + 2. In the future ================ @@ -278,7 +280,7 @@ GNU Libtool it easier to add new platforms. -- - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 This file is part of GNU Libtool. diff --git a/libtoolize.m4sh b/libtoolize.m4sh index 667abc0db..ec422bdaf 100644 --- a/libtoolize.m4sh +++ b/libtoolize.m4sh @@ -418,14 +418,18 @@ func_scan_files () s,^.*LT_CONFIG_LTDL_DIR([[ ]*\([^])]*\).*$,ac_ltdldir=\1, p } + /\@<:@A[CM]_PROG_LIBTOOL/d /A[CM]_PROG_LIBTOOL/ { s,^.*$,seen_libtool=:, p } + /the.*option into.*LT_INIT.*parameter/d + /\@<:@LT_INIT/d /LT_INIT/ { s,^.*$,seen_libtool=:, p } + /\@<:@LTDL_INIT/d /LTDL_INIT/ { s,^.*LTDL_INIT([[ ]*\([^])]*\).*$,ltdl_options="\1", s,^.*LTDL_INIT[ ]*$,seen_ltdl=:, @@ -960,7 +964,7 @@ func_check_macros () else # Don't trace for this, we're just checking the user didn't invoke it # directly from configure.ac. - $SED 's,dnl .*$,,; s,# .*$,,' "$configure_ac" | grep AC_PROG_RANLIB && + $SED 's,dnl .*$,,; s,# .*$,,' "$configure_ac" | grep AC_PROG_RANLIB >/dev/null && func_echo "\`AC_PROG_RANLIB' is rendered obsolete by \`LT_INIT'" fi diff --git a/tests/old-m4-iface.at b/tests/old-m4-iface.at index d481c9764..f36f97f52 100644 --- a/tests/old-m4-iface.at +++ b/tests/old-m4-iface.at @@ -86,6 +86,17 @@ LT_AT_BOOTSTRAP([ignore], [ignore], [ignore], [ignore], [--force]) LT_AT_EXEC_CHECK([./old], 0, [Hello, World!]) +# Now, test that libtoolize doesn't mistakenly think the user called +# any libtool macros if in fact she didn't. +sed '/AM_PROG_LIBTOOL/d' configure.in >configure.int +mv -f configure.int configure.in +AT_CHECK([$LIBTOOLIZE -n], [0], [stdout], [stderr]) +# ensure no shell errors: +AT_CHECK([grep -v "^libtoolize: " stderr], [1]) +AT_CHECK([grep "Remember to add.*LT_INIT.*to configure.in" stdout], [0], [ignore]) +AT_CHECK([grep "Consider adding.*LT_WITH_LTDL" stdout], [1]) +AT_CHECK([grep "Remember to add.*LT_CONFIG_LTDL_DIR" stdout], [1]) + AT_CLEANUP -- 2.47.3