summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2004-06-03 12:41:45 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2004-06-03 12:41:45 (GMT)
commit6b08a40442ca500c8e2073e012b51af66cab9c5a (patch)
tree0281a80cf4080212fbfeb8c45d3b6411798bb976 /configure.in
parentbc555e386bf666c6bf18c2b60c1471007e379d4d (diff)
downloadcpython-6b08a40442ca500c8e2073e012b51af66cab9c5a.zip
cpython-6b08a40442ca500c8e2073e012b51af66cab9c5a.tar.gz
cpython-6b08a40442ca500c8e2073e012b51af66cab9c5a.tar.bz2
Partial fix for #887242 (link extensions with dynamic_lookup in stead
of hard linking against the framework). If $MACOSX_DEPLOYMENT_TARGET is set, and >= 10.3, during configure we setup extensions to link with dynamic lookup. We also record the value in the Makefile. Distutils checks whether a value for MACOSX_DEPLOYMENT_TARGET was recorded in the Makefile, and if it was insists that the current value matches. This is only a partial fix because it only applies to 2.4, and the "two python problem" exists with Python 2.3 shipped with MacOSX 10.3, which we have no influence over.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in29
1 files changed, 28 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index 6098454..cd84ea9 100644
--- a/configure.in
+++ b/configure.in
@@ -216,6 +216,12 @@ then
fi
AC_MSG_RESULT($EXTRAPLATDIR)
+# Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
+# it may influence the way we can build extensions, so distutils
+# needs to check it
+AC_SUBST(CONFIGURE_MACOSX_DEPLOYMENT_TARGET)
+CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
+
# checks for alternative programs
# compiler flags are generated in two sets, BASECFLAGS and OPT. OPT is just
@@ -1257,7 +1263,7 @@ then
# No framework. Ignore undefined symbols, assuming they come from Python
LDSHARED="$LDSHARED -undefined suppress"
fi ;;
- Darwin/*)
+ Darwin/1.4*|Darwin/5.*|Darwin/6.*)
LDSHARED='$(CC) $(LDFLAGS) -bundle'
if test "$enable_framework" ; then
# Link against the framework. All externals should be defined.
@@ -1268,6 +1274,27 @@ then
BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
fi ;;
+ Darwin/*)
+ # Use -undefined dynamic_lookup whenever possible (10.3 and later).
+ # This allows an extension to be used in any Python
+ if test ${MACOSX_DEPLOYMENT_TARGET-10.1} '>' 10.2
+ then
+ LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
+ BLDSHARED="$LDSHARED"
+ CONFIGURE_MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET
+ else
+ LDSHARED='$(CC) $(LDFLAGS) -bundle'
+ if test "$enable_framework" ; then
+ # Link against the framework. All externals should be defined.
+ BLDSHARED="$LDSHARED "'-Wl,-F. -framework $(PYTHONFRAMEWORK)'
+ LDSHARED="$LDSHARED "'-Wl,-F$(PYTHONFRAMEWORKPREFIX) -framework $(PYTHONFRAMEWORK)'
+ else
+ # No framework, use the Python app as bundle-loader
+ BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
+ LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+ fi
+ fi
+ ;;
Linux*|GNU*) LDSHARED='$(CC) -shared';;
BSD/OS*/4*) LDSHARED="gcc -shared";;
OpenBSD*|FreeBSD*)