bug-libtool
[Top][All Lists]
Advanced

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

[PATCH] Standalone libltdl Build


From: Noah Misch
Subject: [PATCH] Standalone libltdl Build
Date: Wed, 6 Oct 2004 02:01:34 -0700
User-agent: Mutt/1.5.6i

Today I bootstrapped CVS m4 from CVS autoconf, automake, and libtool, and the
compilation failed in the included libltdl:

<snip>
Making all in libltdl
cp ../../libltdl/argz_.h argz.h-t
mv argz.h-t argz.h
make  all-recursive
Making all in loaders
make  all-am
source='../../../libltdl/loaders/dyld.c' object='dyld.lo' libtool=yes \
DEPDIR=.deps depmode=gcc /bin/sh ../../../libltdl/config/depcomp \
/bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H="<config.h>" 
-DLTDL -I. -I../../../libltdl/loaders -I..  -I.. -I../../../libltdl -I.. 
-I../../../libltdl/loaders/..   -g -O2 -c -o dyld.lo 
../../../libltdl/loaders/dyld.c
 cc "-DHAVE_CONFIG_H=<config.h>" -DLTDL -I. -I../../../libltdl/loaders -I.. 
-I.. -I../../../libltdl -I.. -I../../../libltdl/loaders/.. -g -O2 -c 
../../../libltdl/loaders/dyld.c -Wp,-MD,.deps/dyld.TPlo  -fno-common -DPIC -o 
.libs/dyld.o
../../../libltdl/lt_dlloader.h:33: header file 'libltdl/lt_system.h' not found
<snip similar errors>

lt_system.h is in $(top_srcdir) of the standalone libltdl build, so the
preprocessor does not find it.  Building libltdl with the libtool build process
masks this problem since $(top_srcdir) is then that of libtool, allowing the
location of the headers to become $(top_srcdir)/libltdl.

How about this fix (against HEAD)?  I omitted the renames from the diff.

2004-10-06  Noah Misch  <address@hidden>

        * configure.ac: Configure libltdl as an ordinary sub-project with
        its own ``configure''.

        * ltdl/lt_dlloader.h ltdl/lt_error.h ltdl/lt_system.h ltdl/ltdl.h:
        Moved from here...
        * ltdl/api/libltdl/lt_dlloader.h ltdl/api/libltdl/lt_error.h
        ltdl/api/libltdl/lt_system.h ltdl/api/ltdl.h: ...to here.
        * ltdl/Makefile.am: Add ``-I''s for new header directories to
        AM_CPPFLAGS.  Update header references.
        * ltdl/loaders/Makefile.am: Likewise, and remove unneeded ``-I''s.
        * m4/ltdl.m4: Update $LTDLINCL to reflect new directory structure.

        * NEWS: Updated.



diff -X dontdiff -urp libtool/NEWS libtool-ltdlinc/NEWS
--- libtool/NEWS        Tue Oct  5 01:48:48 2004
+++ libtool-ltdlinc/NEWS        Wed Oct  6 04:49:27 2004
@@ -8,6 +8,10 @@ New in 1.9f: 2004-??-??; CVS version 1.9
 * Fix a regression in 1.9d, which required an installed automake to build the
   bootstrapped tarball.
 * Fix hanging bug on MinGW.
+* Fix build of libltdl as a convenience library via LT_WITH_LTDL and via any
+  means when in a subdirectory not named ``libltdl''.
+* Move header files within the libltdl source tree.  Applications using libltdl
+  as a convenience library and not using $(LTDLINCL) must adjust -I flags.
 
 New in 1.9d: 2004-10-03; CVS version 1.9c, Libtool team:
 * If non-pic objects were not compiled, and libtool is called in link mode,
diff -X dontdiff -urp libtool/configure.ac libtool-ltdlinc/configure.ac
--- libtool/configure.ac        Tue Oct  5 01:48:48 2004
+++ libtool-ltdlinc/configure.ac        Wed Oct  6 04:09:28 2004
@@ -132,7 +132,7 @@ AC_SUBST([aclocaldir])
 AC_ARG_ENABLE(ltdl-install,
     [AS_HELP_STRING([--disable-ltdl-install], [do not install libltdl])])
 if test x"${enable_ltdl_install+set}" != xset; then
-  enable_ltdl_install=yes
+  ac_configure_args="$ac_configure_args --enable-ltdl-install"
 fi
 
 # All subdirectories that are configured on demand, but that must be
@@ -177,7 +177,7 @@ popdef([AC_MSG_ERROR])
 ## Libtool initialisation. ##
 ## ----------------------- ##
 LT_INIT([dlopen win32-dll])
-LTDL_INIT
+AC_CONFIG_SUBDIRS([libltdl])
 
 # Enable all the language support we can
 LT_LANG(C++)
