From 17a8ec366aec5f93d65c9436dd842f1766c7fa04 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Tue, 21 Mar 2006 19:09:21 +0000 Subject: [PATCH] * aclocal.in (parse_arguments): Added wildcard support to the dirlist parser. * doc/automake.texi (Macro search path): Document it. * tests/dirlist2.test: New test. * m4/dirlist, tests/Makefile.am: Adjust. * NEWS, THANKS: Update. --- ChangeLog | 11 ++++++++ NEWS | 3 +++ THANKS | 1 + aclocal.in | 5 +++- doc/automake.texi | 11 +++++--- m4/dirlist | 3 ++- tests/Makefile.am | 1 + tests/dirlist2.test | 61 +++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 91 insertions(+), 5 deletions(-) create mode 100755 tests/dirlist2.test diff --git a/ChangeLog b/ChangeLog index 1fe798cd9..bb5ec54d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-03-21 Clifford Wolf (tiny change) + Stepan Kasal + Ralf Wildenhues + + * aclocal.in (parse_arguments): Added wildcard support to the + dirlist parser. + * doc/automake.texi (Macro search path): Document it. + * tests/dirlist2.test: New test. + * m4/dirlist, tests/Makefile.am: Adjust. + * NEWS, THANKS: Update. + 2006-03-20 Ralf Wildenhues * m4/init.m4 (AM_INIT_AUTOMAKE): Add `_AM_DEPENDENCIES(OBJC)' diff --git a/NEWS b/NEWS index 70a30ec87..2c5ed01b2 100644 --- a/NEWS +++ b/NEWS @@ -101,6 +101,9 @@ New in 1.9a: - Improved support for Objective C: - Autoconf's new AC_PROG_OBJC will enable automatic dependency tracking. - A new section of the manual documents the support. + + - `dirlist' entries (for the aclocal search path) may use shell wildcards + such as `*', `?', or `[...]'. New in 1.9: diff --git a/THANKS b/THANKS index aa66efe4a..9eb0db305 100644 --- a/THANKS +++ b/THANKS @@ -42,6 +42,7 @@ Bruno Haible haible@ilog.fr Charles Wilson cwilson@ece.gatech.edu Chris Provenzano proven@io.proven.org Christian Cornelssen ccorn@cs.tu-berlin.de +Clifford Wolf clifford@clifford.at Dalibor Topic robilad@kaffe.org danbp danpb@nospam.postmaster.co.uk Daniel Jacobowitz drow@false.org diff --git a/aclocal.in b/aclocal.in index a05ba72a6..2e9bb84f4 100644 --- a/aclocal.in +++ b/aclocal.in @@ -942,7 +942,10 @@ sub parse_arguments () # strip off newlines and end-of-line comments s/\s*\#.*$//; chomp; - push (@system_includes, $_) if -d $_; + foreach my $dir (glob) + { + push (@system_includes, $dir) if -d $dir; + } } close (DIRLIST); } diff --git a/doc/automake.texi b/doc/automake.texi index 25d358570..5c00018f4 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -1860,9 +1860,10 @@ Any extra directories specified using @option{-I} options There is a third mechanism for customizing the search path. If a @file{dirlist} 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. +contain a list of directory patterns, one per line. @command{aclocal} +expands these patterns to directory names, and adds them to the search +list @emph{after} all other directories. @file{dirlist} entries may +use shell wildcards such as @samp{*}, @samp{?}, or @code{[...]}. For example, suppose @file{@var{acdir}/dirlist} contains the following: @@ -1870,6 +1871,7 @@ For example, suppose @example /test1 /test2 +/test3* @end example @noindent @@ -1886,6 +1888,9 @@ Then, the search path would be @item @code{/test2} @end enumerate +@noindent +and all directories with path names starting with @code{/test3}. + If the @option{--acdir=@var{dir}} option is used, then @command{aclocal} will search for the @file{dirlist} file in @var{dir}. In the @samp{--acdir=/opt/private/} example above, @command{aclocal} would look diff --git a/m4/dirlist b/m4/dirlist index ac070b35c..82339e48a 100644 --- a/m4/dirlist +++ b/m4/dirlist @@ -1,3 +1,4 @@ -# This file is used by the testsuite (dirlist.test) +# This file is used by the testsuite (dirlist*.test) # it should not be installed ./dirlist-test +./dirlist2*-test diff --git a/tests/Makefile.am b/tests/Makefile.am index ebac26407..55c4e681d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -202,6 +202,7 @@ depend4.test \ destdir.test \ dirforbid.test \ dirlist.test \ +dirlist2.test \ discover.test \ distcom2.test \ distcom3.test \ diff --git a/tests/dirlist2.test b/tests/dirlist2.test new file mode 100755 index 000000000..5016bf40d --- /dev/null +++ b/tests/dirlist2.test @@ -0,0 +1,61 @@ +#! /bin/sh +# Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. +# +# This file is part of GNU Automake. +# +# GNU Automake 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. +# +# GNU Automake 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 Automake; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +# Check dirlist globbing support. +# This test relies on m4/dirlist + +. ./defs || exit 1 + +set -e + +cat > configure.in <dirlist21-test/dirlist21-check.m4 <<'END' +AC_DEFUN([AM_INIT_GUILE_MODULE],[ +. $srcdir/../GUILE-VERSION +AM_INIT_AUTOMAKE($PACKAGE, $VERSION) +AC_CONFIG_AUX_DIR(..) +module=[$1] +AC_SUBST(module)]) +END + +cat >dirlist22-test/dirlist22-check.m4 <<'END' +AC_DEFUN([AM_FOO_BAR],[ +: foo bar baz +]) +END +$ACLOCAL +$AUTOCONF + +# there should be no m4_include in aclocal.m4, even tho m4/dirlist contains +# `./dirlist-test' as a relative directory. Only -I directories are subject +# to file inclusion. +grep m4_include aclocal.m4 && exit 1 + +grep 'GUILE-VERSION' configure +grep 'foo bar baz' configure + +: -- 2.47.2