]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Determine Woe32 C symbol prefix at configure time.
authorDaiki Ueno <ueno@gnu.org>
Mon, 25 Feb 2013 09:18:24 +0000 (18:18 +0900)
committerDaiki Ueno <ueno@gnu.org>
Tue, 5 Mar 2013 06:17:05 +0000 (15:17 +0900)
gettext-runtime/ChangeLog
gettext-runtime/configure.ac
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/intl-exports.c
gettext-tools/ChangeLog
gettext-tools/configure.ac
gettext-tools/src/ChangeLog
gettext-tools/src/Makefile.am
gettext-tools/woe32dll/export.h
gnulib-local/ChangeLog
gnulib-local/modules/gettext-runtime-misc

index 4c9c28322a6ab8d3842240a902c466d4c471667d..b523cfdfd79f94f858793afd00c841195b848b5d 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 745caf6d10abdbcdee7f59bf56a857bdf011b3e7..e300c733eae01e9b687bee357c98345029179e5b 100644 (file)
@@ -106,6 +106,35 @@ AH_BOTTOM([
 #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])
index c3786a73b27372329b08d9213194205e564fe1c4..8368bec95aa59e96abb008ad4dabee6dd3a3d855 100644 (file)
@@ -1,3 +1,10 @@
+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.*.
index 4a5126b50e3beb90660d4e25076a991be92aab4d..891c25e26590ba6f1aeb9391534b7ea5f6d5355c 100644 (file)
    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
index 167d6a6dfd238154aa62bac532f849595aa9d0b7..123c114eff96e40f358df36c2e869652670973fb 100644 (file)
@@ -1,3 +1,13 @@
+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.
index 6392756cc40f5b5f47e81411b81bca61efce0979..373d3cc8170e6d4377009496c4e1eac7453e5650 100644 (file)
@@ -235,6 +235,12 @@ dnl gl_ERROR, inside gl_INIT.
 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
index 5293673b444974060844e3e02f7984e65d95f868..80308ddbe967177b7bf6b45503e6902117d4f53e 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 87cc358213f138a49c0f984615e5e7c92c8b4f59..aea01e65c68ac455d59b1574816fbb2c46d61dd3 100644 (file)
@@ -240,10 +240,13 @@ libgettextsrc_la_LDFLAGS = \
   -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.
index 68e9bcc5fc080c1f33d2a207724391cd98319c0f..8bd15668001cf0323c53b9f949795996f6d031ba 100644 (file)
 #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
index 5a3a4864332ed77ae9751bf398e05b9dd348fcae..8d7e5432bae1b9dd1a5547a28f5c2c4169c71469 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 4cad86d658484c49b8d94ed8ea3282f381db3269..de358b6ff8cec166b285a57a5ff6f07b286cb695 100644 (file)
@@ -15,6 +15,11 @@ AM_CPPFLAGS += -I$(top_builddir)/intl -I$(top_srcdir)/intl
 # 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: