Fix: handle leak in abi tests
[lttng-ust.git] / configure.ac
index 54915cbd5ebdf833353659863f09f66e586288e2..7a5775f37e541bb5c83f0bc32143322d8d9f1a52 100644 (file)
@@ -9,10 +9,10 @@ dnl Process this file with autoconf to produce a configure script.
 m4_define([ust_version_major], [2])
 m4_define([ust_version_minor], [13])
 m4_define([ust_version_patch], [0])
-m4_define([ust_version_dev_stage], [-pre])
+m4_define([ust_version_dev_stage], [-rc1])
 m4_define([ust_version], ust_version_major[.]ust_version_minor[.]ust_version_patch[]ust_version_dev_stage)
-m4_define([ust_version_name], [[Codename TBD]])
-m4_define([ust_version_description], [[Description TBD]])
+m4_define([ust_version_name], [[Nordicité]])
+m4_define([ust_version_description], [[The product of a collaboration between Champ Libre and Boréale, this farmhouse IPA is brewed with Kveik yeast and Québec-grown barley, oats and juniper branches. The result is a remarkable fruity hazy golden IPA that offers a balanced touch of resinous and woodsy bitterness.]])
 
 # Library version information of "liblttng-ust"
 # Following the numbering scheme proposed by libtool for the library version
