xslt: Build with LIBXSLT_STATIC, fix building with clang in MSVC mode.

This avoids unnecessarily embedding dllexport directives in all
the object files.

This also fixes building with clang in MSVC mode, as the MSVC
definition of XSLTPUBVAR in xsltexports.h is lacking 'extern'
when doing dllexport. (This probably used to work before
compilers defaulted to -fcommon.) This fixes duplicate symbols
like these:

lld-link: error: duplicate symbol: xsltGenericError
>>> defined at ../src/libs/xslt/libxslt/xsltutils.h:140
>>>            libxslt.cross.a(documents.cross.o)
>>> defined at ../src/libs/xslt/libxslt/xsltutils.h:140
>>>            libxslt.cross.a(extensions.cross.o)

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Martin Storsjö 2021-10-21 12:15:36 +03:00 committed by Alexandre Julliard
parent 25bc909283
commit 683b43b996
3 changed files with 3 additions and 3 deletions

2
configure vendored
View File

@ -10771,7 +10771,7 @@ $as_echo "$as_me:${as_lineno-$LINENO}: libxml2 cflags: $XML2_PE_CFLAGS" >&5
$as_echo "$as_me:${as_lineno-$LINENO}: libxml2 libs: $XML2_PE_LIBS" >&5
if ${XSLT_PE_CFLAGS:+false} :; then :
XSLT_PE_CFLAGS="-I\$(top_srcdir)/libs/xslt"
XSLT_PE_CFLAGS="-I\$(top_srcdir)/libs/xslt -DLIBXSLT_STATIC"
else
enable_libxslt=no
fi

View File

@ -1060,7 +1060,7 @@ WINE_EXTLIB_FLAGS(LCMS2, lcms2, lcms2, "-I\$(top_srcdir)/libs/lcms2/include")
WINE_EXTLIB_FLAGS(PNG, png, "png \$(ZLIB_PE_LIBS)", "-I\$(top_srcdir)/libs/png")
WINE_EXTLIB_FLAGS(TIFF, tiff, tiff, "-I\$(top_srcdir)/libs/tiff/libtiff")
WINE_EXTLIB_FLAGS(XML2, libxml2, xml2, "-I\$(top_srcdir)/libs/xml2/include -DLIBXML_STATIC")
WINE_EXTLIB_FLAGS(XSLT, libxslt, xslt, "-I\$(top_srcdir)/libs/xslt")
WINE_EXTLIB_FLAGS(XSLT, libxslt, xslt, "-I\$(top_srcdir)/libs/xslt -DLIBXSLT_STATIC")
WINE_EXTLIB_FLAGS(ZLIB, zlib, z, "-I\$(top_srcdir)/libs/zlib -DFAR= -DZ_SOLO")
dnl **** Check for pthread ****

View File

@ -1,5 +1,5 @@
EXTLIB = libxslt.a
EXTRAINCL = $(XML2_PE_CFLAGS)
EXTRAINCL = $(XML2_PE_CFLAGS) $(XSLT_PE_CFLAGS)
C_SRCS = \
libxslt/attributes.c \