1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-29 21:46:59 +03:00

Fix Python build on Windows

Build Python bindings with -no-undefined on Windows. Remove libs that
should already be set by PKG_CHECK_MODULE.
This commit is contained in:
Nick Wellnhofer 2022-09-04 17:21:51 +02:00
parent 22b82d14d1
commit ad6f10a81b
2 changed files with 7 additions and 15 deletions

View File

@ -790,25 +790,17 @@ AS_IF([test "x$with_python" != "xno"], [
AM_CONDITIONAL([WITH_PYTHON], [test "x$with_python" != "xno"])
dnl
dnl Extra Python flags for Windows (is this still needed now that we use
dnl AM_PATH_PYTHON/PKG_CHECK_MODULES to detect and set up Python?)
dnl Extra Python flags for Windows
dnl
EXTRA_PYTHON_LIBADD=
PYTHON_LDFLAGS=
if test "${PYTHON}" != ""; then
case "$host" in
*-w64-mingw*)
EXTRA_PYTHON_LIBADD="-shrext .pyd -L${pythondir}/../../lib -lpython${PYTHON_VERSION}"
;;
*-*-mingw*)
EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython$(echo ${PYTHON_VERSION} | tr -d .)"
;;
*-*-cygwin*)
EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
*-*-cygwin* | *-*-mingw* | *-*-msys* )
PYTHON_LDFLAGS="-no-undefined"
;;
esac
fi
AC_SUBST(EXTRA_PYTHON_LIBADD)
AC_SUBST(PYTHON_LDFLAGS)
dnl
dnl Check for DSO support

View File

@ -20,8 +20,8 @@ pyexec_LTLIBRARIES = libxml2mod.la
libxml2mod_la_SOURCES = libxml.c libxml_wrap.h types.c
nodist_libxml2mod_la_SOURCES = libxml2-py.h libxml2-py.c
libxml2mod_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
libxml2mod_la_LIBADD = $(top_builddir)/libxml2.la $(EXTRA_PYTHON_LIBADD) $(PYTHON_LIBS)
libxml2mod_la_LDFLAGS = $(AM_LDFLAGS) $(PYTHON_LDFLAGS) -module -avoid-version
libxml2mod_la_LIBADD = $(top_builddir)/libxml2.la $(PYTHON_LIBS)
BUILT_SOURCES = libxml2-export.c libxml2-py.h libxml2-py.c