+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.
(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:
# 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[ ]*=/ {
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
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
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"
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 &&
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
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)
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. ##
## -------------- ##
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],
LTDL_INIT
AC_OUTPUT
]])
+
+AT_DATA([Makefile.am],
+[[ACLOCAL_AMFLAGS = -I ltdl/m4
+]])
])# _LT_AT_LTDL_SETUP
## ------------------------------------------------ ##
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],
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)
AC_OUTPUT
]])
+AT_DATA([Makefile.am],
+[[ACLOCAL_AMFLAGS = -I m4
+]])
+
AT_DATA([aclocal.m4],
[[# This should need upgrading:
# serial 25 LT_INIT
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)
## 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
< 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)
## --------------------- ##
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)
AC_OUTPUT
]])
+AT_DATA([Makefile.am],
+[[ACLOCAL_AMFLAGS = -I m4
+]])
+
LT_AT_CHECK_LIBTOOLIZE([--copy --install --ltdl=ltdl], 0, expout)
AT_CLEANUP
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],