mirror of
https://github.com/boostorg/build.git
synced 2026-02-15 00:52:16 +00:00
tools/build/boost-base.jam
* Handle different spellings of the PATH environment variable for Windows
* Ungristed elements of a target's requirements are now treated as
rules which transform the target's property set. The rules must have
the following signature:
transform-properties ( toolset variant : properties * )
and should return the new property set.
* Added target name adjustment feature for Python debugging targets.
tools/build/borland-tools.jam
tools/build/gcc-tools.jam
tools/build/intel-linux.jam
tools/build/metrowerks-tools.jam
tools/build/msvc-tools.jam
tools/build/mingw-tools.jam
* Adjustments to better support Python targets
tools/build/python.jam
* Lots of adjustments for building / testing Python targets:
PYTHON_LAUNCH variable prefixes Python executable name
-- can be used to invoke debugger.
PYTHON_ARGS variable postfixes Python executable name
CYGWIN_ROOT variable can be used to specify root of cygwin installation
[SVN r12071]
This commit is contained in:
@@ -100,7 +100,7 @@ rule executable-file
|
||||
main-from-objects $(<) : [ Objects $(>) ] : EXE ;
|
||||
}
|
||||
|
||||
rule dll-files
|
||||
rule dll-files ( module implib ? : sources * : target-type ? )
|
||||
{
|
||||
type-DEPENDS dll : $(<) ;
|
||||
|
||||
@@ -110,7 +110,8 @@ rule dll-files
|
||||
INCLUDES $(<[1]) : $(<[2-]) ;
|
||||
INCLUDES $(<[2-]) : $(<[1]) ;
|
||||
}
|
||||
main-from-objects $(<) : [ Objects $(>) ] : DLL ;
|
||||
target-type ?= DLL ;
|
||||
main-from-objects $(<) : [ Objects $(>) ] : $(target-type) ;
|
||||
}
|
||||
|
||||
# main-from-objects exe-target : obj-target... : ("EXE"|"DLL")
|
||||
@@ -156,6 +157,14 @@ rule Link-DLL
|
||||
# This also allows the user to customize the base path for running built
|
||||
# products from the command-line
|
||||
RUN_PATH ?= $(PATH) ;
|
||||
if $(NT)
|
||||
{
|
||||
# Try some other likely spellings
|
||||
RUN_PATH ?= $(Path) ;
|
||||
RUN_PATH ?= $(path) ;
|
||||
}
|
||||
# Now set this, just in case someone tries to use it.
|
||||
PATH = $(RUN_PATH) ;
|
||||
|
||||
# A simple action to run an executable target
|
||||
actions Run
|
||||
@@ -1071,10 +1080,10 @@ rule is-link-compatible
|
||||
}
|
||||
|
||||
# find-compatible-subvariant main-target : toolset variant : dependent-simple-properties
|
||||
rule find-compatible-subvariant
|
||||
rule find-compatible-subvariant ( main-target : toolset variant : dependent-simple-properties * )
|
||||
{
|
||||
local requirements = [ select-properties $(>)
|
||||
: $(gTARGET_REQUIREMENTS($(<))) ] ;
|
||||
local requirements = [ select-properties $(toolset) $(variant)
|
||||
: $(gTARGET_REQUIREMENTS($(main-target))) ] ;
|
||||
|
||||
local free-properties = [ segregate-free-properties requirements ] ;
|
||||
|
||||
@@ -1083,7 +1092,7 @@ rule find-compatible-subvariant
|
||||
|
||||
# add properties from build-request, checking for compatibility
|
||||
local p ;
|
||||
for p in [ difference $(3) : $(requirements) ]
|
||||
for p in [ difference $(dependent-simple-properties) : $(requirements) ]
|
||||
{
|
||||
local f = $(p:G) ;
|
||||
if $(f) in $(requirements:G)
|
||||
@@ -1093,7 +1102,7 @@ rule find-compatible-subvariant
|
||||
|
||||
if ! [ is-link-compatible $(f) : $(required-value) : $(p:G=) ]
|
||||
{
|
||||
EXIT $(<): required property $(f)$(required-value)
|
||||
EXIT $(main-target): required property $(f)$(required-value)
|
||||
incompatible with requested $(p) ;
|
||||
}
|
||||
}
|
||||
@@ -1103,17 +1112,25 @@ rule find-compatible-subvariant
|
||||
}
|
||||
}
|
||||
|
||||
local base-properties = $(gBASE_PROPERTIES($(>[1]),$(>[2]))) ;
|
||||
local base-properties = $(gBASE_PROPERTIES($(toolset),$(variant))) ;
|
||||
segregate-overrides override-properties : base-properties ;
|
||||
|
||||
local all-properties = $(base-properties) $(free-properties) ;
|
||||
|
||||
local rules = [ select-ungristed $(gTARGET_REQUIREMENTS($(<))) ] ;
|
||||
for local r in $(rules)
|
||||
{
|
||||
all-properties = [ $(r) $(toolset) $(variant) : $(all-properties) ] ;
|
||||
}
|
||||
|
||||
# build the path identifying the subvariant
|
||||
local subvariant-id
|
||||
= [ join $(>) # toolset variant
|
||||
= [ join $(toolset) $(variant)
|
||||
[ ungrist-properties [ sort $(override-properties) ] ]
|
||||
: $(SLASH) ] ;
|
||||
|
||||
return $(subvariant-id)
|
||||
[ fixup-path-properties $(base-properties) $(free-properties) ]
|
||||
[ fixup-path-properties $(all-properties) ]
|
||||
$(override-properties) ;
|
||||
}
|
||||
|
||||
@@ -1226,7 +1243,7 @@ rule depend-on-libraries
|
||||
# To run these targets, we need everything needed to run the libraries
|
||||
for local dir in $(gRUN_PATH($(>)))
|
||||
{
|
||||
if ! $(dir) in $(gRUN_PATH($(<)))
|
||||
if ! ( $(dir) in $(gRUN_PATH($(<))) )
|
||||
{
|
||||
gRUN_PATH($(<)) += $(dir) ;
|
||||
}
|
||||
@@ -1267,6 +1284,10 @@ rule subvariant-target
|
||||
= [ join-path $(LOCATE_TARGET) $(BIN_DIRECTORY) $(<:G=) $(>[1]) ] ;
|
||||
|
||||
local target-files = [ FAppendSuffix $(subvariant) : $(SUF$(target-type)) ] ;
|
||||
if $(gNAME_ADJUST($(target-type)))
|
||||
{
|
||||
target-files = [ $(gNAME_ADJUST($(target-type))) $(target-files) : $(2) : $(3) ] ;
|
||||
}
|
||||
|
||||
gTARGET_FILES($(subvariant)) = $(target-files) ;
|
||||
gTARGET_FILES($(<)) += $(target-files) ;
|
||||
@@ -1360,6 +1381,8 @@ rule main-target
|
||||
}
|
||||
}
|
||||
|
||||
SHARED_TYPES = DLL ;
|
||||
|
||||
gGENERATOR_FUNCTION(EXE) = executable-file ;
|
||||
# exe target : sources : requirements : local-build
|
||||
#
|
||||
|
||||
@@ -33,12 +33,12 @@ flags borland CFLAGS <inlining>full : -vi -w-inl ;
|
||||
local flag-vars = USER-INTERFACE TARGET-TYPE THREADING RUNTIME-LINK ;
|
||||
local $(flag-vars) ;
|
||||
|
||||
if [ get-values <target-type> : $(gBUILD_PROPERTIES) ] != DLL
|
||||
if ! [ get-values <target-type> : $(gBUILD_PROPERTIES) ] in $(SHARED_TYPES)
|
||||
{
|
||||
flags borland USER-INTERFACE <user-interface>console : -tWC ;
|
||||
}
|
||||
|
||||
flags borland TARGET-TYPE <target-type>DLL : -tWD ;
|
||||
flags borland TARGET-TYPE <target-type>$(SHARED_TYPES) : -tWD ;
|
||||
flags borland THREADING <threading>multi : -tWM ;
|
||||
flags borland RUNTIME-LINK <runtime-link>dynamic : -tWR ;
|
||||
|
||||
@@ -78,7 +78,7 @@ rule Link-action
|
||||
|
||||
with-command-file borland-Link-action $(<) : $(>) $(NEEDLIBS) ;
|
||||
|
||||
if $(3) = DLL
|
||||
if $(3) in $(SHARED_TYPES)
|
||||
{
|
||||
borland-IMPLIB-action $(<) : $(>) ;
|
||||
}
|
||||
|
||||
@@ -52,11 +52,11 @@ if ! $(NT) # The compiler complains about -fPIC on NT
|
||||
|
||||
if $(BETOOLS)
|
||||
{
|
||||
flags gcc LINKFLAGS <target-type>DLL : -nostart ;
|
||||
flags gcc LINKFLAGS <target-type>DLL <target-type>PYD : -nostart ;
|
||||
}
|
||||
else
|
||||
{
|
||||
flags gcc LINKFLAGS <target-type>DLL : -shared ;
|
||||
flags gcc LINKFLAGS <target-type>DLL <target-type>PYD : -shared ;
|
||||
}
|
||||
|
||||
flags gcc LIBPATH <library-path> ;
|
||||
|
||||
@@ -43,7 +43,7 @@ flags intel-linux CFLAGS <shared-linkable>true : -KPIC ;
|
||||
flags intel-linux LINKFLAGS <shared-linkable>true : -KPIC ;
|
||||
|
||||
# dynamic link library
|
||||
flags intel-linux LINKFLAGS <target-type>DLL : -shared ;
|
||||
flags intel-linux LINKFLAGS <target-type>$(SHARED_TYPES) : -shared ;
|
||||
|
||||
# library linking
|
||||
flags intel-linux LINKFLAGS <runtime-link>static : -static ;
|
||||
|
||||
@@ -28,7 +28,7 @@ flags metrowerks HDRS <include> ;
|
||||
flags metrowerks CFLAGS <debug-symbols>on : -g ;
|
||||
flags metrowerks LINKFLAGS <debug-symbols>on : -g ;
|
||||
|
||||
flags metrowerks LINKFLAGS <target-type>DLL : -shared ;
|
||||
flags metrowerks LINKFLAGS <target-type>$(SHARED_TYPES) : -shared ;
|
||||
flags metrowerks CFLAGS <optimization>off : -O0 ;
|
||||
flags metrowerks CFLAGS <optimization>speed : -opt full ;
|
||||
flags metrowerks CFLAGS <optimization>space : -O4,s intrinsics ;
|
||||
@@ -75,7 +75,8 @@ rule Link-action
|
||||
gRUN_PATH($(<)) += $(METROWERKS_ROOT)"\\Win32-X86 Support\\Libraries\\Runtime" ;
|
||||
IMPLIB_COMMAND on $(<) = "-implib " ; # will be "multiplied away" if not
|
||||
# needed.
|
||||
with-command-file metrowerks-Link-action $(<) : $(>) $(NEEDLIBS) ;
|
||||
with-command-file metrowerks-Link-action $(<) : $(>) $(NEEDLIBS) # $(NEEDLIBS)
|
||||
;
|
||||
}
|
||||
|
||||
# Here we set the environment variable MWWinx86LibraryFiles (customize for other
|
||||
|
||||
@@ -57,7 +57,7 @@ flags msvc STDLIBPATH : $(MSVCDir)$(SLASH)lib ;
|
||||
flags msvc LIBPATH <library-path> ;
|
||||
flags msvc NEEDLIBS <library-file> ;
|
||||
flags msvc FINDLIBS <find-library> ;
|
||||
flags msvc LINKFLAGS <target-type>DLL : /DLL ;
|
||||
flags msvc LINKFLAGS <target-type>$(SHARED_TYPES) : /DLL ;
|
||||
|
||||
#### Link ####
|
||||
|
||||
|
||||
80
python.jam
80
python.jam
@@ -18,6 +18,8 @@ PYTHON_VERSION_NODOT
|
||||
= [ SUBST $(PYTHON_VERSION) ([0-9]*)\.([0-9]*) $1$2 ]
|
||||
;
|
||||
|
||||
local RUN_PATH = $(RUN_PATH) ;
|
||||
|
||||
if $(NT)
|
||||
{
|
||||
PYTHON_ROOT ?= c:/tools/python ;
|
||||
@@ -57,11 +59,11 @@ else if $(UNIX)
|
||||
|
||||
# Locate the python executable
|
||||
PYTHON ?= <executable@>python$(SUFEXE) ;
|
||||
SEARCH on $(PYTHON) = $(PATH) ;
|
||||
SEARCH on $(PYTHON) = $(RUN_PATH) ;
|
||||
|
||||
# And the debugging version
|
||||
PYTHON_D ?= $(PYTHON:S=)_d$(PYTHON:S) ;
|
||||
SEARCH on $(PYTHON_D) = $(PATH) ;
|
||||
SEARCH on $(PYTHON_D) = $(RUN_PATH) ;
|
||||
|
||||
# select-python-library
|
||||
#
|
||||
@@ -99,7 +101,8 @@ PYTHON_PROPERTIES
|
||||
+=
|
||||
<gcc><*><find-library>python$(PYTHON_VERSION).dll
|
||||
<gcc><*><library-path>/usr/local/lib/python$(PYTHON_VERSION)/config
|
||||
<gcc><*><include>/usr/include/python$(PYTHON_VERSION)
|
||||
<gcc><*><include>/usr/local/include/python$(PYTHON_VERSION)
|
||||
<gcc><*><include>/usr/include/python$(PYTHON_VERSION)
|
||||
<include>$(BOOST_ROOT)
|
||||
select-python-library
|
||||
# These two compilers pick up implicit directions from #pragmas
|
||||
@@ -130,46 +133,55 @@ rule python-files ( module implib ? : sources * )
|
||||
{
|
||||
local actual-module = $(module) ;
|
||||
|
||||
if <define>BOOST_DEBUG_PYTHON in $(gBUILD_PROPERTIES)
|
||||
{
|
||||
# build the actual module name
|
||||
actual-module = $(module:S=)_d$(module:S) ;
|
||||
|
||||
# be sure not to create a dependency loop
|
||||
if $(actual-module) != $(module)
|
||||
{
|
||||
# now the original module name is just a fake target
|
||||
NOTFILE $(module) ;
|
||||
DEPENDS $(module) : $(actual-module) ;
|
||||
set-target-variables $(actual-module) ;
|
||||
}
|
||||
}
|
||||
|
||||
dll-files $(actual-module) $(implib) : $(sources) ;
|
||||
dll-files $(actual-module) $(implib) : $(sources) : PYD ;
|
||||
|
||||
if $(NT) && ( $(gCURRENT_TOOLSET) = gcc )
|
||||
{
|
||||
add-cygwin-python-run-path $(<[-1]) ;
|
||||
}
|
||||
|
||||
gRUN_PATH($(module:S=)) = $(gRUN_PATH($(module))) ;
|
||||
}
|
||||
|
||||
if $(NT)
|
||||
{
|
||||
# Adjust the name of Python modules so that they have the _d
|
||||
# suffix when compiled with python debugging enabled.
|
||||
gNAME_ADJUST(PYD) = name-adjust-PYD ;
|
||||
|
||||
rule name-adjust-PYD ( pyd implib ? : properties * : toolset variant )
|
||||
{
|
||||
if <define>BOOST_DEBUG_PYTHON in $(properties)
|
||||
{
|
||||
pyd = $(pyd:S=)_d$(pyd:S) ;
|
||||
}
|
||||
return $(pyd) $(implib) ;
|
||||
}
|
||||
}
|
||||
|
||||
rule Link-PYD
|
||||
{
|
||||
if $(<[2])
|
||||
{
|
||||
MODE on $(<[2]) = $(IMPMODE) ;
|
||||
Chmod $(<[2]) ;
|
||||
}
|
||||
|
||||
gRUN_PATH($(<)) += $(gLOCATE($(<[1]))) ;
|
||||
Link-action $(<) : $(>) : PYD ;
|
||||
}
|
||||
|
||||
declare-target-type PYD : <shared-linkable>true ;
|
||||
gGENERATOR_FUNCTION(PYD) = python-files ;
|
||||
SUFPYD = .pyd $(SUFDLL[2-]) ;
|
||||
PYDMODE = $(DLLMODE) ;
|
||||
SHARED_TYPES += PYD ;
|
||||
|
||||
# Declare a python extension.
|
||||
rule extension ( name : sources + : requirements * : default-BUILD * )
|
||||
{
|
||||
requirements += $(PYTHON_PROPERTIES) ;
|
||||
|
||||
# Temporarily hijack the generator function for DLLs to handle
|
||||
# some python extension-specific things.
|
||||
local gGENERATOR_FUNCTION(DLL) = python-files ;
|
||||
local SUFDLL = .pyd $(SUFDLL[2-]) ;
|
||||
|
||||
dll $(name) :
|
||||
$(sources)
|
||||
: $(requirements)
|
||||
: $(default-BUILD)
|
||||
;
|
||||
|
||||
declare-local-target $(name) : $(sources) : $(requirements) : $(default-BUILD) : PYD ;
|
||||
}
|
||||
|
||||
# boost-python-runtest target : python-script sources : requirements : local-build : args
|
||||
@@ -219,7 +231,7 @@ actions python-test-target bind PYTHON
|
||||
$(SHELL_EXPORT)PATH
|
||||
$(SHELL_SET)PYTHONPATH=$(PYTHONPATH)
|
||||
$(SHELL_EXPORT)PYTHONPATH
|
||||
$(PYTHON) "$(>)" $(ARGS) > "$(<)"
|
||||
$(PYTHON_LAUNCH) $(PYTHON) $(PYTHON_ARGS) "$(>)" $(ARGS) > "$(<)"
|
||||
}
|
||||
|
||||
SUFPYTHON_RUNTEST = .run ;
|
||||
@@ -236,7 +248,7 @@ actions python-runtest-target bind PYTHON
|
||||
$(SHELL_EXPORT)PATH
|
||||
$(SHELL_SET)PYTHONPATH=$(PYTHONPATH)
|
||||
$(SHELL_EXPORT)PYTHONPATH
|
||||
$(PYTHON) "$(>)" $(ARGS)
|
||||
$(PYTHON_LAUNCH) $(PYTHON) $(PYTHON_ARGS) "$(>)" $(ARGS)
|
||||
}
|
||||
|
||||
# This is the rule that actually causes the test to run. It is used by
|
||||
@@ -262,7 +274,7 @@ rule python-runtest-aux ( target : sources + )
|
||||
if $(NT) && ( $(gCURRENT_TOOLSET) = gcc )
|
||||
{
|
||||
python = python$(PYTHON_VERSION)$(SUFEXE) ;
|
||||
SEARCH on $(python) = $(CYGWIN_ROOT)/usr/local/bin ;
|
||||
SEARCH on $(python) = $(RUN_PATH) $(CYGWIN_ROOT)/usr/local/bin ;
|
||||
# Fix up path splitter for cygwin.
|
||||
splitpath = ":" ;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ rule executable-file
|
||||
main-from-objects $(<) : [ Objects $(>) ] : EXE ;
|
||||
}
|
||||
|
||||
rule dll-files
|
||||
rule dll-files ( module implib ? : sources * : target-type ? )
|
||||
{
|
||||
type-DEPENDS dll : $(<) ;
|
||||
|
||||
@@ -110,7 +110,8 @@ rule dll-files
|
||||
INCLUDES $(<[1]) : $(<[2-]) ;
|
||||
INCLUDES $(<[2-]) : $(<[1]) ;
|
||||
}
|
||||
main-from-objects $(<) : [ Objects $(>) ] : DLL ;
|
||||
target-type ?= DLL ;
|
||||
main-from-objects $(<) : [ Objects $(>) ] : $(target-type) ;
|
||||
}
|
||||
|
||||
# main-from-objects exe-target : obj-target... : ("EXE"|"DLL")
|
||||
@@ -156,6 +157,14 @@ rule Link-DLL
|
||||
# This also allows the user to customize the base path for running built
|
||||
# products from the command-line
|
||||
RUN_PATH ?= $(PATH) ;
|
||||
if $(NT)
|
||||
{
|
||||
# Try some other likely spellings
|
||||
RUN_PATH ?= $(Path) ;
|
||||
RUN_PATH ?= $(path) ;
|
||||
}
|
||||
# Now set this, just in case someone tries to use it.
|
||||
PATH = $(RUN_PATH) ;
|
||||
|
||||
# A simple action to run an executable target
|
||||
actions Run
|
||||
@@ -1071,10 +1080,10 @@ rule is-link-compatible
|
||||
}
|
||||
|
||||
# find-compatible-subvariant main-target : toolset variant : dependent-simple-properties
|
||||
rule find-compatible-subvariant
|
||||
rule find-compatible-subvariant ( main-target : toolset variant : dependent-simple-properties * )
|
||||
{
|
||||
local requirements = [ select-properties $(>)
|
||||
: $(gTARGET_REQUIREMENTS($(<))) ] ;
|
||||
local requirements = [ select-properties $(toolset) $(variant)
|
||||
: $(gTARGET_REQUIREMENTS($(main-target))) ] ;
|
||||
|
||||
local free-properties = [ segregate-free-properties requirements ] ;
|
||||
|
||||
@@ -1083,7 +1092,7 @@ rule find-compatible-subvariant
|
||||
|
||||
# add properties from build-request, checking for compatibility
|
||||
local p ;
|
||||
for p in [ difference $(3) : $(requirements) ]
|
||||
for p in [ difference $(dependent-simple-properties) : $(requirements) ]
|
||||
{
|
||||
local f = $(p:G) ;
|
||||
if $(f) in $(requirements:G)
|
||||
@@ -1093,7 +1102,7 @@ rule find-compatible-subvariant
|
||||
|
||||
if ! [ is-link-compatible $(f) : $(required-value) : $(p:G=) ]
|
||||
{
|
||||
EXIT $(<): required property $(f)$(required-value)
|
||||
EXIT $(main-target): required property $(f)$(required-value)
|
||||
incompatible with requested $(p) ;
|
||||
}
|
||||
}
|
||||
@@ -1103,17 +1112,25 @@ rule find-compatible-subvariant
|
||||
}
|
||||
}
|
||||
|
||||
local base-properties = $(gBASE_PROPERTIES($(>[1]),$(>[2]))) ;
|
||||
local base-properties = $(gBASE_PROPERTIES($(toolset),$(variant))) ;
|
||||
segregate-overrides override-properties : base-properties ;
|
||||
|
||||
local all-properties = $(base-properties) $(free-properties) ;
|
||||
|
||||
local rules = [ select-ungristed $(gTARGET_REQUIREMENTS($(<))) ] ;
|
||||
for local r in $(rules)
|
||||
{
|
||||
all-properties = [ $(r) $(toolset) $(variant) : $(all-properties) ] ;
|
||||
}
|
||||
|
||||
# build the path identifying the subvariant
|
||||
local subvariant-id
|
||||
= [ join $(>) # toolset variant
|
||||
= [ join $(toolset) $(variant)
|
||||
[ ungrist-properties [ sort $(override-properties) ] ]
|
||||
: $(SLASH) ] ;
|
||||
|
||||
return $(subvariant-id)
|
||||
[ fixup-path-properties $(base-properties) $(free-properties) ]
|
||||
[ fixup-path-properties $(all-properties) ]
|
||||
$(override-properties) ;
|
||||
}
|
||||
|
||||
@@ -1226,7 +1243,7 @@ rule depend-on-libraries
|
||||
# To run these targets, we need everything needed to run the libraries
|
||||
for local dir in $(gRUN_PATH($(>)))
|
||||
{
|
||||
if ! $(dir) in $(gRUN_PATH($(<)))
|
||||
if ! ( $(dir) in $(gRUN_PATH($(<))) )
|
||||
{
|
||||
gRUN_PATH($(<)) += $(dir) ;
|
||||
}
|
||||
@@ -1267,6 +1284,10 @@ rule subvariant-target
|
||||
= [ join-path $(LOCATE_TARGET) $(BIN_DIRECTORY) $(<:G=) $(>[1]) ] ;
|
||||
|
||||
local target-files = [ FAppendSuffix $(subvariant) : $(SUF$(target-type)) ] ;
|
||||
if $(gNAME_ADJUST($(target-type)))
|
||||
{
|
||||
target-files = [ $(gNAME_ADJUST($(target-type))) $(target-files) : $(2) : $(3) ] ;
|
||||
}
|
||||
|
||||
gTARGET_FILES($(subvariant)) = $(target-files) ;
|
||||
gTARGET_FILES($(<)) += $(target-files) ;
|
||||
@@ -1360,6 +1381,8 @@ rule main-target
|
||||
}
|
||||
}
|
||||
|
||||
SHARED_TYPES = DLL ;
|
||||
|
||||
gGENERATOR_FUNCTION(EXE) = executable-file ;
|
||||
# exe target : sources : requirements : local-build
|
||||
#
|
||||
|
||||
@@ -33,12 +33,12 @@ flags borland CFLAGS <inlining>full : -vi -w-inl ;
|
||||
local flag-vars = USER-INTERFACE TARGET-TYPE THREADING RUNTIME-LINK ;
|
||||
local $(flag-vars) ;
|
||||
|
||||
if [ get-values <target-type> : $(gBUILD_PROPERTIES) ] != DLL
|
||||
if ! [ get-values <target-type> : $(gBUILD_PROPERTIES) ] in $(SHARED_TYPES)
|
||||
{
|
||||
flags borland USER-INTERFACE <user-interface>console : -tWC ;
|
||||
}
|
||||
|
||||
flags borland TARGET-TYPE <target-type>DLL : -tWD ;
|
||||
flags borland TARGET-TYPE <target-type>$(SHARED_TYPES) : -tWD ;
|
||||
flags borland THREADING <threading>multi : -tWM ;
|
||||
flags borland RUNTIME-LINK <runtime-link>dynamic : -tWR ;
|
||||
|
||||
@@ -78,7 +78,7 @@ rule Link-action
|
||||
|
||||
with-command-file borland-Link-action $(<) : $(>) $(NEEDLIBS) ;
|
||||
|
||||
if $(3) = DLL
|
||||
if $(3) in $(SHARED_TYPES)
|
||||
{
|
||||
borland-IMPLIB-action $(<) : $(>) ;
|
||||
}
|
||||
|
||||
@@ -52,11 +52,11 @@ if ! $(NT) # The compiler complains about -fPIC on NT
|
||||
|
||||
if $(BETOOLS)
|
||||
{
|
||||
flags gcc LINKFLAGS <target-type>DLL : -nostart ;
|
||||
flags gcc LINKFLAGS <target-type>DLL <target-type>PYD : -nostart ;
|
||||
}
|
||||
else
|
||||
{
|
||||
flags gcc LINKFLAGS <target-type>DLL : -shared ;
|
||||
flags gcc LINKFLAGS <target-type>DLL <target-type>PYD : -shared ;
|
||||
}
|
||||
|
||||
flags gcc LIBPATH <library-path> ;
|
||||
|
||||
@@ -43,7 +43,7 @@ flags intel-linux CFLAGS <shared-linkable>true : -KPIC ;
|
||||
flags intel-linux LINKFLAGS <shared-linkable>true : -KPIC ;
|
||||
|
||||
# dynamic link library
|
||||
flags intel-linux LINKFLAGS <target-type>DLL : -shared ;
|
||||
flags intel-linux LINKFLAGS <target-type>$(SHARED_TYPES) : -shared ;
|
||||
|
||||
# library linking
|
||||
flags intel-linux LINKFLAGS <runtime-link>static : -static ;
|
||||
|
||||
@@ -28,7 +28,7 @@ flags metrowerks HDRS <include> ;
|
||||
flags metrowerks CFLAGS <debug-symbols>on : -g ;
|
||||
flags metrowerks LINKFLAGS <debug-symbols>on : -g ;
|
||||
|
||||
flags metrowerks LINKFLAGS <target-type>DLL : -shared ;
|
||||
flags metrowerks LINKFLAGS <target-type>$(SHARED_TYPES) : -shared ;
|
||||
flags metrowerks CFLAGS <optimization>off : -O0 ;
|
||||
flags metrowerks CFLAGS <optimization>speed : -opt full ;
|
||||
flags metrowerks CFLAGS <optimization>space : -O4,s intrinsics ;
|
||||
@@ -75,7 +75,8 @@ rule Link-action
|
||||
gRUN_PATH($(<)) += $(METROWERKS_ROOT)"\\Win32-X86 Support\\Libraries\\Runtime" ;
|
||||
IMPLIB_COMMAND on $(<) = "-implib " ; # will be "multiplied away" if not
|
||||
# needed.
|
||||
with-command-file metrowerks-Link-action $(<) : $(>) $(NEEDLIBS) ;
|
||||
with-command-file metrowerks-Link-action $(<) : $(>) $(NEEDLIBS) # $(NEEDLIBS)
|
||||
;
|
||||
}
|
||||
|
||||
# Here we set the environment variable MWWinx86LibraryFiles (customize for other
|
||||
|
||||
@@ -57,7 +57,7 @@ flags msvc STDLIBPATH : $(MSVCDir)$(SLASH)lib ;
|
||||
flags msvc LIBPATH <library-path> ;
|
||||
flags msvc NEEDLIBS <library-file> ;
|
||||
flags msvc FINDLIBS <find-library> ;
|
||||
flags msvc LINKFLAGS <target-type>DLL : /DLL ;
|
||||
flags msvc LINKFLAGS <target-type>$(SHARED_TYPES) : /DLL ;
|
||||
|
||||
#### Link ####
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ PYTHON_VERSION_NODOT
|
||||
= [ SUBST $(PYTHON_VERSION) ([0-9]*)\.([0-9]*) $1$2 ]
|
||||
;
|
||||
|
||||
local RUN_PATH = $(RUN_PATH) ;
|
||||
|
||||
if $(NT)
|
||||
{
|
||||
PYTHON_ROOT ?= c:/tools/python ;
|
||||
@@ -57,11 +59,11 @@ else if $(UNIX)
|
||||
|
||||
# Locate the python executable
|
||||
PYTHON ?= <executable@>python$(SUFEXE) ;
|
||||
SEARCH on $(PYTHON) = $(PATH) ;
|
||||
SEARCH on $(PYTHON) = $(RUN_PATH) ;
|
||||
|
||||
# And the debugging version
|
||||
PYTHON_D ?= $(PYTHON:S=)_d$(PYTHON:S) ;
|
||||
SEARCH on $(PYTHON_D) = $(PATH) ;
|
||||
SEARCH on $(PYTHON_D) = $(RUN_PATH) ;
|
||||
|
||||
# select-python-library
|
||||
#
|
||||
@@ -99,7 +101,8 @@ PYTHON_PROPERTIES
|
||||
+=
|
||||
<gcc><*><find-library>python$(PYTHON_VERSION).dll
|
||||
<gcc><*><library-path>/usr/local/lib/python$(PYTHON_VERSION)/config
|
||||
<gcc><*><include>/usr/include/python$(PYTHON_VERSION)
|
||||
<gcc><*><include>/usr/local/include/python$(PYTHON_VERSION)
|
||||
<gcc><*><include>/usr/include/python$(PYTHON_VERSION)
|
||||
<include>$(BOOST_ROOT)
|
||||
select-python-library
|
||||
# These two compilers pick up implicit directions from #pragmas
|
||||
@@ -130,46 +133,55 @@ rule python-files ( module implib ? : sources * )
|
||||
{
|
||||
local actual-module = $(module) ;
|
||||
|
||||
if <define>BOOST_DEBUG_PYTHON in $(gBUILD_PROPERTIES)
|
||||
{
|
||||
# build the actual module name
|
||||
actual-module = $(module:S=)_d$(module:S) ;
|
||||
|
||||
# be sure not to create a dependency loop
|
||||
if $(actual-module) != $(module)
|
||||
{
|
||||
# now the original module name is just a fake target
|
||||
NOTFILE $(module) ;
|
||||
DEPENDS $(module) : $(actual-module) ;
|
||||
set-target-variables $(actual-module) ;
|
||||
}
|
||||
}
|
||||
|
||||
dll-files $(actual-module) $(implib) : $(sources) ;
|
||||
dll-files $(actual-module) $(implib) : $(sources) : PYD ;
|
||||
|
||||
if $(NT) && ( $(gCURRENT_TOOLSET) = gcc )
|
||||
{
|
||||
add-cygwin-python-run-path $(<[-1]) ;
|
||||
}
|
||||
|
||||
gRUN_PATH($(module:S=)) = $(gRUN_PATH($(module))) ;
|
||||
}
|
||||
|
||||
if $(NT)
|
||||
{
|
||||
# Adjust the name of Python modules so that they have the _d
|
||||
# suffix when compiled with python debugging enabled.
|
||||
gNAME_ADJUST(PYD) = name-adjust-PYD ;
|
||||
|
||||
rule name-adjust-PYD ( pyd implib ? : properties * : toolset variant )
|
||||
{
|
||||
if <define>BOOST_DEBUG_PYTHON in $(properties)
|
||||
{
|
||||
pyd = $(pyd:S=)_d$(pyd:S) ;
|
||||
}
|
||||
return $(pyd) $(implib) ;
|
||||
}
|
||||
}
|
||||
|
||||
rule Link-PYD
|
||||
{
|
||||
if $(<[2])
|
||||
{
|
||||
MODE on $(<[2]) = $(IMPMODE) ;
|
||||
Chmod $(<[2]) ;
|
||||
}
|
||||
|
||||
gRUN_PATH($(<)) += $(gLOCATE($(<[1]))) ;
|
||||
Link-action $(<) : $(>) : PYD ;
|
||||
}
|
||||
|
||||
declare-target-type PYD : <shared-linkable>true ;
|
||||
gGENERATOR_FUNCTION(PYD) = python-files ;
|
||||
SUFPYD = .pyd $(SUFDLL[2-]) ;
|
||||
PYDMODE = $(DLLMODE) ;
|
||||
SHARED_TYPES += PYD ;
|
||||
|
||||
# Declare a python extension.
|
||||
rule extension ( name : sources + : requirements * : default-BUILD * )
|
||||
{
|
||||
requirements += $(PYTHON_PROPERTIES) ;
|
||||
|
||||
# Temporarily hijack the generator function for DLLs to handle
|
||||
# some python extension-specific things.
|
||||
local gGENERATOR_FUNCTION(DLL) = python-files ;
|
||||
local SUFDLL = .pyd $(SUFDLL[2-]) ;
|
||||
|
||||
dll $(name) :
|
||||
$(sources)
|
||||
: $(requirements)
|
||||
: $(default-BUILD)
|
||||
;
|
||||
|
||||
declare-local-target $(name) : $(sources) : $(requirements) : $(default-BUILD) : PYD ;
|
||||
}
|
||||
|
||||
# boost-python-runtest target : python-script sources : requirements : local-build : args
|
||||
@@ -219,7 +231,7 @@ actions python-test-target bind PYTHON
|
||||
$(SHELL_EXPORT)PATH
|
||||
$(SHELL_SET)PYTHONPATH=$(PYTHONPATH)
|
||||
$(SHELL_EXPORT)PYTHONPATH
|
||||
$(PYTHON) "$(>)" $(ARGS) > "$(<)"
|
||||
$(PYTHON_LAUNCH) $(PYTHON) $(PYTHON_ARGS) "$(>)" $(ARGS) > "$(<)"
|
||||
}
|
||||
|
||||
SUFPYTHON_RUNTEST = .run ;
|
||||
@@ -236,7 +248,7 @@ actions python-runtest-target bind PYTHON
|
||||
$(SHELL_EXPORT)PATH
|
||||
$(SHELL_SET)PYTHONPATH=$(PYTHONPATH)
|
||||
$(SHELL_EXPORT)PYTHONPATH
|
||||
$(PYTHON) "$(>)" $(ARGS)
|
||||
$(PYTHON_LAUNCH) $(PYTHON) $(PYTHON_ARGS) "$(>)" $(ARGS)
|
||||
}
|
||||
|
||||
# This is the rule that actually causes the test to run. It is used by
|
||||
@@ -262,7 +274,7 @@ rule python-runtest-aux ( target : sources + )
|
||||
if $(NT) && ( $(gCURRENT_TOOLSET) = gcc )
|
||||
{
|
||||
python = python$(PYTHON_VERSION)$(SUFEXE) ;
|
||||
SEARCH on $(python) = $(CYGWIN_ROOT)/usr/local/bin ;
|
||||
SEARCH on $(python) = $(RUN_PATH) $(CYGWIN_ROOT)/usr/local/bin ;
|
||||
# Fix up path splitter for cygwin.
|
||||
splitpath = ":" ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user