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