m4-patches
[Top][All Lists]
Advanced

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

Re: FYI: 333-gary-refactor-LTDL_INIT.patch


From: Eric Blake
Subject: Re: FYI: 333-gary-refactor-LTDL_INIT.patch
Date: Tue, 22 Jan 2008 23:30:57 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 1/7/2008 1:40 PM:
|
| Well, I finally got done with my look over this, so you may want to
| consider it first.  And when you're done and bored again, I will post a
| few test failures to ponder over, ok?  ;-)

I haven't looked at this patch in detail, but I decided to give it a spin
and convert M4 head to use nonrecursive mode.  Following the examples from
the documentation, I updated configure.ac to include this snippet:

LT_PREREQ([2.1a])
LT_CONFIG_LTDL_DIR([ltdl])
LT_INIT([shared dlopen win32-dll])
LTDL_INIT([nonrecursive convenience])

However, autoreconf -fi now complains:

autoreconf: running: aclocal --force -I ltdl/m4
configure.ac:92: error: multiple libltdl directories: `ltdl',
`nonrecursive convenience'
ltdl/m4/ltdl.m4:23: _LT_CONFIG_LTDL_DIR is expanded from...
ltdl/m4/ltdl.m4:242: LTDL_INIT is expanded from...
configure.ac:92: the top level

Somehow, it is trying to treat the arguments to LTDL_INIT as a directory
name, rather than options.

Since you are more familiar with the recent Libtool patch: Any ideas why,
or how to fix libtool to recognize that M4 is using a custom name for the
libtool files (ltdl, not libltdl)?  I may get around to it, but it will
take me longer to come up to speed.

At any rate, here's the current state of the patch for M4, for reproducing
this.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHlt8g84KuGfSFAYARAqmsAKCC6prQoOOeIwZn+Reexi+1ClwjkgCfWmQd
v36u3TCtxxDdm4uMUSUC2lI=
=aq/5
-----END PGP SIGNATURE-----
>From eb2b6bd0ab38a390a2d7cab4b43e3872391907cc Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Tue, 22 Jan 2008 23:26:31 -0700
Subject: [PATCH] Update to latest libtool usage.

