[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[FYI] {master} ACLOCAL_AMFLAGS: fully deprecate, with warnings in the 'o
From: |
Stefano Lattarini |
Subject: |
[FYI] {master} ACLOCAL_AMFLAGS: fully deprecate, with warnings in the 'obsolete' category |
Date: |
Fri, 28 Dec 2012 21:33:12 +0100 |
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 <address@hidden>
---
NEWS | 9 ++++++++-
automake.in | 6 ++++++
t/aclocal-amflags.sh | 15 ++++++++++++---
t/aclocal-deleted-header-aclocal-amflags.sh | 5 ++++-
t/aclocal-m4-include-are-scanned-aclocal-amflags.sh | 1 +
t/ax/distcheck-hook-m4.am | 2 ++
t/dist-missing-m4.sh | 5 +++--
t/gettext-macros.sh | 3 ++-
t/libtool-macros.sh | 5 ++---
t/remake-deleted-m4-file.sh | 5 +++--
t/remake-gnulib-add-acsubst.sh | 4 ++--
t/remake-gnulib-add-header.sh | 4 ++--
t/remake-gnulib-remove-header.sh | 4 ++--
t/remake-moved-m4-file.sh | 5 +++--
t/remake-renamed-m4-file.sh | 4 ++--
t/remake-renamed-m4-macro-and-file.sh | 4 ++--
t/remake-renamed-m4-macro.sh | 4 ++--
17 files changed, 58 insertions(+), 27 deletions(-)
diff --git a/NEWS b/NEWS
index a8b2cdd..2d63043 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 96ff685..ffe16e2 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 49bcf5f..69bce32 100755
--- a/t/aclocal-amflags.sh
+++ b/t/aclocal-amflags.sh
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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 ea47635..8f11ebd 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 <<EOF
+cat > configure.ac <<EOF
+AC_INIT([$me], [1.3])
+AM_INIT_AUTOMAKE([-Wno-obsolete])
+AC_CONFIG_FILES([Makefile])
FOO
AC_OUTPUT
EOF
diff --git a/t/aclocal-m4-include-are-scanned-aclocal-amflags.sh
b/t/aclocal-m4-include-are-scanned-aclocal-amflags.sh
index 31a0540..c7b2392 100755
--- a/t/aclocal-m4-include-are-scanned-aclocal-amflags.sh
+++ b/t/aclocal-m4-include-are-scanned-aclocal-amflags.sh
@@ -46,6 +46,7 @@ echo 'AC_DEFUN([ANOTHER_MACRO])' >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 5d36102..262e370 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 <http://www.gnu.org/licenses/>.
+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 e0ed886..c5eed84 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 6d58c9c..17045c6 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 c50777b..ec84682 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 2499d82..d733a56 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 <<END
AC_DEFUN([BAR_MACRO], [$macro_value])
END
-$ACLOCAL -I m4
+$ACLOCAL
$AUTOCONF
$AUTOMAKE
diff --git a/t/remake-gnulib-add-acsubst.sh b/t/remake-gnulib-add-acsubst.sh
index 3aea5b9..4cfad96 100755
--- a/t/remake-gnulib-add-acsubst.sh
+++ b/t/remake-gnulib-add-acsubst.sh
@@ -26,12 +26,12 @@ required=cc
cat >> 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 c70b3c6..db6bea1 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 23fbfc8..189bbe5 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 3ca1680..faed95d 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 ff99f1d..462a2ce 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 9658737..985f5c6 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 99ab1db..0d97a22 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
--
1.8.0.1.409.g252f922
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [FYI] {master} ACLOCAL_AMFLAGS: fully deprecate, with warnings in the 'obsolete' category,
Stefano Lattarini <=