libtool
[Top][All Lists]
Advanced

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

Re: libtool --ltdl vs. autoreconf


From: Ralf Wildenhues
Subject: Re: libtool --ltdl vs. autoreconf
Date: Tue, 13 Jun 2006 21:08:15 +0200
User-agent: Mutt/1.5.11+cvs20060403

[ eliding bug-m4 and autoconf lists ]

Hello Eric,

* Ralf Wildenhues wrote on Thu, May 25, 2006 at 06:39:38PM CEST:
> > * Eric Blake wrote on Tue, May 09, 2006 at 02:04:23PM CEST:
> > > 
> > > As promised here,
> > > http://lists.gnu.org/archive/html/m4-patches/2006-05/msg00005.html, I
> > > noticed that m4 bootstrap invokes libtoolize --ltdl prior to autoreconf,
> > > which reinvokes libtoolize without --ltdl.  This seems like a bit of a
> > > waste of time, but when I tried removing the explicit libtoolize line, I
> > > got a bootstrap failure that a required file, ltmain.sh, was not found.  I
> > > thought that using LT_CONFIG_LTDL_DIR in configure.ac would take care of
> > > everything that --ltdl used to do on the command line, but I was obviously
> > > mistaken.

Now that the issue above has been fixed, let's tackle some of the other
issues encountered here...

> [...] with a pristine CVS checkout of M4, and deleting the
> libtoolize invocation from `bootstrap', the aclocal call in the toplevel
> will happen before libtoolize is called; since aclocal isn't called with
> `--install' (well, that would work with CVS Automake aclocal only).
> So, the Libtool macro files aren't in place yet, so the whole of them
> ends up copied into aclocal.m4.  This is then fixed after a second
> bootstrap.

This is fixed already, too.

