diff --git a/src/tools/boostbook.jam b/src/tools/boostbook.jam index 44f19ed73..8f3f916a9 100644 --- a/src/tools/boostbook.jam +++ b/src/tools/boostbook.jam @@ -77,18 +77,25 @@ rule init ( docbook-xsl-dir ? : docbook-dtd-dir ? ) { .docbook-dtd-dir = [ path.make $(docbook-dtd-dir) ] ; } + + local boost-build-path = [ modules.peek : BOOST_BUILD_PATH ] ; local boost-root = [ modules.peek : BOOST_ROOT ] ; - if $(boost-root) + local search-dirs = $(boost-root)/tools/boostbook $(boost-build-path)/../boostbook ; + local boostbook-xsl-dir = [ GLOB $(search-dirs) : xsl ] ; + local boostbook-dtd-dir = [ GLOB $(search-dirs) : dtd ] ; + .boostbook-xsl-dir = [ path.make $(boostbook-xsl-dir[1]) ] ; + .boostbook-dtd-dir = [ path.make $(boostbook-dtd-dir[1]) ] ; + + if ! $(.boostbook-xsl-dir) || ! $(.boostbook-dtd-dir) { - local boost-root-path = [ path.make $(boost-root) ] ; - .boostbook-xsl-dir = [ path.join $(boost-root-path) tools boostbook xsl/ ] ; - .boostbook-dtd-dir = [ path.join $(boost-root-path) tools boostbook dtd/ ] ; + errors.error + couldn't find BoostBook xsl/ or dtd/ directories; + : please set \"BOOST_ROOT\" variable to the root directory of + your boost installation. Searched in: + : $(search-dirs:J=" +") ; + } - else - { - errors.error - "Boost root is not specified. Don't know where to find BoostBook files." ; - } } }