[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dirlist
From: |
Alexandre Duret-Lutz |
Subject: |
Re: dirlist |
Date: |
02 Aug 2002 00:11:53 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
I'm checking this in.
2002-08-01 Alexandre Duret-Lutz <address@hidden>
* aclocal.in (parse_arguments): Add `dirlist' paths add the
very end of the search path, after aclocal-APIVERSION/ and
aclocal/.
* automake.texi (Macro search path): Adjust to reflect the
new ordering.
* tests/dirlist.test: Check for this.
Index: aclocal.in
===================================================================
RCS file: /cvs/automake/automake/aclocal.in,v
retrieving revision 1.72
diff -u -r1.72 aclocal.in
--- aclocal.in 31 Jul 2002 19:58:25 -0000 1.72
+++ aclocal.in 1 Aug 2002 22:20:52 -0000
@@ -184,6 +184,19 @@
$default_dirlist="$acdir/dirlist"
if $acdir ne $default_acdir;
+ # Search the versioned directory near the end, and then the
+ # unversioned directory last. Only do this if the user didn't
+ # override acdir.
+ push (@dirlist, "$acdir-$APIVERSION")
+ if $acdir eq $default_acdir;
+
+ # By default $(datadir)/aclocal doesn't exist. We don't want to
+ # get an error in the case where we are searching the default
+ # directory and it hasn't been created.
+ push (@dirlist, $acdir)
+ unless $acdir eq $default_acdir && ! -d $acdir;
+
+ # Finally, adds any directory listed in the `dirlist' file.
if (open (DEFAULT_DIRLIST, $default_dirlist))
{
while (<DEFAULT_DIRLIST>)
@@ -196,22 +209,11 @@
if (-d $contents )
{
push (@dirlist, $contents);
- }
+ }
}
close (DEFAULT_DIRLIST);
}
- # Search the versioned directory near the end, and then the
- # unversioned directory last. Only do this if the user didn't
- # override acdir.
- push (@dirlist, "$acdir-$APIVERSION")
- if $acdir eq $default_acdir;
-
- # By default $(datadir)/aclocal doesn't exist. We don't want to
- # get an error in the case where we are searching the default
- # directory and it hasn't been created.
- push (@dirlist, $acdir)
- unless $acdir eq $default_acdir && ! -d $acdir;
return @dirlist;
}
Index: automake.texi
===================================================================
RCS file: /cvs/automake/automake/automake.texi,v
retrieving revision 1.293
diff -u -r1.293 automake.texi
--- automake.texi 31 Jul 2002 19:58:25 -0000 1.293
+++ automake.texi 1 Aug 2002 22:21:10 -0000
@@ -1341,7 +1341,7 @@
to supply their own macros.
At startup, @code{aclocal} scans all the @file{.m4} files it can find,
-looking for macro definitions (@pxref{Macro search path}). Then it
+looking for macro definitions (@pxref{Macro search path}). Then it
scans @file{configure.in}. Any
mention of one of the macros found in the first step causes that macro,
and any macros it in turn requires, to be put into @file{aclocal.m4}.
@@ -1417,15 +1417,15 @@
@table @code
@item @var{acdir-APIVERSION}
This is where the @file{.m4} macros distributed with automake itself
-are stored. @var{APIVERSION} depends on the automake release used;
-for automake 1.6.x, @var{APIVERSION} = @code{1.6}.
+are stored. @var{APIVERSION} depends on the automake release used;
+for automake 1.6.x, @var{APIVERSION} = @code{1.6}.
@item @var{acdir}
This directory is intended for third party @file{.m4} files, and is
-configured when @command{automake} itself is built. This is
address@hidden@@datadir@@/aclocal/}, which typically
-expands to @address@hidden@}/share/aclocal/}. To find the compiled-in
-value of @var{acdir}, use the @code{--print-ac-dir} option
+configured when @command{automake} itself is built. This is
address@hidden@@datadir@@/aclocal/}, which typically
+expands to @address@hidden@}/share/aclocal/}. To find the compiled-in
+value of @var{acdir}, use the @code{--print-ac-dir} option
(@pxref{aclocal options}).
@end table
@@ -1442,9 +1442,9 @@
@subsection Modifying the macro search path: @code{--acdir}
-The most obvious option to modify the search path is
+The most obvious option to modify the search path is
@address@hidden, which changes default directory and
-drops the @var{APIVERSION} directory. For example, if one specifies
+drops the @var{APIVERSION} directory. For example, if one specifies
@code{--acdir=/opt/private/}, then the search path becomes:
@enumerate
@@ -1457,7 +1457,7 @@
@subsection Modifying the macro search path: @code{-I @var{dir}}
-Any extra directories specified using @code{-I} options
+Any extra directories specified using @code{-I} options
(@pxref{aclocal options}) are @emph{prepended} to this search list. Thus,
@code{aclocal -I /foo -I /bar} results in the following search path:
@@ -1469,15 +1469,15 @@
@end enumerate
@subsection Modifying the macro search path: @file{dirlist}
address@hidden @file{dirlist}
-There is a third mechanism for customizing the search path. If a
address@hidden file exists in @var{acdir}, then that
-file is assumed to contain a list of directories, one per line, to
-be added to the search list. These directories are searched @emph{after}
-any directories specified on the command line using @code{-I}, but
address@hidden the @var{acdir} and @var{acdir-APIVERSION} directories.
+There is a third mechanism for customizing the search path. If a
address@hidden file exists in @var{acdir}, then that file is assumed to
+contain a list of directories, one per line, to be added to the search
+list. These directories are searched @emph{after} all other
+directories.
-For example, suppose
+For example, suppose
@address@hidden/dirlist} contains the following:
@example
@@ -1485,47 +1485,47 @@
/test2
@end example
address@hidden
and that @code{aclocal} was called with the @code{-I /foo -I /bar} options.
Then, the search path would be
@enumerate
@item @file{/foo}
@item @file{/bar}
address@hidden @file{/test1}
address@hidden @file{/test2}
@item @address@hidden
@item @var{acdir}
address@hidden @file{/test1}
address@hidden @file{/test2}
@end enumerate
-If the @address@hidden option is used,
-then @command{aclocal} will search for the @file{dirlist} file in
-the @emph{redirected} @var{acdir} directory. In the
address@hidden example above, @command{aclocal} will search the
address@hidden/opt/private/} directory for @file{dirlist}. Again, however,
-the @code{--acdir} option is intended for use by the internal
-automake test suite only; @code{--acdir} is not ordinarily
-needed by end-users.
-
address@hidden is useful in the following situation: suppose that
address@hidden version @code{1.6.2} is installed with
-$prefix=/usr by the system vendor. Thus, the default search
-directories are
+If the @address@hidden option is used, then @command{aclocal}
+will search for the @file{dirlist} file in @var{dir}. In the
address@hidden/opt/private/} example above, @command{aclocal} would look
+for @file{/opt/private/dirlist}. Again, however, the @code{--acdir}
+option is intended for use by the internal automake test suite only;
address@hidden is not ordinarily needed by end-users.
+
address@hidden is useful in the following situation: suppose that
address@hidden version @code{1.6.2} is installed with
+$prefix=/usr by the system vendor. Thus, the default search
+directories are
@enumerate
@item @file{/usr/share/aclocal-1.6/}
@item @file{/usr/share/aclocal/}
@end enumerate
-However, suppose further that many packages have been manually
+However, suppose further that many packages have been manually
installed on the system, with $prefix=/usr/local, as is typical.
-In that case, many of these ``extra'' @file{.m4} files are in
address@hidden/usr/local/share/aclocal}. The only way to force
address@hidden/usr/bin/aclocal} to find these ``extra'' @file{.m4} files
-is to always call @code{aclocal -I /usr/local/share/aclocal}.
+In that case, many of these ``extra'' @file{.m4} files are in
address@hidden/usr/local/share/aclocal}. The only way to force
address@hidden/usr/bin/aclocal} to find these ``extra'' @file{.m4} files
+is to always call @code{aclocal -I /usr/local/share/aclocal}.
This is inconvenient. With @file{dirlist}, one may create the file
@file{/usr/share/aclocal/dirlist}
address@hidden
which contains only the single line
@file{/usr/local/share/aclocal}
@@ -1533,15 +1533,19 @@
Now, the ``default'' search path on the affected system is
@enumerate
address@hidden @file{/usr/local/share/aclocal/}
@item @file{/usr/share/aclocal-1.6/}
@item @file{/usr/share/aclocal/}
address@hidden @file{/usr/local/share/aclocal/}
@end enumerate
-without the need for @code{-I} options; @code{-I} options can be reserved
+without the need for @code{-I} options; @code{-I} options can be reserved
for project-specific needs (@file{my-source-dir/m4/}), rather than
using it to work around local system-dependent tool installation
directories.
+
+Similarly, @file{dirlist} can be handy if you have installed a local
+copy Automake on your account and want @command{aclocal} to look for
+macros installed at other places on the system.
@node Macros, Extending aclocal, Invoking aclocal, configure
@section Autoconf macros supplied with Automake
Index: tests/dirlist.test
===================================================================
RCS file: /cvs/automake/automake/tests/dirlist.test,v
retrieving revision 1.1
diff -u -r1.1 dirlist.test
--- tests/dirlist.test 31 Jul 2002 19:58:26 -0000 1.1
+++ tests/dirlist.test 1 Aug 2002 22:21:46 -0000
@@ -5,6 +5,8 @@
. $srcdir/defs || exit 1
+set -e
+
cat > configure.in <<EOF
AC_INIT
AM_INIT_GUILE_MODULE
@@ -12,7 +14,7 @@
mkdir dirlist-test
-cat >>dirlist-test/dirlist-check.m4 << 'END'
+cat >dirlist-test/dirlist-check.m4 <<'END'
AC_DEFUN([AM_INIT_GUILE_MODULE],[
. $srcdir/../GUILE-VERSION
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
@@ -21,6 +23,16 @@
AC_SUBST(module)])
END
-$ACLOCAL || exit 1
+cat >dirlist-test/init.m4 <<EOF
+AC_DEFUN([AM_INIT_AUTOMAKE], [I should not be included])
+EOF
+$ACLOCAL
grep 'DEFUN.*AM_INIT_GUILE_MODULE' aclocal.m4
+
+# This bug can occur only when we do a VPATH build of Automake
+# (beause of the `-I' passed to aclocal in tests/defs) but it's
+# ok because this is what `make distcheck' does.
+grep 'I should not be included' aclocal.m4 && exit 1
+
+:
--
Alexandre Duret-Lutz
- Re: dirlist, Alexandre Duret-Lutz, 2002/08/01
- Re: dirlist, Charles Wilson, 2002/08/01
- Re: dirlist, Alexandre Duret-Lutz, 2002/08/01
- Re: dirlist,
Alexandre Duret-Lutz <=