]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix link error when building with --disable-shared on Cygwin and mingw.
authorBruno Haible <bruno@clisp.org>
Tue, 18 Sep 2018 07:28:11 +0000 (09:28 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 18 Sep 2018 07:28:11 +0000 (09:28 +0200)
* 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.

gettext-tools/configure.ac
gnulib-local/lib/libxml/libxml.h

index 487823024a7721e484044808d741381c67c095e6..c48ac13785ab2c00586af80670f6b52c25158e41 100644 (file)
@@ -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,
index 2da9044ef659ec9ee2b55728b649187ccf5fd901..24b2b57a41db6322be8aa594a4ad4331cde3e03e 100644 (file)
@@ -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__ */