mirror of
https://github.com/boostorg/build.git
synced 2026-02-15 13:02:11 +00:00
Make it possible to suppress 'lib' prefix for a target type derived from 'LIB'.
[SVN r33576]
This commit is contained in:
@@ -470,15 +470,15 @@ rule add-prefix-and-suffix ( specified-name : type ? : property-set )
|
||||
suffix = .$(suffix) ;
|
||||
|
||||
local prefix = [ type.generated-target-prefix $(type) : $(property-set) ] ;
|
||||
|
||||
if ! $(prefix)
|
||||
&& [ type.is-derived $(type) LIB ] && [ os.on-unix ]
|
||||
# This becomes hacky! Need to introduce more general mechanism.
|
||||
# Invoke type.set-target-prefix in unix toolkit?
|
||||
&& ! [ type.is-derived $(type) PYTHON_EXTENSION ]
|
||||
{
|
||||
prefix = lib ;
|
||||
}
|
||||
|
||||
# if ! $(prefix)
|
||||
# && [ type.is-derived $(type) LIB ] && [ os.on-unix ]
|
||||
# # This becomes hacky! Need to introduce more general mechanism.
|
||||
# # Invoke type.set-target-prefix in unix toolkit?
|
||||
# && ! [ type.is-derived $(type) PYTHON_EXTENSION ]
|
||||
# {
|
||||
# prefix = lib ;
|
||||
# }
|
||||
if [ MATCH ^($(prefix)) : $(specified-name) ]
|
||||
{
|
||||
prefix = ;
|
||||
|
||||
@@ -128,6 +128,22 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * )
|
||||
{
|
||||
flags python.capture-output PYTHON $(condition:J=/) : $(interpreter) ;
|
||||
}
|
||||
|
||||
|
||||
local extra-libs ;
|
||||
if [ os.name ] = SOLARIS
|
||||
{
|
||||
extra-libs = dl ;
|
||||
}
|
||||
else if [ os.name ] = OSF || [ os.name ] = QNXTO
|
||||
{
|
||||
# Nothing.
|
||||
}
|
||||
else
|
||||
{
|
||||
extra-libs = dl util ;
|
||||
}
|
||||
|
||||
|
||||
# On Linux, we don't want to link either Boost.Python or
|
||||
# Python extensions to libpython, so that when extensions
|
||||
@@ -143,7 +159,7 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * )
|
||||
;
|
||||
|
||||
alias python
|
||||
: dl util
|
||||
: $(extra-libs)
|
||||
: $(condition)
|
||||
:
|
||||
: <include>$(includes)
|
||||
@@ -373,6 +389,9 @@ type.set-generated-target-suffix PYTHON_EXTENSION : : so ;
|
||||
type.set-generated-target-suffix PYTHON_EXTENSION : <os>NT : dll ;
|
||||
type.set-generated-target-suffix PYTHON_EXTENSION : <os>CYGWIN : so ;
|
||||
|
||||
# Unset 'lib' prefix for PYTHON_EXTENSION
|
||||
type.set-generated-target-prefix PYTHON_EXTENSION : : "" ;
|
||||
|
||||
rule python-extension ( name : sources * : requirements * : default-build * :
|
||||
usage-requirements * )
|
||||
{
|
||||
|
||||
@@ -3,9 +3,15 @@
|
||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import type ; # for set-generated-target-suffix
|
||||
import os ;
|
||||
|
||||
type.register LIB ;
|
||||
|
||||
if [ os.on-unix ]
|
||||
{
|
||||
type.set-generated-target-prefix LIB : : "lib" ;
|
||||
}
|
||||
|
||||
type STATIC_LIB : lib a : LIB : NT CYGWIN ;
|
||||
type STATIC_LIB : a : LIB : MACOSX ;
|
||||
type STATIC_LIB : a : LIB ;
|
||||
|
||||
Reference in New Issue
Block a user