From 1d45ae211bb9ba05628c7ee4273661704e46c7fc Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 07:38:58 +0000 Subject: [PATCH] Merge from trunk. [SVN r33579] --- src/build/virtual-target.jam | 8 -------- src/tools/gcc.jam | 6 ++++-- src/tools/python.jam | 21 ++++++++++++++++++++- src/tools/types/lib.jam | 6 ++++++ 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/build/virtual-target.jam b/src/build/virtual-target.jam index f543652b0..3c52b32d5 100644 --- a/src/build/virtual-target.jam +++ b/src/build/virtual-target.jam @@ -471,14 +471,6 @@ rule add-prefix-and-suffix ( specified-name : type ? : property-set ) 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 [ MATCH ^($(prefix)) : $(specified-name) ] { prefix = ; diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 8200a077b..824e79443 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -317,6 +317,8 @@ rule init-link-flags ( toolset linker condition ) : unchecked ; flags $(toolset).link RPATH $(condition) : : unchecked ; flags $(toolset).link RPATH_LINK $(condition) : : unchecked ; + flags $(toolset).link START-GROUP $(condition) : -Wl,--start-group : unchecked ; + flags $(toolset).link END-GROUP $(condition) : -Wl,--end-group : unchecked ; } case darwin : { @@ -383,7 +385,7 @@ rule link ( targets * : sources * : properties * ) actions link bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS) $(USER_OPTIONS) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP) "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) } @@ -441,7 +443,7 @@ rule link.dll ( targets * : sources * : properties * ) # Differ from 'link' above only by -shared. actions link.dll bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" -o "$(<)" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS) $(USER_OPTIONS) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" -o "$(<)" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[1]:D=) -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) } # Set up threading support. It's somewhat contrived, so perform it at the end, diff --git a/src/tools/python.jam b/src/tools/python.jam index e28734979..c215599a9 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -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) : : $(includes) @@ -373,6 +389,9 @@ type.set-generated-target-suffix PYTHON_EXTENSION : : so ; type.set-generated-target-suffix PYTHON_EXTENSION : NT : dll ; type.set-generated-target-suffix PYTHON_EXTENSION : 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 * ) { diff --git a/src/tools/types/lib.jam b/src/tools/types/lib.jam index 9c753cc2c..21fab6773 100644 --- a/src/tools/types/lib.jam +++ b/src/tools/types/lib.jam @@ -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 ;