[pygobject] testhelper: only link against libpython on Windows
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] testhelper: only link against libpython on Windows
- Date: Thu, 23 Mar 2017 23:07:43 +0000 (UTC)
commit b0476e2db4577e12b52caa3163ccb69575221d6c
Author: Christoph Reiter <creiter src gnome org>
Date: Thu Mar 23 22:32:23 2017 +0100
testhelper: only link against libpython on Windows
https://bugzilla.gnome.org/show_bug.cgi?id=773803
configure.ac | 6 +++---
tests/Makefile.am | 11 ++++++++++-
2 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index a28f75e..b8a811e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,7 +48,7 @@ AM_INIT_AUTOMAKE([1.13 foreign no-dist-gzip dist-xz])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
-AC_MSG_CHECKING([for build time linking with Python (Darwin and Win32)])
+AC_MSG_CHECKING([for build time linking with Python (Win32)])
case "$host" in
*-*-mingw*|*-*-cygwin*)
os_win32=yes
@@ -57,7 +57,7 @@ case "$host" in
;;
*-*-darwin*)
os_win32=no
- link_python_libs=yes
+ link_python_libs=no
OS_EXT=dylib
;;
*)
@@ -116,7 +116,7 @@ AC_SUBST(PYTHON_SO)
PYG_CHECK_PYTHON_HEADERS(, AC_MSG_ERROR([Python headers not found]))
if test "x$link_python_libs" = "xyes"; then
- PYG_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows and Darwin require Python modules to
be explicitly linked to libpython.]))
+ PYG_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows requires Python modules to be
explicitly linked to libpython.]))
fi
AC_MSG_CHECKING([for PySignal_SetWakeupFd in Python.h])
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e7bcfb6..937650e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -2,12 +2,21 @@ CLEANFILES =
test_ltlibraries = libgimarshallingtests.la
test_typelibs = GIMarshallingTests-1.0.typelib
extension_ltlibraries =
+extension_libadd =
common_ldflags = \
-avoid-version \
-rpath $(abs_builddir) \
-shared
+if OS_WIN32
+extension_libadd += \
+ $(PYTHON_LIBS)
+
+common_ldflags += \
+ -no-undefined
+endif
+
# Note for Python extensions we need to use .so on Mac OSX, not .dylib
extension_ldflags = \
$(common_ldflags) \
@@ -76,7 +85,7 @@ extension_ltlibraries += testhelper.la
testhelper_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(WARN_CFLAGS) -I$(top_srcdir)/gi $(PYTHON_INCLUDES)
$(GLIB_CFLAGS)
testhelper_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS)
testhelper_la_LDFLAGS = $(WARN_LDFLAGS) $(extension_ldflags)
-testhelper_la_LIBADD = $(CODE_COVERAGE_LIBS) $(GLIB_LIBS) $(PYTHON_LIBS)
+testhelper_la_LIBADD = $(CODE_COVERAGE_LIBS) $(GLIB_LIBS) $(extension_libadd)
testhelper_la_SOURCES = \
testhelpermodule.c \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]