-e 's,@''HAVE_NEWLOCALE''@,@HAVE_NEWLOCALE@,g' \
-e 's,@''ENHANCE_LOCALE_FUNCS''@,@ENHANCE_LOCALE_FUNCS@,g' \
< $(srcdir)/libgnuintl.in.h \
- | if test '@WOE32DLL@' = yes; then \
+ | if test '@WOE32DLL@' = 1; then \
sed -e 's/extern \([^()]*\);/extern __declspec (dllimport) \1;/'; \
else \
cat; \
-e "/#define _LIBINTL_H/r $(srcdir)/export.h" \
| sed -e '/#define _LIBINTL_H/,/[*][/]$$/{/#define _LIBINTL_H/!d;}' \
| sed -e 's,@''HAVE_VISIBILITY''@,@HAVE_VISIBILITY@,g' \
+ | sed -e 's,@''WOE32DLL''@,@WOE32DLL@,g' \
> libgnuintl.h
MOSTLYCLEANFILES += libgnuintl.h
else
is_woe32dll=no
fi
-WOE32DLL=$is_woe32dll
-AC_SUBST([WOE32DLL])
-AM_CONDITIONAL([WOE32DLL], [test $is_woe32dll = yes])
if test $is_woe32dll = yes; then
- AC_DEFINE([WOE32DLL], [1],
- [Define when --enable-shared is used on Windows.])
+ WOE32DLL=1
+else
+ WOE32DLL=0
fi
+AC_SUBST([WOE32DLL])
+AM_CONDITIONAL([WOE32DLL], [test $is_woe32dll = yes])
dnl Put some default definitions into config.h.
AH_BOTTOM([
/* Tweak gnulib code according to the needs of this library. */
#define IN_LIBINTL 1
-/* On Windows, variables that may be in a DLL must be marked specially. */
-#if (defined _MSC_VER && defined _DLL) && !defined IN_RELOCWRAPPER
+/* On Windows, variables that may be in a DLL must be marked specially.
+ The symbols marked with DLL_VARIABLE should be exported if and only if the
+ object file gets included in a DLL. Libtool, on Windows platforms, defines
+ the C macro DLL_EXPORT (together with PIC) when compiling for a DLL
+ and does not define it when compiling an object file meant to be linked
+ statically into some executable. */
+#if (defined _MSC_VER && defined DLL_EXPORT) && !defined IN_RELOCWRAPPER
# define DLL_VARIABLE __declspec (dllimport)
#else
# define DLL_VARIABLE
/* Control of exported symbols from libintl.
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#if @HAVE_VISIBILITY@ && BUILDING_LIBINTL
-#define LIBINTL_DLL_EXPORTED __attribute__((__visibility__("default")))
-#elif (defined _WIN32 && !defined __CYGWIN__) && defined WOE32DLL && BUILDING_LIBINTL
-#define LIBINTL_DLL_EXPORTED __declspec(dllexport)
-#elif (defined _WIN32 && !defined __CYGWIN__) && defined WOE32DLL
-#define LIBINTL_DLL_EXPORTED __declspec(dllimport)
+# define LIBINTL_DLL_EXPORTED __attribute__((__visibility__("default")))
+#elif (defined _WIN32 && !defined __CYGWIN__) && @WOE32DLL@ && BUILDING_LIBINTL
+/* The symbols from this file should be exported if and only if the object
+ file gets included in a DLL. Libtool, on Windows platforms, defines
+ the C macro DLL_EXPORT (together with PIC) when compiling for a DLL
+ and does not define it when compiling an object file meant to be linked
+ statically into some executable. */
+# if defined DLL_EXPORT
+# define LIBINTL_DLL_EXPORTED __declspec(dllexport)
+# else
+# define LIBINTL_DLL_EXPORTED
+# endif
+#elif (defined _WIN32 && !defined __CYGWIN__) && @WOE32DLL@
+# define LIBINTL_DLL_EXPORTED __declspec(dllimport)
#else
-#define LIBINTL_DLL_EXPORTED
+# define LIBINTL_DLL_EXPORTED
#endif
/* intl-compat.c - Stub functions to call gettext functions from GNU gettext
Library.
- Copyright (C) 1995, 2000-2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2000-2003, 2005, 2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
#if HAVE_VISIBILITY && BUILDING_DLL
# define DLL_EXPORTED __attribute__((__visibility__("default")))
#elif defined _MSC_VER && BUILDING_DLL
-# define DLL_EXPORTED __declspec(dllexport)
+/* When building with MSVC, exporting a symbol means that the object file
+ contains a "linker directive" of the form /EXPORT:symbol. This can be
+ inspected through the "objdump -s --section=.drectve FILE" or
+ "dumpbin /directives FILE" commands.
+ The symbols from this file should be exported if and only if the object
+ file gets included in a DLL. Libtool, on Windows platforms, defines
+ the C macro DLL_EXPORT (together with PIC) when compiling for a DLL
+ and does not define it when compiling an object file meant to be linked
+ statically into some executable. */
+# if defined DLL_EXPORT
+# define DLL_EXPORTED __declspec(dllexport)
+# else
+# define DLL_EXPORTED
+# endif
#else
# define DLL_EXPORTED
#endif
#if HAVE_VISIBILITY && BUILDING_DLL
# define DLL_EXPORTED __attribute__((__visibility__("default")))
#elif defined _MSC_VER && BUILDING_DLL
-# define DLL_EXPORTED __declspec(dllexport)
+/* When building with MSVC, exporting a symbol means that the object file
+ contains a "linker directive" of the form /EXPORT:symbol. This can be
+ inspected through the "objdump -s --section=.drectve FILE" or
+ "dumpbin /directives FILE" commands.
+ The symbols from this file should be exported if and only if the object
+ file gets included in a DLL. Libtool, on Windows platforms, defines
+ the C macro DLL_EXPORT (together with PIC) when compiling for a DLL
+ and does not define it when compiling an object file meant to be linked
+ statically into some executable. */
+# if defined DLL_EXPORT
+# define DLL_EXPORTED __declspec(dllexport)
+# else
+# define DLL_EXPORTED
+# endif
#else
# define DLL_EXPORTED
#endif
/* setlocale() function that respects the locale chosen by the user.
- Copyright (C) 2009, 2011, 2013, 2018-2019, 2022 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2011, 2013, 2018-2019, 2022-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009.
This program is free software: you can redistribute it and/or modify
#if HAVE_VISIBILITY && BUILDING_DLL
# define DLL_EXPORTED __attribute__((__visibility__("default")))
#elif defined _MSC_VER && BUILDING_DLL
-# define DLL_EXPORTED __declspec(dllexport)
+/* When building with MSVC, exporting a symbol means that the object file
+ contains a "linker directive" of the form /EXPORT:symbol. This can be
+ inspected through the "objdump -s --section=.drectve FILE" or
+ "dumpbin /directives FILE" commands.
+ The symbols from this file should be exported if and only if the object
+ file gets included in a DLL. Libtool, on Windows platforms, defines
+ the C macro DLL_EXPORT (together with PIC) when compiling for a DLL
+ and does not define it when compiling an object file meant to be linked
+ statically into some executable. */
+# if defined DLL_EXPORT
+# define DLL_EXPORTED __declspec(dllexport)
+# else
+# define DLL_EXPORTED
+# endif
#else
# define DLL_EXPORTED
#endif