X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=configure.ac;h=1b6f3fcb0d429c0c478caa96943173620f33a76d;hp=852c61f0e246e025849d3a63256b34977cc01b10;hb=077192fd1880652a61400b493a0b6cf5bb199435;hpb=bfb025cd1038e01972c11fdf5fcad8b044b03f76 diff --git a/configure.ac b/configure.ac index 852c61f0e..1b6f3fcb0 100644 --- a/configure.ac +++ b/configure.ac @@ -26,6 +26,36 @@ AC_PROG_CXX RW_PROG_CXX_WORKS AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"]) +# Detect warning flags supported by the compiler, append them to WARN_CFLAGS. +# +# Pass -Werror as an extra flag during the test: this is needed to make the +# -Wunknown-warning-option diagnostic fatal with clang. +AX_APPEND_COMPILE_FLAGS([ dnl + -Wall 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 . [-Werror,-Wincomplete-setjmp-declaration] + dnl extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROWNL; + dnl ^ + -Wno-incomplete-setjmp-declaration dnl + -Wdiscarded-qualifiers dnl + -Wmissing-declarations dnl + -Wmissing-prototypes dnl + -Wmissing-parameter-type dnl + -Wold-style-definition dnl + -Wstrict-prototypes dnl + ], + [WARN_CFLAGS], + [-Werror]) + +# When given, add -Werror to WARN_CFLAGS. +AC_ARG_ENABLE([Werror], + [AS_HELP_STRING([--enable-Werror], [Treat compiler warnings as errors.])] +) +AS_IF([test "x$enable_Werror" = "xyes"], + [WARN_CFLAGS="${WARN_CFLAGS} -Werror"] +) + # Checks for programs. AC_PROG_GREP AC_PROG_MAKE_SET @@ -207,6 +237,9 @@ AC_CHECK_FUNCS([ \ sched_getcpu sysconf sync_file_range ]) +# Check for pthread_setname_np and its signature +LTTNG_PTHREAD_SETNAME_NP + # Check if clock_gettime, timer_create, timer_settime, and timer_delete are available in lib rt, and if so, # add -lrt to LIBS AC_CHECK_LIB([rt], [clock_gettime, timer_create, timer_settime, timer_delete]) @@ -1038,16 +1071,20 @@ 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]) -AM_CFLAGS="-Wall -fno-strict-aliasing $PTHREAD_CFLAGS" +AM_CFLAGS="${WARN_CFLAGS} -fno-strict-aliasing $PTHREAD_CFLAGS" AC_SUBST(AM_CFLAGS) +# This is set even though it is empty, so Makefiles can do "AM_LDFLAGS += ...". +AM_LDFLAGS="" +AC_SUBST(AM_LDFLAGS) + # 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. An example of this is the "version.i" file. # In a scenario where lttng-tools is built from a distribution tarball and in a # out-of-tree manner, the generated "version.i" has priority on the one from # the source (distribution tarball) and must be found first. -AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_srcdir)/include -I\$(top_srcdir)/src -include config.h $AM_CPPFLAGS" +AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_srcdir)/include -I\$(top_builddir)/src -I\$(top_srcdir)/src -include config.h $AM_CPPFLAGS" AC_SUBST(AM_CPPFLAGS) lttngincludedir="${includedir}/lttng" @@ -1065,6 +1102,9 @@ AC_SUBST(lttngnotificationincludedir) lttngtriggerincludedir="${includedir}/lttng/trigger" AC_SUBST(lttngtriggerincludedir) +lttngeventruleincludedir="${includedir}/lttng/event-rule" +AC_SUBST(lttngeventruleincludedir) + lttnglibexecdir="${libdir}/lttng/libexec" AC_SUBST(lttnglibexecdir) @@ -1095,9 +1135,9 @@ AC_CONFIG_FILES([ src/common/config/Makefile src/common/string-utils/Makefile src/common/fd-tracker/Makefile + src/common/filter/Makefile src/lib/Makefile src/lib/lttng-ctl/Makefile - src/lib/lttng-ctl/filter/Makefile src/lib/lttng-ctl/lttng-ctl.pc src/bin/Makefile src/bin/lttng-consumerd/Makefile