libtool-patches
[Top][All Lists]
Advanced

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

Re: config.h inclusion


From: Ralf Wildenhues
Subject: Re: config.h inclusion
Date: Fri, 16 Sep 2005 18:03:05 +0200
User-agent: Mutt/1.4.1i

[ removing bug-gnulib from recipients ]

Hi Noah, libtool-patches readers,

* Noah Misch wrote on Thu, Sep 15, 2005 at 10:40:30PM CEST:
> On Thu, Sep 15, 2005 at 09:45:20AM +0200, Ralf Wildenhues wrote:
> 
> > Another issue:  Packages using libltdl from libtool CVS will break with
> > `#if HAVE_CONFIG_H', because libltdl macros cause HAVE_CONFIG_H to be
> > defined as `<config.h>' or similar.  One or the other needs to be fixed.
> > Comments?
> 
> Please pass the name of the configuration header in a separate define.

Good idea.  Proposed patch below.  While we're at it, also move CONFIG_H
to our own name space, LT_CONFIG_H.  OK to apply to HEAD?

Cheers,
Ralf

        * libltdl/m4/ltdl.m4 (LTDL_INIT) <CONFIG_H>: Rename to ..
        <LT_CONFIG_H>: this, to contain the name of the config
        header.
        * Makefile.am <DEFS>: Use it to define LT_CONFIG_H.
        * HACKING, libltdl/argz.c, libltdl/lt__alloc.c,
        libltdl/libltdl/lt__dirent.h, libltdl/libltdl/lt__glibc.h,
        libltdl/libltdl/lt__private.h, libltdl/libltdl/lt__strl.h:
        Adjusted.

Index: libltdl/m4/ltdl.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/m4/ltdl.m4,v
retrieving revision 1.7
diff -u -r1.7 ltdl.m4
--- libltdl/m4/ltdl.m4  12 Sep 2005 11:21:40 -0000      1.7
+++ libltdl/m4/ltdl.m4  16 Sep 2005 15:02:12 -0000
@@ -170,12 +170,13 @@
 # must contain the definitions required by ltdl.c.
 # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility).
 AC_CONFIG_COMMANDS_PRE([dnl
+m4_pattern_allow([^LT_CONFIG_H$])dnl
 m4_ifset([AH_HEADER],
-        [CONFIG_H=AH_HEADER],
+        [LT_CONFIG_H=AH_HEADER],
         [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])
+                  [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[      
]]*,,;s,[[ :]].*$,,'`],
+                  [LT_CONFIG_H=config.h;AC_CONFIG_HEADERS([config.h])])])])
+AC_SUBST([LT_CONFIG_H])
 
 AC_CHECK_HEADERS([memory.h unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h],
        [], [], [AC_INCLUDES_DEFAULT])
Index: Makefile.am
===================================================================
RCS file: /cvsroot/libtool/libtool/Makefile.am,v
retrieving revision 1.162
diff -u -r1.162 Makefile.am
--- Makefile.am 14 Sep 2005 16:03:33 -0000      1.162
+++ Makefile.am 16 Sep 2005 15:19:13 -0000
@@ -223,7 +223,7 @@
 
 # %%% BEGIN libltdl/Makefile.am
 
-DEFS                   = -DHAVE_CONFIG_H="<$(CONFIG_H)>" -DLTDL
+DEFS                   = -DLTDL -DHAVE_CONFIG_H 
-DLT_CONFIG_H='<$(LT_CONFIG_H)>'
 
 # -I$(srcdir) is needed for user that built libltdl with a sub-Automake
 # (not as a sub-package!) using 'nostdinc':
Index: libltdl/argz.c
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/argz.c,v
retrieving revision 1.6
diff -u -r1.6 argz.c
--- libltdl/argz.c      14 Sep 2005 16:09:16 -0000      1.6
+++ libltdl/argz.c      16 Sep 2005 16:02:35 -0000
@@ -27,14 +27,12 @@
 
 */
 
-/* Provide our wierdo HAVE_CONFIG_H rvalue for other clients.  */
-#if !defined(LTDL) && defined(HAVE_CONFIG_H)
-#  undef HAVE_CONFIG_H
-#  define HAVE_CONFIG_H <config.h>
-#endif
-
 #if defined(HAVE_CONFIG_H)
-#  include HAVE_CONFIG_H
+#  if defined(LTDL) && defined LT_CONFIG_H
+#    include LT_CONFIG_H
+#  else
+#    include <config.h>
+#  endif
 #endif
 
 #include <argz.h>
