configure.ac: check for asciidoc and xmlto
[lttng-tools.git] / configure.ac
index a46bfd39155fa5ef00dbcbe51d214be30ab0517d..fd65ba23439c121551192044b8d32259dd9ce832 100644 (file)
@@ -28,6 +28,13 @@ AC_PROG_SED
 AC_PROG_YACC
 LT_INIT
 
+# Check for objcopy, required by the base address statedump and dynamic linker tests
+AC_CHECK_TOOL([OBJCOPY], objcopy, no)
+AS_IF([test "x$OBJCOPY" = xno],
+       [AC_MSG_WARN([Cannont find objcopy. The base address statedump and dynamic linker tests will be disabled. Install the binutils package to remediate this.])]
+)
+AM_CONDITIONAL([HAVE_OBJCOPY], [test "x$OBJCOPY" != xno])
+
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_INLINE
 AC_TYPE_INT32_T
@@ -90,7 +97,7 @@ AS_IF([test "x$libtool_fixup" = "xyes"],
            [
                  AC_MSG_RESULT([$libtool_flag_pattern_count])
                  AC_MSG_WARN([the detected libtool will not link all dependencies, forcing link_all_deplibs = unknown])
-                 SED -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4
+                 $SED -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4
                  ],
                  [
                  AC_MSG_RESULT([none])
@@ -214,34 +221,58 @@ AC_DEFINE_DIR([CONFIG_LTTNG_SYSTEM_DATADIR],[datadir], [LTTng system data direct
 #
 # Check for pthread
 AC_CHECK_LIB([pthread], [pthread_create], [],
-       [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
+       [AC_MSG_ERROR([Cannot find libpthread. Use LDFLAGS=-Ldir to specify its location.])]
 )
 
 # Check libpopt
-AC_CHECK_LIB([popt], [poptGetContext], [],
-       [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
+PKG_CHECK_MODULES([POPT], [popt],
+       [LIBS="$LIBS $POPT_LIBS"],
+       [
+               AC_MSG_WARN([pkg-config was unable to find a valid .pc for libpopt. Set PKG_CONFIG_PATH to specify the pkgconfig configuration file location])
+               AC_MSG_WARN([Finding libpopt without pkg-config.])
+               AC_CHECK_LIB([popt],
+                       [poptGetContext],
+                       [],
+                       [
+                                AC_MSG_ERROR([Cannot find libpopt. Either set PKG_CONFIG_PATH to the configuration file location or use LDFLAGS=-Ldir to specify the library location])
+                       ]
+               )
+       ]
 )
 
 AM_PATH_XML2(2.7.6, true, AC_MSG_ERROR(No supported version of libxml2 found.))
 
 # Check for libuuid
-AC_CHECK_LIB([uuid], [uuid_generate],
+PKG_CHECK_MODULES([UUID], [uuid],
 [
+       LIBS="$LIBS $UUID_LIBS"
        AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBUUID], 1, [Has libuuid support.])
        have_libuuid=yes
 ],
 [
-       # libuuid not found, check for uuid_create in libc.
-       AC_CHECK_LIB([c], [uuid_create],
-       [
-               AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBC_UUID], 1, [Has libc uuid support.])
-               have_libc_uuid=yes
-       ],
-       [
-               AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.])
-       ])
-]
-)
+       AC_MSG_WARN([pkg-config was unable to find a valid .pc for libuuid. Set PKG_CONFIG_PATH to specify the pkgconfig configuration file location])
+       AC_MSG_WARN([Finding libuuid without pkg-config.])
+       AC_CHECK_LIB([uuid],
+               [uuid_generate],
+               [
+                       AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBUUID], 1, [Has libuuid support.])
+                       have_libuuid=yes
+               ],
+               [
+                       # libuuid not found, check for uuid_create in libc.
+                       AC_CHECK_LIB([c],
+                               [uuid_create],
+                               [
+                                       AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBC_UUID], 1, [Has libc uuid support.])
+                                       have_libc_uuid=yes
+                               ],
+                               [
+                                       AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Either set PKG_CONFIG_PATH to the configuration file location or use LDFLAGS=-Ldir to specify the library location])
+                               ]
+                       )
+               ]
+       )
+])
 AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = "xyes"])
 AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"])
 
@@ -313,7 +344,7 @@ AC_ARG_WITH(lttng-ust-prefix,
 # Check liblttng-ust-ctl library
 AC_ARG_WITH(lttng-ust,
        AS_HELP_STRING([--without-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]),
-       lttng_ust_support=$enableval, lttng_ust_support=yes)
+       lttng_ust_support=$withval, lttng_ust_support=yes)
 
 AS_IF([test "x$lttng_ust_support" = "xyes"], [
        AC_CHECK_LIB([lttng-ust-ctl], [ustctl_recv_channel_from_consumer],
@@ -321,7 +352,7 @@ AS_IF([test "x$lttng_ust_support" = "xyes"], [
                        AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST control support])
                        lttng_ust_ctl_found=yes
                ],
-               [AC_MSG_ERROR([Cannot find LTTng-UST >= 2.2.x. Use --with-lttng-ust-prefix=PREFIX to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])],
+               [AC_MSG_ERROR([Cannot find LTTng-UST >= 2.2.x. Use --with-lttng-ust-prefix=PREFIX to specify its location, or specify --without-lttng-ust to build lttng-tools without LTTng-UST support.])],
                [-lurcu-common -lurcu-bp -lurcu-cds -lrt -ldl]
        )
 ])
@@ -457,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"
 
@@ -703,6 +763,10 @@ AM_CONDITIONAL([BUILD_LIB_SESSIOND_COMM], [test x$build_lib_sessiond_comm = xyes
 AM_CONDITIONAL([BUILD_LIB_TESTPOINT], [test x$build_lib_testpoint = xyes])
 AM_CONDITIONAL([BUILD_LIB_UST_CONSUMER], [test x$build_lib_ust_consumer = xyes])
 
+# check for pgrep
+AC_PATH_PROG([PGREP], [pgrep], [no])
+AM_CONDITIONAL([HAS_PGREP], [test "x$PGREP" != "xno"])
+
 if test ! -f "$srcdir/src/lib/lttng-ctl/filter/filter-parser.h"; then
        if test x"$(basename "$YACC")" != "xbison -y"; then
                AC_MSG_ERROR([[bison not found and is required when building from git.
@@ -772,6 +836,7 @@ AC_CONFIG_FILES([
        src/bin/lttng/Makefile
        src/bin/lttng-crash/Makefile
        tests/Makefile
+       tests/destructive/Makefile
        tests/regression/Makefile
        tests/regression/kernel/Makefile
        tests/regression/tools/Makefile
@@ -786,6 +851,7 @@ AC_CONFIG_FILES([
        tests/regression/tools/mi/Makefile
        tests/regression/tools/wildcard/Makefile
        tests/regression/tools/crash/Makefile
+       tests/regression/tools/metadata-regen/Makefile
        tests/regression/ust/Makefile
        tests/regression/ust/nprocesses/Makefile
        tests/regression/ust/high-throughput/Makefile
@@ -801,11 +867,14 @@ AC_CONFIG_FILES([
        tests/regression/ust/exit-fast/Makefile
        tests/regression/ust/fork/Makefile
        tests/regression/ust/libc-wrapper/Makefile
+       tests/regression/ust/baddr-statedump/Makefile
+       tests/regression/ust/ust-dl/Makefile
        tests/regression/ust/java-jul/Makefile
        tests/regression/ust/java-log4j/Makefile
        tests/regression/ust/python-logging/Makefile
        tests/regression/ust/getcpu-override/Makefile
        tests/regression/ust/clock-override/Makefile
+       tests/regression/ust/type-declarations/Makefile
        tests/stress/Makefile
        tests/unit/Makefile
        tests/unit/ini_config/Makefile
@@ -955,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], [
@@ -963,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.025742 seconds and 4 git commands to generate.