From c83c133556205402d44e81d492efb0b2fe3e3584 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Mon, 11 Feb 2013 13:11:51 +0100 Subject: aclocal: just warn if the primary local m4 dir doesn't exist (don't error) Related to automake bug#13514. Every package which does not need to have the local m4 macro directory pre-existing in the version control system (because e.g., it does not have nor need any private m4 macros) would fail during the "autoreconf -vfi" phase if AC_CONFIG_MACRO_DIRS([m4]) is specified in configure.ac (it could be to instruct tools like 'autopoint' and 'libtoolize' to use 'm4' as the local directory where to install definitions of their m4 macros, and to instruct aclocal to look into it). The failure would go like this: autoreconf: Entering directory `.' autoreconf: running: aclocal --force aclocal: error: couldn't open directory 'm4': No such file or directory autoreconf: aclocal failed with exit status: 1 The problem is that when 'aclocal' is run for the first time during 'autoreconf', the directory 'm4' does not exist yet. It will be created by e.g., 'libtoolize' or 'autopoint' later on. During the second 'aclocal' run, the 'm4' directory exists and aclocal does not complain. To work around this issue, we degrade the error to a simple warning. The warning is still quite useful when aclocal is run by hand - so we are not removing completely. See also: * aclocal.in (SCAN_M4_DIRS_SILENT, SCAN_M4_DIRS_WARN) (SCAN_M4_DIRS_ERROR): New constants. (scan_m4_dirs): Change the second parameter name to $ERR_LEVEL to better reflect new semantic. Use new constants. (scan_m4_files): Adjust to reflect the new 'scan_m4_dirs' semantics. * t/aclocal-macrodir.tap: Adjust. * t/aclocal-macrodirs.tap: Likewise. * THANKS: Update. * NEWS: Likewise. Suggested-by: Ben Pfaff Signed-off-by: Stefano Lattarini --- t/aclocal-macrodirs.tap | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 't/aclocal-macrodirs.tap') diff --git a/t/aclocal-macrodirs.tap b/t/aclocal-macrodirs.tap index 89e424d46..c0bb0acee 100755 --- a/t/aclocal-macrodirs.tap +++ b/t/aclocal-macrodirs.tap @@ -317,23 +317,31 @@ test_end #--------------------------------------------------------------------------- -test_begin "AC_CONFIG_MACRO_DIRS([non-existent]) errors out (1)" +test_begin "AC_CONFIG_MACRO_DIRS([non-existent]) warns (1)" cat > configure.ac << 'END' AC_INIT([oops], [1.0]) AC_CONFIG_MACRO_DIRS([non-existent]) +AM_INIT_AUTOMAKE END -not $ACLOCAL 2>stderr \ +$ACLOCAL -Wno-error 2>stderr \ && cat stderr >&2 \ && grep "couldn't open directory 'non-existent'" stderr \ + && test -f aclocal.m4 \ + || r='not ok' + +rm -rf aclocal.m4 autom4te*.cache + +$ACLOCAL -Werror -Wno-unsupported \ + && test -f aclocal.m4 \ || r='not ok' test_end #--------------------------------------------------------------------------- -test_begin "AC_CONFIG_MACRO_DIRS([non-existent]) errors out (2)" +test_begin "AC_CONFIG_MACRO_DIRS([non-existent]) warns (2)" cat > configure.ac << 'END' AC_INIT([oops], [1.0]) @@ -346,13 +354,14 @@ not $ACLOCAL 2>stderr \ && cat stderr >&2 \ && grep "couldn't open directory 'dir-ko'" stderr \ && not grep "dir-ok" stderr \ + && test ! -e aclocal.m4 \ || r='not ok' test_end #--------------------------------------------------------------------------- -test_begin "AC_CONFIG_MACRO_DIRS([non-existent]) errors out (tricky setup)" +test_begin "AC_CONFIG_MACRO_DIRS([existent non-existent]) errors out" cat > configure.ac << 'END' AC_INIT([oops], [1.0]) -- cgit v1.2.1