[libxml2] Fix Python bindings under Windows



commit 7f40ed01f7a7c05a804664822777e42005c5f1d8
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Tue Jan 23 16:40:36 2018 +0100

    Fix Python bindings under Windows
    
    - Correct linker flags for MinGW-w64
    - Adjust PATH to find libxml2.dll when running tests

 configure.ac             | 9 ++++++++-
 python/tests/Makefile.am | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/configure.ac b/configure.ac
index ca911f34..9cae50c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1620,7 +1620,14 @@ case "$host" in
  WIN32_EXTRA_LDFLAGS="-no-undefined"
  if test "${PYTHON}" != ""
  then
-   WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython$(echo ${PYTHON_VERSION} | tr -d .)"
+   case "$host" in
+     *-w64-mingw*)
+       WIN32_EXTRA_PYTHON_LIBADD="-shrext .pyd -L${pythondir}/../../lib -lpython${PYTHON_VERSION}"
+       ;;
+     *)
+       WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython$(echo ${PYTHON_VERSION} | tr -d .)"
+       ;;
+   esac
  fi
  ;;
  *-*-cygwin*)
diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am
index 95ebead8..d44101c3 100644
--- a/python/tests/Makefile.am
+++ b/python/tests/Makefile.am
@@ -66,6 +66,7 @@ tests: $(PYTESTS)
           export PYTHONPATH; \
           LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
           export LD_LIBRARY_PATH; \
+          export PATH="$(top_builddir)/.libs:$$PATH" ; \
           for test in $(PYTESTS) ; \
           do log=`$(PYTHON) $(srcdir)/$$test` ; \
           if [ "`echo $$log | grep OK`" = "" ] ; then \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]