docs: Add supported versions and fix-backport policy
[lttng-tools.git] / configure.ac
index 8ca893f7512698fd159cbbc6f46b26c7f21fb702..0a4d726d7d1b32113004ce84bc41f265e5832e9e 100644 (file)
@@ -59,20 +59,29 @@ AC_TYPE_UINT8_T
 # WARN_CFLAGS and WARN_CXXFLAGS.
 m4_define([WARN_FLAGS_COMMON_LIST], [ dnl
   -Wall dnl
+  -Wextra dnl
+  -Wmissing-declarations dnl
   -Wnull-dereference dnl
   -Wundef dnl
+  -Wredundant-decls dnl
+  -Wshadow dnl
+  -Wsuggest-attribute=format dnl
+  -Wtautological-constant-out-of-range-compare dnl Clang specific
+  -Wwrite-strings dnl
+  -Wformat=2 dnl
+  -Wstrict-aliasing dnl
+  -Wmissing-noreturn dnl
+  -Wduplicated-cond dnl
+  -Wduplicated-branches dnl
   -Wlogical-op dnl
+  -Winit-self dnl
   dnl We currently get this warning when building with Clang:
   dnl
   dnl /usr/include/setjmp.h:54:12: error: declaration of built-in function '__sigsetjmp' requires the declaration of the 'jmp_buf' type, commonly provided in the header <setjmp.h>. [-Werror,-Wincomplete-setjmp-declaration]
   dnl extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROWNL;
   dnl            ^
   -Wno-incomplete-setjmp-declaration dnl
-  -Wmissing-declarations dnl
-  -Wshadow dnl
-  -Wno-gnu-folding-constant dnl
-  -Wsuggest-attribute=format dnl
-  -Wformat=2 dnl
+  -Wno-gnu-folding-constant dnl Clang specific
 ])
 
 # Detect warning flags specific to the C compiler and append them to
@@ -81,6 +90,9 @@ m4_define([WARN_FLAGS_C_LIST], [ dnl
   -Wdiscarded-qualifiers dnl
   -Wmissing-prototypes dnl
   -Wmissing-parameter-type dnl
+  -Wsuggest-final-types dnl
+  -Wsuggest-final-methods dnl
+  -Wsuggest-override dnl
 ])
 
 # Pass -Werror as an extra flag during the test: this is needed to make the
@@ -145,19 +157,23 @@ AS_IF([test "x$enable_Werror" = "xyes"], [
 AC_PROG_GREP
 AC_PROG_MAKE_SET
 AC_PROG_SED
+AC_PROG_MKDIR_P
 AC_PATH_PROG([report_fold], [fold])
 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_CHECK_TOOL([OBJCOPY], [objcopy])
+AS_IF([test "x$OBJCOPY" = "x"],
        [AC_MSG_WARN([Cannot 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])
+AM_CONDITIONAL([HAVE_OBJCOPY], [test "x$OBJCOPY" != "x"])
 
 # check for pgrep
-AC_PATH_PROG([PGREP], [pgrep], [no])
-AM_CONDITIONAL([HAVE_PGREP], [test "x$PGREP" != "xno"])
+AC_PATH_PROG([PGREP], [pgrep])
+AM_CONDITIONAL([HAVE_PGREP], [test "x$PGREP" != "x"])
+
+AC_PATH_PROG([SHELLCHECK], [shellcheck])
+AM_CONDITIONAL([HAVE_SHELLCHECK], [test "x$SHELLCHECK" != "x"])
 
 # set $IN_GIT_REPO if we're in the Git repository; the `bootstrap` file
 # is not distributed in tarballs
@@ -288,7 +304,7 @@ AC_CHECK_HEADERS([ \
        signal.h stdlib.h sys/un.h sys/socket.h stdlib.h stdio.h \
        getopt.h sys/ipc.h sys/shm.h popt.h grp.h arpa/inet.h \
        netdb.h netinet/in.h paths.h stddef.h sys/file.h sys/ioctl.h \
-       sys/mount.h sys/param.h sys/time.h elf.h
+       sys/mount.h sys/param.h sys/time.h elf.h sys/random.h sys/syscall.h
 ])
 
 AM_CONDITIONAL([HAVE_ELF_H], [test x$ac_cv_header_elf_h = xyes])
@@ -300,7 +316,8 @@ AC_CHECK_FUNCS([ \
        mkdir munmap putenv realpath rmdir socket strchr strcspn strdup \
        strncasecmp strndup strnlen strpbrk strrchr strstr strtol strtoul \
        strtoull dirfd gethostbyname2 getipnodebyname epoll_create1 \
-       sched_getcpu sysconf sync_file_range
+       sched_getcpu sysconf sync_file_range getrandom posix_fadvise \
+       arc4random flock
 ])
 
 # Check for pthread_setname_np and pthread_getname_np
@@ -557,8 +574,8 @@ PKG_CHECK_MODULES([libxml2], [libxml-2.0 >= 2.7.6])
 AC_CHECK_FUNC([clock_gettime], [AC_DEFINE_UNQUOTED([LTTNG_HAVE_CLOCK_GETTIME], 1, [Has clock_gettime() support.])])
 
 # URCU library version needed or newer
-PKG_CHECK_MODULES([URCU], [liburcu >= 0.11])
-PKG_CHECK_MODULES([URCU_CDS], [liburcu-cds >= 0.11])
+PKG_CHECK_MODULES([URCU], [liburcu >= 0.14])
+PKG_CHECK_MODULES([URCU_CDS], [liburcu-cds >= 0.14])
 AM_CPPFLAGS="$AM_CPPFLAGS $URCU_CFLAGS"
 
 # Check for libkmod, it will be auto-neabled if found but won't fail if it's not,
@@ -641,7 +658,7 @@ AM_CONDITIONAL([PYTHON_BINDING], [test "x$enable_python_binding" = xyes])
 if test "x$enable_python_binding" = xyes; then
   AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version or newer is needed]) ])
   AS_IF([test x$enable_shared = xno], [ AC_MSG_ERROR([Python bindings require shared libraries.]) ])
-  AM_PATH_PYTHON([3.0])
+  AM_PATH_PYTHON([3.4])
 
   AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config])
   AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])
@@ -649,9 +666,9 @@ if test "x$enable_python_binding" = xyes; then
     AS_IF([test -z "$PYTHON_CONFIG"], [
       AC_PATH_PROGS([PYTHON_CONFIG],
                     [python$PYTHON_VERSION-config python-config],
-                    [no],
+                    [],
                     [`dirname $PYTHON`])
-      AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])])
+      AS_IF([test "x$PYTHON_CONFIG" = "x"], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])])
     ])
     AC_MSG_CHECKING([python include flags])
     PYTHON_INCLUDE=`$PYTHON_CONFIG --includes`
@@ -739,6 +756,31 @@ if test "x$test_java_agent_jul" = "xyes" || test "x$test_java_agent_log4j" = "xy
        fi
 fi
 
