]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
docs: "aclocal --install -I /abs/dir" actually copies files
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 27 Dec 2011 13:55:41 +0000 (14:55 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 27 Dec 2011 14:59:37 +0000 (15:59 +0100)
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.

ChangeLog
doc/automake.texi
tests/Makefile.am
tests/aclocal-install-absdir.test [new file with mode: 0644]

index 412d4d6b835d7ac57ec7250cb9b79466e29b749d..0d42cdcfdd048b8427d54a865a333e7f2e9fd3de 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+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
index 31516202babfbade079c0d2b650666623a2f4d44..86879d170ad091b0886c91556c9c5a1670a82c16 100644 (file)
@@ -3224,6 +3224,8 @@ Add the directory @var{dir} to the list of directories searched for
 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,
index 5ac0e48260f11ed516afb0cafefe9291c943b8ad..6ce7c53be24517bcfb1080caeac0491c91a7ed25 100644 (file)
@@ -78,6 +78,7 @@ acloca20.test \
 acloca21.test \
 acloca22.test \
 aclocal-acdir.test \
+aclocal-install-absdir.test \
 aclocal-print-acdir.test \
 aclocal-path.test \
 aclocal-path-install.test \
diff --git a/tests/aclocal-install-absdir.test b/tests/aclocal-install-absdir.test
new file mode 100644 (file)
index 0000000..1a642b5
--- /dev/null
@@ -0,0 +1,35 @@
+#! /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
+
+: