automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: automake/338: AM_GNU_GETTEXT([external]) support


From: Charles Wilson
Subject: Re: automake/338: AM_GNU_GETTEXT([external]) support
Date: Fri, 19 Jul 2002 16:10:18 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2

Alexandre Duret-Lutz wrote:

Would you accept to complete this patch so we can include it?
What's needed is
  1. that you follow existing spacing convention to format your code
     (e.g., space before '(', not after)
  2. documentation for this new feature in the manual (its purpose
     and the way it interacts with -I and --acdir) -- and a mention
     in NEWS
  3. a test case, if possible
  4. a signed copyright assigment to the FSF (I'll send you the form
     later today)


I hope the attached patch and ChangeLog address 1, 2, and 3. I'll take care of #4 soon.

--Chuck

2002-07-19  Charles Wilson  <address@hidden>

        * aclocal.in: add support for extending default macro
        search path, using a ``dirlist'' file within the
        acdir-APIVERSION directory
        * NEWS: announce the new capability
        * automake.texi: document the new capability
        * tests/dirlist.test: test it
        * tests/Makefile.am: add the new test
        * m4/dirlist: support file for dirlist.test
        * m4/Makefile.am: add dirlist to EXTRA_DIST

diff -urN -x .build -x .inst -x .sinst automake-1.6.2-orig/NEWS 
automake-1.6.2/NEWS
--- automake-1.6.2-orig/NEWS    2002-06-14 03:12:14.000000000 -0400
+++ automake-1.6.2/NEWS 2002-07-19 14:49:30.000000000 -0400
@@ -1,3 +1,6 @@
+  - add support for extending aclocal's default macro search path
+    using a ``dirlist'' file within the acdir-APIVERSION directory
+
 New in 1.6.2:
 * Many bug fixes, including:
   - Requiring the current version works.
diff -urN -x .build -x .inst -x .sinst automake-1.6.2-orig/aclocal.in 
automake-1.6.2/aclocal.in
--- automake-1.6.2-orig/aclocal.in      2002-04-22 03:35:15.000000000 -0400
+++ automake-1.6.2/aclocal.in   2002-07-19 15:40:54.000000000 -0400
@@ -46,6 +46,11 @@
 # Note also that the versioned directory is handled later.
 $acdir = "@datadir@/aclocal";
 $default_acdir = $acdir;
+# contains a list of directories, one per line, to be added
+# to the dirlist in addition to $acdir, as if -I had been
+# added to the command line.  If acdir has been redirected,
+# we will also check the specified acdir (this is done later).
+$default_dirlist = "$acdir-$APIVERSION/dirlist";
 
 # Some globals.
 
@@ -215,6 +220,26 @@
        exit 0;
     }
 
