From 35d358b50b4ef6b95db8a4b8a98dec1bc7ed6937 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 14 Nov 2006 05:37:44 +0000 Subject: [PATCH] (merge from head) Add generic feature. Fix minor validation problem with boostbook. [SVN r36030] --- v2/tools/boostbook.jam | 27 +++++++-------------------- v2/tools/builtin.jam | 3 +++ v2/tools/xsltproc.jam | 7 ++++++- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/v2/tools/boostbook.jam b/v2/tools/boostbook.jam index e1b5db19a..e8d8217dc 100644 --- a/v2/tools/boostbook.jam +++ b/v2/tools/boostbook.jam @@ -1,6 +1,6 @@ # Copyright 2003, 2004, 2005 Dave Abrahams # Copyright 2003, 2004, 2005 Douglas Gregor -# Copyright 2005 Rene Rivera +# Copyright 2005, 2006 Rene Rivera # Copyright 2003, 2004, 2005 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) @@ -113,12 +113,6 @@ rule init ( docbook-xsl-dir ? : docbook-dtd-dir ? : boostbook-dir ? ) : $(search-dirs:J=" ") ; } - # Add trailing slash since some other code - # uses :B modifier to add last element, and fails - # without trailing slash. The code really should be fixed, - # but not now. - .boostbook-xsl-dir = $(.boostbook-xsl-dir)/ ; - .boostbook-dtd-dir = $(.boostbook-dtd-dir)/ ; # Register generators only if we've were called via "using boostbook ; " generators.register-standard boostbook.dtdxml-to-boostbook : DTDXML : XML ; @@ -162,36 +156,31 @@ rule dtdxml-to-boostbook ( target : source : properties * ) rule boostbook-to-docbook ( target : source : properties * ) { - local native-path = [ path.native $(.boostbook-xsl-dir) ] ; - local stylesheet = $(native-path:B=docbook:S=.xsl) ; + local stylesheet = [ path.native $(.boostbook-xsl-dir)/docbook.xsl ] ; xslt $(target) : $(source) $(stylesheet) : $(properties) ; } rule docbook-to-onehtml ( target : source : properties * ) { - local native-path = [ path.native $(.boostbook-xsl-dir) ] ; - local stylesheet = $(native-path:B=html-single:S=.xsl) ; + local stylesheet = [ path.native $(.boostbook-xsl-dir)/html-single.xsl ] ; xslt $(target) : $(source) $(stylesheet) : $(properties) ; } rule docbook-to-htmldir ( target : source : properties * ) { - local native-path = [ path.native $(.boostbook-xsl-dir) ] ; - local stylesheet = $(native-path:B=html:S=.xsl) ; + local stylesheet = [ path.native $(.boostbook-xsl-dir)/html.xsl ] ; xslt-dir $(target) : $(source) $(stylesheet) : $(properties) : html ; } rule docbook-to-manpages ( target : source : properties * ) { - local native-path = [ path.native $(.boostbook-xsl-dir) ] ; - local stylesheet = $(native-path:B=manpages:S=.xsl) ; + local stylesheet = [ path.native $(.boostbook-xsl-dir)/manpages.xsl ] ; xslt-dir $(target) : $(source) $(stylesheet) : $(properties) : man ; } rule docbook-to-fo ( target : source : properties * ) { - local native-path = [ path.native $(.boostbook-xsl-dir) ] ; - local stylesheet = $(native-path:B=fo:S=.xsl) ; + local stylesheet = [ path.native $(.boostbook-xsl-dir)/fo.xsl ] ; xslt $(target) : $(source) $(stylesheet) : $(properties) ; } @@ -272,9 +261,7 @@ class boostbook-generator : generator # Add the catalog to the property set local catalog-path = [ $(catalog).path ] ; - catalog-path = "$(catalog-path)/" ; - local catalog-file = $(catalog-path:G=:B=catalog:S=.xml) ; - property-set = [ $(property-set).add-raw $(catalog-file) ] ; + property-set = [ $(property-set).add-raw $(catalog-path)/catalog.xml ] ; # local targets = $(catalog) ; diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index 5ccd02eed..e86d2e50f 100644 --- a/v2/tools/builtin.jam +++ b/v2/tools/builtin.jam @@ -116,6 +116,9 @@ feature linkflags : : free ; feature archiveflags : : free ; feature version : : free ; +# Generic, i.e. non-lanugage specific, flags for tools. +feature flags : : free ; + feature.feature location-prefix : : free ; diff --git a/v2/tools/xsltproc.jam b/v2/tools/xsltproc.jam index 021ef58ea..71e1b72ae 100644 --- a/v2/tools/xsltproc.jam +++ b/v2/tools/xsltproc.jam @@ -10,6 +10,7 @@ # Note: except for 'init', this modules does not provide any rules # for end users. +import toolset : flags ; import feature ; import regex ; import sequence ; @@ -38,6 +39,10 @@ rule init ( xsltproc ? ) rule compute-xslt-flags ( target : properties * ) { local flags ; + + # Raw flags. + flags += [ feature.get-values : $(properties) ] ; + # Translate into command line flags. for local param in [ feature.get-values : $(properties) ] { @@ -75,7 +80,7 @@ rule compute-xslt-flags ( target : properties * ) local rule .xsltproc ( target : source stylesheet : properties * : dirname ? : action ) { STYLESHEET on $(target) = $(stylesheet) ; - FLAGS on $(target) = [ compute-xslt-flags $(target) : $(properties) ] ; + FLAGS on $(target) += [ compute-xslt-flags $(target) : $(properties) ] ; NAME on $(target) = $(.xsltproc) ; for local catalog in [ feature.get-values : $(properties) ]