From 5558ee11313fd929ed6aeb22228e89de2263e520 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 4 Jul 2012 12:17:10 +0100 Subject: Link Python extensions differently on Windows --- _dbus_bindings/Makefile.am | 14 ++++++++++++++ _dbus_glib_bindings/Makefile.am | 14 ++++++++++++++ configure.ac | 13 +++++++++++++ 3 files changed, 41 insertions(+) diff --git a/_dbus_bindings/Makefile.am b/_dbus_bindings/Makefile.am index e0fb889..42c9f91 100644 --- a/_dbus_bindings/Makefile.am +++ b/_dbus_bindings/Makefile.am @@ -7,6 +7,20 @@ AM_LDFLAGS = -module -avoid-version \ libadd = $(DBUS_LIBS) +if WINDOWS +# Win32 DLLs can't have undefined symbols (so this needs explicit linking +# against the Python DLL), and Python expects extensions to be *.pyd +# instead of *.dll +AM_LDFLAGS += \ + -no-undefined \ + -shrext ".pyd" \ + $(NULL) + +libadd += \ + $(PYTHON_LIBS) \ + $(NULL) +endif + _dbus_bindings_la_LIBADD = $(libadd) _dbus_bindings_la_SOURCES = \ abstract.c \ diff --git a/_dbus_glib_bindings/Makefile.am b/_dbus_glib_bindings/Makefile.am index 48af169..ead49da 100644 --- a/_dbus_glib_bindings/Makefile.am +++ b/_dbus_glib_bindings/Makefile.am @@ -11,5 +11,19 @@ libadd = \ $(DBUS_GLIB_LIBS) \ $(NULL) +if WINDOWS +# Win32 DLLs can't have undefined symbols (so this needs explicit linking +# against the Python DLL), and Python expects extensions to be *.pyd +# instead of *.dll +AM_LDFLAGS += \ + -no-undefined \ + -shrext ".pyd" \ + $(NULL) + +libadd += \ + $(PYTHON_LIBS) \ + $(NULL) +endif + _dbus_glib_bindings_la_LIBADD = $(libadd) _dbus_glib_bindings_la_SOURCES = module.c diff --git a/configure.ac b/configure.ac index 4c7c728..73bd3fa 100644 --- a/configure.ac +++ b/configure.ac @@ -36,6 +36,19 @@ AM_INIT_AUTOMAKE([1.9 -Wno-portability]) AC_CANONICAL_BUILD AC_CANONICAL_HOST +# mingw32, mingw-w64 are native Windows; for our purposes, Cygwin isn't +AC_MSG_CHECKING([for native Windows host]) +case "$host" in + (*-*-mingw*) + windows=yes + ;; + (*) + windows=no + ;; +esac +AC_MSG_RESULT([$windows]) +AM_CONDITIONAL([WINDOWS], [test "x$windows" = xyes]) + AC_DISABLE_STATIC dnl XXXX hack to kill off all the libtool tags ... -- cgit v1.2.1