mirror of
https://github.com/boostorg/build.git
synced 2026-02-15 13:02:11 +00:00
Attempt to simulate the actions that Python itself uses for building extensions.
* darwin-tools.jam; Added <link-format> 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]
This commit is contained in:
@@ -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 <shared-linkable>true : -fPIC ;
|
||||
flags darwin CFLAGS <warnings>on : -Wall ;
|
||||
flags darwin CFLAGS <warnings>off : -w ;
|
||||
|
||||
flags darwin LINK_FORMAT <target-type>$(SHARED_TYPES)/<link-format>bundle : bundle ;
|
||||
flags darwin LINK_FORMAT <target-type>$(SHARED_TYPES)/<link-format>dynamic : dynamic ;
|
||||
if $(BUNDLE_LOADER)
|
||||
{
|
||||
flags darwin LINK_FORMAT <target-type>$(SHARED_TYPES) : bundle ;
|
||||
}
|
||||
|
||||
if $(LINK_FORMAT) = bundle
|
||||
{
|
||||
flags darwin LINKFLAGS <target-type>$(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 $(<) =
|
||||
|
||||
@@ -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 ?=
|
||||
<sysinclude>$(PYTHON_INCLUDES)
|
||||
@@ -201,12 +207,9 @@ rule select-python-library ( toolset variant : properties * )
|
||||
{
|
||||
if <target-type>PYD in $(properties)
|
||||
{
|
||||
properties += <bundle-loader>$(PYTHON_ROOT)/Python ;
|
||||
}
|
||||
else
|
||||
{
|
||||
properties += <framework>$(PYTHON_ROOT)/Python ;
|
||||
properties = [ replace $(properties) : <link-format>default <link-format>bundle ] ;
|
||||
}
|
||||
properties += <framework>$(PYTHON_FRAMEWORK) ;
|
||||
}
|
||||
return $(properties) ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user