]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* configure.ac (AC_CONFIG_HEADERS): Create config.h in
authorGary V. Vaughan <gary@gnu.org>
Fri, 16 Jan 2004 22:03:19 +0000 (22:03 +0000)
committerGary V. Vaughan <gary@gnu.org>
Fri, 16 Jan 2004 22:03:19 +0000 (22:03 +0000)
$top_srcdir.
* m4/ltdl.m4 (AC_LIB_LTDL): Run AC_CONFIG_HEADERS for the user if
necessary. Calculate filename from first argument to
AC_CONFIG_HEADERS, and substitute as CONFIG_H.
* libltdl/Makefile.am (AM_CPPFLAGS): Make sure we are searching in
$top_srcdir for headers.
(DEFS): Override the default HAVE_CONFIG_H with the config.h
filename.
(ltdl.lo): Reference config.h via $(CONFIG_H).
* libltdl/ltdl.c (HAVE_CONFIG_H): Ditto.

ChangeLog
configure.ac
libltdl/Makefile.am
libltdl/ltdl.c
m4/ltdl.m4

index c7ba936fd2b0580a178f9d6da304ea7ad40c4c2d..a9271b370b53ca0beb3bb51532eb4803e85faeab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2004-01-16  Gary V. Vaughan  <gary@gnu.org>
+
+       * configure.ac (AC_CONFIG_HEADERS): Create config.h in
+       $top_srcdir.
+       * m4/ltdl.m4 (AC_LIB_LTDL): Run AC_CONFIG_HEADERS for the user if
+       necessary. Calculate filename from first argument to
+       AC_CONFIG_HEADERS, and substitute as CONFIG_H.
+       * libltdl/Makefile.am (AM_CPPFLAGS): Make sure we are searching in
+       $top_srcdir for headers.
+       (DEFS): Override the default HAVE_CONFIG_H with the config.h
+       filename.
+       (ltdl.lo): Reference config.h via $(CONFIG_H).
+       * libltdl/ltdl.c (HAVE_CONFIG_H): Ditto.
+
 2004-01-15  Scott James Remnant  <scott@netsplit.com>
 
        * m4/lt~obsolete.m4: Add a file containing aclocal-fooling
@@ -17,7 +31,7 @@
 2004-01-13  Peter O'Gorman  <peter@pogma.com>
 
        * m4/libtool.m4: Quote shrext as it is evaled in ltmain.
-       
+
 2004-01-11  Scott James Remnant  <scott@netsplit.com>
 
        * ltmain.in: new -precious-files-regex link mode option
index 7e0a03f603e352463965110b4c55e57e16b22235..619f9b511a72ebbefe6c1d276b4c7762731354b9 100644 (file)
@@ -25,7 +25,7 @@ AC_PREREQ(2.58) ## We use AS_HELP_STRING
 ## Autoconf initialisation. ##
 ## ------------------------ ##
 AC_INIT([libtool], [1.5a], [bug-libtool@gnu.org])
-AC_CONFIG_HEADERS([libltdl/config.h:libltdl/config-h.in])
+AC_CONFIG_HEADERS([config.h:config-h.in])
 AC_CONFIG_SRCDIR([ltmain.in])
 AC_CONFIG_AUX_DIR([config])
 
index 4d28542f402cedd362a6bac5af329072b112e665..f9116dabaeec61a746c89b180581cce4ff49dcbe 100644 (file)
@@ -2,6 +2,8 @@
 
 AUTOMAKE_OPTIONS = no-dependencies foreign
 ACLOCAL_AMFLAGS  = -I ../m4
+AM_CPPFLAGS = -I$(top_srcdir)
+DEFS = -DHAVE_CONFIG_H="<$(CONFIG_H)>"
 
 if INSTALL_LTDL
 include_HEADERS = ltdl.h
@@ -26,7 +28,7 @@ libltdlc_la_SOURCES = ltdl.c
 libltdlc_la_LIBADD = $(LIBADD_DL)
 
 ## Because we do not have automatic dependency tracking:
-ltdl.lo: ltdl.h config.h
+ltdl.lo: ltdl.h $(top_srcdir)/$(CONFIG_H)
 
 ## This allows us to install libltdl without using ln and without creating
 ## a world writeable directory.
index 4e992c58191171e76a2782965a851ec9f791a11f..ed7239da2f4b83732847ccc5678ed396258c76ff 100644 (file)
@@ -25,8 +25,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
 */
 
-#if HAVE_CONFIG_H
-#  include <config.h>
+#ifdef HAVE_CONFIG_H
+#  include HAVE_CONFIG_H
 #endif
 
 #if HAVE_UNISTD_H
index 2cb3b97fa4b806adcfb4828468412b00ce86dc5d..7768f126648da5b4e8a9609fc0629e8a3ed124ef 100644 (file)
@@ -96,6 +96,15 @@ AC_REQUIRE([AC_LTDL_DLSYM_USCORE])
 AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS])
 AC_REQUIRE([AC_LTDL_FUNC_ARGZ])
 
+# In order that ltdl.c can compile, run AC_CONFIG_HEADERS for the user
+# if they did not call it themself.  This is so that ltdl.h can pick up
+# the parent projects config.h file, The first file in AC_CONFIG_HEADERS
+# must contain the definitions required by ltdl.c.
+m4_ifset([AC_LIST_HEADERS],
+    [CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[    ]]*,,;s,[[ :]].*$,,'`],
+  [CONFIG_H=config.h;AC_CONFIG_HEADERS([config.h])])
+AC_SUBST([CONFIG_H])
+
 AC_CHECK_HEADERS([assert.h ctype.h errno.h malloc.h memory.h stdlib.h \
                  stdio.h unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h],
        [], [], [AC_INCLUDES_DEFAULT])