diff --git a/build/Makefile b/build/Makefile new file mode 100644 index 0000000..b7a43ff --- /dev/null +++ b/build/Makefile @@ -0,0 +1,40 @@ +include Makefile.def +include Makefile.rules + +default: html + +all: html man pdf + +.dummy: + +docbook: .dummy + $(XSL) --stringparam boost.root $(BOOST_ROOT) $(BOOSTBOOK_XSL_PATH)/docbook.xsl $(BOOST_ROOT)/doc/src/boost.xml > boost.docbook + @mkdir -p $(BOOST_ROOT)/doc + +fo: docbook + $(XSL) $(DOCBOOK_FO_PARAMS) $(DOCBOOK_XSL_PATH)/fo/docbook.xsl boost.docbook > boost.fo + +man: docbook + $(XSL) $(DOCBOOK_XSL_PATH)/manpages/docbook.xsl boost.docbook + @rm -rf $(BOOST_ROOT)/doc/man + @mkdir -p $(BOOST_ROOT)/doc/man + @mkdir -p $(BOOST_ROOT)/doc/man/man3 + @mv *.3 $(BOOST_ROOT)/doc/man/man3 + (cd $(BOOST_ROOT) && tar czvf doc/boost-doc-man.tar.gz doc/man) + +html: docbook + @rm -f $(BOOST_ROOT)/doc/html/*.html + $(XSL) -o $(BOOST_ROOT)/doc/html/ $(BOOSTBOOK_XSL_PATH)/html.xsl boost.docbook + +pdf: fo + JAVA_HOME=$(JAVA_HOME) $(FOP) boost.fo $(BOOST_ROOT)/doc/boost.pdf + +testsuite: .dummy + $(XSL) --stringparam boost.root $(BOOST_ROOT) $(BOOSTBOOK_XSL_PATH)/testing/Jamfile.xsl boost.xml + +check: .dummy + $(CHECK_DTD) boost.xml + +check-docbook: docbook + $(CHECK_DTD) boost.docbook + diff --git a/build/Makefile.rules b/build/Makefile.rules new file mode 100644 index 0000000..fc8b05a --- /dev/null +++ b/build/Makefile.rules @@ -0,0 +1,14 @@ +XSL=XML_CATALOG_FILES=$(BOOSTBOOK_CATALOG) $(XSLTPROC) --xinclude --nonet +CHECK_DTD=XML_CATALOG_FILES=$(BOOSTBOOK_CATALOG) $(XMLLINT) --xinclude --noout --postvalid + +%.docbook: %.xml + $(XSL) --stringparam boost.root $(BOOST_ROOT) -o $@ $(BOOSTBOOK_XSL_PATH)/docbook.xsl $< + +%.fo: %.docbook + $(XSL) -o $@ $(BOOSTBOOK_XSL_PATH)/fo.xsl $< + +%.pdf: %.fo + JAVA_HOME=$(JAVA_HOME) $(FOP) $< $@ + +%.html: %.docbook + $(XSL) -o $@ $(BOOSTBOOK_XSL_PATH)/html-single.xsl $< \ No newline at end of file diff --git a/build/configure b/build/configure new file mode 100755 index 0000000..b6fe466 --- /dev/null +++ b/build/configure @@ -0,0 +1,116 @@ +#!/bin/sh + +if [ -z $2 ]; then + echo "Syntax is ./configure []" + echo "If you do not have the DocBook XSL Stylesheets or DTD, please download" + echo "them from http://docbook.sourceforge.net/" + exit -1 +fi + +DOCBOOK_XSL_PATH=$1 +if [ ! -r $DOCBOOK_XSL_PATH/html/chunk.xsl ]; then + echo "The DocBook XSL path given does not seem correct. Please check the" + echo "path again and rerun configure. The DocBook XSL path given was: " + echo " $DOCBOOK_XSL_PATH" + exit -2 +fi + +DOCBOOK_DTD_PATH=$2 +if [ ! -r $DOCBOOK_DTD_PATH/docbookx.dtd ]; then + echo "The DocBook DTD patch given does not seem correct. Please check the" + echo "path again and rerun configure. The DocBook DTD path given was: " + echo " $DOCBOOK_DTD_PATH" + exit -3; +fi + +BOOSTBOOK_XSL_PATH=`pwd` +BOOSTBOOK_XSL_PATH="${BOOSTBOOK_XSL_PATH%/build*}/xsl" +if [ ! -r "$BOOSTBOOK_XSL_PATH/docbook.xsl" ]; then + echo "Please execute configure from the BoostBook build directory" + exit -4; +fi + +BOOSTBOOK_DTD_PATH=`pwd` +BOOSTBOOK_DTD_PATH="${BOOSTBOOK_DTD_PATH%/build*}/dtd" +if [ ! -r "$BOOSTBOOK_DTD_PATH/boostbook.dtd" ]; then + echo "Please execute configure from the BoostBook build directory" + exit -5; +fi + + +XSLTPROC=${XSLTPROC:-`which xsltproc`} +if [ ! -x $XSLTPROC ]; then + echo "Could not find the program xsltproc in the current PATH. Stopping..." + exit -6 +fi + +XMLLINT=${XMLLINT:-`which xmllint`} +if [ ! -x $XMLLINT ]; then + echo "Could not find the program xmllint in the current PATH." + echo "This is not a problem per se, but you may not be able to validate" + echo "XML files against a DTD." +fi + +if [ -z $JAVA_HOME ]; then + JAVA=${JAVA:-`which java`} + JAVA_BIN_PATH=${JAVA%/*} + JAVA_HOME=${JAVA_BIN_PATH%/bin} +fi + +if [ ! -d $JAVA_HOME ]; then + echo "Could not find Java. PDF generation will not be available." + echo "If you have Java installed, set JAVA_HOME to its path and rerun " + echo "configure." +else + FOP=${FOP:-$3} + if [ ! -z $FOP ]; then + if [ -d $FOP ]; then + FOP=${FOP%/} + FOP="$FOP/fop.sh" + fi + fi + + if [ -z $FOP ] || [ ! -x $FOP ]; then + echo "Could not find FOP. PDF generation will not be available." + echo "If you have FOP installed, pass the installation path as the second" + echo "argument to configure, e.g.," + echo " ./configure $DOCBOOK_XSL_PATH " + echo "" + echo "If you do not have FOP and would like support for building PDF" + echo "documentations, please download FOP from:" + echo " http://xml.apache.org/fop/" + fi +fi + +BOOSTBOOK_CATALOG="`pwd`/catalog.xml" + +cat > Makefile.def << . +XSLTPROC=$XSLTPROC +XMLLINT=$XMLLINT +DOCBOOK_XSL_PATH=$DOCBOOK_XSL_PATH +BOOSTBOOK_XSL_PATH=$BOOSTBOOK_XSL_PATH +JAVA_HOME=$JAVA_HOME +FOP=$FOP +BOOSTBOOK_CATALOG=$BOOSTBOOK_CATALOG +. + +cat > catalog.xml << . + + + + + + + + +. + +echo "BoostBook configuration is complete."