]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Libtoolize now advises AC_CONFIG_MACRO_DIR use where appropriate.
authorGary V. Vaughan <gary@gnu.org>
Wed, 23 Apr 2008 03:18:56 +0000 (23:18 -0400)
committerGary V. Vaughan <gary@gnu.org>
Wed, 23 Apr 2008 03:18:56 +0000 (23:18 -0400)
* libtoolize.at (func_check_macros): Always advise use of
AC_CONFIG_MACRO_DIR when not able to copy libtool macros into
the project tree.
* tests/libtoolize.at: New test for correct diagnosis of mismatch
between AC_CONFIG_MACRO_DIR and ACLOCAL_AMFLAGS.
Update expected output of other tests.
* NEWS: Updated.

ChangeLog
NEWS
libtoolize.m4sh
tests/libtoolize.at

index f251edeafe31b31a5d3d5ad4fe0de31e58736435..ebf9ba93e761fc0a725b0223377dec17f031a7be 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-04-22  Gary V. Vaughan  <gary@gnu.org>
+
+       Libtoolize now advises AC_CONFIG_MACRO_DIR use where appropriate.
+       * libtoolize.m4sh (func_check_macros): Always advise use of
+       AC_CONFIG_MACRO_DIR when not able to copy libtool macros into
+       the project tree.
+       * tests/libtoolize.at: New test for correct diagnosis of mismatch
+       between AC_CONFIG_MACRO_DIR and ACLOCAL_AMFLAGS.
+       Update expected output of other tests.
+       * NEWS: Updated.
+
 2008-04-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Fix regression over 1.5.26 with ccache $CC -all-static.
diff --git a/NEWS b/NEWS
index df43da7a3235415ec196544d09f5b4642d43dd13..d7579e9aab8261c981f54443cb597558eece485b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,11 @@ New in 2.2.4: 2008-??-??: CVS version 2.2.3a, Libtool team:
     (i.e. AC_CONFIG_MACRO_DIR is not being used), libtoolize no longer
     reports that all macros need to be added to `aclocal.m4', and
     diagnoses only the macro files that are missing or not up-to-date.
+  - libtoolize now advises use of AC_CONFIG_MACRO_DIR to keep matching
+    libtool macros in-tree where appropriate.
+  - libtoolize now advises use of `ACLOCAL_AMFLAGS = -I m4' (or
+    equivalent) where appropriate, and errors out when ACLOCAL_AMFLAGS
+    names a different directory to AC_CONFIG_MACRO_DIR.
 
 New in 2.2.2: 2008-04-01: CVS version 2.2.1a, Libtool team:
 
index 7981dde0fb39eda5b86f92f23daf5c731dd7a594..5748e23ed0cb5ecb61cbb0b96eea8da5b02b3879 100644 (file)
@@ -586,8 +586,7 @@ func_scan_files ()
     # Find local m4 macro directory. #
     # ------------------------------ #
 
-    # If AC_CONFIG_MACRO_DIR turned nothing up, we hunt for ACLOCAL_AMFLAGS
-    # in `Makefile.am' for a `-I' argument.
+    # Hunt for ACLOCAL_AMFLAGS in `Makefile.am' for a `-I' argument.
 
     my_sed_aclocal_flags='
         /^[    ]*ACLOCAL_[A-Z_]*FLAGS[         ]*=/ {
@@ -595,12 +594,11 @@ func_scan_files ()
            q
        }
        d'
-    macrodir="$ac_macrodir"
-    if test ! -n "$macrodir" && test -f Makefile.am; then
+    if test -f Makefile.am; then
       my_macrodir_is_next=false
       for arg in `$SED "$my_sed_aclocal_flags" Makefile.am`; do
         if $my_macrodir_is_next; then
-          macrodir="$arg"
+          am_macrodir="$arg"
           break
         else
           if test "X$arg" = "X-I"; then
@@ -611,6 +609,14 @@ func_scan_files ()
         fi
       done
     fi
+
+    macrodir="$ac_macrodir"
+    test -z "$macrodir" && macrodir="$am_macrodir"
+
+    if test -n "$am_macrodir" && test -n "$ac_macrodir"; then
+      test "$am_macrodir" = "$ac_macrodir" \
+        || func_fatal_error "AC_CONFIG_MACRO_DIR([$ac_macrodir]) conflicts with ACLOCAL_AMFLAGS=-I $am_macrodir."
+    fi
 }
 
 # func_included_files searchfile
@@ -1324,17 +1330,7 @@ func_check_macros ()
 
     ac_config_macro_dir_advised=false
 