* configure.ac (LT_PREREQ): Require bleeding-edge libtool.  If the
user insists on an installed libtool, ensure it is new enough.
(LT_WITH_LTDL): Delete, obsoleted by libtool.
(LTDL_INIT): Call new libtool macro, select nonrecursive mode.
* Makefile.am (SUBDIRS): No longer build ltdl recursively.
(AM_CPPFLAGS): Rely on libtool for . and LTDLINCL.
(AM_LDFLAGS): Rely on libtool for -no-undefined.
(EXTRA_DIST, lib_LTLIBRARIES): Factor for appending.
(include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
variables required by libtool.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog    |   14 ++++++++++++++
 Makefile.am  |   36 ++++++++++++++++++++++++------------
 configure.ac |   17 +++++++++++++++--
 3 files changed, 53 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b911528..771b228 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2008-01-23  Eric Blake  <address@hidden>
+
+       Update to latest libtool usage.
+       * configure.ac (LT_PREREQ): Require bleeding-edge libtool.  If the
+       user insists on an installed libtool, ensure it is new enough.
+       (LT_WITH_LTDL): Delete, obsoleted by libtool.
+       (LTDL_INIT): Call new libtool macro, select nonrecursive mode.
+       * Makefile.am (SUBDIRS): No longer build ltdl recursively.
+       (AM_CPPFLAGS): Rely on libtool for . and LTDLINCL.
+       (AM_LDFLAGS): Rely on libtool for -no-undefined.
+       (EXTRA_DIST, lib_LTLIBRARIES): Factor for appending.
+       (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
+       variables required by libtool.
+
 2008-01-22  Ralf Wildenhues  <address@hidden>
        and Eric Blake  <address@hidden>
 
diff --git a/Makefile.am b/Makefile.am
index e79210c..76d0efc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,34 +23,46 @@
 config_aux_dir = build-aux
 config_macro_dir= ltdl/m4
 
-SUBDIRS                = ltdl po gnu tests/gnu .
+SUBDIRS                = po gnu tests/gnu .
 
 ACLOCAL_AMFLAGS = -I ltdl/m4
 AUTOMAKE_OPTIONS = nostdinc
-AM_CPPFLAGS    = -I. -I$(srcdir) \
-                 -Ignu -I$(srcdir)/gnu \
-                 -Im4 -I$(srcdir)/m4 \
-                 $(LTDLINCL)
+
+# Prime variables that will be added to by libtool.
+AM_CPPFLAGS    =
 # FIXME - the -export-symbols-regex ".*" is a hack to work around the
 # fact that on cygwin, the convenience library libltdl exports symbols,
 # which effectively disables the auto-exporting of all other symbols.
 # Revisit this if libtool on cygwin improves.
 # See http://lists.gnu.org/archive/html/libtool-patches/2007-02/msg00062.html
-AM_LDFLAGS     = -no-undefined -export-dynamic -export-symbols-regex ".*"
+AM_LDFLAGS     = -export-dynamic -export-symbols-regex ".*"
+
+BUILT_SOURCES  =
+EXTRA_DIST     =
+CLEANFILES     =
+MOSTLYCLEANFILES=
+
+include_HEADERS        =
+noinst_LTLIBRARIES=
+lib_LTLIBRARIES        =
+EXTRA_LTLIBRARIES=
 
-EXTRA_DIST     = bootstrap \
+# Include Libtool's rules.
+include ltdl/Makefile.inc
+
+# Additional configuration.
+AM_CPPFLAGS    += -Ignu -I$(srcdir)/gnu \
+                 -Im4 -I$(srcdir)/m4
+
+EXTRA_DIST     += bootstrap \
                  $(config_aux_dir)/mkstamp \
                  $(config_macro_dir)/gnulib-cache.m4
-CLEANFILES     =
 DISTCLEANFILES =
-MOSTLYCLEANFILES=
 MAINTAINERCLEANFILES = \
                  ABOUT-NLS COPYING INSTALL Makefile.in aclocal.m4 \
                  config-h.in configure stamp-h.in \
                  po/cat-id-tbl.c po/m4.pot po/stamp-cat-id
 
-BUILT_SOURCES  =
-
 MKSTAMP = $(SHELL) $(srcdir)/$(config_aux_dir)/mkstamp
 
 # Make sure config.status is regenerated when the version timestamp changes
@@ -202,7 +214,7 @@ EXTRA_DIST     += \
 ## libm4 ##
 ## ----- ##
 
-lib_LTLIBRARIES        = m4/libm4.la
+lib_LTLIBRARIES += m4/libm4.la
 
 nobase_include_HEADERS = \
                  m4/m4module.h
diff --git a/configure.ac b/configure.ac
index bf2b5ff..40eefcb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,10 +86,23 @@ M4_CHECK_DEBUGGING
 ## ----------------------- ##
 ## Libtool initialization. ##
 ## ----------------------- ##
-LT_PREREQ([2.0])
+LT_PREREQ([2.1a])
 LT_CONFIG_LTDL_DIR([ltdl])
 LT_INIT([shared dlopen win32-dll])
-LT_WITH_LTDL([ltdl])
+LTDL_INIT([nonrecursive convenience])
+
+# The lt_dlhandle_iterate symbol was added with libtool-2.2
+if test "x$with_included_ltdl" != "xyes"; then
+  save_CFLAGS="$CFLAGS"
+  save_LDFLAGS="$LDFLAGS"
+  CFLAGS="$CFLAGS $LTDLINCL"
+  LDFLAGS="$LDFLAGS $LIBLTDL"
+  AC_CHECK_LIB([ltdl], [lt_dlhandle_iterate],
+               [],
+       [AC_MSG_ERROR([installed libltdl is too old])])
+  LDFLAGS="$save_LDFLAGS"
+  CFLAGS="$save_CFLAGS"
+fi
 
 # Use gcc's -pipe option if available: for faster compilation.
 case "$CFLAGS" in
-- 
1.5.3.8


reply via email to

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