Index: HACKING
===================================================================
RCS file: /cvsroot/libtool/libtool/HACKING,v
retrieving revision 1.19
diff -u -r1.19 HACKING
--- HACKING     12 Sep 2005 11:21:39 -0000      1.19
+++ HACKING     16 Sep 2005 14:42:06 -0000
@@ -267,7 +267,11 @@
   by libtool.  Typically, the files that implement this layer begin:
 
   #if defined(HAVE_CONFIG_H)
-  #  include HAVE_CONFIG_H
+  #  if defined(LT_CONFIG_H)
+  #    include LT_CONFIG_H
+  #  else
+  #    include <config.h>
+  #  endif
   #endif
   #include "lt_system.h"
 
Index: libltdl/lt__alloc.c
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/lt__alloc.c,v
retrieving revision 1.5
diff -u -r1.5 lt__alloc.c
--- libltdl/lt__alloc.c 22 Apr 2005 10:10:30 -0000      1.5
+++ libltdl/lt__alloc.c 16 Sep 2005 14:42:07 -0000
@@ -28,7 +28,11 @@
 */
 
 #if defined(HAVE_CONFIG_H)
-#  include HAVE_CONFIG_H
+#  if defined(LT_CONFIG_H)
+#    include LT_CONFIG_H
+#  else
+#    include <config.h>
+#  endif
 #endif
 
 #include <stdio.h>
Index: libltdl/libltdl/lt__dirent.h
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/libltdl/lt__dirent.h,v
retrieving revision 1.2
diff -u -r1.2 lt__dirent.h
--- libltdl/libltdl/lt__dirent.h        22 Apr 2005 10:10:30 -0000      1.2
+++ libltdl/libltdl/lt__dirent.h        16 Sep 2005 14:42:07 -0000
@@ -31,7 +31,11 @@
 #define LT__DIRENT_H 1
 
 #if defined(HAVE_CONFIG_H)
-#  include HAVE_CONFIG_H
+#  if defined(LT_CONFIG_H)
+#    include LT_CONFIG_H
+#  else
+#    include <config.h>
+#  endif
 #endif
 
 #include "lt_system.h"
Index: libltdl/libltdl/lt__glibc.h
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/libltdl/lt__glibc.h,v
retrieving revision 1.3
diff -u -r1.3 lt__glibc.h
--- libltdl/libltdl/lt__glibc.h 22 Apr 2005 10:10:30 -0000      1.3
+++ libltdl/libltdl/lt__glibc.h 16 Sep 2005 14:42:07 -0000
@@ -31,7 +31,11 @@
 #define LT__GLIBC_H 1
 
 #if defined(HAVE_CONFIG_H)
-#  include HAVE_CONFIG_H
+#  if defined(LT_CONFIG_H)
+#    include LT_CONFIG_H
+#  else
+#    include <config.h>
+#  endif
 #endif
 
 #if !defined(HAVE_ARGZ_H)
Index: libltdl/libltdl/lt__private.h
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/libltdl/lt__private.h,v
retrieving revision 1.4
diff -u -r1.4 lt__private.h
--- libltdl/libltdl/lt__private.h       22 Apr 2005 10:10:30 -0000      1.4
+++ libltdl/libltdl/lt__private.h       16 Sep 2005 14:42:07 -0000
@@ -31,7 +31,11 @@
 #define LT__PRIVATE_H 1
 
 #if defined(HAVE_CONFIG_H)
-#  include HAVE_CONFIG_H
+#  if defined(LT_CONFIG_H)
+#    include LT_CONFIG_H
+#  else
+#    include <config.h>
+#  endif
 #endif
 
 #include <stdio.h>
Index: libltdl/libltdl/lt__strl.h
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/libltdl/lt__strl.h,v
retrieving revision 1.3
diff -u -r1.3 lt__strl.h
--- libltdl/libltdl/lt__strl.h  22 Apr 2005 10:10:30 -0000      1.3
+++ libltdl/libltdl/lt__strl.h  16 Sep 2005 14:42:07 -0000
@@ -31,7 +31,11 @@
 #define LT__STRL_H 1
 
 #if defined(HAVE_CONFIG_H)
-#  include HAVE_CONFIG_H
+#  if defined(LT_CONFIG_H)
+#    include LT_CONFIG_H
+#  else
+#    include <config.h>
+#  endif
 #endif
 
 #include <string.h>




reply via email to

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