-    # Suggest modern idioms for storing autoconf macros:
-    if test -z "$ac_macrodir$ltdldir"; then
-      if test -z "$macrodir" || test x"$macrodir" = x.; then
-        func_echo "Consider adding \`AC_CONFIG_MACRO_DIR([m4])' to $configure_ac and"
-        func_echo "rerunning libtoolize, to keep the correct libtool macros in-tree."
-      elif test -z "$ac_macrodir$ltdldir"; then
-        func_echo "Consider adding \`AC_CONFIG_MACRO_DIR([$macrodir])' to $configure_ac,"
-        func_echo "and rerunning libtoolize and aclocal."
-      fi
-
-    elif test -z "$macrodir"; then
+    if test -n "$ac_macrodir$ltdldir" && test -z "$macrodir"; then
       my_ac_config_macro_srcdir="$aclocaldir"
       if $opt_ltdl && test "$macrodir" != "$subproject_macrodir"; then
        my_ac_config_macro_srcdir="$subproject_macrodir"
@@ -1389,9 +1385,33 @@ func_check_macros ()
           func_echo "Consider using \`AC_CONFIG_AUX_DIR([$subproject_auxdir])' in $configure_ac."
         $ac_config_macro_dir_advised || test "$subproject_macrodir" = "$macrodir" ||
           func_echo "Consider using \`AC_CONFIG_MACRO_DIR([$subproject_macrodir])' in $configure_ac."
+       ac_config_macro_dir_advised=:
       fi
     fi
 
+    # Suggest modern idioms for storing autoconf macros:
+    $ac_config_macro_dir_advised || if test -z "$ac_macrodir" || test x"$macrodir" = x.; then
+      func_echo "Consider adding \`AC_CONFIG_MACRO_DIR([m4])' to $configure_ac and"
+      func_echo "rerunning libtoolize, to keep the correct libtool macros in-tree."
+      ac_config_macro_dir_advised=:
+
+    elif test -z "$ac_macrodir$ltdldir"; then
+      func_echo "Consider adding \`AC_CONFIG_MACRO_DIR([$macrodir])' to $configure_ac,"
+      func_echo "and rerunning libtoolize and aclocal."
+      ac_config_macro_dir_advised=:
+    fi
+
+    if test -z "$am_macrodir$macrodir"; then
+      func_echo "Consider adding \`-I m4' to ACLOCAL_AMFLAGS in Makefile.am."
+
+    elif test -z "$am_macrodir"; then
+      if $opt_ltdl && test "x$ltdl_mode" = "xsubproject" && test "$subproject_macrodir" != "$macrodir"; then
+       func_echo "Consider adding \`-I $subproject_macrodir' to ACLOCAL_AMFLAGS in Makefile.am."
+      else
+        func_echo "Consider adding \`-I $macrodir' to ACLOCAL_AMFLAGS in Makefile.am."
+      fi
+    fi 
+
     # 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 >/dev/null &&
index 4f673862f900e436757738aef71a47900cc3bbb9..25d664746b2943cc3ac2c2f452a4eda7f4a73e43 100644 (file)
@@ -46,6 +46,10 @@ test -d m4 || { rm -f m4 && mkdir m4; }
 
 rm -f m4/libtool.m4 m4/ltoptions.m4 build-aux/ltmain.sh
 
+AT_DATA([Makefile.am],
+[[ACLOCAL_AMFLAGS = -I m4
+]])
+
 # This file should be upgraded.
 AT_DATA([m4/libtool.m4], [[
 # serial 25 LT_INIT
@@ -89,6 +93,7 @@ libtoolize: copying file `m4/ltoptions.m4'
 libtoolize: copying file `m4/ltsugar.m4'
 libtoolize: copying file `m4/ltversion.m4'
 libtoolize: copying file `m4/lt~obsolete.m4'
+libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
 ]])
 
 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
@@ -96,6 +101,26 @@ LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
 AT_CLEANUP
 
 
+## ------------------------- ##
+## ACLOCAL_AMFLAGS mismatch. ##
+## ------------------------- ##
+
+AT_SETUP([libtoolize macro directory mismatch error])
+
+_LT_CONFIGURE_AC
+
+AT_DATA([Makefile.am],
+[[ACLOCAL_AMFLAGS = -I me2
+]])
+
+AT_DATA(experr,
+[[libtoolize: AC_CONFIG_MACRO_DIR([m4]) conflicts with ACLOCAL_AMFLAGS=-I me2.
+]])
+
+LT_AT_CHECK_LIBTOOLIZE([--copy], 1, [ignore], experr)
+
+AT_CLEANUP
+
 ## -------------- ##
 ## Serial update. ##
 ## -------------- ##
