[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.4
From: |
Stefano Lattarini |
Subject: |
[Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.4-925-gb64c1f4 |
Date: |
Thu, 15 Nov 2012 15:56:19 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".
http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=b64c1f41633729250d2b7184359b673f17ce29b2
The branch, ng/master has been updated
via b64c1f41633729250d2b7184359b673f17ce29b2 (commit)
via 92bd5d25c2ba94b8664202990d0152e68d440632 (commit)
via 60fe7d3d124f9b3f3b580432f44acbc6f4bcd7b7 (commit)
via 26432142c64229f6c11c833aa8019e672593d2c1 (commit)
via 33c836b2ad72c1384ba0a8983989322b88e6bfa2 (commit)
via f0dd2dee9e4cebdc2ef1c5a9875728185bfd60eb (commit)
via 326cd5f0797b32616a7a6caaa854b04c4ebd53f7 (commit)
via b7c507eadfa7b9ef40ba433dee0d231432ab7c39 (commit)
via 834e16016b07aab9e3613a0b08a86dbadeff88c0 (commit)
via d114599bd66589794c6b78130bbc0db4ac91c334 (commit)
via 838238295952cc86e5ccfe59113e6c315cf640ec (commit)
via 256659b06280ab4be5103c760b777e26980863c3 (commit)
via bd337b9b203aa92fc524d24d325329b099d8cbc2 (commit)
via 4a5955172d2d39ef03191d2ca69edc585a12910d (commit)
via 9018a126345d53a83b0666e7e44e8b1d0d1bb8ee (commit)
via fd60ad28737e90d8732f28ce85d6cdaa781bdeed (commit)
via d2155d50e6ef6d11845583af0113a717642f53df (commit)
from 280765a36eed78934286c515cbc5c1e558cf564d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b64c1f41633729250d2b7184359b673f17ce29b2
Merge: 280765a 92bd5d2
Author: Stefano Lattarini <address@hidden>
Date: Thu Nov 15 16:40:46 2012 +0100
Merge branch 'master' into ng/master
* master:
fixup: Automake installation works again
tests: AC_CONFIG_MACRO_DIRS: ignore inevitable failures with old autoconf
recursion: remove _AM_EXTRA_RECURSIVE_TARGETS indirection
aclocal: AC_CONFIG_MACRO_DIRS: work around autom4te option parsing bugs
aclocal: tracing AC_CONFIG_MACRO_DIRS can work with older autoconf as well
news: we trace AC_CONFIG_MACRO_DIRS
news: improve wording
aclocal: trace AC_CONFIG_MACRO_DIR_TRACE
aclocal: avoid spurious warnings from autom4te with AC_CONFIG_MACRO_DIRS
coverage: expose a bug in aclocal (spurious warnings)
aclocal: smash newlines in arguments of traced macros
tests: better coverage for AC_CONFIG_MACRO_DIRS
aclocal: diagnose non-existing directories in AC_CONFIG_MACRO_DIRS better
aclocal: multiple local m4 macro dirs with AC_CONFIG_MACRO_DIRS
-----------------------------------------------------------------------
Summary of changes:
Makefile.am | 3 +
NEWS | 29 ++--
aclocal.in | 124 ++++++++---
automake.in | 9 +-
doc/automake-ng.texi | 6 +-
m4/extra-recurs.m4 | 3 +-
m4/internal/ac-config-macro-dirs.m4 | 15 ++
t/acloca17.sh | 41 ----
t/aclocal-acdir.sh | 3 +
t/aclocal-macrodir.tap | 58 +++++-
t/aclocal-macrodirs.tap | 416 +++++++++++++++++++++++++++++++++++
t/subpkg-macrodir.sh | 87 ++++++++
12 files changed, 693 insertions(+), 101 deletions(-)
create mode 100644 m4/internal/ac-config-macro-dirs.m4
delete mode 100755 t/acloca17.sh
create mode 100755 t/aclocal-macrodirs.tap
create mode 100755 t/subpkg-macrodir.sh
diff --git a/Makefile.am b/Makefile.am
index 2bb3e35..6b2df5d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -261,6 +261,9 @@ dist_automake_ac_DATA = \
m4/upc.m4 \
m4/vala.m4
+automake_internal_acdir = $(automake_acdir)/internal
+dist_automake_internal_ac_DATA = m4/internal/ac-config-macro-dirs.m4
+
dist_system_ac_DATA = m4/acdir/README
# We build amversion.m4 here, instead of from config.status,
diff --git a/NEWS b/NEWS
index 4425a89..7fa94d0 100644
--- a/NEWS
+++ b/NEWS
@@ -42,12 +42,12 @@ New in 1.13:
* Obsolescent features:
- Use of the long-deprecated two- and three-arguments invocation forms
- of the AM_INIT_AUTOMAKE is not documented anymore. It's still
- supported though (albeit with a warning in the 'obsolete' category),
- to cater for people who want to define the version number for their
- package dynamically (e.g., from the current VCS revision). We'll
- have to continue this support until Autoconf itself is fixed to allow
- better support for such dynamic version numbers.
+ of the AM_INIT_AUTOMAKE is no longer documented. It's still supported
+ though (albeit with a warning in the 'obsolete' category), to cater
+ for people who want to define the version number for their package
+ dynamically (e.g., from the current VCS revision). We'll have to
+ continue this support until Autoconf itself is fixed to allow better
+ support for such dynamic version numbers.
* Elisp byte-compilation:
@@ -95,8 +95,8 @@ New in 1.13:
"make V=0" to enable quieter output in the package he's building.
- The 'silent-rules' option has now become a no-op, preserved for
- backward-compatibility only. In particular, its use does not disable
- the warnings in the 'portability-recursive' category anymore.
+ backward-compatibility only. In particular, its use no longer
+ disables the warnings in the 'portability-recursive' category.
* Texinfo Support:
@@ -107,8 +107,8 @@ New in 1.13:
* Automatic remake rules and 'missing' script:
- - The 'missing' script does not try anymore to update the timestamp
- of out-of-date files that require a maintainer-specific tool to be
+ - The 'missing' script no longer tries to update the timestamp of
+ out-of-date files that require a maintainer-specific tool to be
remade, in case the user lacks such a tool (or has a too-old version
of it). It just give a useful warning, and in some cases also a tip
about how to obtain such a tool.
@@ -138,10 +138,11 @@ New in 1.13:
* Improvements to aclocal and related rebuilds rules:
- - The Autoconf-provided macro AC_CONFIG_MACRO_DIR is now traced by
- aclocal, and can be used to declare the local m4 include directory.
- Formerly, one had to specify it with an explicit '-I' option to the
- 'aclocal' invocation.
+ - Autoconf-provided macros AC_CONFIG_MACRO_DIR and AC_CONFIG_MACRO_DIRS
+ (the latter of which will only be present since Autoconf 2.70) are
+ now traced by aclocal, and can be used to declare the local m4 include
+ directories. Formerly, one had to specify it with an explicit '-I'
+ option to the 'aclocal' invocation.
- The special make variable ACLOCAL_AMFLAGS is deprecated; future
Automake versions will warn about its use, and later version will
diff --git a/aclocal.in b/aclocal.in
index cb50e42..1098f63 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -44,11 +44,21 @@ use File::Path ();
# Some globals.
+# Support AC_CONFIG_MACRO_DIRS also with older autoconf.
+# FIXME: To be removed in Automake 1.14, once we can assume autoconf
+# 2.70 or later.
+# FIXME: keep in sync with 'internal/ac-config-macro-dirs.m4'.
+my $ac_config_macro_dirs_fallback =
+ 'm4_ifndef([AC_CONFIG_MACRO_DIRS], [' .
+ 'm4_defun([_AM_CONFIG_MACRO_DIRS], [])' .
+ 'm4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])' .
+ '])';
+
# Include paths for searching macros. We search macros in this order:
# user-supplied directories first, then the directory containing the
# automake macros, and finally the system-wide directories for
# third-party macros.
-# @user_includes can be augmented with -I or AC_CONFIG_MACRO_DIR.
+# @user_includes can be augmented with -I or AC_CONFIG_MACRO_DIRS.
# @automake_includes can be reset with the '--automake-acdir' option.
# @system_includes can be augmented with the 'dirlist' file or the
# ACLOCAL_PATH environment variable, and reset with the '--system-acdir'
@@ -143,10 +153,10 @@ my $serial_number_rx = '^\d+(?:\.\d+)*$';
# Autoconf version. This variable is set by 'trace_used_macros'.
my $ac_version;
-# Primary user directory containing extra m4 files for macros
-# definition, as extracted from call to macro AC_CONFIG_MACRO_DIR.
-# This variable is set by 'trace_used_macros'.
-my $ac_config_macro_dir;
+# User directory containing extra m4 files for macros definition,
+# as extracted from calls to the macro AC_CONFIG_MACRO_DIRS.
+# This variable is updated by 'trace_used_macros'.
+my @ac_config_macro_dirs;
# If set, names a temporary file that must be erased on abnormal exit.
my $erase_me;
@@ -161,7 +171,7 @@ sub check_acinclude ();
sub reset_maps ();
sub install_file ($$);
sub list_compare (address@hidden@);
-sub scan_m4_dirs ($@);
+sub scan_m4_dirs ($$@);
sub scan_m4_files ();
sub add_macro ($);
sub scan_configure_dep ($);
@@ -341,28 +351,20 @@ sub list_compare (address@hidden@)
################################################################
-# scan_m4_dirs($TYPE, @DIRS)
-# --------------------------
+# scan_m4_dirs($TYPE, $ERR_ON_NONEXISTING, @DIRS)
+# -----------------------------------------------
# Scan all M4 files installed in @DIRS for new macro definitions.
# Register each file as of type $TYPE (one of the FT_* constants).
-my $first_user_m4dir = 1;
-sub scan_m4_dirs ($@)
+sub scan_m4_dirs ($$@)
{
- my ($type, @dirlist) = @_;
+ my ($type, $err_on_nonexisting, @dirlist) = @_;
foreach my $m4dir (@dirlist)
{
if (! opendir (DIR, $m4dir))
{
- if ($install && $type == FT_USER && $first_user_m4dir)
- {
- # We will try to create this directory later, so don't
- # complain if it doesn't exist.
- # TODO: maybe we should avoid complaining only if errno
- # is ENONENT?
- $first_user_m4dir = 0;
- next;
- }
+ # TODO: maybe avoid complaining only if errno == ENONENT?
+ next unless $err_on_nonexisting;
fatal "couldn't open directory '$m4dir': $!";
}
@@ -397,9 +399,16 @@ sub scan_m4_files ()
}
# Finally, scan all files in our search paths.
- scan_m4_dirs (FT_USER, @user_includes);
- scan_m4_dirs (FT_AUTOMAKE, @automake_includes);
- scan_m4_dirs (FT_SYSTEM, @system_includes);
+
+ if (@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]);
+ scan_m4_dirs (FT_USER, 1, @user_includes[1..$#user_includes]);
+ }
+ scan_m4_dirs (FT_AUTOMAKE, 1, @automake_includes);
+ scan_m4_dirs (FT_SYSTEM, 1, @system_includes);
# Construct a new function that does the searching. We use a
# function (instead of just evaluating $search in the loop) so that
@@ -714,8 +723,27 @@ sub trace_used_macros ()
my %files = map { $map{$_} => 1 } keys %macro_seen;
%files = strip_redundant_includes %files;
+ # When AC_CONFIG_MACRO_DIRS is used, avoid possible spurious warnings
+ # from autom4te about macros being "m4_require'd but not m4_defun'd";
+ # for more background, see:
+ # http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg00004.html
+ # as well as autoconf commit 'v2.69-44-g1ed0548', "warn: allow aclocal
+ # to silence m4_require warnings".
+ my $early_m4_code .= "m4_define([m4_require_silent_probe], [-])";
+
my $traces = ($ENV{AUTOM4TE} || '@am_AUTOM4TE@');
$traces .= " --language Autoconf-without-aclocal-m4 ";
+ $traces = "echo '$early_m4_code' | $traces - ";
+
+ # Support AC_CONFIG_MACRO_DIRS also with older autoconf.
+ # Note that we can't use '$ac_config_macro_dirs_fallback' here, because
+ # a bug in option parsing code of autom4te 2.68 and earlier will cause
+ # it to read standard input last, even if the "-" argument is specified
+ # early.
+ # FIXME: To be removed in Automake 1.14, once we can assume autoconf
+ # 2.70 or later.
+ $traces .= "$automake_includes[0]/internal/ac-config-macro-dirs.m4 ";
+
# All candidate files.
$traces .= join (' ',
(map { "'$_'" }
@@ -723,12 +751,18 @@ sub trace_used_macros ()
# All candidate macros.
$traces .= join (' ',
- (map { "--trace='$_:\$f::\$n::\$1'" }
+ (map { "--trace='$_:\$f::\$n::\${::}%'" }
('AC_DEFUN',
'AC_DEFUN_ONCE',
'AU_DEFUN',
'_AM_AUTOCONF_VERSION',
- 'AC_CONFIG_MACRO_DIR')),
+ 'AC_CONFIG_MACRO_DIR_TRACE',
+ # FIXME: Tracing the next two macros is a hack for
+ # compatibility with older autoconf. Remove this in
+ # Automake 1.14, when we can assume Autoconf 2.70 or
+ # later.
+ 'AC_CONFIG_MACRO_DIR',
+ '_AM_CONFIG_MACRO_DIRS')),
# Do not trace $1 for all other macros as we do
# not need it and it might contains harmful
# characters (like newlines).
@@ -738,7 +772,7 @@ sub trace_used_macros ()
my $tracefh = new Automake::XFile ("$traces $configure_ac |");
- $ac_config_macro_dir = undef;
+ @ac_config_macro_dirs = ();
my %traced = ();
@@ -758,12 +792,34 @@ sub trace_used_macros ()
{
$ac_version = $arg1;
}
+ elsif ($macro eq 'AC_CONFIG_MACRO_DIR_TRACE')
+ {
+ push @ac_config_macro_dirs, $arg1;
+ }
+ # FIXME: We still need to trace AC_CONFIG_MACRO_DIR
+ # for compatibility with older autoconf. Remove this
+ # once we can assume Autoconf 2.70 or later.
elsif ($macro eq 'AC_CONFIG_MACRO_DIR')
{
- $ac_config_macro_dir = $arg1;
+ @ac_config_macro_dirs = ($arg1);
+ }
+ # FIXME:This is an hack for compatibility with older autoconf.
+ # Remove this once we can assume Autoconf 2.70 or later.
+ elsif ($macro eq '_AM_CONFIG_MACRO_DIRS')
+ {
+ # Empty leading/trailing fields might be produced by split,
+ # hence the grep is really needed.
+ push @ac_config_macro_dirs, grep (/./, (split /\s+/, $arg1));
}
}
+ # FIXME: in Autoconf >= 2.70, AC_CONFIG_MACRO_DIR calls
+ # AC_CONFIG_MACRO_DIR_TRACE behind the scenes, which could
+ # leave unwanted duplicates in @ac_config_macro_dirs.
+ # Remove this in Automake 1.14, when we'll stop tracing
+ # AC_CONFIG_MACRO_DIR explicitly.
+ @ac_config_macro_dirs = uniq @ac_config_macro_dirs;
+
$tracefh->close;
return %traced;
@@ -889,6 +945,7 @@ $output";
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
+$ac_config_macro_dirs_fallback
$output";
# We try not to update $output_file unless necessary, because
@@ -1092,13 +1149,12 @@ while (1)
last if $exit_code;
my %macro_traced = trace_used_macros;
- if (!$rerun_due_to_macrodir && defined $ac_config_macro_dir)
+ if (!$rerun_due_to_macrodir && @ac_config_macro_dirs)
{
- # The directory specified by the AC_CONFIG_MACRO_DIR m4 macro
- # (if any) must after the user includes specified explicitly
- # with the '-I' option.
- push @user_includes, $ac_config_macro_dir
- if defined $ac_config_macro_dir;
+ # The directory specified in calls to the AC_CONFIG_MACRO_DIRS
+ # m4 macro (if any) must go after the user includes specified
+ # explicitly with the '-I' option.
+ push @user_includes, @ac_config_macro_dirs;
# We might have to scan some new directory of .m4 files.
$rerun_due_to_macrodir++;
next;
@@ -1107,7 +1163,7 @@ while (1)
if ($install && address@hidden)
{
fatal "installation of third-party macros impossible without " .
- "-I options nor AC_CONFIG_MACRO_DIR m4 macro";
+ "-I options nor AC_CONFIG_MACRO_DIR{,S} m4 macro(s)";
}
last if write_aclocal ($output_file, keys %macro_traced);
diff --git a/automake.in b/automake.in
index 6606853..1b4d375 100644
--- a/automake.in
+++ b/automake.in
@@ -4175,7 +4175,7 @@ sub scan_autoconf_traces ($)
AC_SUBST_TRACE => 1,
AM_AUTOMAKE_VERSION => 1,
AM_CONDITIONAL => 2,
- _AM_EXTRA_RECURSIVE_TARGETS => 1,
+ AM_EXTRA_RECURSIVE_TARGETS => 1,
AM_GNU_GETTEXT => 0,
AM_GNU_GETTEXT_INTL_SUBDIR => 0,
AM_INIT_AUTOMAKE => 0,
@@ -4332,9 +4332,12 @@ sub scan_autoconf_traces ($)
{
$configure_cond{$args[1]} = $where;
}
- elsif ($macro eq '_AM_EXTRA_RECURSIVE_TARGETS')
+ elsif ($macro eq 'AM_EXTRA_RECURSIVE_TARGETS')
{
- push @extra_recursive_targets, split (' ', $args[1]);
+ # Empty leading/trailing fields might be produced by split,
+ # hence the grep is really needed.
+ push @extra_recursive_targets,
+ grep (/./, (split /\s+/, $args[1]));
}
elsif ($macro eq 'AM_GNU_GETTEXT')
{
diff --git a/doc/automake-ng.texi b/doc/automake-ng.texi
index fc525f2..c850e3d 100644
--- a/doc/automake-ng.texi
+++ b/doc/automake-ng.texi
@@ -3589,10 +3589,10 @@ will be almost impossible to share macros between
packages.
The second possibility, which we do recommend, is to write each macro
in its own file and gather all these files in a directory. This
directory is usually called @file{m4/}. Then it's enough to update
address@hidden by adding a proper call to @code{AC_CONFIG_MACRO_DIR}:
address@hidden by adding a proper call to @code{AC_CONFIG_MACRO_DIRS}:
@example
-AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_MACRO_DIRS([m4])
@end example
@command{aclocal} will then take care of automatically adding @file{m4/}
@@ -3715,7 +3715,7 @@ MyPackage uses an @file{m4/} directory to store local
macros as
explained in @ref{Local Macros}, and has
@example
-AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_MACRO_DIRS([m4])
@end example
@noindent
diff --git a/m4/extra-recurs.m4 b/m4/extra-recurs.m4
index 7b7ecc7..68d575a 100644
--- a/m4/extra-recurs.m4
+++ b/m4/extra-recurs.m4
@@ -12,6 +12,5 @@
# be traced by Automake, which will ensure that a proper definition of
# user-defined recursive targets (and associated rules) is propagated
# into all the generated Makefiles.
-AC_DEFUN([AM_EXTRA_RECURSIVE_TARGETS], [_$0(m4_flatten([$1]))])
# TODO: We should really reject non-literal arguments here...
-m4_define([_AM_EXTRA_RECURSIVE_TARGETS], [])
+AC_DEFUN([AM_EXTRA_RECURSIVE_TARGETS], [])
diff --git a/m4/internal/ac-config-macro-dirs.m4
b/m4/internal/ac-config-macro-dirs.m4
new file mode 100644
index 0000000..530e655
--- /dev/null
+++ b/m4/internal/ac-config-macro-dirs.m4
@@ -0,0 +1,15 @@
+# Support AC_CONFIG_MACRO_DIRS with older autoconf. -*- Autoconf -*-
+# FIXME: To be removed in Automake 1.14, once we can assume autoconf
+# 2.70 or later.
+# FIXME: keep in sync with the contents of the variable
+# '$ac_config_macro_dirs_fallback' in aclocal.in.
+
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS],
+[m4_defun([_AM_CONFIG_MACRO_DIRS],[])]dnl
+[m4_defun([AC_CONFIG_MACRO_DIRS],[_AM_CONFIG_MACRO_DIRS($@)])])
diff --git a/t/acloca17.sh b/t/acloca17.sh
deleted file mode 100755
index ed8fc32..0000000
--- a/t/acloca17.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2004-2012 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Make sure aclocal report unused required macros.
-
-am_create_testdir=empty
-. test-init.sh
-
-cat > configure.ac << 'END'
-AC_INIT
-SOME_DEFS
-END
-
-mkdir m4
-cat >m4/somedefs.m4 <<EOF
-AC_DEFUN([SOME_DEFS], [
- AC_REQUIRE([UNDEFINED_MACRO])
-])
-EOF
-
-# FIXME: We want autom4te's 'undefined required macro' warning to be fatal,
-# but have no means to say so to aclocal. We use WARNINGS=error instead.
-
-WARNINGS=error $ACLOCAL -I m4 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep '^configure\.ac:2:.*UNDEFINED_MACRO' stderr
-
-:
diff --git a/t/aclocal-acdir.sh b/t/aclocal-acdir.sh
index 59182bb..944604b 100755
--- a/t/aclocal-acdir.sh
+++ b/t/aclocal-acdir.sh
@@ -21,6 +21,9 @@
. test-init.sh
mkdir am sys
+# FIXME: remove in Automake 1.14.
+mkdir am/internal
+: > am/internal/ac-config-macro-dirs.m4
cat >> configure.ac <<'END'
MY_MACRO
diff --git a/t/aclocal-macrodir.tap b/t/aclocal-macrodir.tap
index 3daedad..2d3b0d6 100755
--- a/t/aclocal-macrodir.tap
+++ b/t/aclocal-macrodir.tap
@@ -15,12 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Several tests on the use of the m4 macro AC_CONFIG_MACRO_DIR with
-# aclocal.
+# aclocal. See also related test 'aclocal-macrodir.tap'.
am_create_testdir=empty
. test-init.sh
-plan_ later
+plan_ 6
ocwd=$(pwd) || fatal_ "getting current working directory"
ACLOCAL_PATH=; unset ACLOCAL_PATH
@@ -44,6 +44,7 @@ test_begin ()
else
r=ok
description=$1
+ directive=${2-}
echo "$description" > README.txt
shift
fi
@@ -68,8 +69,6 @@ test_end ()
fi
}
-test_todo () { directive=TODO; }
-
#---------------------------------------------------------------------------
test_begin "AC_CONFIG_MACRO_DIR is honored"
@@ -158,4 +157,55 @@ test_end
#---------------------------------------------------------------------------
+test_begin "AC_CONFIG_MACRO_DIR([non-existent]) errors out (1)"
+
+cat > configure.ac << 'END'
+AC_INIT([oops], [1.0])
+AC_CONFIG_MACRO_DIR([non-existent])
+END
+
+not $ACLOCAL -Wnone 2>stderr \
+ && cat stderr >&2 \
+ && grep "couldn't open directory 'non-existent'" stderr \
+ || 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
+
+ test_begin "AC_CONFIG_MACRO_DIR interaction with AC_REQUIRE"
+
+ unindent > configure.ac <<'END'
+ AC_INIT([req], [1.0])
+ AC_CONFIG_MACRO_DIR([macro-dir])
+ AC_DEFUN([MY_FOO], [AC_REQUIRE([MY_BAR])])
+ MY_FOO
+END
+
+ mkdir macro-dir
+ echo 'AC_DEFUN([MY_BAR], [//my//bar//])' > macro-dir/x.m4
+
+ st=0; $ACLOCAL 2>stderr || st=$?
+ cat stderr >&2
+
+ test $st -eq 0 \
+ && test ! -s stderr \
+ && $FGREP 'm4_include([macro-dir/x.m4])' aclocal.m4 \
+ && $AUTOCONF \
+ && not $EGREP 'MY_(FOO|BAR)' configure \
+ && $FGREP '//my//bar//' configure \
+ || r='not ok'
+
+ test_end
+
+else
+
+ skip_ -r "autoconf is too old (AC_CONFIG_MACRO_DIRS not defined)"
+
+fi
+
:
diff --git a/t/aclocal-macrodirs.tap b/t/aclocal-macrodirs.tap
new file mode 100755
index 0000000..10256fd
--- /dev/null
+++ b/t/aclocal-macrodirs.tap
@@ -0,0 +1,416 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Several tests on the use of the m4 macro AC_CONFIG_MACRO_DIRS with
+# aclocal. See also related test 'aclocal-macrodir.tap'.
+
+am_create_testdir=empty
+. test-init.sh
+
+plan_ 14
+
+ocwd=$(pwd) || fatal_ "getting current working directory"
+ACLOCAL_PATH=; unset ACLOCAL_PATH
+
+#
+# General utility functions and variables.
+#
+# TODO: These should maybe be refactored, generalized and
+# moved into 't/ax/tap-functions.sh' ...
+#
+
+tcount=0
+r=invalid
+description=''
+directive=''
+
+test_begin ()
+{
+ if test -n "$description"; then
+ fatal_ "'test_begin' called, but another test seems active already"
+ else
+ r=ok
+ description=$1
+ directive=${2-}
+ echo "$description" > README.txt
+ shift
+ fi
+ tcount=$(($tcount + 1)) && test $tcount -gt 0 \
+ || fatal_ "failed to bump the test count"
+ mkdir $tcount.d
+ cd $tcount.d
+}
+
+test_end ()
+{
+ if test -z "$description"; then
+ fatal_ "'test_end' called, but no test seems active"
+ else
+ cd "$ocwd" || fatal_ "cannot chdir back to top-level directory"
+ result_ "$r" -D "$directive" -- "$description"
+ # Don't leave directories for successful subtests hanging around.
+ if test -z "$directive" && test "$r" = ok; then
+ rm -rf "$tcount.d" || fatal_ "removing subdir $tcount.d"
+ fi
+ r=invalid directive= description=
+ fi
+}
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS is honored"
+
+cat > configure.ac <<'END'
+AC_INIT([md], [10.0])
+AC_CONFIG_MACRO_DIRS([macro-dir])
+MY_FOO
+END
+
+mkdir macro-dir
+echo 'AC_DEFUN([MY_FOO], [::my::foo::])' > macro-dir/foo.m4
+
+$ACLOCAL \
+ && $FGREP 'm4_include([macro-dir/foo.m4])' aclocal.m4 \
+ && $AUTOCONF \
+ && not $FGREP 'MY_FOO' configure \
+ && $FGREP '::my::foo::' configure \
+ || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+three_dirs_check ()
+{
+ mkdir dir1 dir2 dir3
+ echo 'AC_DEFUN([MY_FOO], [::my::foo::])' > dir1/foo.m4
+ echo 'AC_DEFUN([MY_BAR], [!!my!!bar!!])' > dir2/zap.m4
+ echo 'AC_DEFUN([MY_BAZ], [==my==baz==])' > dir3/0.m4
+ $ACLOCAL \
+ && $FGREP 'm4_include([dir1/foo.m4])' aclocal.m4 \
+ && $FGREP 'm4_include([dir2/zap.m4])' aclocal.m4 \
+ && $FGREP 'm4_include([dir3/0.m4])' aclocal.m4 \
+ && $AUTOCONF \
+ && not $EGREP 'MY_(FOO|BAR|BAZ)' configure \
+ && $FGREP '::my::foo::' configure \
+ && $FGREP '!!my!!bar!!' configure \
+ && $FGREP '==my==baz==' configure \
+ || r='not ok'
+}
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS several arguments"
+
+cat > configure.ac <<'END'
+AC_INIT([more-args], [0.2])
+AC_CONFIG_MACRO_DIRS([dir1 dir2 dir3])
+MY_FOO
+MY_BAR
+MY_BAZ
+END
+
+three_dirs_check
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS several calls"
+
+cat > configure.ac <<'END'
+AC_INIT([more-calls], [2.0])
+AC_CONFIG_MACRO_DIRS([dir1])
+AC_CONFIG_MACRO_DIRS([dir2 dir3])
+MY_FOO
+MY_BAR
+MY_BAZ
+END
+
+three_dirs_check
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS extra whitespace"
+
+bslash=\\
+
+cat > configure.ac <<END
+AC_INIT([more-args], [0.2])
+AC_CONFIG_MACRO_DIRS([ dir1${bslash}
+${tab} dir2 ${tab}${tab}dir3
+${bslash}
+
+])
+MY_FOO
+MY_BAR
+MY_BAZ
+END
+
+three_dirs_check
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS precedence"
+
+cat > configure.ac <<'END'
+AC_INIT([more-calls], [2.0])
+AC_CONFIG_MACRO_DIRS([dir1])
+AC_CONFIG_MACRO_DIRS([dir2 dir3])
+MY_FOO
+MY_BAR
+MY_BAZ
+END
+
+mkdir dir1 dir2 dir3
+echo 'AC_DEFUN([MY_FOO], [OK-Foo])' > dir1/b.m4
+echo 'AC_DEFUN([MY_FOO], [KO-Foo])' > dir2/a.m4
+echo 'AC_DEFUN([MY_BAR], [OK-Bar])' > dir2/1.m4
+echo 'AC_DEFUN([MY_BAR], [KO-Bar])' > dir3/0.m4
+echo 'AC_DEFUN([MY_BAZ], [OK-Baz])' > dir3/x.m4
+
+$ACLOCAL \
+ && $FGREP 'm4_include([dir1/b.m4])' aclocal.m4 \
+ && $FGREP 'm4_include([dir2/1.m4])' aclocal.m4 \
+ && $FGREP 'm4_include([dir3/x.m4])' aclocal.m4 \
+ && test $($FGREP -c 'm4_include([dir1' aclocal.m4) -eq 1 \
+ && test $($FGREP -c 'm4_include([dir2' aclocal.m4) -eq 1 \
+ && test $($FGREP -c 'm4_include([dir3' aclocal.m4) -eq 1 \
+ && $AUTOCONF \
+ && not $EGREP 'MY_(FOO|BAR|BAZ)' configure \
+ && $FGREP 'OK-Foo' configure \
+ && $FGREP 'OK-Bar' configure \
+ && $FGREP 'OK-Baz' configure \
+ && not $FGREP 'KO-' configure \
+ || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS interaction with --install"
+
+cat > configure.ac << 'END'
+AC_INIT([inst], [1.0])
+AC_CONFIG_MACRO_DIRS([the-dir])
+THE_MACRO
+END
+
+mkdir sys-dir the-dir
+echo 'AC_DEFUN([THE_MACRO], [:])' > sys-dir/my.m4
+
+test ! -r the-dir/my.m4 \
+ && $ACLOCAL --install --system-acdir ./sys-dir \
+ && diff sys-dir/my.m4 the-dir/my.m4 \
+ || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+two_dirs_install_check ()
+{
+ mkdir sys-dir dir1 dir2
+ echo 'AC_DEFUN([THE_MACRO], [:])' > sys-dir/my.m4
+ echo 'AC_DEFUN([AX_FOO], [:])' > dir2/zap.m4
+ test ! -r dir1/my.m4 \
+ && $ACLOCAL --install --system-acdir ./sys-dir \
+ && diff sys-dir/my.m4 dir1/my.m4 \
+ && test ! -e dir2/my.m4 \
+ && $FGREP 'm4_include([dir1/my.m4])' aclocal.m4 \
+ && $FGREP 'm4_include([dir2/zap.m4])' aclocal.m4 \
+ || r='not ok'
+}
+
+#---------------------------------------------------------------------------
+
+test_begin "several AC_CONFIG_MACRO_DIRS arguments and --install"
+
+cat > configure.ac << 'END'
+AC_INIT([inst2a], [1.0])
+AC_CONFIG_MACRO_DIRS([dir1 dir2])
+THE_MACRO
+AX_FOO
+END
+
+two_dirs_install_check
+
+test_end
+
+#---------------------------------------------------------------------------
+
+
+test_begin "several AC_CONFIG_MACRO_DIRS calls and --install"
+
+cat > configure.ac << 'END'
+AC_INIT([inst2b], [1.0])
+AC_CONFIG_MACRO_DIRS([dir1])
+AC_CONFIG_MACRO_DIRS([dir2])
+THE_MACRO
+AX_FOO
+END
+
+two_dirs_install_check
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "'-I' option wins over AC_CONFIG_MACRO_DIRS"
+
+cat > configure.ac <<'END'
+AC_INIT([md], [4.6])
+AC_CONFIG_MACRO_DIRS([dir1])
+MY_FOO
+END
+
+mkdir dir1 dir2
+echo 'AC_DEFUN([MY_FOO], [::ko::ko::])' > dir1/1.m4
+echo 'AC_DEFUN([MY_FOO], [::ok::ok::])' > dir2/2.m4
+
+$ACLOCAL -I dir2 \
+ && $FGREP 'm4_include([dir2/2.m4])' aclocal.m4 \
+ && not $FGREP 'm4_include([dir1/1.m4])' aclocal.m4 \
+ && $AUTOCONF \
+ && not $FGREP '::ko::ko::' configure \
+ && $FGREP '::ok::ok::' configure \
+ || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS([foo]) can create directory 'foo'"
+
+cat > configure.ac << 'END'
+AC_INIT([x], [1.0])
+AC_CONFIG_MACRO_DIRS([foo])
+MY_MACRO
+END
+
+mkdir acdir
+echo 'AC_DEFUN([MY_MACRO], [:])' > acdir/bar.m4
+
+test ! -d foo \
+ && $ACLOCAL --install --system-acdir ./acdir \
+ && diff acdir/bar.m4 foo/bar.m4 \
+ || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS([non-existent]) errors out (1)"
+
+cat > configure.ac << 'END'
+AC_INIT([oops], [1.0])
+AC_CONFIG_MACRO_DIRS([non-existent])
+END
+
+not $ACLOCAL 2>stderr \
+ && cat stderr >&2 \
+ && grep "couldn't open directory 'non-existent'" stderr \
+ || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS([non-existent]) errors out (2)"
+
+cat > configure.ac << 'END'
+AC_INIT([oops], [1.0])
+AC_CONFIG_MACRO_DIRS([dir-ok])
+AC_CONFIG_MACRO_DIRS([dir-ko])
+END
+
+mkdir dir-ok
+not $ACLOCAL 2>stderr \
+ && cat stderr >&2 \
+ && grep "couldn't open directory 'dir-ko'" stderr \
+ && not grep "dir-ok" stderr \
+ || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS([non-existent]) errors out (tricky setup)"
+
+cat > configure.ac << 'END'
+AC_INIT([oops], [1.0])
+AC_CONFIG_MACRO_DIRS([dir-ok])
+AC_CONFIG_MACRO_DIRS([dir-ko])
+END
+
+mkdir dir-ok
+
+not $ACLOCAL -Wnone --install 2>stderr \
+ && cat stderr >&2 \
+ && grep "couldn't open directory 'dir-ko'" stderr \
+ && test ! -e dir-ko \
+ || 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
+
+ test_begin "AC_CONFIG_MACRO_DIRS interaction with AC_REQUIRE"
+
+ unindent > configure.ac <<'END'
+ AC_INIT([req], [1.0])
+ AC_CONFIG_MACRO_DIRS([m1 m2])
+ AC_DEFUN([MY_FOO], [
+ AC_REQUIRE([MY_BAR])
+ AC_REQUIRE([MY_BAZ])
+ ])
+ MY_FOO
+END
+
+ mkdir m1 m2
+ echo 'AC_DEFUN([MY_BAR], [^^my^^bar^^])' > m1/x.m4
+ echo 'AC_DEFUN([MY_BAZ], [~~my~~baz~~])' > m2/x.m4
+
+ st=0; $ACLOCAL 2>stderr || st=$?
+ cat stderr >&2
+
+ test $st -eq 0 \
+ && test ! -s stderr \
+ && $FGREP 'm4_include([m1/x.m4])' aclocal.m4 \
+ && $FGREP 'm4_include([m2/x.m4])' aclocal.m4 \
+ && $AUTOCONF \
+ && not $EGREP 'MY_(FOO|BAR|BAZ)' configure \
+ && $FGREP '^^my^^bar^^' configure \
+ && $FGREP '~~my~~baz~~' configure \
+ || r='not ok'
+
+ test_end
+
+else
+
+ skip_ -r "autoconf is too old (AC_CONFIG_MACRO_DIRS not defined)"
+
+fi
+
+:
diff --git a/t/subpkg-macrodir.sh b/t/subpkg-macrodir.sh
new file mode 100755
index 0000000..a16f42b
--- /dev/null
+++ b/t/subpkg-macrodir.sh
@@ -0,0 +1,87 @@
+#! /bin/sh
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Subpackages that want to use m4 macros from their superpackages,
+# with AC_CONFIG_MACRO_DIRS.
+
+. test-init.sh
+
+cat > configure.ac <<'END'
+AC_INIT([super], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_SUBDIRS([pkg])
+AX_BAR
+AX_FOO
+END
+
+mkdir m4
+
+cat > m4/foo.m4 <<'EOF'
+AC_DEFUN([AX_FOO], [
+ AC_CONFIG_FILES([Makefile])
+ AC_OUTPUT
+])
+EOF
+
+cat > m4/bar.m4 <<'EOF'
+AC_DEFUN([AX_BAR], [AC_SUBST([WHOMAI], [SuperPkg])])
+EOF
+
+cat > Makefile.am << 'END'
+test-whomai:
+ test '$(WHOAMI)' = SuperPkg
+check-local: test
+.PHONY: test
+END
+
+mkdir pkg
+
+cat > pkg/configure.ac <<'END'
+AC_INIT([super], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_MACRO_DIRS([macros ../m4])
+AX_BAR
+AX_FOO
+END
+
+mkdir pkg/macros
+cat > pkg/macros/zardoz.m4 << 'END'
+AC_DEFUN([AX_BAR], [AC_SUBST([WHOMAI], [sub-pkg])])
+END
+
+cat > pkg/Makefile.am << 'END'
+test-whomai:
+ test '$(WHOAMI)' = sub-pkg
+check-local: test
+.PHONY: test
+END
+
+AUTOMAKE=$AUTOMAKE ACLOCAL=$ACLOCAL AUTOCONF=$AUTOCONF $AUTORECONF -vi
+
+$FGREP 'm4_include([m4/foo.m4])' aclocal.m4
+$FGREP 'm4_include([m4/bar.m4])' aclocal.m4
+$FGREP 'm4_include([../m4/foo.m4])' pkg/aclocal.m4
+$FGREP 'm4_include([macros/zardoz.m4])' pkg/aclocal.m4
+
+./configure
+
+$MAKE test
+(cd pkg && $MAKE test) || exit 1
+
+$MAKE distcheck
+
+:
hooks/post-receive
--
GNU Automake
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.4-925-gb64c1f4,
Stefano Lattarini <=