+2012-12-27 Daiki Ueno <ueno@gnu.org>
+
+ * configure.ac (WOE32DLL): New conditional.
+ (INTL_EXPORTS_FLAGS): New substituted variable.
+
2012-12-25 Daiki Ueno <ueno@gnu.org>
* gettext-0.18.2 released.
#endif
])
+dnl Compilation on mingw and Cygwin needs special Makefile rules, because
+dnl 1. when we install a shared library, we must arrange to export
+dnl auxiliary pointer variables for every exported variable,
+dnl 2. when we install a shared library and a static library simultaneously,
+dnl the include file specifies __declspec(dllimport) and therefore we
+dnl must arrange to define the auxiliary pointer variables for the
+dnl exported variables _also_ in the static library.
+if test "$enable_shared" = yes; then
+ case "$host_os" in
+ mingw* | cygwin*) is_woe32dll=yes ;;
+ *) is_woe32dll=no ;;
+ esac
+else
+ is_woe32dll=no
+fi
+AM_CONDITIONAL([WOE32DLL], [test $is_woe32dll = yes])
+if test $is_woe32dll = yes; then
+ AC_DEFINE([WOE32DLL], [1],
+ [Define when --enable-shared is used on mingw or Cygwin.])
+fi
+
+INTL_EXPORTS_FLAGS=
+dnl 64-bit mingw does not prepend an underscore to C symbols.
+dnl USER_LABEL_PREFIX is set by gl_ASM_SYMBOL_PREFIX, inside gl_INIT.
+if test "$USER_LABEL_PREFIX" = _; then
+ INTL_EXPORTS_FLAGS="-DUSER_LABEL_PREFIX_UNDERSCORE $INTL_EXPORTS_FLAGS"
+fi
+AC_SUBST([INTL_EXPORTS_FLAGS])
+
dnl Check for tools needed for formatting the documentation.
ac_aux_dir_abs=`cd $ac_aux_dir && pwd`
AC_PATH_PROG([PERL], [perl], [$ac_aux_dir_abs/missing perl])
+2013-02-25 Daiki Ueno <ueno@gnu.org>
+
+ Determine imported C symbol prefix at configure time.
+ Suggested by Evgeny Grin in <http://savannah.gnu.org/bugs/?29946>.
+ * intl-exports.c (IMP): Define depending on the result of the
+ configure run.
+
2013-01-21 Daiki Ueno <ueno@gnu.org>
Remove references to non-existing COPYING.LIB-2.*.
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* IMP(x) is a symbol that contains the address of x. */
-#if defined _WIN64 && defined __MINGW32__
- /* mingw W64 started using __imp_ prefix for MSVC compatibility since
- 2010. Ideally we should check the prefix in configure though,
- we assume __imp_ on mingw W64 for the time being. */
-# define IMP(x) __imp_##x
-#else
+#if USER_LABEL_PREFIX_UNDERSCORE
# define IMP(x) _imp__##x
+#else
+# define IMP(x) __imp_##x
#endif
/* Ensure that the variable x is exported from the library, and that a
+2012-12-27 Daiki Ueno <ueno@gnu.org>
+
+ Determine imported C symbol prefix at configure time.
+ Suggested by Evgeny Grin in <http://savannah.gnu.org/bugs/?29946>.
+ * woe32dll/export.h (IMP): Define depending on the result of the
+ configure run.
+ * configure.ac (GETTEXTLIB_EXPORTS_FLAGS): Add
+ -DUSER_LABEL_PREFIX_UNDERSCORE if imported C symbol has
+ underscore prefix.
+
2012-12-25 Daiki Ueno <ueno@gnu.org>
* gettext-0.18.2 released.
if test "$ac_cv_lib_error_at_line" = no; then
GETTEXTLIB_EXPORTS_FLAGS="-DGNULIB_DEFINED_ERROR $GETTEXTLIB_EXPORTS_FLAGS"
fi
+
+dnl 64-bit mingw does not prepend an underscore to C symbols.
+dnl USER_LABEL_PREFIX is set by gl_ASM_SYMBOL_PREFIX, inside gl_INIT.
+if test "$USER_LABEL_PREFIX" = _; then
+ GETTEXTLIB_EXPORTS_FLAGS="-DUSER_LABEL_PREFIX_UNDERSCORE $GETTEXTLIB_EXPORTS_FLAGS"
+fi
AC_SUBST([GETTEXTLIB_EXPORTS_FLAGS])
dnl Tell the source files that the error facility is replaced by
+2013-02-25 Daiki Ueno <ueno@gnu.org>
+
+ * Makefile.am (libgettextsrc_la_CPPFLAGS): Define to specify Woe32
+ DLL export flags.
+
2013-01-09 Andreas Stricker <astricker@futurelab.ch> (tiny change)
* po-xerror.c: Include error.h for error_message_count.
-release @VERSION@ \
../gnulib-lib/libgettextlib.la $(LTLIBUNISTRING) @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
+libgettextsrc_la_CPPFLAGS = $(AM_CPPFLAGS)
+
# Tell the mingw or Cygwin linker which symbols to export.
if WOE32DLL
libgettextsrc_la_SOURCES += ../woe32dll/gettextsrc-exports.c
libgettextsrc_la_LDFLAGS += -Wl,--export-all-symbols
+libgettextsrc_la_CPPFLAGS += $(GETTEXTLIB_EXPORTS_FLAGS)
endif
# No need to install libgettextsrc.a, except on AIX.
#if defined __GNUC__ /* GCC compiler, GNU toolchain */
/* IMP(x) is a symbol that contains the address of x. */
-#if defined _WIN64 && defined __MINGW32__
- /* mingw W64 started using __imp_ prefix for MSVC compatibility since
- 2010. Ideally we should check the prefix in configure though,
- we assume __imp_ on mingw W64 for the time being. */
-# define IMP(x) __imp_##x
-#else
+#if USER_LABEL_PREFIX_UNDERSCORE
# define IMP(x) _imp__##x
+#else
+# define IMP(x) __imp_##x
#endif
/* Ensure that the variable x is exported from the library, and that a
+2013-02-25 Daiki Ueno <ueno@gnu.org>
+
+ * modules/gettext-runtime-misc (AM_CPPFLAGS): Augment by
+ INTL_EXPORTS_FLAGS.
+
2013-01-03 Daiki Ueno <ueno@gnu.org>
Update after gnulib changed.
# Parametrization of the 'relocatable' module.
AM_CPPFLAGS += -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1
+# Tell the mingw or Cygwin linker which symbols to export.
+if WOE32DLL
+AM_CPPFLAGS += @INTL_EXPORTS_FLAGS@
+endif
+
Include:
License: