summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Include/pyport.h3
-rw-r--r--Makefile.pre.in12
-rwxr-xr-xconfigure14
-rw-r--r--configure.in12
4 files changed, 35 insertions, 6 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index c358cc2..06ce6ab 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -421,7 +421,8 @@ extern double hypot(double, double);
# define HAVE_DECLSPEC_DLL
#endif
-#if defined(Py_ENABLE_SHARED) /* only get special linkage if built as shared */
+/* only get special linkage if built as shared or platform is Cygwin */
+#if defined(Py_ENABLE_SHARED) || defined(__CYGWIN__)
# if defined(HAVE_DECLSPEC_DLL)
# ifdef Py_BUILD_CORE
# define PyAPI_FUNC(RTYPE) __declspec(dllexport) RTYPE
diff --git a/Makefile.pre.in b/Makefile.pre.in
index a91e36c..82073fe 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -379,10 +379,14 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
$(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
$(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
-# This rule builds the Cygwin Python DLL
-libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
- $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
- $(LIBS) $(MODLIBS) $(SYSLIBS)
+# This rule builds the Cygwin Python DLL and import library if configured
+# for a shared core library; otherwise, this rule is a noop.
+$(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
+ if test -n "$(DLLLIBRARY)"; then \
+ $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
+ $(LIBS) $(MODLIBS) $(SYSLIBS); \
+ else true; \
+ fi
oldsharedmods: $(SHAREDMODS)
diff --git a/configure b/configure
index 795d5cd..0f74a29 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.in Revision: 1.428 .
+# From configure.in Revision: 1.429 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.57 for python 2.4.
#
@@ -3619,6 +3619,13 @@ _ACEOF
BASECFLAGS="$BASECFLAGS -pic"
;;
esac
+else # shared is disabled
+ case $ac_sys_system in
+ CYGWIN*)
+ BLDLIBRARY='$(LIBRARY)'
+ LDLIBRARY='libpython$(VERSION).dll.a'
+ ;;
+ esac
fi
echo "$as_me:$LINENO: result: $LDLIBRARY" >&5
@@ -10192,6 +10199,11 @@ then
LINKFORSHARED="-Xlinker --export-dynamic"
fi;;
esac;;
+ CYGWIN*)
+ if test $enable_shared = "no"
+ then
+ LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
+ fi;;
esac
fi
echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5
diff --git a/configure.in b/configure.in
index 00483ed..44da831 100644
--- a/configure.in
+++ b/configure.in
@@ -539,6 +539,13 @@ if test $enable_shared = "yes"; then
BASECFLAGS="$BASECFLAGS -pic"
;;
esac
+else # shared is disabled
+ case $ac_sys_system in
+ CYGWIN*)
+ BLDLIBRARY='$(LIBRARY)'
+ LDLIBRARY='libpython$(VERSION).dll.a'
+ ;;
+ esac
fi
AC_MSG_RESULT($LDLIBRARY)
@@ -1371,6 +1378,11 @@ then
LINKFORSHARED="-Xlinker --export-dynamic"
fi;;
esac;;
+ CYGWIN*)
+ if test $enable_shared = "no"
+ then
+ LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
+ fi;;
esac
fi
AC_MSG_RESULT($LINKFORSHARED)