>From f852616715d0de12eb32a19386b274c5060be58d Mon Sep 17 00:00:00 2001
From: Pavel Raiskup
Date: Fri, 8 Feb 2013 13:27:08 +0100
Subject: [PATCH 2/3] maint: Fix for more-than-once specified directories
Do not explore these directories multiple times in 'aclocal'. This causes
problems on older packages having specified:
configure.ac: AC_CONFIG_MACRO_DIRS([m4])
Makefile.am: ACLOCAL_AMFLAGS = -I m4
When the m4 directory does not exist.
See:
* aclocal.in (scan_m4_files): Unique multiply specified directories.
---
aclocal.in | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/aclocal.in b/aclocal.in
index 6fa8eeb..2a9e83b 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -415,6 +415,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 user has e.g.
+ # specified 'ACLOCAL_AMFLAGS = -I m4' and user has also set
+ # AC_CONFIG_MACRO_DIR[S]([m4]) in configure.ac. This forces the 'm4'
+ # directory occur twice here and fail on the second call to
+ # scan_m4_dirs([m4]) when non existent.
+ # TODO: Should'nt there be rather 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, !$install, $user_includes[0]);
--
1.7.11.7