This change is for automake bug#8407.
In the past, there had been some debate and confusion about
whether "aclocal --install" should copy third-party .m4 files
in the first directory passed to the `-I' option even when
such directory was given as an absolute path, or whether it
was better to do so only for directories specified with a
relative path.
The rationale for this latter behaviour was that, before the
existence of the `ACLOCAL_PATH' variable, the only way (a poor
way, I might add) for a common user to extend the search path
of a system-wide installation of aclocal was to export something
like ACLOCAL="aclocal -I /my/extra/macros" in the environment.
Today, the correct way to proceed is undoubtedly through the
use of ACLOCAL_PATH, so we can settle the question once and for
all, and start verifying the correct behaviour of `-I' with a
new test.
* tests/aclocal-install-absdir.test: New test.
* tests/Makefile.am (TESTS): Add it.
* doc/automake.texi (aclocal Options): Be more explicit about
this part of `--install' semantics.
+2011-12-27 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ docs: "aclocal --install -I /abs/dir" actually copies files
+
+ This change is for automake bug#8407.
+
+ In the past, there had been some debate and confusion about
+ whether "aclocal --install" should copy third-party .m4 files
+ in the first directory passed to the `-I' option even when
+ such directory was given as an absolute path, or whether it
+ was better to do so only for directories specified with a
+ relative path.
+
+ The rationale for this latter behaviour was that, before the
+ existence of the `ACLOCAL_PATH' variable, the only way (a poor
+ way, I might add) for a common user to extend the search path
+ of a system-wide installation of aclocal was to export something
+ like ACLOCAL="aclocal -I /my/extra/macros" in the environment.
+ Today, the correct way to proceed is undoubtedly through the
+ use of ACLOCAL_PATH, so we can settle the question once and for
+ all, and start verifying the correct behaviour of `-I' with a
+ new test.
+
+ * tests/aclocal-install-absdir.test: New test.
+ * tests/Makefile.am (TESTS): Add it.
+ * doc/automake.texi (aclocal Options): Be more explicit about
+ this part of `--install' semantics.
+
2011-12-26 Stefano Lattarini <stefano.lattarini@gmail.com>
docs: fix node names for automake and aclocal invocations
Install system-wide third-party macros into the first directory
specified with @samp{-I @var{dir}} instead of copying them in the
output file.
+@c The following semantics is checked by `aclocal-install-absdir.test'.
+Note that this will happen also if @var{dir} is an absolute path.
@cindex serial number and @option{--install}
When this option is used, and only when this option is used,
acloca21.test \
acloca22.test \
aclocal-acdir.test \
+aclocal-install-absdir.test \
aclocal-print-acdir.test \
aclocal-path.test \
aclocal-path-install.test \
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2011 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 --install" install files also in directories
+# passed to `-I' as absolute paths. Now that we support the
+# ACLOCAL_PATH variable, it is clear that this is the right thing
+# to do. See also automake bug#8407.
+
+. ./defs || Exit 1
+
+set -e
+
+mkdir loc sys
+
+echo 'AM_DUMMY_MACRO' >> configure.in
+echo 'AC_DEFUN([AM_DUMMY_MACRO], [:])' >> sys/foo.m4
+
+cwd=`pwd` || fatal_ "cannot get current working directory"
+env ACLOCAL_PATH="$cwd/sys" $ACLOCAL --verbose --install -I "$cwd/loc"
+diff sys/foo.m4 loc/foo.m4
+
+: