[Python-checkins] python/dist/src Makefile.pre.in, 1.136.6.5, 1.136.6.6 configure, 1.416.4.17, 1.416.4.18 configure.in, 1.427.4.16, 1.427.4.17

jackjansen at users.sourceforge.net jackjansen at users.sourceforge.net
Tue Jan 11 14:49:09 CET 2005


Update of /cvsroot/python/python/dist/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29714

Modified Files:
      Tag: release23-maint
	Makefile.pre.in configure configure.in 
Log Message:
Backport of fixes for #887242 and #1097739:

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, and distutils uses the same value to build extension
modules. If MACOSX_DEPLOYMENT_TARGET is not set it defaults to the
current OSX version.

If we cannot use -undefined dynamic_lookup (such as on 10.2 or earlier)
we link extensions directly against the dynamic library in the framework in
stead of against the framework. This will fix building extensions for 2.3
after 2.4 has been installed too.



Index: Makefile.pre.in
===================================================================
RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v
retrieving revision 1.136.6.5
retrieving revision 1.136.6.6
diff -u -d -r1.136.6.5 -r1.136.6.6
--- Makefile.pre.in	26 Sep 2004 17:26:16 -0000	1.136.6.5
+++ Makefile.pre.in	11 Jan 2005 13:48:52 -0000	1.136.6.6
@@ -107,6 +107,9 @@
 PYTHONFRAMEWORKDIR=	@PYTHONFRAMEWORKDIR@
 PYTHONFRAMEWORKPREFIX=	@PYTHONFRAMEWORKPREFIX@
 PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
+# Deployment target selected during configure, to be checked
+# by distutils
+CONFIGURE_MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
 # Options to enable prebinding (for fast startup)
 OTHER_LIBTOOL_OPT = -prebind -seg1addr 0x10000000
 

Index: configure
===================================================================
RCS file: /cvsroot/python/python/dist/src/configure,v
retrieving revision 1.416.4.17
retrieving revision 1.416.4.18
diff -u -d -r1.416.4.17 -r1.416.4.18
--- configure	18 Sep 2004 10:06:26 -0000	1.416.4.17
+++ configure	11 Jan 2005 13:48:52 -0000	1.416.4.18
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.427.4.15 .
+# From configure.in Revision: 1.427.4.16 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59 for python 2.3.
 #
@@ -310,7 +310,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION SOVERSION CONFIG_ARGS PYTHONFRAMEWORK PYTHONFRAMEWORKDIR PYTHONFRAMEWORKPREFIX PYTHONFRAMEWORKINSTALLDIR MACHDEP SGI_ABI EXTRAPLATDIR EXTRAMACHDEPPATH CXX MAINOBJ EXEEXT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP EGREP BUILDEXEEXT LIBRARY LDLIBRARY DLLLIBRARY BLDLIBRARY LDLIBRARYDIR INSTSONAME RUNSHARED LINKCC RANLIB ac_ct_RANLIB AR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN OPT BASECFLAGS LIBTOOL_CRUFT SO LDSHARED BLDSHARED CCSHARED LINKFORSHARED CFLAGSFORSHARED SHLIBS USE_SIGNAL_MODULE SIGNAL_OBJS USE_THREAD_MODULE LDLAST THREADOBJ DLINCLDIR DYNLOADFILE MACHDEP_OBJS TRUE LIBOBJS HAVE_GETHOSTBYNAME_R_6_ARG HAVE_GETHOSTBYNAME_R_5_ARG HAVE_GETHOSTBYNAME_R_3_ARG HAVE_GETHOSTBYNAME_R HAVE_GETHOSTBYNAME LIBM LIBC UNICODE_OBJS THREADHEADERS SRCDIRS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION SOVERSION CONFIG_ARGS PYTHONFRAMEWORK PYTHONFRAMEWORKDIR PYTHONFRAMEWORKPREFIX PYTHONFRAMEWORKINSTALLDIR MACHDEP SGI_ABI EXTRAPLATDIR EXTRAMACHDEPPATH CONFIGURE_MACOSX_DEPLOYMENT_TARGET CXX MAINOBJ EXEEXT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP EGREP BUILDEXEEXT LIBRARY LDLIBRARY DLLLIBRARY BLDLIBRARY LDLIBRARYDIR INSTSONAME RUNSHARED LINKCC RANLIB ac_ct_RANLIB AR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN OPT BASECFLAGS LIBTOOL_CRUFT SO LDSHARED BLDSHARED CCSHARED LINKFORSHARED CFLAGSFORSHARED SHLIBS USE_SIGNAL_MODULE SIGNAL_OBJS USE_THREAD_MODULE LDLAST THREADOBJ DLINCLDIR DYNLOADFILE MACHDEP_OBJS TRUE LIBOBJS HAVE_GETHOSTBYNAME_R_6_ARG HAVE_GETHOSTBYNAME_R_5_ARG HAVE_GETHOSTBYNAME_R_3_ARG HAVE_GETHOSTBYNAME_R HAVE_GETHOSTBYNAME LIBM LIBC UNICODE_OBJS THREADHEADERS SRCDIRS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -1573,6 +1573,12 @@
 echo "$as_me:$LINENO: result: $EXTRAPLATDIR" >&5
 echo "${ECHO_T}$EXTRAPLATDIR" >&6
 
+# Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
+# it may influence the way we can build extensions, so distutils
+# needs to check it
+
+CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
+
 # checks for alternative programs
 
 # compiler flags are generated in two sets, BASECFLAGS and OPT.  OPT is just
@@ -10969,21 +10975,45 @@
 		LDSHARED='$(CC) $(LDFLAGS) -bundle'
 		if test "$enable_framework" ; then
 			# Link against the framework. All externals should be defined.
-			LDSHARED="$LDSHARED "'-framework $(PYTHONFRAMEWORK)'
+			BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
+			LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
 		else
 			# 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.
-			LDSHARED="$LDSHARED "'-framework $(PYTHONFRAMEWORK)'
+			BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
+			LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(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 ;;
+	Darwin/*)
+		# Use -undefined dynamic_lookup whenever possible (10.3 and later).
+		# This allows an extension to be used in any Python
+		cur_target=`sw_vers -productVersion | sed 's/\(10\.[0-9]*\).*/\1/'`
+		CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
+		if test ${MACOSX_DEPLOYMENT_TARGET-${cur_target}} '>' 10.2
+		then
+			LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
+			BLDSHARED="$LDSHARED"
+		else
+			LDSHARED='$(CC) $(LDFLAGS) -bundle'
+			if test "$enable_framework" ; then
+				# Link against the framework. All externals should be defined.
+				BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
+				LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(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';;
 	dgux*) LDSHARED="ld -G";;
 	BSD/OS*/4*) LDSHARED="gcc -shared";;
@@ -11075,7 +11105,7 @@
 		LINKFORSHARED="$extra_undefs -framework System"
 		if test "$enable_framework"
 		then
-			LINKFORSHARED="$LINKFORSHARED -framework Python"
+			LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
 		fi
 		LINKFORSHARED="$LINKFORSHARED $extra_frameworks";;
 	OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";;
@@ -21394,6 +21424,7 @@
 s, at SGI_ABI@,$SGI_ABI,;t t
 s, at EXTRAPLATDIR@,$EXTRAPLATDIR,;t t
 s, at EXTRAMACHDEPPATH@,$EXTRAMACHDEPPATH,;t t
+s, at CONFIGURE_MACOSX_DEPLOYMENT_TARGET@,$CONFIGURE_MACOSX_DEPLOYMENT_TARGET,;t t
 s, at CXX@,$CXX,;t t
 s, at MAINOBJ@,$MAINOBJ,;t t
 s, at EXEEXT@,$EXEEXT,;t t

Index: configure.in
===================================================================
RCS file: /cvsroot/python/python/dist/src/configure.in,v
retrieving revision 1.427.4.16
retrieving revision 1.427.4.17
diff -u -d -r1.427.4.16 -r1.427.4.17
--- configure.in	18 Sep 2004 10:06:32 -0000	1.427.4.16
+++ configure.in	11 Jan 2005 13:49:00 -0000	1.427.4.17
@@ -220,6 +220,12 @@
 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
@@ -1273,21 +1279,45 @@
 		LDSHARED='$(CC) $(LDFLAGS) -bundle'
 		if test "$enable_framework" ; then
 			# Link against the framework. All externals should be defined.
-			LDSHARED="$LDSHARED "'-framework $(PYTHONFRAMEWORK)'
+			BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
+			LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
 		else
 			# 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.
-			LDSHARED="$LDSHARED "'-framework $(PYTHONFRAMEWORK)'
+			BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
+			LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(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 ;;
+	Darwin/*)
+		# Use -undefined dynamic_lookup whenever possible (10.3 and later).
+		# This allows an extension to be used in any Python
+		cur_target=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
+		CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
+		if test ${MACOSX_DEPLOYMENT_TARGET-${cur_target}} '>' 10.2
+		then
+			LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
+			BLDSHARED="$LDSHARED"
+		else
+			LDSHARED='$(CC) $(LDFLAGS) -bundle'
+			if test "$enable_framework" ; then
+				# Link against the framework. All externals should be defined.
+				BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
+				LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(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';;
 	dgux*) LDSHARED="ld -G";;
 	BSD/OS*/4*) LDSHARED="gcc -shared";;
@@ -1375,7 +1405,7 @@
 		LINKFORSHARED="$extra_undefs -framework System"
 		if test "$enable_framework"
 		then
-			LINKFORSHARED="$LINKFORSHARED -framework Python"
+			LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
 		fi
 		LINKFORSHARED="$LINKFORSHARED $extra_frameworks";;
 	OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";;



More information about the Python-checkins mailing list