From: Bruno Haible Date: Thu, 11 May 2006 20:50:48 +0000 (+0000) Subject: Explicitly export _imp__ variables when building shared libraries on Cygwin. X-Git-Tag: v0.15~153 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a39b2b2f35a0ce8ca55ff504816428cb212b3e07;p=thirdparty%2Fgettext.git Explicitly export _imp__ variables when building shared libraries on Cygwin. --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index aa34c5c26..6c6fe4893 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,13 @@ +2006-05-11 Bruno Haible + + * 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 * Makefile.in (MKINSTALLDIRS, mkinstalldirs): Remove variables. diff --git a/gettext-runtime/intl/Makefile.in b/gettext-runtime/intl/Makefile.in index 8b9f66944..520db2bb8 100644 --- a/gettext-runtime/intl/Makefile.in +++ b/gettext-runtime/intl/Makefile.in @@ -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' \ diff --git a/gettext-runtime/intl/osdep.c b/gettext-runtime/intl/osdep.c index d2d8575ec..3cc35c03b 100644 --- a/gettext-runtime/intl/osdep.c +++ b/gettext-runtime/intl/osdep.c @@ -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. */