path: root/
diff options
authorGiorgio Dal Molin <>2014-11-12 17:41:05 +0100
committerPablo Neira Ayuso <>2014-11-12 21:43:45 +0100
commitc12d635ca3ef24345e37aca7bd2bb1aa280c0e34 (patch)
tree466d66415fcac8679ccfeeae7db6cbdbc059d174 /
parent5fa8e494ca240567313215a7d5a87c620e86024e (diff)
build: add autotools support for the 'doc' subdir
'nft' documentation is originally contained in the XML file 'doc/nft.xml'. Processing this file with the proper tools we can obtain a PDF document, 'nft.pdf', and a unix man page, 'nft.8'. To produce the PDF we need the tool 'dblatex' (current release To produce the man page we use the tool 'docbook2man'; it is part of the package 'docbook2X' ( On some linux distributions the tool can have slightly different names as 'docbook2x-man' or 'db2x_docbook2man' so we search for all three names and use the first one found and issue the command: # ${DB2MAN} --xinclude $< Signed-off-by: Giorgio Dal Molin <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to '')
1 files changed, 17 insertions, 21 deletions
diff --git a/ b/
index e71dcedf..7bbd86ef 100644
--- a/
+++ b/
@@ -49,29 +49,24 @@ then
exit 1
-AC_CHECK_PROG(CONFIG_MAN1, [docbook2x-man], [y], [n])
-if test "$CONFIG_MAN1" == "y"
- DB2MAN=docbook2x-man
- AC_CHECK_PROG(CONFIG_MAN2, [db2x_docbook2man], [y], [n])
- if test "$CONFIG_MAN2" == "y"
- then
- DB2MAN=db2x_docbook2man
- else
- AC_MSG_WARN([docbookx2-man/db2x_docbook2man not found, no manpages will be built])
- fi
+AC_CHECK_PROG(DOCBOOK2X_MAN, [docbook2x-man], [docbook2x-man], [no])
+AC_CHECK_PROG(DOCBOOK2MAN, [docbook2man], [docbook2man], [no])
+AC_CHECK_PROG(DB2X_DOCBOOK2MAN, [db2x_docbook2man], [db2x_docbook2man], [no])
+AS_IF([test "$DOCBOOK2X_MAN" != "no"], [DB2MAN="$DOCBOOK2X_MAN"],
+ [AS_IF([test "$DOCBOOK2MAN" != "no"], [DB2MAN="$DOCBOOK2MAN"],
+ [AS_IF([test "$DB2X_DOCBOOK2MAN" != "no"], [DB2MAN="$DB2X_DOCBOOK2MAN"],
+ [AC_MSG_WARN([docbookx2-man/db2x_docbook2man not found, no manpages will be built])]
+ )]
+ )]
-AC_CHECK_PROG(CONFIG_PDF, dblatex, y, n)
-if test "$CONFIG_PDF" != "y"
- AC_MSG_WARN([dblatex not found, no PDF manpages will be built])
+AC_CHECK_PROG(DBLATEX, [dblatex], [found], [no])
+AS_IF([test "$DBLATEX" == "no"],
+ [AC_MSG_WARN([dblatex not found, no PDF manpages will be built])]
+AM_CONDITIONAL([BUILD_PDF], [test "$DBLATEX" == "found"])
# Checks for libraries.
PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.3])
@@ -125,6 +120,7 @@ AC_CONFIG_FILES([ \
include/Makefile \
include/linux/Makefile \
include/linux/netfilter/Makefile \
+ doc/Makefile \