@@ -300,6 +325,7 @@ libtoolize: copying file `ltdl/ltdl.h'
 libtoolize: copying file `ltdl/slist.c'
 libtoolize: creating file `ltdl/Makefile.inc'
 libtoolize: Remember to add `LT_CONFIG_LTDL_DIR([ltdl])' to `configure.ac'.
+libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
 ]])
 
 AT_DATA([configure.ac],
@@ -387,6 +413,10 @@ LT_INIT
 LTDL_INIT
 AC_OUTPUT
 ]])
+
+AT_DATA([Makefile.am],
+[[ACLOCAL_AMFLAGS = -I ltdl/m4
+]])
 ])# _LT_AT_LTDL_SETUP
 
 ## ------------------------------------------------ ##
@@ -472,6 +502,7 @@ libtoolize: copying file `ltdl/ltdl.c'
 libtoolize: copying file `ltdl/ltdl.h'
 libtoolize: copying file `ltdl/slist.c'
 libtoolize: Remember to add `LTDL_INIT' to configure.ac.
+libtoolize: Consider adding `-I ltdl/m4' to ACLOCAL_AMFLAGS in Makefile.am.
 ]])
 
 AT_DATA([configure.ac],
@@ -511,6 +542,9 @@ libtoolize:   `/usr/local/share/aclocal/ltoptions.m4'
 libtoolize:   `/usr/local/share/aclocal/ltversion.m4'
 libtoolize:   `/usr/local/share/aclocal/ltsugar.m4'
 libtoolize:   `/usr/local/share/aclocal/lt~obsolete.m4'
+libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
+libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
+libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
 ]])
 
 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
@@ -528,6 +562,10 @@ LT_INIT
 AC_OUTPUT
 ]])
 
+AT_DATA([Makefile.am],
+[[ACLOCAL_AMFLAGS = -I m4
+]])
+
 AT_DATA([aclocal.m4],
 [[# This should need upgrading:
 # serial 25 LT_INIT
@@ -639,6 +677,9 @@ libtoolize:   `/usr/local/share/aclocal/libtool.m4'
 libtoolize:   `/usr/local/share/aclocal/ltversion.m4'
 libtoolize:   `/usr/local/share/aclocal/ltsugar.m4'
 libtoolize:   `/usr/local/share/aclocal/lt~obsolete.m4'
+libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
+libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
+libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
 ]])
 
 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
@@ -648,8 +689,6 @@ LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
 ## Upgrading an aclocal maintained aclocal.m4 without AC_CONFIG_MACRO_DIR. ##
 ## ----------------------------------------------------------------------- ##
 
-rm -f aclocal.m4
-
 LT_AT_ACLOCAL()
 
 ## The following code is adapted (and simplified) from libtoolize.m4sh
@@ -711,7 +750,13 @@ $SED -e 's,^#.*serial.*ltoptions.m4$,# serial 99999 ltoptions.m4,' \
  < aclocal.m4 > aclocal.m4t
 mv -f aclocal.m4t aclocal.m4
 
-LT_AT_CHECK_LIBTOOLIZE([--copy], 0)
+AT_DATA([expout],
+[[libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
+libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
+libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
+]])
+
+LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
 
 
 ## --------------------- ##
@@ -721,6 +766,9 @@ LT_AT_CHECK_LIBTOOLIZE([--copy], 0)
 AT_DATA(expout,
 [[libtoolize: putting auxiliary files in `.'.
 libtoolize: copying file `./ltmain.sh'
+libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
+libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
+libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
 ]])
 
 LT_AT_CHECK_LIBTOOLIZE([--copy --force], 0, expout)
@@ -790,6 +838,10 @@ LTDL_INIT([nonrecursive])
 AC_OUTPUT
 ]])
 
+AT_DATA([Makefile.am],
+[[ACLOCAL_AMFLAGS = -I m4
+]])
+
 LT_AT_CHECK_LIBTOOLIZE([--copy --install --ltdl=ltdl], 0, expout)
 
 AT_CLEANUP
@@ -868,6 +920,7 @@ libtoolize: copying file `ltdl/ltdl.h'
 libtoolize: copying file `ltdl/slist.c'
 libtoolize: Consider using `AC_CONFIG_AUX_DIR([ltdl/config])' in configure.ac.
 libtoolize: Consider using `AC_CONFIG_MACRO_DIR([ltdl/m4])' in configure.ac.
+libtoolize: Consider adding `-I ltdl/m4' to ACLOCAL_AMFLAGS in Makefile.am.
 ]])
 
 AT_DATA([configure.ac],