+    $default_dirlist="$acdir/dirlist"
+       if ! ($acdir eq $default_acdir);
+
+    if (open (DEFAULT_DIRLIST, $default_dirlist))
+    {
+       while (<DEFAULT_DIRLIST>)
+       {
+           # Ignore '#' lines.
+           next if /^#/;
+           # strip off newlines and end-of-line comments
+           s/\s*\#.*$//;
+           chomp ($contents=$_);
+           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.
diff -urN -x .build -x .inst -x .sinst automake-1.6.2-orig/automake.texi 
automake-1.6.2/automake.texi
--- automake-1.6.2-orig/automake.texi   2002-06-11 05:07:59.000000000 -0400
+++ automake-1.6.2/automake.texi        2002-07-19 15:59:38.000000000 -0400
@@ -1301,7 +1301,8 @@
 to supply their own macros.
 
 At startup, @code{aclocal} scans all the @file{.m4} files it can find,
-looking for macro definitions.  Then it scans @file{configure.in}.  Any
+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}.
 
@@ -1316,6 +1317,17 @@
 comment which will be completely ignored by @code{aclocal}, use
 @samp{##} as the comment leader.
 
address@hidden
+* aclocal options::             Options supported by aclocal
+* Macro search path::           How aclocal finds .m4 files
address@hidden menu
+
address@hidden aclocal options, Macro search path, Invoking aclocal, Invoking 
aclocal
address@hidden aclocal options
+
address@hidden aclocal, Options
address@hidden Options, aclocal
+
 @code{aclocal} accepts the following options:
 
 @table @code
@@ -1353,6 +1365,134 @@
 Print the version number of Automake and exit.
 @end table
 
address@hidden Macro search path, , aclocal options, Invoking aclocal
address@hidden Macro search path
+
address@hidden Macro search path
address@hidden aclocal search path
+
+By default, @command{aclocal} searches for @file{.m4} files in the following
+directories, in this order:
+
address@hidden @code
address@hidden @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 
+(@pxref{aclocal options}).
+
address@hidden @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}.  
+
address@hidden table
+
+As an example, suppose that automake-1.6.2 was configured with
address@hidden/usr/local}.  Then, the search path would be:
+
address@hidden
address@hidden @file{/usr/local/share/aclocal/}
address@hidden @file{/usr/local/share/aclocal-1.6/}
address@hidden enumerate
+
+As explained in (@pxref{aclocal options}), there are several options that
+can be used to change or extend this search path.
+
address@hidden Modifying the macro search path: @code{--acdir}
+
+The most obvious option to modify the search path is 
address@hidden@address@hidden, which changes default directory and
+drops the @var{APIVERSION} directory.  For example, if one specifies 
address@hidden/opt/private/}, then the search path becomes:
+
address@hidden
address@hidden @file{/opt/private/}
address@hidden enumerate
+
address@hidden Modifying the macro search path: @code{-I} @var{dir}
+
+Any extra directories specified using @code{-I} options 
+(@pxref{aclocal options}) are @emph{prepended} to this search list.  Thus,
address@hidden -I /home/special} results in the following search path:
+
address@hidden
address@hidden @file{/home/special}
address@hidden @var{acdir}
address@hidden @address@hidden
address@hidden enumerate
+
address@hidden Modifying the macro search path: @file{dirlist}
+
+There is a third mechanism for customizing the search path.  If a 
address@hidden file exists in @var{acdir-APIVERSION}, 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.
+
+For example, suppose 
address@hidden/dirlist} contains the following:
+
address@hidden
+/test1
+/test2
address@hidden example
+
+and that @code{aclocal} was called with the @code{-I /home/special} option.
+Then, the search path would be
+
address@hidden
address@hidden @file{/home/special}
address@hidden @file{/test1}
address@hidden @file{/test2}
address@hidden @var{acdir}
address@hidden @address@hidden
address@hidden enumerate
+
+If the @address@hidden@var{dir} 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}.
+
address@hidden is useful in the following situation: suppose that 
address@hidden version @code{1.6.2} is installed with 
+$prefix=/usr/local.  Thus, the default search directories are 
+
address@hidden
address@hidden @file{/usr/local/share/aclocal/}
address@hidden @file{/usr/local/share/aclocal-1.6/}
address@hidden enumerate
+
+However, suppose further that many packages were provided by the 
+operation system vendor with $prefix=/usr, as is typical.
+In that case, most of the system @file{.m4} files are in 
address@hidden/usr/share/aclocal}.  The only way to force 
@file{/usr/local/bin/aclocal}
+to search the system @file{.m4} files is to always call 
address@hidden -I /usr/share/aclocal}.  This is inconvenient.  With 
address@hidden, one may create the file
+
address@hidden/usr/local/share/aclocal-1.6/dirlist}
+
+which contains only the single line
+
address@hidden/usr/share/aclocal}
+
+Now, the ``default'' search path on the affected system is
+
address@hidden
address@hidden @file{/usr/share/aclocal/}
address@hidden @file{/usr/local/share/aclocal/}
address@hidden @file{/usr/local/share/aclocal-1.6/}
address@hidden enumerate
+
+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.
 
 @node Macros, Extending aclocal, Invoking aclocal, configure
 @section Autoconf macros supplied with Automake
diff -urN -x .build -x .inst -x .sinst automake-1.6.2-orig/m4/Makefile.am 
automake-1.6.2/m4/Makefile.am
--- automake-1.6.2-orig/m4/Makefile.am  2002-06-10 03:18:42.000000000 -0400
+++ automake-1.6.2/m4/Makefile.am       2002-07-19 15:33:38.000000000 -0400
@@ -29,3 +29,4 @@
 
 nodist_m4data_DATA = amversion.m4
 DISTCLEANFILES = amversion.m4
+EXTRA_DIST = dirlist
diff -urN -x .build -x .inst -x .sinst automake-1.6.2-orig/m4/dirlist 
automake-1.6.2/m4/dirlist
--- automake-1.6.2-orig/m4/dirlist      1969-12-31 19:00:00.000000000 -0500
+++ automake-1.6.2/m4/dirlist   2002-07-19 15:31:22.000000000 -0400
@@ -0,0 +1 @@
+./dirlist-test
diff -urN -x .build -x .inst -x .sinst automake-1.6.2-orig/tests/Makefile.am 
automake-1.6.2/tests/Makefile.am
--- automake-1.6.2-orig/tests/Makefile.am       2002-06-11 13:00:08.000000000 
-0400
+++ automake-1.6.2/tests/Makefile.am    2002-07-19 15:01:18.000000000 -0400
@@ -124,6 +124,7 @@
 depend3.test \
 depend4.test \
 dirforbid.test \
+dirlist.test \
 dirname.test \
 discover.test \
 distcommon.test \
diff -urN -x .build -x .inst -x .sinst automake-1.6.2-orig/tests/dirlist.test 
automake-1.6.2/tests/dirlist.test
--- automake-1.6.2-orig/tests/dirlist.test      1969-12-31 19:00:00.000000000 
-0500
+++ automake-1.6.2/tests/dirlist.test   2002-07-19 15:31:02.000000000 -0400
@@ -0,0 +1,25 @@
+#! /bin/sh
+
+# Check dirlist support.
+
+. $srcdir/defs || exit 1
+
+cat > configure.in <<EOF
+AC_INIT
+AM_INIT_GUILE_MODULE
+EOF
+
+mkdir dirlist-test
+
+cat >>dirlist-test/dirlist-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
+
+$ACLOCAL || exit 1
+
+grep 'DEFUN.*AM_INIT_GUILE_MODULE' aclocal.m4

reply via email to

[Prev in Thread] Current Thread [Next in Thread]