-# Optional debug info feature
-# Do _not_ indent the help string below (appears in the configure --help
-# output).
-AC_ARG_ENABLE([debug-info],
-[AC_HELP_STRING([--enable-debug-info], [enable the debug info feature (default on Linux)])]
-[AC_HELP_STRING([--disable-debug-info], [disable the debug info feature (default on OS X and Solaris)])],
- [AS_IF([test "x$enableval" = xyes], [_enable_debug_info=yes], [_enable_debug_info=no])], [])
-
-AM_CONDITIONAL([ENABLE_DEBUG_INFO], [test "x$_enable_debug_info" = xyes])
-AC_DEFINE([BT_ENABLE_DEBUG_INFO], [1], [Enable debug info support])
-
-AS_IF([test "x$_enable_debug_info" = xyes], [
- # Check if libelf and libdw are present
- AC_CHECK_LIB([elf], [elf_version], [], [AC_MSG_ERROR(Missing libelf (from elfutils >= 0.154) which is required by debug info. You can disable this feature using --disable-debug-info.)])
- AC_CHECK_LIB([dw], [dwarf_begin], [], [AC_MSG_ERROR(Missing libdw (from elfutils >= 0.154) which is required by debug info. You can disable this feature using --disable-debug-info.)])
- BT_LIB_ELFUTILS([0], [154], [:], [AC_MSG_ERROR(elfutils >= 0.154 is required to use the debug info feature. You can disable this feature using --disable-debug-info.)])
- AC_DEFINE([ENABLE_DEBUG_INFO], [1], [Define to 1 if you enable the 'debug info' feature])
-], [])
-
-AC_ARG_VAR([BUILT_IN_PLUGINS], [Statically-link in-tree plug-ins into the babeltrace binary])
-AS_IF([test "x$BUILT_IN_PLUGINS" != x], [
-# Built-in plug-ins are only available when the --disable-shared --enable-static options are used.
- AS_IF([test "x$enable_static" != "xyes"], [AC_MSG_ERROR(--enable-static must be used to bundle plug-ins in the babeltrace executable)])
- AS_IF([test "x$enable_shared" = "xyes"], [AC_MSG_ERROR(--disable-shared must be used to bundle plug-ins in the babeltrace executable)])
- built_in_plugins=yes
- AC_DEFINE([BT_BUILT_IN_PLUGINS], [1], [Define to 1 to register plug-in attributes in static executable sections])
-])
-AM_CONDITIONAL([BUILT_IN_PLUGINS], [test "x$built_in_plugins" = "xyes"])
-
-AC_ARG_VAR([BUILT_IN_PYTHON_PLUGIN_SUPPORT], [Statically-link Python plugin support into the babeltrace binary])
-AS_IF([test "x$BUILT_IN_PYTHON_PLUGIN_SUPPORT" != x], [
-# Built-in plug-ins are only available when the --disable-shared --enable-static options are used.
- AS_IF([test "x$enable_static" != "xyes"], [AC_MSG_ERROR(--enable-static must be used to bundle Python plugin support in the babeltrace executable)])
- AS_IF([test "x$enable_shared" = "xyes"], [AC_MSG_ERROR(--disable-shared must be used to bundle Python plugin support in the babeltrace executable)])
- built_in_python_plugin_support=yes
- AC_DEFINE([BT_BUILT_IN_PYTHON_PLUGIN_SUPPORT], [1], [Define to 1 to register plug-in attributes in static executable sections])
+have_asciidoc_xmlto=no
+warn_prebuilt_man_pages=no
+
+AS_IF([test "x$enable_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"], [
+ AS_IF([test "x$in_git_repo" = "xyes"], [
+ # this is an error because we're in the Git repo, which
+ # means the man pages are not already generated for us,
+ # thus asciixmlto are required because we were asked
+ # to build the man pages
+ AC_MSG_ERROR([
+You need asciidoc and xmlto to build the Babeltrace man pages. Use
+--disable-man-pages to disable building the man pages, in which case
+they will not be installed.
+ ])
+ ], [
+ # only warn here: since we're in the tarball, the man
+ # pages should already be generated at this point, thus
+ # asciidoc/xmlto are not strictly required
+ warn_prebuilt_man_pages=yes
+ ])
+ ], [
+ have_asciidoc_xmlto=yes
+ ])