@@ -202,6 +202,5 @@ AM_CONDITIONAL(HAVE_RC, [test -n "[$]_LT
 ## -------- ##
 ## Outputs. ##
 ## -------- ##
-AC_CONFIG_FILES([Makefile libltdl/Makefile libltdl/loaders/Makefile
-               doc/Makefile tests/Makefile])
+AC_CONFIG_FILES([Makefile doc/Makefile tests/Makefile])
 AC_OUTPUT
diff -X dontdiff -urp libtool/libltdl/Makefile.am 
libtool-ltdlinc/libltdl/Makefile.am
--- libtool/libltdl/Makefile.am Mon Oct  4 01:42:47 2004
+++ libtool-ltdlinc/libltdl/Makefile.am Wed Oct  6 00:59:42 2004
@@ -27,15 +27,22 @@ AUTOMAKE_OPTIONS    = foreign
 ACLOCAL_AMFLAGS                = -I m4
 
 DEFS                   = -DHAVE_CONFIG_H="<$(CONFIG_H)>" -DLTDL
-AM_CPPFLAGS            = -I$(top_builddir) -I$(top_srcdir)
+AM_CPPFLAGS            = -I$(top_builddir) -I$(top_srcdir) \
+                         -I$(top_srcdir)/api -I$(top_srcdir)/api/libltdl
 AM_LDFLAGS             = -no-undefined
 VERSION_INFO           = -version-info 6:0:0
 
 pkgincludedir          = $(includedir)/libltdl
 
+## Headers defining the libltdl API
+ltdl_h                 = api/ltdl.h
+lt_system_h            = api/libltdl/lt_system.h
+lt_dlloader_h          = api/libltdl/lt_dlloader.h
+lt_error_h             = api/libltdl/lt_error.h
+
 lib_LTLIBRARIES                = libdlloader.la
-libdlloader_la_SOURCES  = lt_error.h lt_error.c \
-                         lt__private.h lt_system.h \
+libdlloader_la_SOURCES  = $(lt_error_h) lt_error.c \
+                         $(lt_system_h) lt__private.h \
                          lt__alloc.h lt__alloc.c \
                          lt__glibc.h \
                          lt__dirent.h \
@@ -45,8 +52,8 @@ libdlloader_la_LIBADD = $(LTLIBOBJS)
 
 ## Libltdl brings it all together:
 if INSTALL_LTDL
-include_HEADERS                = ltdl.h
-pkginclude_HEADERS     = lt_system.h lt_error.h lt_dlloader.h
+include_HEADERS                = $(ltdl_h)
+pkginclude_HEADERS     = $(lt_system_h) $(lt_error_h) $(lt_dlloader_h)
 lib_LTLIBRARIES                += libltdl.la
 endif
 
@@ -54,8 +61,8 @@ if CONVENIENCE_LTDL
 noinst_LTLIBRARIES     = libltdlc.la
 endif
 
-libltdl_la_SOURCES     = ltdl.h ltdl.c \
-                         lt_dlloader.h lt_dlloader.c loaders/preopen.c
+libltdl_la_SOURCES     = $(ltdl_h) ltdl.c \
+                         $(lt_dlloader_h) lt_dlloader.c loaders/preopen.c
 libltdl_la_CPPFLAGS    = -DLTDLOPEN=libltdl $(AM_CPPFLAGS)
 libltdl_la_LDFLAGS     =  $(VERSION_INFO) $(LT_DLPREOPEN)
 libltdl_la_LIBADD      = libdlloader.la
diff -X dontdiff -urp libtool/libltdl/loaders/Makefile.am 
libtool-ltdlinc/libltdl/loaders/Makefile.am
--- libtool/libltdl/loaders/Makefile.am Thu Jul 22 09:03:47 2004
+++ libtool-ltdlinc/libltdl/loaders/Makefile.am Wed Oct  6 00:52:28 2004
@@ -25,7 +25,7 @@ AUTOMAKE_OPTIONS      = foreign
 
 DEFS                   = -DHAVE_CONFIG_H="<$(CONFIG_H)>" -DLTDL
 AM_CPPFLAGS            = -I$(top_builddir) -I$(top_srcdir) \
-                         -I.. -I$(srcdir)/..
+                         -I$(top_srcdir)/api -I$(top_srcdir)/api/libltdl
 AM_LDFLAGS             = -no-undefined -module -avoid-version -export-dynamic
 
 pkgincludedir          = $(includedir)/libltdl
diff -X dontdiff -urp libtool/m4/ltdl.m4 libtool-ltdlinc/m4/ltdl.m4
--- libtool/m4/ltdl.m4  Mon Oct  4 01:42:47 2004
+++ libtool-ltdlinc/m4/ltdl.m4  Wed Oct  6 02:57:22 2004
@@ -88,7 +88,7 @@ AC_DEFUN([LTDL_CONVENIENCE],
       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
   esac
 LIBLTDL='${top_builddir}/'m4_if($#, 1, [$1], ['libltdl'])/libltdlc.la
-LTDLINCL='-I${top_srcdir}/'m4_if($#, 1, [$1], ['libltdl'])
+LTDLINCL='-I${top_srcdir}/'m4_if($#, 1, [$1], ['libltdl'])/api
 
 AC_SUBST([LIBLTDL])
 AC_SUBST([LTDLINCL])




reply via email to

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