From 77476676e5eabccaf6f4d5a63e76d5cc59f9c91b Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 25 Apr 2005 04:24:04 +0000 Subject: [PATCH] boostbook.jam; Make it possible to configure where to find boostbook files. boostbook-config.jam; Find boostbook files using Boost install key. quickbook-config.jam; Auto config of quickbook tool. [SVN r28464] --- v2/tools/boostbook-config.jam | 29 +++++++++++++++-------- v2/tools/boostbook.jam | 7 ++++-- v2/tools/quickbook-config.jam | 44 +++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 12 deletions(-) create mode 100644 v2/tools/quickbook-config.jam diff --git a/v2/tools/boostbook-config.jam b/v2/tools/boostbook-config.jam index 8a80b8c28..b1d1d8137 100644 --- a/v2/tools/boostbook-config.jam +++ b/v2/tools/boostbook-config.jam @@ -9,18 +9,22 @@ import toolset : using ; local docbook_xsl-path = [ modules.peek : DOCBOOK_XSL_DIR ] ; local docbook_dtd-path = [ modules.peek : DOCBOOK_DTD_DIR ] ; +local boostbook-path = [ modules.peek : BOOSTBOOK_DIR ] ; if [ os.name ] = NT { - docbook_xsl-path ?= [ GLOB "C:\\Boost\\share" : docbook-xsl* ] ; - docbook_xsl-path = $(docbook_xsl-path[1]) ; - docbook_dtd-path ?= [ GLOB "C:\\Boost\\share" : docbook-xml* ] ; - docbook_dtd-path = $(docbook_dtd-path[1]) ; - - if --debug-configuration in [ modules.peek : ARGV ] + local boost-dir = ; + for local R in cvs 1.33.0 { - ECHO "notice:" using boostbook ":" $(docbook_xsl-path) ":" $(docbook_dtd-path) ; + boost-dir += [ W32_GETREG + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Boost.org\\$(R)" + : "InstallRoot" ] ; } - using boostbook : $(docbook_xsl-path) : $(docbook_dtd-path) ; + docbook_xsl-path ?= [ GLOB "$(boost-dir)\\share" "\\Boost\\share" : docbook-xsl* ] ; + docbook_xsl-path = $(docbook_xsl-path[1]) ; + docbook_dtd-path ?= [ GLOB "$(boost-dir)\\share" "\\Boost\\share" : docbook-xml* ] ; + docbook_dtd-path = $(docbook_dtd-path[1]) ; + boostbook-path ?= [ GLOB "$(boost-dir)\\share" "\\Boost\\share" : boostbook* ] ; + boostbook-path = $(boostbook-path[1]) ; } else { @@ -28,10 +32,15 @@ else docbook_xsl-path = $(docbook_xsl-path[1]) ; docbook_dtd-path ?= [ GLOB "/usr/local/share" "/usr/share" "/opt/share" : docbook-xml* ] ; docbook_dtd-path = $(docbook_dtd-path[1]) ; + boostbook-path ?= [ GLOB "/usr/local/share" "/usr/share" "/opt/share" : boostbook* ] ; + boostbook-path = $(boostbook-path[1]) ; +} +if $(docbook_xsl-path) && $(docbook_dtd-path) && $(boostbook-path) +{ if --debug-configuration in [ modules.peek : ARGV ] { - ECHO "notice:" using boostbook ":" $(docbook_xsl-path) ":" $(docbook_dtd-path) ; + ECHO "notice:" using boostbook ":" $(docbook_xsl-path) ":" $(docbook_dtd-path) ":" $(boostbook-path) ; } - using boostbook : $(docbook_xsl-path) : $(docbook_dtd-path) ; + using boostbook : $(docbook_xsl-path) : $(docbook_dtd-path) : $(boostbook-path) ; } diff --git a/v2/tools/boostbook.jam b/v2/tools/boostbook.jam index 29f1f446e..c9f261b1a 100644 --- a/v2/tools/boostbook.jam +++ b/v2/tools/boostbook.jam @@ -52,7 +52,10 @@ type.register BOOSTBOOK_MAIN ; # docbook-dtd-dir: The DocBook DTD directory. If not provided, we use # DOCBOOK_DTD_DIR From the environment (if available). Otherwise, we let # the XML processor load the DTD remotely. -rule init ( docbook-xsl-dir ? : docbook-dtd-dir ? ) +# +# boost-book-dir: The BoostBook directory with the DTD and XSL subdirs. +# +rule init ( docbook-xsl-dir ? : docbook-dtd-dir ? : boostbook-dir ? ) { docbook-xsl-dir ?= [ modules.peek : DOCBOOK_XSL_DIR ] ; @@ -79,7 +82,7 @@ rule init ( docbook-xsl-dir ? : docbook-dtd-dir ? ) local boost-build-root = [ sequence.transform path.make : [ modules.peek : BOOST_BUILD_PATH ] ] ; - local search-dirs = [ path.join $(boost-root) tools boostbook ] + local search-dirs = $(boostbook-dir) [ path.join $(boost-root) tools boostbook ] $(boost-build-root)/../../boostbook ; if --debug-configuration in [ modules.peek : ARGV ] diff --git a/v2/tools/quickbook-config.jam b/v2/tools/quickbook-config.jam new file mode 100644 index 000000000..d986ba491 --- /dev/null +++ b/v2/tools/quickbook-config.jam @@ -0,0 +1,44 @@ +#~ Copyright 2005 Rene Rivera. +#~ 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) + +# Automatic configuration for BoostBook tools. To use, just import this module. + +import os ; +import toolset : using ; + +if [ os.name ] = NT +{ + local boost-dir = ; + for local R in cvs 1.33.0 + { + boost-dir += [ W32_GETREG + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Boost.org\\$(R)" + : "InstallRoot" ] ; + } + local quickbook-path = [ GLOB "$(boost-dir)\\bin" "\\Boost\\bin" : quickbook.exe ] ; + quickbook-path = $(quickbook-path[1]) ; + + if $(quickbook-path) + { + if --debug-configuration in [ modules.peek : ARGV ] + { + ECHO "notice:" using quickbook ":" $(quickbook-path) ; + } + using quickbook : $(quickbook-path) ; + } +} +else +{ + local quickbook-path = [ GLOB "/usr/local/bin" "/usr/bin" "/opt/bin" : quickbook ] ; + quickbook-path = $(quickbook-path[1]) ; + + if $(quickbook-path) + { + if --debug-configuration in [ modules.peek : ARGV ] + { + ECHO "notice:" using quickbook ":" $(quickbook-path) ; + } + using quickbook : $(quickbook-path) ; + } +}