diff --git a/configure.ac b/configure.ac index e5bc551..9f13c83 100644 --- a/configure.ac +++ b/configure.ac @@ -203,6 +203,21 @@ fi AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes) +################################################## +# Check for txt2man +################################################## + +AC_ARG_ENABLE(man, [ --disable-man Disable man generation], enable_man="$enableval", [enable_man=yes]) +if test "$enable_man" = yes; then + if ! which txt2man > /dev/null; then + AC_MSG_ERROR([Could not find txt2man script. Install it or configure with --disable-man if you are not interrested in manuals.]) + fi +fi +AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" = yes) + +################################################## +# Check for docbook +################################################## AM_CONDITIONAL(ENABLE_DOCBOOK, test -n "$DOCBOOK_DSL") dnl Checks for library functions. diff --git a/doc/Makefile.am b/doc/Makefile.am index 6d7c3dc..d35a3e4 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -3,9 +3,11 @@ TXT2MAN = txt2man PRODUCT = MDBTools # To make the userguide, export DOCBOOK_DSL TO point to docbook.dsl. - -dist_man_MANS = mdb-tables.1 mdb-ver.1 mdb-export.1 mdb-schema.1 mdb-sql.1 \ +dist_man_MANS = +if ENABLE_MAN + dist_man_MANS += mdb-tables.1 mdb-ver.1 mdb-export.1 mdb-schema.1 mdb-sql.1 \ mdb-array.1 mdb-header.1 mdb-hexdump.1 mdb-parsecsv.1 mdb-prop.1 gmdb2.1 +endif if ENABLE_DOCBOOK dist_man_MANS += install.tgz endif @@ -15,7 +17,7 @@ EXTRA_DIST = mdb-tables.txt mdb-ver.txt mdb-export.txt mdb-schema.txt mdb-sql.tx faq.html install.sgml .txt.1: - - $(TXT2MAN) -t $* -r "$(PRODUCT) $(VERSION)" -s 1 -v "Executable programs or shell commands" $(srcdir)/$< > $@ + $(TXT2MAN) -t $* -r "$(PRODUCT) $(VERSION)" -s 1 -v "Executable programs or shell commands" $(srcdir)/$< > $@ # Converting DocBook to HTML (several small files) # http://www.freebsd.org/tutorials/docproj-primer/x3132.html#AEN3140