> Which opens up an interesting side question: should autoreconf-2.60 be
> prepared for `aclocal-1.10 --install'?

I have not looked at this yet...

> Back to Libtool, the next issue is that, currently, the patch below will
> cause libltdl to be copied twice: once from the toplevel dir, and once
> from within the libltdl dir.  This is ugly and error-prone.  On the one
> hand, we want `libtoolize --ltdl=.' to copy libltdl, on the other, we
> don't want `libtoolize --ltdl' to copy libltdl if
> `LT_CONFIG_LTDL_DIR([.])' is found; so I guess we should make libtoolize
> change behavior between detected libltdl-directory `.' and passed
> directory `.'.  (All of this is in recursive-ltdl-mode.)  I definitely
> do not want to have to put more of this logic into autoreconf.

One easy way to fix this is to `autoreconf --no-recursive --ltdl' so
that autoreconf simply won't enter the directory in which the recursive
libltdl resides (see the patch I posted on m4-patches).  (We may still
want to fix the issue as described above, but it's not so pressing.)

> Then, currently inside a libltdl subdir, libtoolize wrongly suggests:
> | libtoolize: Consider using `AC_CONFIG_AUX_DIR([./config])' in configure.ac.
> | libtoolize: Consider using `AC_CONFIG_MACRO_DIR([./m4])' in configure.ac.
> 
> This is a libtoolize bug.
> (First, these macros are already used, second, the arguments should not
> start with `./', to cater for non-GNU make.)

To finish the sentence in parentheses: And third, libtoolize should
realize that AC_CONFIG_AUX_DIR([config]) is what is needed, and is
already present there.

These 3 issues are fixed by the patch below, which I have applied now.
You will notice that libtoolize output may seem a bit inconsistent now:

$ libtoolize --ltdl=.
| libtoolize: linking file `m4/argz.m4'
[...]
| libtoolize: linking file `./COPYING.LIB'
[...]
| libtoolize: linking file `./config/compile'

and I may eventually fix that (post 2.0).  But that is not a serious
bug, if it could even be qualified as such, and the other functions in
libtoolize are sufficiently messed up that I don't care much to rewrite
them now.

Cheers,
Ralf

        Fix the bugs where libtoolize needs to use `dir/file' instead of
        `./dir/file', where ltdldir is `.', so that libtoolize correctly
        checks for (and suggests) `config' and `m4' instead of
        `./config' and `./m4' as auxiliary resp. macro directories.
        The change is necessary for unambiguous naming, the chosen way
        plays better with non-GNU make in VPATH builds.

        * libtoolize.m4sh (ltdlprefix): New variable, to use as prefix
        instead of `$ltdldir/'.
        (func_check_macros): Use it.  Bug report by Eric Blake.

Index: libtoolize.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/libtoolize.m4sh,v
retrieving revision 1.55
diff -u -r1.55 libtoolize.m4sh
--- libtoolize.m4sh     12 Jun 2006 17:54:15 -0000      1.55
+++ libtoolize.m4sh     13 Jun 2006 18:55:32 -0000
@@ -904,8 +904,8 @@
        func_echo "and rerunning libtoolize."
       fi
     elif test -z "$m4dir"; then
-      if $opt_ltdl && test "$ltdldir/m4" != "$m4dir"; then
-       acmacrodir="$ltdldir/m4"
+      if $opt_ltdl && test "${ltdlprefix}m4" != "$m4dir"; then
+       acmacrodir="${ltdlprefix}m4"
       else
        acmacrodir="$aclocaldir"
       fi
@@ -940,10 +940,10 @@
 
       # Offer some suggestions for avoiding duplicate files in a project
       # that uses libltdl:
-      test "$ltdldir/config" = "$auxdir" ||
-        func_echo "Consider using \`AC_CONFIG_AUX_DIR([[$ltdldir/config]])' in 
$configure_ac."
-      $ac_config_macro_dir_advised || test "$ltdldir/m4" = "$m4dir" ||
-        func_echo "Consider using \`AC_CONFIG_MACRO_DIR([[$ltdldir/m4]])' in 
$configure_ac."
+      test "${ltdlprefix}config" = "$auxdir" ||
+        func_echo "Consider using 
\`AC_CONFIG_AUX_DIR([[${ltdlprefix}config]])' in $configure_ac."
+      $ac_config_macro_dir_advised || test "${ltdlprefix}m4" = "$m4dir" ||
+        func_echo "Consider using \`AC_CONFIG_MACRO_DIR([[${ltdlprefix}m4]])' 
in $configure_ac."
     else
       # Don't trace for this, we're just checking the user didn't invoke it
       # directly from configure.ac.
@@ -1086,12 +1086,17 @@
 
   func_scan_files
 
+  case $ltdldir in
+  .) ltdlprefix= ;;
+  *) ltdlprefix=$ltdldir/ ;;
+  esac
+
   # Unless we share CONFIG_AUX_DIR with the libltdl subproject, then
   # if they are newer, copy all the installed utility files to the
   # auxiliary directory if `--install' was passed, or else copy just
   # ltmain.sh.
   if test -n "$auxdir"; then
-    if test "$ltdldir/config" != "$auxdir"; then
+    if test "${ltdlprefix}config" != "$auxdir"; then
       $opt_quiet || if test "$auxdir" != .; then
         func_echo "putting files in AC_CONFIG_AUX_DIR, \`$auxdir'."
       fi
@@ -1150,9 +1155,9 @@
 
     # Unless we share CONFIG_MACRO_DIR with our parent project,
     # copy macros here.
-    if test "$ltdldir/m4" != "$m4dir"; then
+    if test "${ltdlprefix}m4" != "$m4dir"; then
       func_copy_some_files "$pkgmacro_files:libtool.m4:ltdl.m4" \
-        "$aclocaldir" "$ltdldir/m4"
+        "$aclocaldir" "${ltdlprefix}m4"
     fi
 
     func_copy_some_files "$pkgltdl_files" "$pkgltdldir/libltdl" "$ltdldir"




reply via email to

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