configure.ac: check for asciidoc and xmlto
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 1 Sep 2015 05:39:13 +0000 (01:39 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 17 Mar 2016 21:11:03 +0000 (17:11 -0400)
asciidoc and xmlto are now needed to build the lttng(1) man pages from
AsciiDoc sources. This is only checked if the --enable-build-man-pages
is passed to ./configure; otherwise, the man pages are still installed
if their troff version exists, which should always be the case in
tarball distributions so that the user does not need asciidoc and xmlto.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac

index 4e5e4f22248780057a1b777652b66ad86722374c..fd65ba23439c121551192044b8d32259dd9ce832 100644 (file)
@@ -488,6 +488,35 @@ if test "x$test_java_agent_jul" = "xyes" || test "x$test_java_agent_log4j" = "xy
        fi
 fi
 
+# set $IN_GIT_REPO if we're in the Git repository; the `bootstrap` file
+# is not distributed in tarballs
+AS_IF([test -f "$srcdir/bootstrap"], [in_git_repo=yes], [in_git_repo=no])
+AM_CONDITIONAL([IN_GIT_REPO], [test "x$in_git_repo" = "xyes"])
+
+# enable building man pages
+AC_ARG_ENABLE(
+       build-man-pages,
+       AS_HELP_STRING(
+               [--enable-build-man-pages],
+               [Build man pages (already built in a distributed tarball)]
+       ),
+       [enable_build_man_pages=yes],
+       [enable_build_man_pages=no]
+)
+
+# export man page build condition
+AM_CONDITIONAL([BUILD_MAN_PAGES], [test "x$enable_build_man_pages" != "xno"])
+
+# check for asciidoc and xmlto if we enabled building the man pages
+AS_IF([test "x$enable_build_man_pages" = "xyes"], [
+       AC_PATH_PROG([ASCIIDOC], [asciidoc], [no])
+       AC_PATH_PROG([XMLTO], [xmlto], [no])
+
+       AS_IF([test "x$ASCIIDOC" = "xno" || test "x$XMLTO" = "xno"], [
+               AC_MSG_ERROR([Both asciidoc and xmlto are needed to build the LTTng man pages.])
+       ])
+])
+
 # Python agent test
 UST_PYTHON_AGENT="lttngust"
 
@@ -995,6 +1024,8 @@ AS_IF([test ! -z "$PYTHON3_AGENT"],[
        AS_ECHO("Disabled")
 ])
 
+AS_ECHO()
+
 #Python binding enabled/disabled
 AS_ECHO_N("Python binding: ")
 AS_IF([test "x${enable_python_binding:-yes}" = xyes], [
@@ -1003,8 +1034,31 @@ AS_IF([test "x${enable_python_binding:-yes}" = xyes], [
        AS_ECHO("Disabled")
 ])
 
-# If we build the sessiond, print the paths it will use
 AS_ECHO()
+
+# man pages build enabled/disabled
+AS_ECHO_N("Build man pages: ")
+AS_IF([test "x$enable_build_man_pages" = "xyes"], [
+       AS_ECHO("Yes")
+], [
+       AS_IF([test "x$in_git_repo" = "xyes"], [
+               AS_ECHO("No")
+       ], [
+               AS_ECHO("Already built")
+       ])
+])
+
+# man pages install enabled/disabled (always true in tarball)
+AS_ECHO_N("Install man pages: ")
+AS_IF([test "x$enable_build_man_pages" = "xno" && test "x$in_git_repo" = "xyes"], [
+       AS_ECHO("No")
+], [
+       AS_ECHO("Yes")
+])
+
+AS_ECHO()
+
+# If we build the sessiond, print the paths it will use
 AS_ECHO_N("The lttng command will search for the lttng-sessiond executable at: ")
 AS_IF([test "$SESSIOND_BIN" = ""],[
        AS_ECHO_N("`eval eval echo $bindir`")
This page took 0.02695 seconds and 4 git commands to generate.