autoconf
[Top][All Lists]
Advanced

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

Re: generating a configure script in a subdirectory?


From: Andreas Schwab
Subject: Re: generating a configure script in a subdirectory?
Date: Sat, 20 Dec 2003 17:25:50 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux)

Bob Friesenhahn <address@hidden> writes:

> On Wed, 17 Dec 2003, Akim Demaille wrote:
>
>>
>>  > But beware, autoreconf can be dangerous and doesn't always work.
>>
>> Why?
>
> In times past, it has trashed & thrashed subdirectories.  For example,
> I recall (a couple of years ago) that libltdl required a particular
> version of Autoconf.  Libltdl was subordinate to my package's
> directory.  Executing autoreconf ended up with a zero-length configure
> script in the libltdl subdirectory.

Please try this patch:

2003-12-20  Andreas Schwab  <address@hidden>

        * bin/autoreconf.in: Don't recurse into libtool's libltdl
        subdirectory.  Pass --ltdl to libtoolize in this case.

--- bin/autoreconf.in
+++ bin/autoreconf.in
@@ -426,6 +426,8 @@
   my $aux_dir;
   my $uses_gettext_via_traces;
   my $uses_libtool;
+  my $uses_libltdl;
+  my $libltdl_directory = 'libltdl';
   my $uses_autoheader;
   my @subdir;
   verb "$configure_ac: tracing";
@@ -437,6 +439,8 @@
             'AC_CONFIG_AUX_DIR:AC_CONFIG_AUX_DIR:\$1',
             'AC_CONFIG_HEADERS',
             'AC_CONFIG_SUBDIRS:AC_CONFIG_SUBDIRS:\$1',
+            'AC_LIBLTDL_CONVENIENCE:AC_LIBLTDL_CONVENIENCE:\$1',
+            'AC_LIBLTDL_INSTALLABLE:AC_LIBLTDL_INSTALLABLE:\$1',
             'AC_INIT',
             'AC_PROG_LIBTOOL',
             'AM_GNU_GETTEXT',
@@ -448,6 +452,8 @@
       $uses_autoconf = 1            if /AC_INIT/;
       $uses_gettext_via_traces = 1  if /AM_GNU_GETTEXT/;
       $uses_libtool = 1             if /AC_PROG_LIBTOOL/;
+      $uses_libltdl = 1             if /AC_LIBLTDL_(CONVENIENCE|INSTALLABLE)/;
+      $libltdl_directory = $2       if 
/AC_LIBLTDL_(CONVENIENCE|INSTALLABLE):(.*)/ && $2 ne "";
       $uses_autoheader = 1          if /AC_CONFIG_HEADERS/;
       push @subdir, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/;
     }
@@ -455,7 +461,11 @@
   # The subdirs are *optional*, they may not exist.
   foreach (@subdir)
     {
-      if (-d)
+      if ($uses_libltdl && $_ eq $libltdl_directory)
+       {
+         verb "$configure_ac: subdirectory $_ ignored";
+       }
+      elsif (-d)
        {
          verb "$configure_ac: subdirectory $_ to autoreconf";
          autoreconf ($_);
@@ -501,7 +511,7 @@
     }
   elsif ($install)
     {
-      xsystem ($libtoolize);
+      xsystem ($libtoolize . ($uses_libltdl ? " --ltdl" : ""));
       $rerun_aclocal = 1;
     }
   else

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

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