AC_PATH_PROG([XSLTPROC], [xsltproc])
-AC_ARG_ENABLE([asciidoc],
- AS_HELP_STRING([--disable-asciidoc], [do not generate man pages from asciidoc]),
- [], [enable_asciidoc=check]
-)
-
-AS_IF([test "x$enable_asciidoc" = xno], [
- AM_CONDITIONAL([ENABLE_ASCIIDOC], [false])
-], [
- AC_PATH_PROG([ASCIIDOCTOR], [asciidoctor])
- AS_IF([test "x$enable_asciidoc" = xyes && "x$ASCIIDOCTOR" = x], [
- AC_MSG_ERROR([AsciiDoc requested but asciidoctor not found])
- ])
- AM_CONDITIONAL([ENABLE_ASCIIDOC], [test "x$ASCIIDOCTOR" != x])
-])
-
-
linux_os=no
bsd_os=no
AS_CASE([${host_os}],
AS_CASE([$enable_all_programs],
[yes], [AC_MSG_WARN([force to build all programs by default])
ul_default_estate=check],
- [no], [AC_MSG_WARN([disable all programs by default])
+ [no], [AC_MSG_WARN([disable all programs and man pages by default])
ul_default_estate=no]
)
+AC_ARG_ENABLE([asciidoc],
+ AS_HELP_STRING([--disable-asciidoc], [do not generate man pages from asciidoc]),
+ [], [UL_DEFAULT_ENABLE([asciidoc], [check])]
+)
+UL_BUILD_INIT([asciidoc])
+UL_REQUIRES_PROGRAM([asciidoc], [ASCIIDOCTOR], [asciidoctor], [man pages])
+AM_CONDITIONAL([ENABLE_ASCIIDOC], [test "x$build_asciidoc" = xyes])
+
+
AX_CHECK_TLS
have_pty=no
Btrfs support: ${have_btrfs}
Wide-char support: ${build_widechar}
+ Manual pages: ${build_asciidoc}
+
warnings:
${WARN_CFLAGS}
fi
])
+
+dnl UL_REQUIRES_PROGRAM(NAME, PROGVAR, PROGRAM, DESC, [VARSUFFIX=$1])
+dnl
+dnl Modifies $build_<name> variable according to $enable_<name> and
+dnl ability compile AC_PATH_PROG().
+dnl
+dnl The <desc> is description used for warning/error dnl message (e.g. "foo support").
+dnl
+dnl The default <name> for $build_ and $enable_ could be overwrited by option $5.
+AC_DEFUN([UL_REQUIRES_PROGRAM], [
+ m4_define([suffix], m4_default([$5],$1))
+
+ if test "x$[build_]suffix" != xno; then
+
+ AC_PATH_PROG([$2], [$3])
+
+ case $[enable_]suffix:x$$2 in #(
+ no:*)
+ [build_]suffix=no ;;
+ yes:x)
+ AC_MSG_ERROR([$1 selected, but required $3 not available]);;
+ yes:x*)
+ [build_]suffix=yes ;;
+ check:x)
+ AC_MSG_WARN([$3 not found; not building $4])
+ [build_]suffix=no ;;
+ check:x*)
+ [build_]suffix=yes ;;
+ esac
+ fi
+])
+
dnl
dnl UL_CONFLICTS_BUILD(NAME, ANOTHER, ANOTHERDESC, [VARSUFFIX=$1])
dnl