]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Explicitly export _imp__ variables when building shared libraries on Cygwin.
authorBruno Haible <bruno@clisp.org>
Thu, 11 May 2006 20:50:48 +0000 (20:50 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:13:18 +0000 (12:13 +0200)
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/Makefile.in
gettext-runtime/intl/osdep.c

index aa34c5c26ac206316487fd06fd3f5997c2d50f6c..6c6fe4893d591e5b8715ab66f1c3c6a4c4bf2ab3 100644 (file)
@@ -1,3 +1,13 @@
+2006-05-11  Bruno Haible  <bruno@clisp.org>
+
+       * intl-exports.c: New file.
+       * osdep.c: Include it on Cygwin.
+       * Makefile.in (LDFLAGS_yes, LDFLAGS_no): New variables.
+       (LDFLAGS): Use it.
+       (SOURCES): Add intl-exports.c.
+       (libgnuintl.h): When compiling a DLL on Cygwin, mark all exported
+       variables as to be imported.
+
 2006-04-17  Bruno Haible  <bruno@clisp.org>
 
        * Makefile.in (MKINSTALLDIRS, mkinstalldirs): Remove variables.
index 8b9f66944fc2f0aa06bd6fe4564d86ccc099bcd2..520db2bb8ebd36ec7aaa084eb6c1cb431d323ca6 100644 (file)
@@ -72,7 +72,9 @@ DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
 -DDEPENDS_ON_LIBICONV=1 @DEFS@
 CPPFLAGS = @CPPFLAGS@
 CFLAGS = @CFLAGS@ @CFLAG_VISIBILITY@
-LDFLAGS = @LDFLAGS@
+LDFLAGS = @LDFLAGS@ $(LDFLAGS_@CYGWINDLL@)
+LDFLAGS_yes = -Wl,--export-all-symbols
+LDFLAGS_no =
 LIBS = @LIBS@
 
 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
@@ -121,6 +123,7 @@ SOURCES = \
   version.c \
   osdep.c \
   os2compat.c \
+  intl-exports.c \
   intl-compat.c
 OBJECTS = \
   bindtextdom.$lo \
@@ -270,6 +273,11 @@ libgnuintl.h: $(srcdir)/libgnuintl.h.in
            -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
            -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
          < $(srcdir)/libgnuintl.h.in \
+       | if test '@CYGWINDLL@' = yes; then \
+           sed -e 's/extern \([^()]*\);/extern __declspec (dllimport) \1;/'; \
+         else \
+           cat; \
+         fi \
        | sed -e 's/extern \([^"]\)/extern LIBINTL_DLL_EXPORTED \1/' \
              -e "/#define _LIBINTL_H/r $(srcdir)/export.h" \
        | sed -e 's,@''HAVE_VISIBILITY''@,@HAVE_VISIBILITY@,g' \
index d2d8575ec66e8df7c03df5b3f7fdb05d60514b95..3cc35c03b737b342707954370a3179460e24bfa5 100644 (file)
@@ -1,5 +1,5 @@
 /* OS dependent parts of libintl.
-   Copyright (C) 2001-2002 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU Library General Public License as published
@@ -16,7 +16,9 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
    USA.  */
 
-#if defined __EMX__
+#if defined __CYGWIN__
+# include "intl-exports.c"
+#elif defined __EMX__
 # include "os2compat.c"
 #else
 /* Avoid AIX compiler warning.  */