- AM_CHECK_PYTHON_LIBS doesn't work for 64bit sytems (lib64)
- Python extension modules do not need to be linked against
libpython on linux anyway, but it is needed on Windows
So only run AM_CHECK_PYTHON_LIBS in configure.ac for the windows
case and make it clear in Makefile-giscanner.am linking
against libpython is a windows only thing.
https://bugzilla.gnome.org/show_bug.cgi?id=658914
$(PYTHON_INCLUDES) \
$(GOBJECT_CFLAGS) \
-I$(top_srcdir)/giscanner
$(PYTHON_INCLUDES) \
$(GOBJECT_CFLAGS) \
-I$(top_srcdir)/giscanner
-_giscanner_la_LIBADD = libgiscanner.la $(GOBJECT_LIBS) $(PYTHON_LIBS)
+_giscanner_la_LIBADD = libgiscanner.la $(GOBJECT_LIBS)
_giscanner_la_LDFLAGS = \
-module -avoid-version -export-symbols-regex init_giscanner
if OS_WIN32
_giscanner_la_LDFLAGS = \
-module -avoid-version -export-symbols-regex init_giscanner
if OS_WIN32
+# Windows requires Python extension modules to be explicitly
+# linked to libpython. Extension modules are shared libaries
+# (.dll files), but need to be called .pyd for Python to load
+# them as extension modules.
+_giscanner_la_LIBADD += \
+ $(PYTHON_LIBS)
+
_giscanner_la_LDFLAGS += \
-no-undefined \
-shrext ".pyd"
_giscanner_la_LDFLAGS += \
-no-undefined \
-shrext ".pyd"
-AM_CONDITIONAL(OS_WIN32, [test x"$os_win32" = "xyes"])
+AM_CONDITIONAL(OS_WIN32, [test "x$os_win32" = "xyes"])
# Checks for programs.
AC_PROG_CC
# Checks for programs.
AC_PROG_CC
;;
esac
AM_CHECK_PYTHON_HEADERS(, AC_MSG_ERROR([Python headers not found]))
;;
esac
AM_CHECK_PYTHON_HEADERS(, AC_MSG_ERROR([Python headers not found]))
-AM_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found]))
+if test "x$os_win32" = "xyes"; then
+ AM_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows requires Python modules to be explicitly linked to libpython.]))
+fi