From: Bruno Haible Date: Thu, 11 May 2006 20:55:46 +0000 (+0000) Subject: Cygwin support. X-Git-Tag: v0.15~151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2a015e371ed1854b92b945a4f72b56334512600;p=thirdparty%2Fgettext.git Cygwin support. --- diff --git a/gettext-tools/ChangeLog b/gettext-tools/ChangeLog index 6137b8aaa..088a54c26 100644 --- a/gettext-tools/ChangeLog +++ b/gettext-tools/ChangeLog @@ -1,3 +1,17 @@ +2006-05-11 Bruno Haible + + * woe32dll: Directory renamed from mingw. + * cygwin/export.h: New file. + * cygwin/gettextlib-exports.c: New file. + * cygwin/gettextsrc-exports.c: New file. + * cygwin/gettextpo-exports.c: New file. + * configure.ac (WOE32DLL): Condition renamed from MINGW. Activate it + also on Cygwin. Only activate it when compiling shared libraries. + (CYGWINDLL): New condition. + (CYGWINDLL): New define. + (DLL_VARIABLE): Use dllimport also on Cygwin. + * Makefile.am (EXTRA_DIST): Add cygwin/export.h. + 2006-05-11 Bruno Haible * woe32dll/c++format.cc: New file. diff --git a/gettext-tools/Makefile.am b/gettext-tools/Makefile.am index e9073caf7..e29e7ebc7 100644 --- a/gettext-tools/Makefile.am +++ b/gettext-tools/Makefile.am @@ -237,3 +237,8 @@ windows/stdbool.h: lib/stdbool_.h all-local : windows/stdbool.h EXTRA_DIST += README.woe32 Makefile.msvc config.h.msvc windows/alloca.h windows/fnmatch.h windows/getopt.h windows/stdbool.h windows/gettextlib.def windows/gettextsrc.def windows/gettextpo.def windows/gettextlib.rc windows/gettextsrc.rc windows/gettextpo.rc + + +# Cygwin support. + +EXTRA_DIST += cygwin/export.h diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index 6d8a834e5..d10cb43b0 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -204,13 +204,37 @@ AC_DEFINE_UNQUOTED([ENDIANNESS], [$endianness], gt_PREREQ_HOSTNAME -dnl Compilation on mingw needs special Makefile rules, because of variables -dnl being exported from or imported into shared libraries. -case "$host_os" in - mingw*) is_mingw=yes ;; - *) is_mingw=no ;; -esac -AM_CONDITIONAL([MINGW], [test $is_mingw = yes]) +dnl Compilation on mingw and Cygwin needs special Makefile rules, because of +dnl variables being exported from or imported into shared libraries. +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]) + +dnl Compilation on 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 + cygwin*) is_cygwindll=yes ;; + *) is_cygwindll=no ;; + esac +else + is_cygwindll=no +fi +AM_CONDITIONAL([CYGWINDLL], [test $is_cygwindll = yes]) +if test $is_cygwindll = yes; then + AC_DEFINE([CYGWINDLL], 1, [Define when --enable-shared is used on Cygwin.]) +fi dnl Put some default definitions into config.h. AH_TOP([ @@ -243,7 +267,7 @@ AH_BOTTOM([ #define PAGE_WIDTH 79 /* On Windows, variables that may be in a DLL must be marked specially. */ -#if (defined _MSC_VER && defined _DLL) || (defined __MINGW32__ && defined DLL_EXPORT) +#if (defined _MSC_VER && defined _DLL) || (defined __MINGW32__ && defined DLL_EXPORT) || defined CYGWINDLL # define DLL_VARIABLE __declspec (dllimport) #else # define DLL_VARIABLE