Commit 1cce2f51 authored by Ian Lynagh's avatar Ian Lynagh

Handle deciding what docs to build better

Now we have variables for whether or not to build the docbook docs as
HTML, as PS, and as PDF. The configure script output now matches what
the build system will do (except it cannot take account of any
mk/build.mk settings, of course).
parent 78d34718
......@@ -768,6 +768,19 @@ EOF
]) # FP_GEN_DOCBOOK_XML
# FP_PROG_DBLATEX
# ----------------
# Sets the output variable DblatexCmd to the full path of dblatex,
# which we use for building PDF and PS docs.
# DblatexCmd is empty if dblatex could not be found.
AC_DEFUN([FP_PROG_DBLATEX],
[AC_PATH_PROG([DblatexCmd], [dblatex])
if test -z "$DblatexCmd"; then
AC_MSG_WARN([cannot find dblatex in your PATH, you will not be able to build the PDF and PS documentation])
fi
])# FP_PROG_DBLATEX
# FP_PROG_XSLTPROC
# ----------------
# Sets the output variable XsltprocCmd to the full path of the XSLT processor
......@@ -775,7 +788,7 @@ EOF
AC_DEFUN([FP_PROG_XSLTPROC],
[AC_PATH_PROG([XsltprocCmd], [xsltproc])
if test -z "$XsltprocCmd"; then
AC_MSG_WARN([cannot find xsltproc in your PATH, you will not be able to build the documentation])
AC_MSG_WARN([cannot find xsltproc in your PATH, you will not be able to build the HTML documentation])
fi
])# FP_PROG_XSLTPROC
......
......@@ -1002,6 +1002,8 @@ FP_CHECK_DOCBOOK_DTD
FP_DIR_DOCBOOK_XSL([/usr/share/xml/docbook/stylesheet/nwalsh/current /usr/share/xml/docbook/stylesheet/nwalsh /usr/share/xml/docbook/xsl-stylesheets* /usr/share/sgml/docbook/docbook-xsl-stylesheets* /usr/share/sgml/docbook/xsl-stylesheets* /opt/kde?/share/apps/ksgmltools2/docbook/xsl /usr/share/docbook-xsl /usr/share/sgml/docbkxsl /usr/local/share/xsl/docbook /sw/share/xml/xsl/docbook-xsl /opt/local/share/xsl/docbook-xsl])
FP_PROG_FO_PROCESSOR
FP_PROG_DBLATEX
dnl ** check for ghc-pkg command
FP_PROG_GHC_PKG
......@@ -1297,6 +1299,26 @@ else
fi
AC_SUBST(HavePapi)
if test "$DIR_DOCBOOK_XSL" = "" -o
test "$XsltprocCmd" = ""
then
BUILD_DOCBOOK_HTML=NO
else
BUILD_DOCBOOK_HTML=YES
fi
AC_SUBST(BUILD_DOCBOOK_HTML)
if test "$DblatexCmd" = ""
then
BUILD_DOCBOOK_PS=NO
BUILD_DOCBOOK_PDF=NO
else
BUILD_DOCBOOK_PS=YES
BUILD_DOCBOOK_PDF=YES
fi
AC_SUBST(BUILD_DOCBOOK_PS)
AC_SUBST(BUILD_DOCBOOK_PDF)
AC_CONFIG_FILES([mk/config.mk mk/project.mk compiler/ghc.cabal ghc/ghc-bin.cabal ghc.spec extra-gcc-opts docs/users_guide/ug-book.xml])
AC_CONFIG_COMMANDS([mk/stamp-h],[echo timestamp > mk/stamp-h])
AC_OUTPUT
......@@ -1362,17 +1384,11 @@ echo ["\
"]
fi
if test "$DIR_DOCBOOK_XSL" = ""; then
echo ["\
Building DocBook documentation : no"]
else
echo ["\
Building DocBook documentation : yes"]
fi
echo "Building DocBook HTML documentation: $BUILD_DOCBOOK_HTML"
echo "Building DocBook PS documentation: $BUILD_DOCBOOK_PS"
echo "Building DocBook PDF documentation: $BUILD_DOCBOOK_PDF"
echo ["\
Building shared libraries : $BuildSharedLibs"]
echo ["Building shared libraries : $BuildSharedLibs"]
echo ["----------------------------------------------------------------------
"]
......
This diff is collapsed.
......@@ -280,7 +280,7 @@ main = do let xs = {-# SCC "X" #-} [1..1000000]
<para>which gives this heap profile when run:</para>
<imagedata fileref="prof_scc.png"/>
<imagedata fileref="prof_scc"/>
</sect2>
......
......@@ -892,6 +892,10 @@ ISCC =
#-----------------------------------------------------------------------------
# DocBook XML stuff
BUILD_DOCBOOK_HTML = @BUILD_DOCBOOK_HTML@
BUILD_DOCBOOK_PS = @BUILD_DOCBOOK_PS@
BUILD_DOCBOOK_PDF = @BUILD_DOCBOOK_PDF@
DBLATEX = @DblatexCmd@
XSLTPROC = @XsltprocCmd@
XMLLINT = @XmllintCmd@
FOP = @FopCmd@
......
......@@ -17,10 +17,10 @@ define docbook
# $1 = dir
# $2 = docname
$(call clean-target,$1,docbook,$1/$2)
$(call clean-target,$1,docbook,$1/$2 $1/$2.pdf $1/$2.ps)
ifneq "$$(XSLTPROC)" ""
$(call all-target,$1,$1/$2/index.html)
ifeq "$$(BUILD_DOCBOOK_HTML)" "YES"
$(call all-target,$1_html,$1/$2/index.html)
$1/$2/index.html: $$($1_DOCBOOK_SOURCES)
$$(RM) -r $$(dir $$@)
......@@ -32,5 +32,19 @@ $1/$2/index.html: $$($1_DOCBOOK_SOURCES)
cp mk/fptools.css $$(dir $$@)
endif
ifeq "$$(BUILD_DOCBOOK_PS)" "YES"
$(call all-target,$1_ps,$1/$2.ps)
$1/$2.ps: $$($1_DOCBOOK_SOURCES)
$$(DBLATEX) $$(DBLATEX_OPTS) $1/$2.xml --ps -o $$@
endif
ifeq "$$(BUILD_DOCBOOK_PDF)" "YES"
$(call all-target,$1_pdf,$1/$2.pdf)
$1/$2.pdf: $$($1_DOCBOOK_SOURCES)
$$(DBLATEX) $$(DBLATEX_OPTS) $1/$2.xml --pdf -o $$@
endif
endef
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment