bug-gnulib
[Top][All Lists]
Advanced

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

Re: auxdir and multiple configure.ac's


From: Simon Josefsson
Subject: Re: auxdir and multiple configure.ac's
Date: Fri, 08 May 2009 08:31:09 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.93 (gnu/linux)

Ralf Wildenhues <address@hidden> writes:

> Hi Simon,
>
> * Simon Josefsson wrote on Thu, May 07, 2009 at 01:01:42PM CEST:
>> 
>> My thought is that the machinery to search top-level configure.ac for
>> AC_CONFIG_AUX_DIR is not worth the trouble, and that we should use the
>> same machinery for specifying the other directories to gnulib-tool for
>> build-aux as well.  Opinions?
>
> Even if doing something isn't right for your package (with special
> needs), why make life harder for others, too?  Moreso when you can
> easily override the machinery using --auxdir?

Hi!  If I can find a work around that works, that's fine.  However,
using --auxdir doesn't work well, because:

1) I need to run gnulib-tool --import two times, one for all gnulib
   instances, and then another time for the lib/ instance with its own
   build-aux.  This might be acceptable, if it weren't for:

2) The gnulib generated Makefile.am is incorrect if I use the --auxdir
   parameter: it will use $(top_srcdir)/lib/build-aux/foo in
   lib/gl/Makefile.am, but that is wrong because $(top_srcdir) in the
   lib/ sub-directory is relative to the lib/configure.ac.  So it should
   be $(top_srcdir)/build-aux/.

Perhaps using $(top_srcdir) in gnulib generated Makefile.am's is wrong,
because gnulib-tool never checks for intermediate configure.ac's, which
changes the meaning of top_* variables?

> On another note, why can't your two configure.ac scripts share a
> build-aux directory?  The toplevel one could have
>   AC_CONFIG_AUX_DIR([lib/build-aux])
>
> while lib/configure.ac had
>   AC_CONFIG_AUX_DIR([build-aux])
>
> Note that this will require Automake >= 1.10 IIRC.

Thanks, great idea!  It is not a generic solution, consider if I had two
sub-directories, each with their own configure.ac and
makefile-maintainer.  But the approach would work for GNU SASL, and
would avoid duplicating some scripts.

However it doesn't work.  gnulib-tool puts all the build-aux files in
gl/build-aux/?!  I suspect it rewrites lib/build-aux/ to gl/build-aux
because gl/ is the --source-base.  That seems like a bug to me.  Yes,
the patch below fixes it.  What happens is that the filename

  build-aux/config.rpath

    gets rewritten, because of AC_CONFIG_AUX_DIR([lib/build-aux]) to 

  lib/build-aux/config.rpath

    which gets rewritten, because of --sourcebase, to

  gl/build-aux/config.rpath

which is wrong.  The proper way to solve this would be by having the sed
expression not apply to earlier changes made by the same sed expression.
How can that be expressed?

Thanks,
/Simon

diff --git a/gnulib-tool b/gnulib-tool
index 2c00b1f..6290ac9 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -2918,17 +2918,17 @@ 
s,^\(.................................................[^ ]*\) *,
   fi
 
   sed_rewrite_old_files="\
+    s,^lib/,$cached_sourcebase/,
     s,^build-aux/,$auxdir/,
     s,^doc/,$cached_docbase/,
-    s,^lib/,$cached_sourcebase/,
     s,^m4/,$cached_m4base/,
     s,^tests/,$cached_testsbase/,
     s,^tests=lib/,$cached_testsbase/,
     s,^top/,,"
   sed_rewrite_new_files="\
+    s,^lib/,$sourcebase/,
     s,^build-aux/,$auxdir/,
     s,^doc/,$docbase/,
-    s,^lib/,$sourcebase/,
     s,^m4/,$m4base/,
     s,^tests/,$testsbase/,
     s,^tests=lib/,$testsbase/,
@@ -3884,9 +3884,9 @@ func_create_testdir ()
   fi
 
   sed_rewrite_files="\
+    s,^lib/,$sourcebase/,
     s,^build-aux/,$auxdir/,
     s,^doc/,$docbase/,
-    s,^lib/,$sourcebase/,
     s,^m4/,$m4base/,
     s,^tests/,$testsbase/,
     s,^top/,,"
@@ -4716,9 +4716,9 @@ case $mode in
     test -n "$testsbase" || testsbase="tests"
     test -n "$auxdir" || auxdir="build-aux"
     sed_rewrite_files="\
+      s,^lib/,$sourcebase/,
       s,^build-aux/,$auxdir/,
       s,^doc/,$docbase/,
-      s,^lib/,$sourcebase/,
       s,^m4/,$m4base/,
       s,^tests/,$testsbase/,
       s,^top/,,"




reply via email to

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