From da3daca411cf2589db1576638f7458d5e10ffbcb Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 7 Nov 2010 14:46:20 +0000 Subject: [PATCH] Fix some issues with the fop tool. * Import boostbook to register `FO`. * Remove re-initialization check, now overrides previous initialization. * Set `JAVA_HOME` and `JAVACMD` based on the appropriate parameters. [SVN r66432] --- src/tools/fop.jam | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/tools/fop.jam b/src/tools/fop.jam index 2fc426d20..ed0255502 100644 --- a/src/tools/fop.jam +++ b/src/tools/fop.jam @@ -9,7 +9,8 @@ import os ; import generators ; import common ; -import errors ; +import errors ; +import boostbook ; generators.register-standard fop.render.pdf : FO : PDF ; generators.register-standard fop.render.ps : FO : PS ; @@ -19,21 +20,23 @@ rule init ( fop-command ? : java-home ? : java ? ) fop-command = [ common.get-invocation-command fop : fop : $(fop-command) : [ modules.peek : FOP_DIR ] ] ; - if $(.initialized) + .FOP_COMMAND = $(fop-command) ; + .FOP_SETUP = ; + + # JAVA_HOME is the location that java was installed to. + + if $(java-home) { - if $(.FOP_COMMAND) != $(fop-command) || $(JAVA_HOME) != $(java-home) - || $(JAVACMD) != $(java) - { - errors.user-error "fop: reinitialization with different options" ; - } + .FOP_SETUP += [ common.variable-setting-command JAVA_HOME : $(java-home) ] ; } - else + + # JAVACMD is the location that of the java executable, useful for a + # non-standard java installation, where the executable isn't at + # $JAVA_HOME/bin/java. + + if $(java) { - .initialized = true ; - .FOP_COMMAND = $(fop-command) ; - # What is the meaning of this logic? Needs more comments!! --DWA - java-home ?= $(java) ; - .FOP_SETUP = [ common.variable-setting-command JAVA_HOME : $(java-home) ] ; + .FOP_SETUP += [ common.variable-setting-command JAVACMD : $(java) ] ; } # Make sure the fop command is executed from within the directory where it's located.