VirtualBox

Changeset 99043 in vbox


Ignore:
Timestamp:
Mar 19, 2023 2:47:46 AM (23 months ago)
Author:
vboxsync
Message:

manual/Makefile.kmk: Copy the dita-ot for each invocation (using new script dita-ot-copy-exec.sh), but try to hardlink the files where possible. Also added a hack to prevent hhc.exe from being searched for and ran during the htmlhelp/qhelp processing. bugref:10302

Location:
trunk/doc/manual
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/Makefile.kmk

    r99042 r99043  
    6666
    6767# Error out if someone tries to override old globals.
    68 ifdef HTMLHELPOPTS
    69  $(error HTMLHELPOPTS was renamed to VBOX_HTMLHELP_OPTS!)
    70 endif
    7168ifdef DOCBOOKPATH
    7269 $(error DOCBOOKPATH was renamed to VBOX_PATH_DOCBOOK!)
     
    8784 $(error PDFLATEX was renamed to VBOX_PDFLATEX_CMD!)
    8885endif
    89 ifdef HHC
    90  $(error HHC was renamed to VBOX_HHC!)
    91 endif
    92 
    93 VBOX_DITA_PATH          = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita-ot-1.8.5
    9486
    9587VBOX_QHELP_OUTPUT_FILES = \
     
    117109 VBOX_PDFLATEX_CMD         = pdflatex $(VBOX_PDFLATEX_HALT) -interaction $(VBOX_PDFLATEX_INTERACTION)
    118110endif
    119 
    120 # Windows HTML Help Workshop compiler (stupid thing always returns an error!)
    121 VBOX_HHC = -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe
    122 
    123 
    124 # Additional xsltproc options when generating
    125 VBOX_HTMLHELP_OPTS ?=
    126111
    127112# SDK related globals.
     
    167152  VBOX_PATH_BIN_QHELP :=
    168153 endif
    169 
    170  ## @todo r=bird: Explanations for all of this is required!
    171  .NOTPARALLEL: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/qhelp/UserManual.qch \
    172                 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.qhc \
    173                 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.pdf \
    174                 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip
    175154
    176155 ifndef VBOX_ONLY_SDK
     
    635614                $(VBOX_PATH_MANUAL_OUTBASE)/dita_common
    636615        $(call MSG_L1,Building html chunks $@)
    637         $(QUIET)$(call VBOX_DITA_ENV_SETUP) $(VBOX_JAVA) -jar $(VBOX_DITA_PATH_LIB)/dost.jar \
    638                 /i:$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual.ditamap \
    639                 /transtype:xhtml \
    640                 /ditadir:$(VBOX_DITA_PATH) \
    641                 /outdir:$(@D) \
    642                 /tempdir:$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/temp_xhtml
     616        $(QUIET)$(RM) -Rf -- "$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita-ot-html-chunks/"
     617        $(QUIET)$(call VBOX_DITA_RUN_DOST,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita-ot-html-chunks) \
     618                "/i:$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual.ditamap" \
     619                "/transtype:xhtml" \
     620                "/outdir:$(@D)" \
     621                "/tempdir:$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/temp_xhtml"
    643622
    644623 # disable for now
     
    689668                $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/% : \
    690669                $(VBOX_PATH_MANUAL_SRC)/en_US/dita/% | $$(dir $$@)
    691         $(INSTALL_STAGING) -v -m 0644 -- "$<" "$(@D)/"
     670        $(QUIET)$(INSTALL_STAGING) -m 0644 -- "$<" "$(@D)/"
    692671
    693672 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/reference.dtd: | $$(dir $$@)
     
    703682                $(VBOX_USER_MANUAL_STAGED_DITA_FILES) \
    704683                $(VBOX_USER_MANUAL_STAGED_IMAGE_FILES) \
    705                 $$(VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES) \
    706                 $(VBOX_DITA_PATH)
     684                $$(VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES)
    707685        $(call MSG_L1, Ran common dita steps)
    708686        $(QUIET)$(TOUCH) -- "$@"
     
    765743        $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --maxdepth 6000 --output "$$@" \
    766744                "$$(VBOX_PATH_MANUAL_SRC)/mark_external_urls.xsl" "$$@"
    767         $$(QUIET)$$(VBOX_BLD_PYTHON) $$(VBOX_PATH_MANUAL_SRC)/add_file_to_id_only_references.py -v \
     745        $$(QUIET)$$(VBOX_BLD_PYTHON) $$(VBOX_PATH_MANUAL_SRC)/add_file_to_id_only_references.py \
    768746                --mapping-file "$$(VBOX_USER_MANUAL_ID_MAPPING_FILE)" "$$@"
    769747 endef
     
    779757 #
    780758 ##########################################################################################
    781  # Copy the dita library under out folder since at each use the library modifies some
    782  # run-time configuation files and there seems to be no way to override this.
    783  ## @todo r=bird: This is _incredibly_ crude.  But then, the tool is the worst with its inane
    784  ##       desire to modify build.xml, catalog-dita.xml and lib/org.dita.dost.platform/plugin.properties
    785  ##       with a fresh plugin setup (the differences seems to be down to hashing/map
    786  ##       ordering difference).  Wonder if we can get away with a single copy
    787  ##       as long as we do the plugin update right after duplicating it here...
    788  ##       Also, I would _really_ like to symlink/hardlink as much as possible
    789  ##       of it to save time and storage space.
    790  $(VBOX_DITA_PATH):
    791         $(MKDIR) -p $(VBOX_DITA_PATH)
    792         $(CP) -vR -- "$(VBOX_DITA_ORIGINAL_PATH)/" "$(VBOX_DITA_PATH)/"
    793         $(RM) -vf -- "$(VBOX_DITA_PATH)/build.xml" \
    794                 "$(VBOX_DITA_PATH)/catalog-dita.xml" \
    795                 "$(VBOX_DITA_PATH)/lib/org.dita.dost.platform/plugin.properties"
    796 
    797  VBOX_DITA_PATH_LIB ?= $(VBOX_DITA_PATH)/lib
    798  VBOX_DITA_ENV_SETUP ?= $(REDIRECT) \
     759 ## Copies DITA-OT to $1, runs the dost.jar with /ditadir given and nukes $1 when done.
     760 ##
     761 ## Additional options for dost.jar can be specified following the call to VBOX_DITA_RUN_DOST
     762 ##
     763 ## @param 1    Temporary+unique DITA-OT path.
     764 ## @param 2    Additional kmk_redirect options.
     765 VBOX_DITA_RUN_DOST ?= $(REDIRECT) \
    799766        -E 'ANT_OPTS=-Xmx512m -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl' \
    800         -E 'ANT_HOME=$(VBOX_DITA_PATH)/tools/ant' \
    801         -E 'DITA_DIR=$(VBOX_DITA_PATH)' \
     767        -E 'ANT_HOME=$1/tools/ant' \
     768        -E 'DITA_DIR=$1' \
    802769        -E 'JAVA_HOME=$(VBOX_JAVA_HOME)' \
    803         -A 'PATH=$(HOST_PATH_SEP)$(VBOX_DITA_PATH)/tools/ant/bin' \
    804         -E 'CLASSPATH=$(VBOX_DITA_PATH_LIB)/dost.jar' \
    805         -A 'CLASSPATH=$(HOST_PATH_SEP)$(VBOX_DITA_PATH_LIB)' \
    806         -A 'CLASSPATH=$(HOST_PATH_SEP)$(VBOX_DITA_PATH_LIB)/commons-codec-1.4.jar' \
    807         -A 'CLASSPATH=$(HOST_PATH_SEP)$(VBOX_DITA_PATH_LIB)/resolver.jar' \
    808         -A 'CLASSPATH=$(HOST_PATH_SEP)$(VBOX_DITA_PATH_LIB)/icu4j.jar' \
    809         -A 'CLASSPATH=$(HOST_PATH_SEP)$(VBOX_DITA_PATH_LIB)/xercesImpl.jar' \
    810         -A 'CLASSPATH=$(HOST_PATH_SEP)$(VBOX_DITA_PATH_LIB)/xml-apis.jar' \
    811         -A 'CLASSPATH=$(HOST_PATH_SEP)$(VBOX_DITA_PATH_LIB)/saxon/saxon9.jar' \
    812         -A 'CLASSPATH=$(HOST_PATH_SEP)$(VBOX_DITA_PATH_LIB)/saxon/saxon9-dom.jar' \
    813         --
     770        -A 'PATH=$(HOST_PATH_SEP)$1/tools/ant/bin' \
     771        -E 'CLASSPATH=$1/lib/dost.jar' \
     772        -A 'CLASSPATH=$(HOST_PATH_SEP)$1/lib' \
     773        -A 'CLASSPATH=$(HOST_PATH_SEP)$1/lib/commons-codec-1.4.jar' \
     774        -A 'CLASSPATH=$(HOST_PATH_SEP)$1/lib/resolver.jar' \
     775        -A 'CLASSPATH=$(HOST_PATH_SEP)$1/lib/icu4j.jar' \
     776        -A 'CLASSPATH=$(HOST_PATH_SEP)$1/lib/xercesImpl.jar' \
     777        -A 'CLASSPATH=$(HOST_PATH_SEP)$1/lib/xml-apis.jar' \
     778        -A 'CLASSPATH=$(HOST_PATH_SEP)$1/lib/saxon/saxon9.jar' \
     779        -A 'CLASSPATH=$(HOST_PATH_SEP)$1/lib/saxon/saxon9-dom.jar' \
     780        $2 \
     781        -- $(SHELL) $(VBOX_PATH_MANUAL_SRC)/dita-ot-copy-exec.sh "$(VBOX_DITA_ORIGINAL_PATH)" "$1" \
     782        -- $(VBOX_JAVA) -jar "$1/lib/dost.jar" "/ditadir:$1" # "/outercontrol:fail" ?
     783
    814784
    815785 # Note! The /tempdir is deleted, recreated, used and deleted again for each run. So, be careful where you point it.
     
    824794                $$(VBOX_MANUAL_XML_FILES_GENERATED_$(lang)) \
    825795                $$(VBOX_PATH_MANUAL_OUTBASE)/dita_common
    826         $(QUIET)$(RM) -f -- "$$@"
    827         $(QUIET)$(call VBOX_DITA_ENV_SETUP) $(VBOX_JAVA) -jar $(VBOX_DITA_PATH_LIB)/dost.jar \
    828                 /i:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/UserManual.ditamap \
    829                 /transtype:pdf \
    830                 /ditadir:$(VBOX_DITA_PATH) \
    831                 /outdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1) \
    832                 /tempdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/temp_pdf
     796        $$(QUIET)$(RM) -f -- "$$@"
     797        $$(QUIET)$(RM) -Rf -- "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita-ot-pdf/"
     798        $$(QUIET)$$(call VBOX_DITA_RUN_DOST,$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita-ot-pdf) \
     799                "/i:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/UserManual.ditamap" \
     800                "/transtype:pdf" \
     801                "/outdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)" \
     802                "/tempdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/temp_pdf"
    833803
    834804  ditamap-to-pdf: $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual.pdf
     
    939909
    940910
     911 # Setting HHCDIR here so that it fails to locate hcc.exe and always skips the
     912 # compilation step that produces the .chm-file, since we don't need it and it
     913 # mangles the path so it always fails anyway.
    941914 define def_ditamap_to_htmlhelp
    942915  ditamap-to-htmlhelp: $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/qhelp/UserManual.hhp
    943916  $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/qhelp/UserManual.hhp: \
    944917                $(VBOX_PATH_MANUAL_OUTBASE)/dita_common
    945         $(QUIET)$(call VBOX_DITA_ENV_SETUP) $(VBOX_JAVA) -jar $(VBOX_DITA_PATH_LIB)/dost.jar \
    946                 /i:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/UserManual.ditamap \
    947                 /transtype:htmlhelp \
    948                 /ditadir:$(VBOX_DITA_PATH) \
    949                 /outdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/qhelp \
    950                 /tempdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/temp_htmlhelp
     918        $$(QUIET)$(RM) -Rf -- "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita-ot-qhelp/"
     919        $$(QUIET)$$(call VBOX_DITA_RUN_DOST,$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita-ot-qhelp, -EHHCDIR="$$(@D)") \
     920                "/i:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/UserManual.ditamap" \
     921                "/transtype:htmlhelp" \
     922                "/outdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/qhelp" \
     923                "/tempdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/temp_htmlhelp"
    951924
    952925 endef
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette