From 0f07115f1ad6b0cbb49b85a5de98caeeba0ea724 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 4 Nov 2003 08:15:59 +0000 Subject: [PATCH] Attempt to simulate the actions that Python itself uses for building extensions. * darwin-tools.jam; Added to specify the type of linking to do. * python.jam; Adjust framework specification so that the added search path is correct. * python.jam; Change selection of library when building on MacOSX to always use the framework. * python.jam; Change adjustment of properties so that it builds Python extensions with link-format = bundle. [SVN r20633] --- v1/darwin-tools.jam | 12 +++++++++++- v1/python.jam | 13 ++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/v1/darwin-tools.jam b/v1/darwin-tools.jam index 0b66eb388..59fd1ce00 100644 --- a/v1/darwin-tools.jam +++ b/v1/darwin-tools.jam @@ -16,6 +16,9 @@ free-feature bundle-loader ; # Controll generation of compiler warnings. feature warnings : on off ; +# Type of shared object to create. +feature link-format : default dynamic bundle ; + # compute directories for invoking GCC # # The gcc toolset can be user-configured using the following @@ -119,7 +122,14 @@ flags darwin CFLAGS true : -fPIC ; flags darwin CFLAGS on : -Wall ; flags darwin CFLAGS off : -w ; +flags darwin LINK_FORMAT $(SHARED_TYPES)/bundle : bundle ; +flags darwin LINK_FORMAT $(SHARED_TYPES)/dynamic : dynamic ; if $(BUNDLE_LOADER) +{ + flags darwin LINK_FORMAT $(SHARED_TYPES) : bundle ; +} + +if $(LINK_FORMAT) = bundle { flags darwin LINKFLAGS $(SHARED_TYPES) : -bundle ; @@ -137,7 +147,7 @@ rule Link-action { _ on $(<) = " " ; DEPENDS $(<) : $(NEEDLIBS) $(NEEDIMPS) ; - if $(DLLVERSION) && $(TARGET_TYPE) in $(SHARED_TYPES) && ! $(BUNDLE_LOADER) + if $(DLLVERSION) && $(TARGET_TYPE) in $(SHARED_TYPES) && $(LINK_FORMAT) != bundle { DLLFLAGS on $(<) = ; #~ DLLFLAGS on $(<) = diff --git a/v1/python.jam b/v1/python.jam index 3947838e8..f4cbb1eb3 100644 --- a/v1/python.jam +++ b/v1/python.jam @@ -94,6 +94,12 @@ else if $(UNIX) && $(OS) = MACOSX } PYTHON_ROOT = $(PYTHON_ROOT:J=" ") ; PYTHON_INCLUDES ?= $(PYTHON_ROOT)/include/python$(PYTHON_VERSION) ; + PYTHON_FRAMEWORK ?= $(PYTHON_ROOT) ; + while $(PYTHON_FRAMEWORK:D=) != Python.framework + { + PYTHON_FRAMEWORK = $(PYTHON_FRAMEWORK:D) ; + } + PYTHON_FRAMEWORK = $(PYTHON_FRAMEWORK:D)/Python ; PYTHON_PROPERTIES ?= $(PYTHON_INCLUDES) @@ -201,12 +207,9 @@ rule select-python-library ( toolset variant : properties * ) { if PYD in $(properties) { - properties += $(PYTHON_ROOT)/Python ; - } - else - { - properties += $(PYTHON_ROOT)/Python ; + properties = [ replace $(properties) : default bundle ] ; } + properties += $(PYTHON_FRAMEWORK) ; } return $(properties) ; }