+# API documentation using Doxygen
+AC_ARG_ENABLE([api-doc], [
+       AS_HELP_STRING([--enable-api-doc], [build HTML API documentation])
+], [api_doc=$enableval], [api_doc=no])
+
+AS_IF([test "x$api_doc" = xyes], [
+       DX_DOXYGEN_FEATURE(ON)
+       DX_DOT_FEATURE(OFF)
+       DX_HTML_FEATURE(ON)
+       DX_CHM_FEATURE(OFF)
+       DX_CHI_FEATURE(OFF)
+       DX_MAN_FEATURE(OFF)
+       DX_RTF_FEATURE(OFF)
+       DX_XML_FEATURE(OFF)
+       DX_PDF_FEATURE(OFF)
+       DX_PS_FEATURE(OFF)
+       DX_INIT_DOXYGEN(["LTTng control library"], [$(builddir)/Doxyfile], [output])
+
+       AS_IF([test -z "$DX_DOXYGEN"], [
+               AC_MSG_ERROR([You need Doxygen to build the liblttng-ctl API documentation])
+       ])
+])
+
+AM_CONDITIONAL([API_DOC], [test "x$api_doc" = xyes])
+
 # enable building man pages (user's intention)
 AC_ARG_ENABLE(
        man-pages,
@@ -755,10 +797,10 @@ have_asciidoc_xmlto=no
 warn_prebuilt_man_pages=no
 
 AS_IF([test "x$man_pages_opt" = "xyes"], [
-       AC_PATH_PROG([ASCIIDOC], [asciidoc], [no])
-       AC_PATH_PROG([XMLTO], [xmlto], [no])
+       AC_PATH_PROG([ASCIIDOC], [asciidoc])
+       AC_PATH_PROG([XMLTO], [xmlto])
 
-       AS_IF([test "x$ASCIIDOC" = "xno" || test "x$XMLTO" = "xno"], [
+       AS_IF([test "x$ASCIIDOC" = "x" || test "x$XMLTO" = "x"], [
                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,
@@ -801,8 +843,8 @@ AS_IF([test "x$embedded_help" = "xyes"], [
        AS_IF([test "x$man_pages_opt" = "xno"], [
                AC_MSG_ERROR([You need the --enable-man-pages option with the --enable-embedded-help option.])
        ])
-       AC_PATH_PROG([man_prog_path], [man], [no])
-       AS_IF([test "x$man_prog_path" = "xno"], [
+       AC_PATH_PROG([man_prog_path], [man])
+       AS_IF([test "x$man_prog_path" = "x"], [
                AC_MSG_ERROR([You need man with the --enable-embedded-help option.])
        ])
        AC_DEFINE_UNQUOTED([LTTNG_EMBED_HELP], 1, [Embed --help messages.])
@@ -937,6 +979,9 @@ AS_IF([test "$test_sdt_uprobe" = "autodetect"], [
 
 AM_CONDITIONAL([TEST_SDT_UPROBE], [test "$test_sdt_uprobe" = "yes"])
 
+AC_ARG_ENABLE([lib-lttng-ctl], AS_HELP_STRING([--disable-lib-lttng-ctl],
+       [Disable the build of liblttng-ctl (only possible if no binaries that depend on it are built)]))
+
 # Arguments for binaries build exclusion
 AC_ARG_ENABLE([bin-lttng], AS_HELP_STRING([--disable-bin-lttng],[Disable the build of lttng binaries]))
 AC_ARG_ENABLE([bin-lttng-consumerd], AS_HELP_STRING([--disable-bin-lttng-consumerd],
@@ -1007,11 +1052,23 @@ AS_IF([test x$enable_bin_lttng_sessiond != xno],
 )
 
 # Libraries dependencies enabling
+# If we want to build liblttng-ctl
+AS_IF([test x$enable_lib_lttng_ctl != xno],
+      [
+       build_lib_lttng_ctl=yes
+      ]
+)
+# If we need to build liblttng-ctl because a binary depends on it
 AS_IF([test x$build_lib_lttng_ctl = xyes],
       [
        build_lib_sessiond_comm=yes
       ]
 )
+# Fail if we didn't want to build liblttng-ctl but need to build it anyway
+AS_IF([test "x$build_lib_lttng_ctl" = "xyes" -a "x$enable_lib_lttng_ctl" = "xno"],[
+       AC_MSG_FAILURE(
+               [liblttng-ctl must be built, because at least one binary that depends on it is enabled])
+])
 
 AS_IF([test x$build_lib_consumer = xyes],
       [
@@ -1108,6 +1165,13 @@ test "x$enable_bin_lttng_sessiond" != "xno"],
 )
 
 AM_CONDITIONAL([BUILD_TESTS], [test x$build_tests = xyes])
+
+AS_IF([test "x$build_tests" = "xyes"],
+  [
+    PKG_CHECK_MODULES([babeltrace2], [babeltrace2])
+  ]
+)
+
 AM_CONDITIONAL([BUILD_EXTRAS], [test x$enable_extras != xno])
 
 # Export libraries build conditions.
@@ -1165,6 +1229,9 @@ AC_SUBST(lttnglibexecdir)
 AC_CONFIG_FILES([
        Makefile
        doc/Makefile
+       doc/api/Makefile
+       doc/api/liblttng-ctl/Doxyfile
+       doc/api/liblttng-ctl/Makefile
        doc/examples/Makefile
        doc/examples/rotation/Makefile
        doc/examples/trigger-condition-event-matches/Makefile
@@ -1191,6 +1258,7 @@ AC_CONFIG_FILES([
        src/vendor/msgpack/Makefile
        tests/Makefile
        tests/destructive/Makefile
+       tests/meta/Makefile
        tests/regression/Makefile
        tests/regression/kernel/Makefile
        tests/regression/tools/Makefile
@@ -1223,6 +1291,8 @@ AC_CONFIG_FILES([
        tests/regression/tools/trigger/utils/Makefile
        tests/regression/tools/trigger/name/Makefile
        tests/regression/tools/trigger/hidden/Makefile
+       tests/regression/tools/context/Makefile
+       tests/regression/tools/client/Makefile
        tests/regression/ust/Makefile
        tests/regression/ust/nprocesses/Makefile
        tests/regression/ust/high-throughput/Makefile
@@ -1250,17 +1320,24 @@ AC_CONFIG_FILES([
        tests/regression/ust/rotation-destroy-flush/Makefile
        tests/regression/ust/blocking/Makefile
        tests/regression/ust/namespaces/Makefile
+       tests/regression/ust/ust-constructor/Makefile
        tests/stress/Makefile
        tests/unit/Makefile
        tests/unit/ini_config/Makefile
        tests/perf/Makefile
        tests/utils/Makefile
+       tests/utils/bt2_plugins/Makefile
+       tests/utils/bt2_plugins/event_name/Makefile
+       tests/utils/bt2_plugins/field_stats/Makefile
+       tests/utils/lttngtest/Makefile
        tests/utils/tap/Makefile
        tests/utils/testapp/Makefile
+       tests/utils/testapp/gen-data-pending/Makefile
        tests/utils/testapp/gen-ns-events/Makefile
        tests/utils/testapp/gen-kernel-test-events/Makefile
        tests/utils/testapp/gen-py-events/Makefile
        tests/utils/testapp/gen-ust-events/Makefile
+       tests/utils/testapp/gen-ust-events-constructor/Makefile
        tests/utils/testapp/gen-ust-events-ns/Makefile
        tests/utils/testapp/gen-syscall-events-callstack/Makefile
        tests/utils/testapp/gen-ust-nevents/Makefile
@@ -1278,6 +1355,7 @@ AC_CONFIG_FILES([tests/regression/ust/python-logging/test_python_logging],[chmod
 # Inject LTTNG_TOOLS_BUILD_WITH_LIBPFM variable in test script.
 AC_CONFIG_FILES([tests/perf/test_perf_raw],[chmod +x tests/perf/test_perf_raw])
 AC_CONFIG_FILES([tests/regression/ust/ust-dl/test_ust-dl],[chmod +x tests/regression/ust/ust-dl/test_ust-dl])
+AC_CONFIG_FILES([pre-inst-env],[chmod +x pre-inst-env])
 
 AC_OUTPUT
 
@@ -1323,6 +1401,13 @@ PPRINT_PROP_BOOL([libkmod support], $value)
 test "x$with_lttng_ust" = "xyes" && value=1 || value=0
 PPRINT_PROP_BOOL([LTTng-UST support], $value)
 
+AS_ECHO
+PPRINT_SUBTITLE([Libraries])
+
+# liblttng-ctl enabled/disabled
+test x$build_lib_lttng_ctl != xno && value=1 || value=0
+PPRINT_PROP_BOOL([liblttng-ctl], $value)
+
 AS_ECHO
 PPRINT_SUBTITLE([Binaries])
 
@@ -1409,6 +1494,9 @@ m4_popdef([build_man_pages_msg])
 test "x$embedded_help" = xyes && value=1 || value=0
 PPRINT_PROP_BOOL([Embed --help messages], $value, $PPRINT_COLOR_SUBTITLE)
 
+test "x$api_doc" = xyes && value=1 || value=0
+PPRINT_PROP_BOOL([liblttng-ctl HTML API documentation], $value, $PPRINT_COLOR_SUBTITLE)
+
 PPRINT_SET_INDENT(1)
 
 report_bindir="`eval eval echo $bindir`"
This page took 0.027275 seconds and 4 git commands to generate.