Update of /cvsroot/boost/boost/tools/build/v2/tools
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8415/tools/build/v2/tools
Modified Files:
Tag: bbv2python
gcc.jam builtin.jam
Log Message:
gcc.jam: build and use import libraries on Cygwin and Windows, but
accept DLL-only linking with prebuilt DLLs.
builtin.jam: fix default-host-os so that <target-os> actually becomes
a functional feature. Improve English in comments
property-set.jam: add str method so we can print them in generator
debugging output.
generators.jam: improved debugging output
build-system.jam: add missing semicolon
Index: gcc.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/gcc.jam,v
retrieving revision 1.63.2.20.2.1
retrieving revision 1.63.2.20.2.2
diff -u -d -r1.63.2.20.2.1 -r1.63.2.20.2.2
--- gcc.jam 8 Mar 2007 15:56:58 -0000 1.63.2.20.2.1
+++ gcc.jam 10 Mar 2007 06:46:24 -0000 1.63.2.20.2.2
@@ -44,6 +44,9 @@
type.set-generated-target-suffix OBJ : <toolset>gcc : o ;
type.set-generated-target-suffix STATIC_LIB : <toolset>gcc : a ;
+type.set-generated-target-suffix IMPORT_LIB : <toolset>gcc <target-os>cygwin :
dll.a ;
+type.set-generated-target-suffix IMPORT_LIB : <toolset>gcc <target-os>windows
: a ;
+
import rc ;
# Initializes the gcc toolset for the given version.
@@ -427,8 +430,19 @@
}
else
{
- return [ unix-linking-generator.run $(project) $(name)
+ local generated-targets = [ unix-linking-generator.run $(project)
$(name)
: $(property-set) : $(sources) ] ;
+
+ # If more than one target was generated, throw out the
+ # last one, which on windows just leaves the import
+ # library. Most generators on windows simply don't accept
+ # shared libraries as input, but being able to link
+ # directly to a shared library without an import library
+ # is an important capability of GCC. Therefore, we remove
+ # the target after the action sees it so that dependent
+ # targets don't try to link to both the import library and
+ # the DLL.
+ return $(generated-targets[1-2]) ;
}
}
}
@@ -436,9 +450,17 @@
generators.register [ new gcc-linking-generator gcc.link : LIB OBJ : EXE
: <toolset>gcc ] ;
-generators.register [ new gcc-linking-generator gcc.link.dll : LIB OBJ :
SHARED_LIB
- : <toolset>gcc ] ;
+.IMPLIB-COMMAND = ;
+.IMPLIB-TYPE = IMPORT_LIB ;
+if [ os.on-windows ]
+{
+ .IMPLIB-COMMAND = "-Wl,--out-implib," ;
+ .IMPLIB-COMMAND = IMPORT_LIB ;
+}
+generators.register
+ [ new gcc-linking-generator gcc.link.dll : LIB OBJ : $(.IMPLIB-TYPE)
SHARED_LIB
+ : <toolset>gcc ] ;
# Declare flags for linking
# First, the common flags
@@ -601,7 +623,7 @@
# 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 $(START-GROUP)
"$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS)
$(USER_OPTIONS)
+ "$(CONFIG_COMMAND)" -L"$(LINKPATH)"
-Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" "$(.IMPLIB-COMMAND)$(<[1])" -o
"$(<[-1])" $(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,
Index: builtin.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/builtin.jam,v
retrieving revision 1.189.2.7
retrieving revision 1.189.2.7.2.1
diff -u -d -r1.189.2.7 -r1.189.2.7.2.1
--- builtin.jam 6 Jan 2007 12:39:42 -0000 1.189.2.7
+++ builtin.jam 10 Mar 2007 06:46:24 -0000 1.189.2.7.2.1
@@ -33,14 +33,17 @@
local os = [ modules.peek : OS ] ;
feature os : $(os) : propagated link-incompatible ;
+.os-names = amiga aix bsd cygwin darwin dos emx freebsd hpux
+ linux netbsd openbsd osf qnx qnxnto sgi solaris sun sunos
+ svr4 sysv ultrix unix unixware vms windows ;
+
# Translates from bjam current OS to the os tags used
# in host-os and target-os. I.e. it returns the
# running host-os.
local rule default-host-os ( )
{
local host-os ;
- local os-list = [ feature.values host-os ] ;
- if [ os.name ] in $(os-list:U)
+ if [ os.name ] in $(.os-names:U)
{
host-os = [ os.name ] ;
}
@@ -71,15 +74,11 @@
# Both set the default value to the current OS to account for
# the default use case of building on the target OS.
feature host-os
- : amiga aix bsd cygwin darwin dos emx freebsd hpux
- linux netbsd openbsd osf qnx qnxnto sgi solaris sun sunos
- svr4 sysv ultrix unix unixware vms windows
+ : $(.os-names)
: optional ;
feature.set-default host-os : [ default-host-os ] ;
feature target-os
- : amiga aix bsd cygwin darwin dos emx freebsd hpux
- linux netbsd openbsd osf qnx qnxnto sgi solaris sun sunos
- svr4 sysv ultrix unix unixware vms windows
+ : $(.os-names)
: propagated link-incompatible ;
feature.set-default target-os : [ default-host-os ] ;
@@ -169,9 +168,9 @@
feature hardcode-dll-paths : true false : incidental ;
-# This is internal feature which holds the paths of all dependency
+# An internal feature that holds the paths of all dependency
# dynamic libraries. On Windows, it's needed so that we can all
-# those paths to PATH, when running applications.
+# those paths to PATH when running applications.
# On Linux, it's needed to add proper -rpath-link command line options.
feature xdll-path : : free path ;
@@ -726,7 +725,7 @@
}
# Hardcode dll paths only when linking executables.
- # Pros: don't need to relinking libraries when installing.
+ # Pros: don't need to relink libraries when installing.
# Cons: "standalone" libraries (plugins, python extensions)
# can't hardcode paths to dependent libraries.
if [ $(property-set).get <hardcode-dll-paths> ] = true
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs