diff options
-rw-r--r-- | configure.ac | 41 | ||||
-rw-r--r-- | docbook/Makefile.am | 48 |
2 files changed, 25 insertions, 64 deletions
diff --git a/configure.ac b/configure.ac index 2b16f059d0..d142736925 100644 --- a/configure.ac +++ b/configure.ac @@ -726,34 +726,19 @@ AX_LIBSMI # # Check for programs used when building DocBook documentation. # - -# Check for a2x (convert asciidoc to another format) -AC_PATH_PROG(A2X, a2x) -AC_CHECK_PROG(HAVE_A2X, a2x, "yes", "no") -AM_CONDITIONAL(HAVE_A2X, test x$HAVE_A2X = xyes) - -# Check for fop (translate .fo to e.g. pdf) -AC_PATH_PROG(FOP, fop) -AC_CHECK_PROG(HAVE_FOP, fop, "yes", "no") -AM_CONDITIONAL(HAVE_FOP, test x$HAVE_FOP = xyes) - -# TODO: HAVE_LYNX and HAVE_W3M are unused. Maybe require one of them -# to be found when a2x is enabled? Otherwise it will fail later... -# Check for lynx (asciidoc text format from html) -AC_PATH_PROG(LYNX, lynx) -AC_CHECK_PROG(HAVE_LYNX, lynx, "yes", "no") -AM_CONDITIONAL(HAVE_LYNX, test x$HAVE_LYNX = xyes) - -# Check for w3m (asciidoc text format from html) -AC_PATH_PROG(W3M, w3m) -AC_CHECK_PROG(HAVE_W3M, w3m, "yes", "no") -AM_CONDITIONAL(HAVE_W3M, test x$HAVE_W3M = xyes) - -# Check for xsltproc -AC_PATH_PROG(XSLTPROC, xsltproc) -AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, "yes", "no") -AM_CONDITIONAL(HAVE_XSLTPROC, test x$HAVE_XSLTPROC = xyes) - +AC_CHECK_PROGS(XSLTPROC, xsltproc, xsltproc) +AC_CHECK_PROGS(A2X, a2x, a2x) +AC_CHECK_PROGS(FOP, fop, fop) + +# HTML to text processor +AC_MSG_CHECKING([for an HTML to text processor]) +AS_IF([w3m -version >&AS_MESSAGE_LOG_FD 2>&1], [have_a2x_text=w3m], + [lynx -version >&AS_MESSAGE_LOG_FD 2>&1], [have_a2x_text=lynx], + [have_a2x_text=no]) +AC_MSG_RESULT([$have_a2x_text]) +AM_CONDITIONAL(HAVE_A2X_TEXT, [test "x$have_a2x_text" != xno]) +AS_IF([test $have_a2x_text = lynx], [A2X_LYNX="--lynx"]) +AC_SUBST(A2X_LYNX) # Check for packaging utilities # For now, we check to see if the various packaging utilites are in our diff --git a/docbook/Makefile.am b/docbook/Makefile.am index c31eb8d353..d67543b2e7 100644 --- a/docbook/Makefile.am +++ b/docbook/Makefile.am @@ -14,10 +14,6 @@ FOP_OPTS=-Xmx256m A2X_HTML_OPTS="--stylesheet=ws.css" A2X_TEXT_OPTS= -#if HAVE_LYNX -A2X_TEXT_OPTS+="--lynx" -#endif - ############### YOU SHOULDN'T HAVE TO EDIT ANYTHING BELOW THIS LINE! ################ include Makefile.common @@ -25,28 +21,16 @@ include Makefile.common # Automatically generate .pdf files from .fo files # Suse needs FOP_OPTS, Debian needs JAVA_OPTS .fo.pdf: -if HAVE_FOP FOP_OPTS=$(FOP_OPTS) JAVA_OPTS=$(FOP_OPTS) $(FOP) $< $@ -else - @echo - @echo "Error: FOP is needed to create PDFs!" - @false -endif -if HAVE_XSLTPROC -ALL_TARGETS=wsug wsdg release_notes -endif +all: wsug wsdg release-notes -all: $(ALL_TARGETS) +all-pdf: wsug-pdf wsdg-pdf release-notes-pdf # Wireshark User Guide -if HAVE_FOP -WSUG_TARGETS=wsug_html_chunked wsug_html user-guide-a4.pdf user-guide-us.pdf -else -WSUG_TARGETS=wsug_html_chunked wsug_html -endif +wsug: wsug_html_chunked wsug_html -wsug: $(WSUG_TARGETS) +wsug-pdf: wsug user-guide-a4.pdf user-guide-us.pdf user-guide.xml: user-guide.asciidoc $(WSUG_FILES) $(A2X) --verbose \ @@ -106,17 +90,9 @@ wsluarm: make-wsluarm.pl $(WSLUA_MODULES) # Wireshark Developer Guide -if HAVE_A2X -if HAVE_FOP -WSDG_TARGETS=wsdg_html_chunked wsdg_html developer-guide-a4.pdf developer-guide-us.pdf -else -WSDG_TARGETS=wsdg_html_chunked wsdg_html -endif -else -WSDG_TARGETS= -endif +wsdg: wsdg_html_chunked wsdg_html -wsdg: $(WSDG_TARGETS) +wsdg-pdf: wsdg developer-guide-a4.pdf developer-guide-us.pdf developer-guide.xml: developer-guide.asciidoc $(WSDG_FILES) $(A2X) --verbose \ @@ -173,14 +149,14 @@ developer-guide-a4.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl --path .:wsluarm_src:$(srcdir) \ --nonet $(srcdir)/custom_layer_pdf.xsl $< > $@ - -if HAVE_FOP -RELEASE_NOTES_TARGETS=release-notes.html release-notes.txt release-notes-a4.pdf release-notes-us.pdf +# Release notes +if HAVE_A2X_TEXT +release-notes: release-notes.html release-notes.txt else -RELEASE_NOTES_TARGETS=release-notes.html release-notes.txt +release-notes: release-notes.html endif -release_notes: $(RELEASE_NOTES_TARGETS) +release-notes-pdf: release-notes release-notes-a4.pdf release-notes-us.pdf # create html single page file release-notes.html: $(RELEASE_NOTES_SOURCE) @@ -192,7 +168,7 @@ release-notes.html: $(RELEASE_NOTES_SOURCE) # create txt single page file (through HTML) release-notes.txt: $(RELEASE_NOTES_SOURCE) @ echo --- RELEASE NOTES - TXT --- - TZ=UTC $(A2X) --format=text $(A2X_TEXT_OPTS) \ + TZ=UTC $(A2X) --format=text @A2X_LYNX@ $(A2X_TEXT_OPTS) \ --xsltproc-opts "--stringparam generate.toc \"article nop\"" \ --destination-dir=$(builddir) \ $(srcdir)/release-notes.asciidoc && \ |