[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#13514: [PATCH v3 2/2] aclocal: fix for more-than-once specified dire
From: |
Stefano Lattarini |
Subject: |
bug#13514: [PATCH v3 2/2] aclocal: fix for more-than-once specified directories |
Date: |
Sat, 16 Feb 2013 19:18:10 +0100 |
From: Pavel Raiskup <address@hidden>
Related to automake bug#13514.
Do not explore directories for extra m4 files multiple times in 'aclocal'.
Doing so caused problems on older packages that specify
configure.ac: AC_CONFIG_MACRO_DIRS([m4])
Makefile.am: ACLOCAL_AMFLAGS = -I m4
when the 'm4' directory does not exist when aclocal is called the first
time by autoreconf.
See:
<http://lists.gnu.org/archive/html/bug-automake/2013-01/msg00115.html>
* aclocal.in (scan_m4_files): Remove duplicates in @user_includes.
* t/aclocal-macrodir.tap: Extend.
* t/aclocal-macrodirs.tap: Likewise.
Signed-off-by: Stefano Lattarini <address@hidden>
---
aclocal.in | 10 ++++++++++
t/aclocal-macrodir.tap | 22 +++++++++++++++++++++-
t/aclocal-macrodirs.tap | 22 +++++++++++++++++++++-
3 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/aclocal.in b/aclocal.in
index e65b0ab..d68ea33 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -432,6 +432,16 @@ sub scan_m4_files ()
if (@user_includes)
{
+ # Don't explore the same directory multiple times. This is here not
+ # only for speedup purposes. We need this when the user has e.g.
+ # specified 'ACLOCAL_AMFLAGS = -I m4' and has also set
+ # AC_CONFIG_MACRO_DIR[S]([m4]) in configure.ac. This makes the 'm4'
+ # directory to occur twice here and fail on the second call to
+ # scan_m4_dirs([m4]) when the 'm4' directory doesn't exist.
+ # TODO: Shouldn't there be rather a check in scan_m4_dirs for
+ # @user_includes[0]?
+ @user_includes = uniq @user_includes;
+
# Don't complain if the first user directory doesn't exist, in case
# we need to create it later (can happen if '--install' was given).
scan_m4_dirs (FT_USER,
diff --git a/t/aclocal-macrodir.tap b/t/aclocal-macrodir.tap
index a480c4c..051fdb5 100755
--- a/t/aclocal-macrodir.tap
+++ b/t/aclocal-macrodir.tap
@@ -20,7 +20,7 @@
am_create_testdir=empty
. test-init.sh
-plan_ 6
+plan_ 7
ocwd=$(pwd) || fatal_ "getting current working directory"
ACLOCAL_PATH=; unset ACLOCAL_PATH
@@ -181,6 +181,26 @@ test_end
#---------------------------------------------------------------------------
+test_begin "AC_CONFIG_MACRO_DIR([not-exist]) and ACLOCAL_AMFLAGS = -I
not-exist"
+
+cat > configure.ac << 'END'
+AC_INIT([oops], [1.0])
+AC_CONFIG_MACRO_DIR([not-exist])
+END
+
+cat > Makefile.am << 'END'
+ACLOCAL_AMFLAGS = -I not-exist
+END
+
+$ACLOCAL -Wno-error 2>stderr \
+ && cat stderr >&2 \
+ && test $(grep -c "couldn't open directory 'not-exist'" stderr) -eq 1 \
+ || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
# Avoid spurious failures with pre-2.70 autoconf.
# FIXME: remove this in automake 1.14, once we require Autoconf 2.70.
if echo 'AC_INIT AC_CONFIG_MACRO_DIRS' | $AUTOCONF -o/dev/null -; then
diff --git a/t/aclocal-macrodirs.tap b/t/aclocal-macrodirs.tap
index c0bb0ac..0deae72 100755
--- a/t/aclocal-macrodirs.tap
+++ b/t/aclocal-macrodirs.tap
@@ -20,7 +20,7 @@
am_create_testdir=empty
. test-init.sh
-plan_ 14
+plan_ 15
ocwd=$(pwd) || fatal_ "getting current working directory"
ACLOCAL_PATH=; unset ACLOCAL_PATH
@@ -381,6 +381,26 @@ test_end
#---------------------------------------------------------------------------
+test_begin "AC_CONFIG_MACRO_DIRS([not-exist]) and ACLOCAL_AMFLAGS = -I
not-exist"
+
+cat > configure.ac << 'END'
+AC_INIT([oops], [1.0])
+AC_CONFIG_MACRO_DIRS([not-exist])
+END
+
+cat > Makefile.am << 'END'
+ACLOCAL_AMFLAGS = -I not-exist
+END
+
+$ACLOCAL -Wno-error 2>stderr \
+ && cat stderr >&2 \
+ && test $(grep -c "couldn't open directory 'not-exist'" stderr) -eq 1 \
+ || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
# Avoid spurious failures with pre-2.70 autoconf.
# FIXME: remove this in automake 1.14, once we require Autoconf 2.70.
if echo 'AC_INIT AC_CONFIG_MACRO_DIRS' | $AUTOCONF -o/dev/null -; then
--
1.8.1.1.701.g02339dd
- bug#13514: unintentional regression with AC_CONFIG_MACRO_DIR in 1.13.1, (continued)
- bug#13514: unintentional regression with AC_CONFIG_MACRO_DIR in 1.13.1, Pavel Raiskup, 2013/02/08
- bug#13514: unintentional regression with AC_CONFIG_MACRO_DIR in 1.13.1, Pavel Raiskup, 2013/02/09
- bug#13514: unintentional regression with AC_CONFIG_MACRO_DIR in 1.13.1, Stefano Lattarini, 2013/02/09
- bug#13514: [PATCH v2 0/0] AC_CONFIG_MACRO_DIR && non-existent directory, Pavel Raiskup, 2013/02/11
- bug#13514: [PATCH 1/2] aclocal: just warn if the primary local m4 dir doesn't exist (no error), Pavel Raiskup, 2013/02/11
- bug#13514: [PATCH 1/2] aclocal: just warn if the primary local m4 dir doesn't exist (no error), Stefano Lattarini, 2013/02/15
- bug#13514: [PATCH 2/2] aclocal: fix for more-than-once specified directories, Pavel Raiskup, 2013/02/11
- bug#13514: [PATCH v2 0/0] AC_CONFIG_MACRO_DIR && non-existent directory, Stefano Lattarini, 2013/02/11
- bug#13514: [PATCH v2 0/0] AC_CONFIG_MACRO_DIR && non-existent directory, Pavel Raiskup, 2013/02/11
- bug#13514: [PATCH v3 0/2] AC_CONFIG_MACRO_DIR && non-existent directories, Stefano Lattarini, 2013/02/16
- bug#13514: [PATCH v3 2/2] aclocal: fix for more-than-once specified directories,
Stefano Lattarini <=
- bug#13514: [PATCH v3 1/2] aclocal: just warn if the primary local m4 dir doesn't exist (don't error), Stefano Lattarini, 2013/02/16
- bug#13514: [PATCH v3 1/2] aclocal: just warn if the primary local m4 dir doesn't exist (don't error), Pavel Raiskup, 2013/02/18
- bug#13514: [PATCH v3 1/2] aclocal: just warn if the primary local m4 dir doesn't exist (don't error), Stefano Lattarini, 2013/02/20
- bug#13514: [PATCH v3 1/2] aclocal: just warn if the primary local m4 dir doesn't exist (don't error), Stefano Lattarini, 2013/02/21