@@ -38,7 +38,7 @@ m4_define([ust_ctl_lib_version], ust_ctl_lib_version_current[:]ust_ctl_lib_versi
 AC_PREREQ([2.69])
 AC_INIT([lttng-ust],[ust_version],[mathieu dot desnoyers at efficios dot com],[],[https://lttng.org])
 
-AC_CONFIG_HEADERS([include/config.h include/lttng/ust-config.h include/lttng/ust-version.h])
+AC_CONFIG_HEADERS([src/common/config.h include/lttng/ust-config.h include/lttng/ust-version.h])
 AC_CONFIG_AUX_DIR([config])
 AC_CONFIG_MACRO_DIR([m4])
 
@@ -135,6 +135,55 @@ AC_TYPE_UINT64_T
 AC_TYPE_UINT8_T
 AC_CHECK_TYPES([ptrdiff_t])
 
+# Detect warning flags supported by the C compiler and append them to
+# WARN_CFLAGS.
+m4_define([WARN_FLAGS_LIST], [ dnl
+  -Wall dnl
+  -Wextra dnl
+  -Wmissing-prototypes dnl
+  -Wmissing-declarations dnl
+  -Wnull-dereference dnl
+  -Wundef dnl
+  -Wshadow dnl
+  -Wjump-misses-init dnl
+  -Wsuggest-attribute=format dnl
+  -Wtautological-constant-out-of-range-compare dnl
+  -Wnested-externs dnl
+  -Wwrite-strings dnl
+  -Wformat=2 dnl
+  -Wstrict-aliasing dnl
+  -Wmissing-noreturn dnl
+  -Winit-self dnl
+  -Wduplicated-cond dnl
+  -Wduplicated-branches dnl
+  -Wlogical-op dnl
+  dnl These would require reworking the tracepoint macros
+  dnl-Wredundant-decls dnl
+  -Wno-sign-compare dnl
+  -Wno-missing-field-initializers dnl
+  -Wno-null-dereference dnl
+])
+
+# Pass -Werror as an extra flag during the test: this is needed to make the
+# -Wunknown-warning-option diagnostic fatal with clang.
+AC_LANG_PUSH([C])
+AX_APPEND_COMPILE_FLAGS([WARN_FLAGS_LIST], [WARN_CFLAGS], [-Werror])
+AC_LANG_POP([C])
+
+# The test used in AX_APPEND_COMPILE_FLAGS, generated using AC_LANG_PROGRAM, is
+# written in such a way that it triggers warnings with the following warning
+# flags.  So they would always end up disabled if we put them there, because
+# the test program would not build.
+#
+# Enable them here unconditionally.  They are supported by GCC >= 4.8 and by
+# Clang >= 3.3 (required by the project) and are only valid for C code.
+WARN_CFLAGS="${WARN_CFLAGS} -Wold-style-definition -Wstrict-prototypes"
+
+# Disable 'strict aliasing' if the compiler supports it.
+AC_LANG_PUSH([C])
+AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing], [OPT_CFLAGS], [-Werror])
+AC_LANG_POP([C])
+
 
 ##                     ##
 ## C++ compiler checks ##
@@ -143,6 +192,14 @@ AC_CHECK_TYPES([ptrdiff_t])
 # Find an optional C++11 compiler without GNU extensions (-std=c++11)
 AX_CXX_COMPILE_STDCXX([11], [noext], [optional])
 
+AS_IF([test "$HAVE_CXX11" = "1"], [
+  # Pass -Werror as an extra flag during the test: this is needed to make the
+  # -Wunknown-warning-option diagnostic fatal with clang.
+  AC_LANG_PUSH([C++])
+  AX_APPEND_COMPILE_FLAGS([WARN_FLAGS_LIST -Wno-undef -Wno-duplicated-branches], [WARN_CXXFLAGS], [-Werror])
+  AC_LANG_POP([C++])
+])
+
 
 ##               ##
 ## Header checks ##
@@ -186,10 +243,6 @@ AC_CHECK_PROGS([XMLTO], [xmlto])
 
 AM_PATH_PYTHON([2.7], [], [PYTHON=""])
 
-AX_PROG_JAVAC
-AX_PROG_JAVA
-AX_PROG_JAR
-
 # Initialize and configure libtool
 LT_INIT([disable-static])
 
@@ -208,6 +261,7 @@ AC_CHECK_FUNCS([ \
   clock_gettime \
   ftruncate \
   getpagesize \
+  gettid \
   gettimeofday \
   localeconv \
   memchr \
@@ -361,8 +415,9 @@ argument to disable NUMA support.
 
 # The JNI interface and Java Agents require a working Java JDK
 AS_IF([AE_IS_FEATURE_ENABLED([jni-interface]) || AE_IS_FEATURE_ENABLED([java-agent-jul]) || AE_IS_FEATURE_ENABLED([java-agent-log4j])], [
-  # We detected a java compiler earlier, make sure it works
-  AX_PROG_JAVAC_WORKS
+  AX_PROG_JAVAC
+  AX_PROG_JAVA
+  AX_PROG_JAR
 
   # Get the CPPFLAGS required to build jni libaries
   AX_JNI_INCLUDE_DIR
@@ -492,16 +547,19 @@ AM_CONDITIONAL([HAVE_PERF_EVENT], [test "x$ac_cv_header_linux_perf_event_h" = "x
 AC_SUBST([LTTNG_UST_LIBRARY_VERSION], ust_lib_version)
 AC_SUBST([LTTNG_UST_CTL_LIBRARY_VERSION], ust_ctl_lib_version)
 
-AM_CFLAGS="-Wall $URCU_CFLAGS $PTHREAD_CFLAGS"
+# Major soname for python-lttngust
+AC_SUBST([LTTNG_UST_LIB_SONAME_MAJOR], [ust_lib_version_current])
+
+AM_CFLAGS="$OPT_CFLAGS $WARN_CFLAGS $URCU_CFLAGS $PTHREAD_CFLAGS"
 AC_SUBST(AM_CFLAGS)
 
-AM_CXXFLAGS="$AM_CFLAGS"
+AM_CXXFLAGS="$WARN_CXXFLAGS $URCU_CFLAGS $PTHREAD_CFLAGS"
 AC_SUBST(AM_CXXFLAGS)
 
 # The order in which the include folders are searched is important.
 # The top_builddir should always be searched first in the event that a build
 # time generated file is included.
-AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_srcdir)/include -include config.h"
+AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_srcdir)/include -I\$(top_builddir)/src -I\$(top_srcdir)/src -include common/config.h"
 AC_SUBST(AM_CPPFLAGS)
 
 AC_SUBST(JNI_CPPFLAGS)
@@ -513,58 +571,70 @@ AC_SUBST(JNI_CPPFLAGS)
 
 # List of files to be generated from '.in' templates by AC_OUTPUT
 AC_CONFIG_FILES([
-       Makefile
-       doc/Makefile
-       doc/examples/Makefile
-       doc/man/Makefile
-       include/Makefile
-       snprintf/Makefile
-       libcounter/Makefile
-       libmsgpack/Makefile
-       libringbuffer/Makefile
-       liblttng-ust-comm/Makefile
-       liblttng-ust/Makefile
-       liblttng-ust-ctl/Makefile
-       liblttng-ust-fork/Makefile
-       liblttng-ust-dl/Makefile
-       liblttng-ust-fd/Makefile
-       liblttng-ust-java/Makefile
-       liblttng-ust-java-agent/Makefile
-       liblttng-ust-java-agent/java/Makefile
-       liblttng-ust-java-agent/java/lttng-ust-agent-all/Makefile
-       liblttng-ust-java-agent/java/lttng-ust-agent-common/Makefile
-       liblttng-ust-java-agent/java/lttng-ust-agent-jul/Makefile
-       liblttng-ust-java-agent/java/lttng-ust-agent-log4j/Makefile
-       liblttng-ust-java-agent/jni/Makefile
-       liblttng-ust-java-agent/jni/common/Makefile
-       liblttng-ust-java-agent/jni/jul/Makefile
-       liblttng-ust-java-agent/jni/log4j/Makefile
-       liblttng-ust-libc-wrapper/Makefile
-       liblttng-ust-cyg-profile/Makefile
-       liblttng-ust-python-agent/Makefile
-       python-lttngust/Makefile
-       python-lttngust/setup.py
-       python-lttngust/lttngust/__init__.py
-       tools/Makefile
-       tests/Makefile
-       tests/compile/Makefile
-       tests/compile/ctf-types/Makefile
-       tests/compile/hello.cxx/Makefile
-       tests/compile/hello/Makefile
-       tests/compile/hello-many/Makefile
-       tests/compile/same_line_tracepoint/Makefile
-       tests/compile/test-app-ctx/Makefile
-       tests/benchmark/Makefile
-       tests/unit/gcc-weak-hidden/Makefile
-       tests/unit/libmsgpack/Makefile
-       tests/unit/Makefile
-       tests/unit/libringbuffer/Makefile
-       tests/unit/pthread_name/Makefile
-       tests/unit/snprintf/Makefile
-       tests/unit/ust-elf/Makefile
-       tests/utils/Makefile
-       lttng-ust.pc
-       lttng-ust-ctl.pc
+  Makefile
+  doc/examples/Makefile
+  doc/Makefile
+  doc/man/Makefile
+  include/Makefile
+  src/common/Makefile
+  src/lib/lttng-ust-common/Makefile
+  src/lib/lttng-ust-ctl/Makefile
+  src/lib/lttng-ust-cyg-profile/Makefile
+  src/lib/lttng-ust-dl/Makefile
+  src/lib/lttng-ust-fd/Makefile
+  src/lib/lttng-ust-fork/Makefile
+  src/lib/lttng-ust-java-agent/java/lttng-ust-agent-all/Makefile
+  src/lib/lttng-ust-java-agent/java/lttng-ust-agent-common/Makefile
+  src/lib/lttng-ust-java-agent/java/lttng-ust-agent-jul/Makefile
+  src/lib/lttng-ust-java-agent/java/lttng-ust-agent-log4j/Makefile
+  src/lib/lttng-ust-java-agent/java/Makefile
+  src/lib/lttng-ust-java-agent/jni/common/Makefile
+  src/lib/lttng-ust-java-agent/jni/jul/Makefile
+  src/lib/lttng-ust-java-agent/jni/log4j/Makefile
+  src/lib/lttng-ust-java-agent/jni/Makefile
+  src/lib/lttng-ust-java-agent/Makefile
+  src/lib/lttng-ust-java/Makefile
+  src/lib/lttng-ust-libc-wrapper/Makefile
+  src/lib/lttng-ust-pthread-wrapper/Makefile
+  src/lib/lttng-ust-tracepoint/Makefile
+  src/lib/lttng-ust/Makefile
+  src/lib/lttng-ust-python-agent/Makefile
+  src/lib/Makefile
+  src/lib/lttng-ust-ctl.pc
+  src/lib/lttng-ust.pc
+  src/Makefile
+  src/python-lttngust/lttngust/version.py
+  src/python-lttngust/Makefile
+  src/python-lttngust/setup.py
+  tests/benchmark/Makefile
+  tests/compile/api0/ctf-types/Makefile
+  tests/compile/api0/hello.cxx/Makefile
+  tests/compile/api0/hello/Makefile
+  tests/compile/api0/hello-many/Makefile
+  tests/compile/api0/Makefile
+  tests/compile/api0/same_line_tracepoint/Makefile
+  tests/compile/api1/ust-fields/Makefile
+  tests/compile/api1/hello.cxx/Makefile
+  tests/compile/api1/hello/Makefile
+  tests/compile/api1/hello-many/Makefile
+  tests/compile/api1/Makefile
+  tests/compile/api1/same_line_tracepoint/Makefile
+  tests/compile/api1/test-app-ctx/Makefile
+  tests/compile/Makefile
+  tests/Makefile
+  tests/regression/abi0-conflict/Makefile
+  tests/regression/Makefile
+  tests/unit/gcc-weak-hidden/Makefile
+  tests/unit/libmsgpack/Makefile
+  tests/unit/libringbuffer/Makefile
+  tests/unit/Makefile
+  tests/unit/pthread_name/Makefile
+  tests/unit/snprintf/Makefile
+  tests/unit/ust-elf/Makefile
+  tests/unit/ust-error/Makefile
+  tests/unit/ust-utils/Makefile
+  tests/utils/Makefile
+  tools/Makefile
 ])
 
 AC_OUTPUT
@@ -589,9 +659,9 @@ AS_ECHO
 
 AS_IF([test -n "ust_version_description"], [
   AS_IF([test -n "$FOLD"], [
-    AS_ECHO("`AS_ECHO("ust_version_description") | $FOLD -s`")
+    AS_ECHO(["ust_version_description"]) | $FOLD -s
   ], [
-    AS_ECHO("ust_version_description")
+    AS_ECHO(["ust_version_description"])
   ])
   AS_ECHO
 ])
@@ -686,3 +756,5 @@ their sources.
 Use --disable-man-pages to completely disable building and installing
 the man pages.])
 ])
+
+# vim: shiftwidth=2 softtabstop=2 expandtab
This page took 0.026258 seconds and 4 git commands to generate.