From: Stefano Lattarini Date: Sat, 22 Sep 2012 23:24:12 +0000 (+0200) Subject: ACLOCAL_AMFLAGS: fully deprecate, with warnings in the 'obsolete' category X-Git-Tag: v1.16~158 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d989ddd3afc5e4fbf58290c94a6e0c311ccd15e;p=thirdparty%2Fautomake.git ACLOCAL_AMFLAGS: fully deprecate, with warnings in the 'obsolete' category Users are expected to use the AC_CONFIG_MACRO_DIR{,S} autoconf macros instead. And the use of the '--install' aclocal option in ACLOCAL_AMFLAGS has proved to be a bad idea anyway -- see automake bug#9037. * NEWS: Update. * t/aclocal-amflags.sh: Enhance and adjust. * t/acloca14b.sh: Adjust. * t/acloca22b.sh: Likewise. * t/ax/distcheck-hook-m4.am: Likewise. * t/dist-missing-m4.sh: Likewise. * t/remake-renamed-m4-macro.sh: Likewise. * t/remake-renamed-m4-macro-and-file.sh: Likewise. * t/remake-renamed-m4-file.sh: Likewise. * t/remake-moved-m4-file.sh: Likewise. * t/remake-gnulib-remove-header.sh: Likewise. * t/remake-gnulib-add-acsubst.sh: Likewise. * t/remake-deleted-m4-file.sh: Likewise. * t/remake-deleted-m4-file.sh: Likewise. * t/libtool-macros.sh: Likewise. * t/gettext-macros.sh: Likewise. Signed-off-by: Stefano Lattarini --- diff --git a/NEWS b/NEWS index a8b2cdd7f..2d6304305 100644 --- a/NEWS +++ b/NEWS @@ -11,11 +11,18 @@ New in 1.14: over the same-named automake-provided macro, as defined in file '/usr/local/share/aclocal-1.14/vala.m4'. -* Obsolete features: +* Obsolete and obsolescent features: - Support for the long-obsolete $(INCLUDES) variable has been finally removed, in favour of the modern equivalent $(AM_CPPFLAGS). + - Use of the special makefile variable 'ACLOCAL_AMFLAGS' is deprecated. + To specify locations of extra m4 files, the 'AC_CONFIG_MACRO_DIR' or + 'AC_CONFIG_MACRO_DIRS' (the latter introduced with autoconf 2.70) + should be used instead. And use of the '--install' aclocal option in + 'ACLOCAL_AMFLAGS' has proved to be a bad idea anyway -- see automake + bug#9037. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New in 1.13: diff --git a/automake.in b/automake.in index 96ff68565..ffe16e22c 100644 --- a/automake.in +++ b/automake.in @@ -7832,6 +7832,12 @@ sub generate_makefile ($$) # Catch some obsolete variables. reject_var 'INCLUDES', "'INCLUDES' is the obsolete name for " . "'AM_CPPFLAGS' (or '*_CPPFLAGS')"; + if (my $amflags = var ('ACLOCAL_AMFLAGS')) + { + msg_var 'obsolete', $amflags, + "'ACLOCAL_AMFLAGS' is deprecated; use 'AC_CONFIG_MACRO_DIRS'" + . " in configure.ac instead"; + } # Must do this after reading .am file. define_variable ('subdir', $relative_dir, INTERNAL); diff --git a/t/aclocal-amflags.sh b/t/aclocal-amflags.sh index 49bcf5f37..69bce3201 100755 --- a/t/aclocal-amflags.sh +++ b/t/aclocal-amflags.sh @@ -15,8 +15,8 @@ # along with this program. If not, see . # Check that the obsolescent idiom of setting $(ACLOCAL_AMFLAGS) in -# Makefile.am still works. Remove this test once support for this -# obsolescent idiom is removed. +# Makefile.am is warned against, but still works. Remove this test +# once support for this obsolescent idiom is removed. . test-init.sh @@ -45,7 +45,16 @@ $ACLOCAL -I m4_1 >output 2>&1 || { cat output; exit 1; } cat output grep 'found macro' output && exit 1 # Sanity check. $AUTOCONF -$AUTOMAKE + +for opts in '' '-Wnone -Wobsolete'; do + AUTOMAKE_fails $opts + grep "Makefile\.am:.*'ACLOCAL_AMFLAGS' is deprecated" stderr + grep "Makefile\.am:.*'AC_CONFIG_MACRO_DIRS'.*configure\.ac.*instead" stderr +done + +echo AUTOMAKE_OPTIONS = -Wall -Wno-obsolete >> Makefile.am +cat Makefile.am # For debugging. +$AUTOMAKE -Werror ./configure test -f foo diff --git a/t/aclocal-deleted-header-aclocal-amflags.sh b/t/aclocal-deleted-header-aclocal-amflags.sh index ea47635c0..8f11ebdd5 100755 --- a/t/aclocal-deleted-header-aclocal-amflags.sh +++ b/t/aclocal-deleted-header-aclocal-amflags.sh @@ -22,7 +22,10 @@ . test-init.sh -cat >>configure.ac < configure.ac <defs/f.m4 cat >>Makefile.am<<\EOF ACLOCAL_AMFLAGS = -I defs +AUTOMAKE_OPTIONS = -Wno-obsolete testdist1: distdir test -f $(distdir)/acinclude.m4 test -f $(distdir)/a.m4 diff --git a/t/ax/distcheck-hook-m4.am b/t/ax/distcheck-hook-m4.am index 5d36102c6..262e370c9 100644 --- a/t/ax/distcheck-hook-m4.am +++ b/t/ax/distcheck-hook-m4.am @@ -15,6 +15,8 @@ ## You should have received a copy of the GNU General Public License ## along with this program. If not, see . +AUTOMAKE_OPTIONS = -Wno-obsolete + distcheck-hook: @fatal () { echo "$@: $$*" >&2; exit 1; }; \ $(am__cd) $(distdir) && chmod u+w . && mkdir _m4 \ diff --git a/t/dist-missing-m4.sh b/t/dist-missing-m4.sh index e0ed88614..c5eed848b 100755 --- a/t/dist-missing-m4.sh +++ b/t/dist-missing-m4.sh @@ -23,6 +23,7 @@ . test-init.sh cat >> configure.ac <<'END' +AC_CONFIG_MACRO_DIR([m4]) m4_pattern_forbid([^MY_]) MY_FOOBAR || exit 1 MY_ZARDOZ || exit 1 @@ -33,9 +34,9 @@ mkdir m4 echo 'AC_DEFUN([MY_FOOBAR], [:])' > m4/foobar.m4 echo 'AC_DEFUN([MY_ZARDOZ], [:])' > m4/zardoz.m4 -echo 'ACLOCAL_AMFLAGS = -I m4' > Makefile.am +: > Makefile.am -$ACLOCAL -I m4 +$ACLOCAL $AUTOCONF $AUTOMAKE diff --git a/t/gettext-macros.sh b/t/gettext-macros.sh index 6d58c9c37..17045c611 100755 --- a/t/gettext-macros.sh +++ b/t/gettext-macros.sh @@ -29,7 +29,8 @@ echo "# Automatically generated by $me." > get.sh echo : >> get.sh # The 'gettextize' and 'autopoint' scripts will look into Makefile.am. -echo ACLOCAL_AMFLAGS = -I m4 > Makefile.am +echo AUTOMAKE_OPTIONS = -Wno-obsolete > Makefile.am +echo ACLOCAL_AMFLAGS = -I m4 >> Makefile.am # Prefer autopoint to gettextize, since the more modern versions of the # latter might unconditionally require user interaction to complete; diff --git a/t/libtool-macros.sh b/t/libtool-macros.sh index c50777b7c..ec84682a1 100755 --- a/t/libtool-macros.sh +++ b/t/libtool-macros.sh @@ -23,8 +23,7 @@ echo "# Automatically generated by $me." > get.sh echo : >> get.sh -# The 'libtoolize' script will look into Makefile.am. -echo ACLOCAL_AMFLAGS = -I m4 > Makefile.am +echo 'AC_CONFIG_MACRO_DIR([m4])' >> configure.ac if libtoolize --copy --install && test -f m4/libtool.m4; then echo "ACLOCAL_PATH='$(pwd)/m4':\$ACLOCAL_PATH" >> get.sh @@ -37,7 +36,7 @@ else mkdir m4 echo AC_PROG_LIBTOOL >> configure.ac # See below for an explanation about the use the of '-Wno-syntax'. - if $ACLOCAL -Wno-syntax -I m4 --install && test -f m4/libtool.m4; then + if $ACLOCAL -Wno-syntax --install && test -f m4/libtool.m4; then : # Libtool macros already accessible by default. else echo "skip_all_ \"couldn't find or get libtool macros\"" >> get.sh diff --git a/t/remake-deleted-m4-file.sh b/t/remake-deleted-m4-file.sh index 2499d82cd..d733a56c5 100755 --- a/t/remake-deleted-m4-file.sh +++ b/t/remake-deleted-m4-file.sh @@ -25,10 +25,11 @@ cat >> configure.ac <<'END' FOO_MACRO AC_OUTPUT +dnl Deliberately put this late, for better coverage. +AC_CONFIG_MACRO_DIR([m4]) END cat > Makefile.am <<'END' -ACLOCAL_AMFLAGS = -I m4 .PHONY: test test: test '$(the_answer)' -eq 42 @@ -46,7 +47,7 @@ cat > m4/bar.m4 <> configure.ac <<'END' AC_PROG_CC +AC_CONFIG_MACRO_DIRS([m4]) MY_MACROS AC_OUTPUT END cat > Makefile.am <<'END' -ACLOCAL_AMFLAGS = -I m4 noinst_PROGRAMS = foo foo_SOURCES = foo.c BUILT_SOURCES = foo.h @@ -70,7 +70,7 @@ int main (void) { return 0; } typedef int checkfoo[1 - 2 * (foo != 42)]; END -$ACLOCAL -I m4 +$ACLOCAL $AUTOCONF $AUTOMAKE diff --git a/t/remake-gnulib-add-header.sh b/t/remake-gnulib-add-header.sh index c70b3c672..db6bea186 100755 --- a/t/remake-gnulib-add-header.sh +++ b/t/remake-gnulib-add-header.sh @@ -25,6 +25,7 @@ required=cc . test-init.sh cat >> configure.ac <<'END' +AC_CONFIG_MACRO_DIR([.]) AC_CONFIG_HEADERS([config.h]) AC_PROG_CC MY_MACROS @@ -32,7 +33,6 @@ AC_OUTPUT END cat > Makefile.am <<'END' -ACLOCAL_AMFLAGS = -I . noinst_PROGRAMS = foo foo_SOURCES = foo.c BUILT_SOURCES = $(STDIO_H) @@ -80,7 +80,7 @@ FILE *f; int main () { return 0; } END -$ACLOCAL -I . +$ACLOCAL $AUTOHEADER $AUTOMAKE $AUTOCONF diff --git a/t/remake-gnulib-remove-header.sh b/t/remake-gnulib-remove-header.sh index 23fbfc81b..189bbe5d3 100755 --- a/t/remake-gnulib-remove-header.sh +++ b/t/remake-gnulib-remove-header.sh @@ -26,6 +26,7 @@ required=cc . test-init.sh cat >> configure.ac <<'END' +AC_CONFIG_MACRO_DIR([.]) AC_CONFIG_HEADERS([config.h]) AC_PROG_CC MY_MACROS @@ -33,7 +34,6 @@ AC_OUTPUT END cat > Makefile.am <<'END' -ACLOCAL_AMFLAGS = -I . noinst_PROGRAMS = foo foo_SOURCES = foo.c BUILT_SOURCES = $(STDIO_H) @@ -79,7 +79,7 @@ FILE *f; int main () { return 0; } END -$ACLOCAL -I . +$ACLOCAL $AUTOHEADER $AUTOMAKE $AUTOCONF diff --git a/t/remake-moved-m4-file.sh b/t/remake-moved-m4-file.sh index 3ca16801f..faed95d8b 100755 --- a/t/remake-moved-m4-file.sh +++ b/t/remake-moved-m4-file.sh @@ -21,11 +21,12 @@ cat >> configure.ac <<'END' MY_MACRO +AC_CONFIG_MACRO_DIRS([d1]) +AC_CONFIG_MACRO_DIRS([d2 d3]) AC_OUTPUT END cat > Makefile.am <<'END' -ACLOCAL_AMFLAGS = -I d1 -I d2 -I d3 .PHONY: test test: test '$(the_answer)' -eq 42 @@ -41,7 +42,7 @@ cat > d1/foo.m4 <<'END' AC_DEFUN([FOO], [the_answer=42; AC_SUBST([the_answer])]) END -$ACLOCAL -I d1 +$ACLOCAL $AUTOCONF $AUTOMAKE diff --git a/t/remake-renamed-m4-file.sh b/t/remake-renamed-m4-file.sh index ff99f1d54..462a2ce01 100755 --- a/t/remake-renamed-m4-file.sh +++ b/t/remake-renamed-m4-file.sh @@ -19,12 +19,12 @@ . test-init.sh cat >> configure.ac <<'END' +AC_CONFIG_MACRO_DIR([m4]) MY_MACRO AC_OUTPUT END cat > Makefile.am <<'END' -ACLOCAL_AMFLAGS = -I m4 .PHONY: test test: test '$(the_answer)' -eq 42 @@ -40,7 +40,7 @@ cat > m4/foo.m4 <<'END' AC_DEFUN([FOO], [the_answer=42; AC_SUBST([the_answer])]) END -$ACLOCAL -I m4 +$ACLOCAL $AUTOCONF $AUTOMAKE diff --git a/t/remake-renamed-m4-macro-and-file.sh b/t/remake-renamed-m4-macro-and-file.sh index 965873709..985f5c67a 100755 --- a/t/remake-renamed-m4-macro-and-file.sh +++ b/t/remake-renamed-m4-macro-and-file.sh @@ -21,12 +21,12 @@ . test-init.sh cat >> configure.ac <<'END' +AC_CONFIG_MACRO_DIR([m4]) MY_MACRO AC_OUTPUT END cat > Makefile.am <<'END' -ACLOCAL_AMFLAGS = -I m4 .PHONY: test test: test '$(the_answer)' -eq 42 @@ -42,7 +42,7 @@ cat > m4/foo.m4 <<'END' AC_DEFUN([FOO_MACRO], [the_answer=42; AC_SUBST([the_answer])]) END -$ACLOCAL -I m4 +$ACLOCAL $AUTOCONF $AUTOMAKE diff --git a/t/remake-renamed-m4-macro.sh b/t/remake-renamed-m4-macro.sh index 99ab1db90..0d97a221e 100755 --- a/t/remake-renamed-m4-macro.sh +++ b/t/remake-renamed-m4-macro.sh @@ -20,12 +20,12 @@ . test-init.sh cat >> configure.ac <<'END' +AC_CONFIG_MACRO_DIR([m4]) MY_MACRO AC_OUTPUT END cat > Makefile.am <<'END' -ACLOCAL_AMFLAGS = -I m4 .PHONY: test test: test '$(the_answer)' -eq 42 @@ -42,7 +42,7 @@ AC_DEFUN([FOO_1], [the_answer=42 AC_SUBST([the_answer])]) END -$ACLOCAL -I m4 +$ACLOCAL $AUTOCONF $AUTOMAKE