summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2022-09-04 17:21:51 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2022-09-04 18:36:04 +0200
commitad6f10a81be19c4dca2f7e77a2f8173d3eaf2591 (patch)
tree210fa6cc66b84290b0e7d1cb858fe2628a5136fc
parent22b82d14d1a9e0596e9e9455fec8d6b2ef5246b2 (diff)
downloadlibxml2-ad6f10a81be19c4dca2f7e77a2f8173d3eaf2591.tar.gz
Fix Python build on Windows
Build Python bindings with -no-undefined on Windows. Remove libs that should already be set by PKG_CHECK_MODULE.
-rw-r--r--configure.ac18
-rw-r--r--python/Makefile.am4
2 files changed, 7 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac
index 2563d858..1c9da738 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/python/Makefile.am b/python/Makefile.am
index d9f909e9..778270df 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -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