From: Bruno Haible Date: Tue, 18 Sep 2018 07:28:11 +0000 (+0200) Subject: Fix link error when building with --disable-shared on Cygwin and mingw. X-Git-Tag: v0.20~380 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0ba017fc01d4ae55b30a214c9697412da5331ce;p=thirdparty%2Fgettext.git Fix link error when building with --disable-shared on Cygwin and mingw. * gettext-tools/configure.ac (LIBXML_STATIC): Define to 1 when using the included libxml and building with --disable-shared. * gnulib-local/lib/libxml/libxml.h (LIBXML_STATIC): Define to 1, not empty. --- diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index 487823024..c48ac1378 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -195,6 +195,14 @@ AH_BOTTOM([ gt_PREREQ_HOSTNAME +dnl Parameterization of the 'libxml' module: +dnl When INCLUDED_LIBXML is true and building static libraries, tell +dnl libxml's xmlexports.h to omit '__declspec(dllimport)' on mingw and Cygwin. +if test "$gl_cv_libxml_use_included" = yes && test "$enable_shared" != yes; then + AC_DEFINE([LIBXML_STATIC], [1], + [Define if libxml is being used as a static library.]) +fi + 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, diff --git a/gnulib-local/lib/libxml/libxml.h b/gnulib-local/lib/libxml/libxml.h index 2da9044ef..24b2b57a4 100644 --- a/gnulib-local/lib/libxml/libxml.h +++ b/gnulib-local/lib/libxml/libxml.h @@ -107,6 +107,6 @@ int xmlNop(void); #endif #endif #if !defined(PIC) && !defined(NOLIBTOOL) -# define LIBXML_STATIC +# define LIBXML_STATIC 1 #endif #endif /* ! __XML_LIBXML_H__ */