2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-14 00:32:11 +00:00

Make it possible to configure docutils to use built-in docutils package.

This commit is contained in:
Rene Rivera
2015-12-23 10:07:44 -06:00
parent 1b1025fe20
commit 8849b091c5

View File

@@ -51,13 +51,20 @@ rule init ( docutils-dir ? : tools-dir ? )
if ! $(.initialized)
{
.initialized = true ;
.docutils-dir = $(docutils-dir) ;
.tools-dir = $(tools-dir:R="") ;
.setup = [
common.prepend-path-variable-command PYTHONPATH
: $(.docutils-dir) $(.docutils-dir)/extras ] ;
RST2XXX = [ common.find-tool rst2html ] ;
if $(docutils-dir)
{
.docutils-dir = $(docutils-dir) ;
.tools-dir = $(tools-dir:R="") ;
.setup = [
common.prepend-path-variable-command PYTHONPATH
: $(.docutils-dir) $(.docutils-dir)/extras ] ;
RST2XXX = [ common.find-tool rst2html ] ;
}
else
{
RST2XXX_PY = [ common.find-tool rst2html.py ] ;
}
}
}
@@ -66,7 +73,7 @@ rule html ( target : source : properties * )
if ! [ on $(target) return $(RST2XXX) ]
{
local python-cmd = [ property.select <python.interpreter> : $(properties) ] ;
if ! $(.tools-dir) {
if ! $(.tools-dir) && ! $(RST2XXX_PY) {
errors.user-error
"The docutils module is used, but not configured. "
: ""
@@ -79,7 +86,15 @@ rule html ( target : source : properties * )
: "On Windows, you can install from http://docutils.sourceforge.net/."
;
}
RST2XXX on $(target) = $(python-cmd:G=:E="python") $(.tools-dir)/rst2html.py ;
if $(RST2XXX_PY)
{
RST2XXX on $(target) = $(python-cmd:G=:E="python") $(RST2XXX_PY) ;
}
else
{
RST2XXX on $(target) = $(python-cmd:G=:E="python") $(.tools-dir)/rst2html.py ;
}
}
}