|
Boost-Build : |
From: Andre Hentz (ahentz_at_[hidden])
Date: 2004-02-20 03:23:49
Hi Volodya,
Vladimir Prus wrote:
>
> Of course, it's not that bad. One can start by inlining toolset.inherit call:
>
Thanks for you help. I've implemented that idea following your
instructions. I also make changes in several places to make most tests
pass (3 are still failing). The patch is attached.
I was wondering if
$(.$(rule-or-module).condition.$(f))
is the right thing to use as a filter since it contains the condition as
in <debug-symbols>off (and <debug-symbols>on). I suppose this is what we
want but thought I would bring that issue to your attention.
Again, thanks for your help,
Andre Hentz
--------------040704020407040104020501 Content-Type: text/plain;
name="patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="patch"
Index: build/toolset.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/build/toolset.jam,v
retrieving revision 1.21
diff -u -r1.21 toolset.jam
--- build/toolset.jam 11 Dec 2003 13:42:40 -0000 1.21
+++ build/toolset.jam 20 Feb 2004 07:51:38 -0000
@@ -11,6 +11,7 @@
import property ;
import path ;
import generators ;
+import set : difference ;
.flag-no = 1 ;
@@ -288,29 +289,38 @@
}
}
-rule inherit-flags ( toolset : base )
+# properties listed in prohibited-properties won't
+# be inherited. Note that <debug-symbols>on and
+# <debug-symbols>off are two different properties
+rule inherit-flags ( toolset : base : prohibited-properties * )
{
for local f in $(.module-flags.$(base))
{
local rule-or-module = $(.rule-or-module.$(f)) ;
- local rule_ = [ MATCH "[^.]*\.(.*)" : $(rule-or-module) ] ;
- local new-rule-or-module ;
- if $(rule_)
+ if [ set.difference
+ $(.$(rule-or-module).condition.$(f)) :
+ $(prohibited-properties)
+ ]
{
- new-rule-or-module = $(toolset).$(rule_) ;
- }
- else
- {
- new-rule-or-module = $(toolset) ;
- }
+ local rule_ = [ MATCH "[^.]*\.(.*)" : $(rule-or-module) ] ;
+ local new-rule-or-module ;
+ if $(rule_)
+ {
+ new-rule-or-module = $(toolset).$(rule_) ;
+ }
+ else
+ {
+ new-rule-or-module = $(toolset) ;
+ }
- add-flag
- $(new-rule-or-module)
- : $(.$(rule-or-module).match-type.$(f))
- : $(.$(rule-or-module).variable.$(f))
- : $(.$(rule-or-module).condition.$(f))
- : $(.$(rule-or-module).values.$(f))
- ;
+ add-flag
+ $(new-rule-or-module)
+ : $(.$(rule-or-module).match-type.$(f))
+ : $(.$(rule-or-module).variable.$(f))
+ : $(.$(rule-or-module).condition.$(f))
+ : $(.$(rule-or-module).values.$(f))
+ ;
+ }
}
}
Index: build/type.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/build/type.jam,v
retrieving revision 1.31
diff -u -r1.31 type.jam
--- build/type.jam 29 Oct 2003 06:08:44 -0000 1.31
+++ build/type.jam 20 Feb 2004 07:51:38 -0000
@@ -107,7 +107,7 @@
# Specifies that targets with suffix from 'suffixes' has the type 'type'.
# If different type is already specified for any of syffixes,
# issues an error.
-local rule register-suffixes ( suffixes + : type )
+rule register-suffixes ( suffixes + : type )
{
for local s in $(suffixes)
{
Index: test/BoostBuild.py
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/test/BoostBuild.py,v
retrieving revision 1.60
diff -u -r1.60 BoostBuild.py
--- test/BoostBuild.py 13 Jan 2004 09:24:16 -0000 1.60
+++ test/BoostBuild.py 20 Feb 2004 07:51:39 -0000
@@ -31,6 +31,9 @@
if toolset in ["gcc"]:
suffixes['.lib'] = '.a' # static libs have '.a' suffix with mingw...
suffixes['.obj'] = '.o'
+ if os.uname()[0] == 'Darwin':
+ suffixes['.dll'] = '.dylib'
+
@@ -90,6 +93,8 @@
jam_build_dir = "bin.linuxx86"
elif os.uname()[0] == 'SunOS':
jam_build_dir = "bin.solaris"
+ elif os.uname()[0] == 'Darwin':
+ jam_build_dir = "bin.macosxppc"
else:
raise "Don't know directory where jam is build for this system: " + os.name + "/" + os.uname()[0]
else:
Index: test/prebuilt.py
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/test/prebuilt.py,v
retrieving revision 1.7
diff -u -r1.7 prebuilt.py
--- test/prebuilt.py 28 Oct 2003 07:46:40 -0000 1.7
+++ test/prebuilt.py 20 Feb 2004 07:51:40 -0000
@@ -7,6 +7,8 @@
t.set_tree('prebuilt')
+t.expand_toolset("ext/project-root.jam")
+t.expand_toolset("project-root.jam")
# First, build the external project
t.run_build_system("debug release", subdir="ext")
Index: test/prebuilt/project-root.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/test/prebuilt/project-root.jam,v
retrieving revision 1.1
diff -u -r1.1 project-root.jam
--- test/prebuilt/project-root.jam 6 Nov 2002 10:26:09 -0000 1.1
+++ test/prebuilt/project-root.jam 20 Feb 2004 07:51:40 -0000
@@ -1,2 +1,2 @@
-import gcc ;
\ No newline at end of file
+import $toolset ;
Index: test/prebuilt/ext/Jamfile2
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/test/prebuilt/ext/Jamfile2,v
retrieving revision 1.7
diff -u -r1.7 Jamfile2
--- test/prebuilt/ext/Jamfile2 10 Apr 2003 15:10:37 -0000 1.7
+++ test/prebuilt/ext/Jamfile2 20 Feb 2004 07:51:40 -0000
@@ -13,7 +13,10 @@
dll-suffix = lib ;
}
}
-
+if $toolset = darwin
+{
+ dll-suffix = dylib ;
+}
project ext ;
@@ -28,4 +31,4 @@
:
: <include>release
;
-
\ No newline at end of file
+
Index: test/prebuilt/ext/Jamfile3
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/test/prebuilt/ext/Jamfile3,v
retrieving revision 1.1
diff -u -r1.1 Jamfile3
--- test/prebuilt/ext/Jamfile3 8 May 2003 13:52:28 -0000 1.1
+++ test/prebuilt/ext/Jamfile3 20 Feb 2004 07:51:40 -0000
@@ -17,6 +17,11 @@
dll-suffix = lib ;
}
}
+if $toolset = darwin
+{
+ dll-suffix = dylib ;
+}
+
project ext ;
@@ -35,4 +40,4 @@
:
: <include>release
;
-
\ No newline at end of file
+
Index: test/prebuilt/ext/project-root.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/test/prebuilt/ext/project-root.jam,v
retrieving revision 1.1
diff -u -r1.1 project-root.jam
--- test/prebuilt/ext/project-root.jam 6 Nov 2002 10:26:09 -0000 1.1
+++ test/prebuilt/ext/project-root.jam 20 Feb 2004 07:51:40 -0000
@@ -1,2 +1,2 @@
-import gcc ;
\ No newline at end of file
+import $toolset ;
Index: tools/darwin.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/darwin.jam,v
retrieving revision 1.2
diff -u -r1.2 darwin.jam
--- tools/darwin.jam 6 Nov 2003 07:32:04 -0000 1.2
+++ tools/darwin.jam 20 Feb 2004 07:51:40 -0000
@@ -12,7 +12,14 @@
import type ;
toolset.register darwin ;
-toolset.inherit darwin : gcc ;
+import gcc ;
+toolset.inherit-generators darwin : gcc ;
+# we can't pass -s to ld unless we also pass -static
+# so we removed -s completly from OPTIONS and add it
+# to ST_OPTIONS
+toolset.inherit-flags darwin : gcc : <debug-symbols>off ;
+toolset.inherit-rules darwin : gcc ;
+flags darwin.link ST_OPTIONS <debug-symbols>off : -s ;
# No additional initialization should be necessary
rule init ( )
@@ -22,6 +29,8 @@
# Darwin has a different shared library suffix
type.set-generated-target-suffix SHARED_LIB : <toolset>darwin : dylib ;
+# we need to be able to tell the type of .dylib files
+type.register-suffixes dylib : SHARED_LIB ;
feature framework : : free ;
@@ -37,7 +46,7 @@
actions link bind LIBRARIES
{
- $(NAME:E=g++) $(OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) -framework$(_)$(FRAMEWORK)
+ $(NAME:E=g++) $(ST_OPTIONS) $(OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) -framework$(_)$(FRAMEWORK)
}
rule link.dll
@@ -47,11 +56,11 @@
actions link.dll bind LIBRARIES
{
- $(NAME:E=g++) -dynamiclib $(OPTIONS) -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) -framework$(_)$(FRAMEWORK)
+ $(NAME:E=g++) -dynamiclib $(OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) -framework$(_)$(FRAMEWORK)
}
actions piecemeal archive
{
- ar -r -s $(ARFLAGS) "$(<:T)" "$(>:T)"
+ ar -c -r -s $(ARFLAGS) "$(<:T)" "$(>:T)"
}
--------------040704020407040104020501 Content-Type: text/plain;
name="log"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="log"
Darwin improvements.
* v2/build/toolset.jam
(inherit-flags): Take an extra parameter describing properties that
should not be inherited.
* v2/build/type.jam
(register-suffixes): Removed local qualifier.
* v2/test/BoostBuild.py
(prepare_suffix_map): Add .dylib if OS is Darwin.
(Tester::_init_): path to bjam on Darwin.
* v2/test/prebuilt.py
make sure $toolset is expanded correctly.
* v2/test/prebuilt/project-root.jam
use $toolset instead of gcc.
* v2/test/prebuilt/ext/project-root.jam
use $toolset instead of gcc.
* v2/test/prebuilt/ext/Jamfile2.jam
handle extension .dylib.
* v2/test/prebuilt/ext/Jamfile2.jam
handle extension .dylib.
* v2/tools/darwin.jam
inline call to toolset.inherit.
filter <debug-symbols>off because -s is not accepted for dlls.
speficy that .dylib files are of type SHARED_LIB.
(actions link): pass -s for static linkage.
(actions link.dll): pass -L flag with path to libraries.
(actions archive): -c inhibits warning.
--------------040704020407040104020501--
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk