summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/Makefile.in5
-rw-r--r--docs/aclocal.m435
-rw-r--r--docs/configure.in60
3 files changed, 76 insertions, 24 deletions
diff --git a/docs/Makefile.in b/docs/Makefile.in
index dea99ed91c..4a03a94f3f 100644
--- a/docs/Makefile.in
+++ b/docs/Makefile.in
@@ -63,7 +63,7 @@ HOWTODIR_IMAGES_EPS=$(patsubst %.png,%.eps,$(wildcard $(IMAGEPROJDIR)/*.png))
HOWTODIR_DEPS = $(HOWTODIR)/*.xml $(HOWTODIR)/attributions.xml $(MANPAGEDIR)/*.xml $(SMBDOTCONFDOC)/smb.conf.5.xml $(SMBDOTCONFDOC)/parameters.all.xml $(SMBDOTCONFDOC)/parameters.global.xml $(SMBDOTCONFDOC)/parameters.service.xml
DEVDOCDIR_DEPS = $(DEVDOCDIR)/*.xml $(DEVDOCDIR)/attributions.xml
-all:
+help:
@echo "Supported make targets:"
@echo "release - Build the docs needed for a Samba release"
@echo "pdf - Build PDF version of book"
@@ -80,8 +80,11 @@ all:
@echo "undocumented - Output list of undocumented smb.conf options"
@echo "samples - Extract examples"
@echo "files - Extract other files"
+ @echo "all - Build all docs that can be build using the utilities found by configure"
@echo "everything - Build all of the above"
+all: @TARGETS@
+
everything: manpages pdf html-single html htmlman txt ps
release: manpages htmlman html html-single pdf guide
diff --git a/docs/aclocal.m4 b/docs/aclocal.m4
new file mode 100644
index 0000000000..731139cfde
--- /dev/null
+++ b/docs/aclocal.m4
@@ -0,0 +1,35 @@
+dnl DOCS_DEFINE_TARGET
+dnl arg1: Target that is defined
+dnl arg2: Requirement
+dnl arg3: Official name
+dnl arg4: Makefile target name
+
+AC_DEFUN(DOCS_DEFINE_TARGET, [
+ if test "x$$1_REQUIRES" = x; then
+ $1_REQUIRES="$$2_REQUIRES"
+ else
+ $1_REQUIRES="$$1_REQUIRES $$2_REQUIRES"
+ fi
+
+ if test x"$$1_REQUIRES" = x; then
+ TARGETS="$TARGETS $4"
+ else
+ AC_MSG_RESULT([Building the $3 requires : $$1_REQUIRES])
+ fi
+])
+
+dnl DOCS_TARGET_REQUIRE_PROGRAM
+dnl arg1: program variable
+dnl arg2: program executable name
+dnl arg3: target that requires it
+
+AC_DEFUN(DOCS_TARGET_REQUIRE_PROGRAM, [
+ AC_PATH_PROG([$1], [$2])
+ if test x"$$1" = x; then
+ if test x"$$3_REQUIRES" = x; then
+ $3_REQUIRES="$2"
+ else
+ $3_REQUIRES="$$3_REQUIRES $2"
+ fi
+ fi
+])
diff --git a/docs/configure.in b/docs/configure.in
index 02514990df..276a162761 100644
--- a/docs/configure.in
+++ b/docs/configure.in
@@ -1,18 +1,5 @@
AC_INIT(entities/global.entities)
-AC_PATH_PROG(XSLTPROC, xsltproc)
-if test "x$XSLTPROC" = x; then
- AC_MSG_ERROR("xsltproc is required")
-fi
-AC_PATH_PROG(PDFLATEX, pdflatex)
-if test "x$PDFLATEX" = x; then
- AC_MSG_ERROR("pdflatex is required")
-fi
-AC_PATH_PROG(MAKEINDEX, makeindex)
-if test "x$MAKEINDEX" = x; then
- AC_MSG_ERROR("makeindex is required")
-fi
-
PAPERSIZE=""
DUPLICATE_ULINKS=""
@@ -34,16 +21,6 @@ AC_ARG_WITH(fontsize,
[ --with-fontsize Specify the fontsize in points (default: 10.5) ],
[ test "$withval" && FONTSIZE="$withval" ])
-AC_PATH_PROG(RM, rm)
-AC_PATH_PROG(WGET, wget)
-AC_PATH_PROG(LATEX, latex)
-AC_PATH_PROG(DVIPS, dvips)
-AC_PATH_PROG(PNGTOPNM, pngtopnm)
-AC_PATH_PROG(PNMTOPS, pnmtops)
-AC_PATH_PROG(PERL, perl)
-AC_PATH_PROG(XMLTO, xmlto)
-AC_PATH_PROG(PLUCKERBUILD, plucker-build, [echo -e 'No plucker-build utility was found, ignoring following options:\n'])
-AC_PATH_PROG(EPSTOPDF, epstopdf)
DOC_BUILD_DATE=`date '+%d-%m-%Y'`
AC_SUBST(DOC_BUILD_DATE)
@@ -52,4 +29,41 @@ AC_SUBST(DUPLICATE_ULINKS)
AC_SUBST(FONTSIZE)
AC_SUBST(DOCROP)
+DOCS_TARGET_REQUIRE_PROGRAM(XSLTPROC, xsltproc, ALL)
+DOCS_TARGET_REQUIRE_PROGRAM(RM, rm, ALL)
+DOCS_TARGET_REQUIRE_PROGRAM(MAKEINDEX, makeindex, LATEX)
+DOCS_TARGET_REQUIRE_PROGRAM(WGET, wget, LATEX)
+DOCS_TARGET_REQUIRE_PROGRAM(PDFLATEX, pdflatex, PDF)
+DOCS_TARGET_REQUIRE_PROGRAM(EPSTOPDF, epstopdf, PDF)
+DOCS_TARGET_REQUIRE_PROGRAM(PNGTOPNM, pngtopnm, PS)
+DOCS_TARGET_REQUIRE_PROGRAM(PNMTOPS, pnmtops, PS)
+DOCS_TARGET_REQUIRE_PROGRAM(LATEX, latex, PS)
+DOCS_TARGET_REQUIRE_PROGRAM(DVIPS, dvips, PS)
+DOCS_TARGET_REQUIRE_PROGRAM(PLUCKERBUILD, plucker-build, PLUCKER)
+DOCS_TARGET_REQUIRE_PROGRAM(XMLTO, xmlto, TXT)
+DOCS_TARGET_REQUIRE_PROGRAM(PERL, perl, UNDOCUMENTED)
+
+AC_MSG_RESULT([])
+AC_MSG_RESULT([Summary:])
+AC_MSG_RESULT([--------------])
+
+
+DOCS_DEFINE_TARGET(ALL, [], [base requirements], [])
+DOCS_DEFINE_TARGET(LATEX, ALL, [LaTeX versions], [tex])
+DOCS_DEFINE_TARGET(PDF, LATEX, [PDF versions], [pdf])
+DOCS_DEFINE_TARGET(PS, LATEX, [PostScript versions], [ps])
+DOCS_DEFINE_TARGET(HTML, ALL, [HTML versions], [html])
+DOCS_DEFINE_TARGET(MANPAGES, ALL, [manpages], [manpages])
+DOCS_DEFINE_TARGET(PLUCKER, HTML, [plucker versions], [plucker])
+DOCS_DEFINE_TARGET(UNDOCUMENTED, MANPAGES, [list of undocumented options], [undocumented])
+DOCS_DEFINE_TARGET(TXT, ALL, [text versions], [txt])
+
+if test x"$TARGETS" = x; then
+ AC_MSG_ERROR([You won't be able to build any of the docs])
+else
+ AC_MSG_RESULT([You will be able to build: $TARGETS])
+fi
+
+AC_SUBST(TARGETS)
+
AC_OUTPUT( Makefile settings.xsl )