From: Michael Jeanson Date: Tue, 2 May 2017 17:18:33 +0000 (-0400) Subject: Fix: Don't override user variables within the build system X-Git-Tag: v2.10.0-rc2~25 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=87e96404184f6c8e06d693d89684674f2e63d1e5;p=lttng-tools.git Fix: Don't override user variables within the build system Instead use the appropriatly prefixed AM_* variables as to not interfere when a user variable is passed to a make command. The proper use of flag variables is documented at : https://www.gnu.org/software/automake/manual/automake.html#Flag-Variables-Ordering Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/.gitignore b/.gitignore index eb781239c..108dc1c7e 100644 --- a/.gitignore +++ b/.gitignore @@ -85,6 +85,7 @@ gen-events-time gen-events gen-ust-events health_check +/tests/regression/kernel/select_poll_epoll /tests/regression/tools/mi/extract_xml /tests/regression/tools/mi/validate_xml /tests/regression/tools/notification/base_client @@ -98,7 +99,7 @@ health_check /tests/regression/ust/fork/fork /tests/regression/ust/fork/fork2 /tests/regression/ust/libc-wrapper/prog -tests/regression/ust/python-logging/test_python_logging +/tests/regression/ust/python-logging/test_python_logging /tests/regression/ust/baddr-statedump/prog /tests/regression/ust/baddr-statedump/prog.debug /tests/regression/ust/baddr-statedump/prog.strip @@ -106,12 +107,16 @@ tests/regression/ust/python-logging/test_python_logging /tests/regression/ust/ust-dl/prog /tests/regression/ust/ust-dl/libfoo.so.debug /tests/regression/ust/ust-dl/libbar.so.debug +/tests/regression/ust/ust-dl/libzzz.so.debug /tests/utils/testapp/gen-ust-nevents/gen-ust-nevents /tests/utils/testapp/gen-ust-tracef/gen-ust-tracef /tests/regression/tools/live/live_test /tests/unit/ini_config/ini_config /tests/perf/find_event /tests/perf/test_perf_raw +/tests/regression/1 +/tests/unit/test_string_utils +/tests/utils/testapp/gen-ust-nevents-str/gen-ust-nevents-str # man pages /doc/man/*.1 diff --git a/configure.ac b/configure.ac index 96ef544f0..fcb3e60ac 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,7 @@ AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_TARGET AC_CANONICAL_HOST -AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip tar-pax]) +AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip tar-pax nostdinc]) AM_MAINTAINER_MODE([enable]) # Enable silent rules if available (Introduced in AM 1.11) @@ -59,9 +59,6 @@ AS_IF([test "x$ax_cv___attribute__" = "xyes"], [AC_MSG_ERROR([The compiler does not support __attribute__ extensions])]) AX_PTHREAD(,[AC_MSG_ERROR([Could not configure pthreads support])]) -LIBS="$PTHREAD_LIBS $LIBS" -CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -CC="$PTHREAD_CC" AX_LIB_SOCKET_NSL @@ -416,7 +413,7 @@ AC_ARG_WITH(kmod-prefix, [Specify the installation prefix of the kmod library. Headers must be in PATH/include; libraries in PATH/lib.]), [ - CPPFLAGS="$CPPFLAGS -I${withval}/include" + AM_CPPFLAGS="$AM_CPPFLAGS -I${withval}/include" LDFLAGS="$LDFLAGS -L${withval}/lib64 -L${withval}/lib" ]) @@ -441,7 +438,7 @@ AC_ARG_WITH(lttng-ust-prefix, [Specify the installation prefix of the lttng-ust library. Headers must be in PATH/include; libraries in PATH/lib.]), [ - CPPFLAGS="$CPPFLAGS -I${withval}/include" + AM_CPPFLAGS="$AM_CPPFLAGS -I${withval}/include" LDFLAGS="$LDFLAGS -L${withval}/lib64 -L${withval}/lib" ]) @@ -970,9 +967,11 @@ modify their sources. # export flex condition AM_CONDITIONAL([HAVE_FLEX], [test "x$have_flex" = "xyes"]) -CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing" +AM_CFLAGS="-Wall -fno-strict-aliasing $PTHREAD_CFLAGS" +AC_SUBST(AM_CFLAGS) -DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include -include config.h" +AM_CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include -I\$(top_srcdir)/src -include config.h $AM_CPPFLAGS" +AC_SUBST(AM_CPPFLAGS) lttngincludedir="${includedir}/lttng" AC_SUBST(lttngincludedir) @@ -989,8 +988,6 @@ AC_SUBST(lttngnotificationincludedir) lttngtriggerincludedir="${includedir}/lttng/trigger" AC_SUBST(lttngtriggerincludedir) -AC_SUBST(DEFAULT_INCLUDES) - lttnglibexecdir="${libdir}/lttng/libexec" AC_SUBST(lttnglibexecdir) diff --git a/extras/bindings/swig/python/Makefile.am b/extras/bindings/swig/python/Makefile.am index af1daf87c..25f0a4395 100644 --- a/extras/bindings/swig/python/Makefile.am +++ b/extras/bindings/swig/python/Makefile.am @@ -1,7 +1,7 @@ lttng.i: lttng.i.in $(SED) "s/LTTNG_VERSION_STR/LTTng $(PACKAGE_VERSION)/g" < $(srcdir)/lttng.i.in >lttng.i -AM_CFLAGS = $(PYTHON_INCLUDE) -I$(top_srcdir)/include +AM_CPPFLAGS += $(PYTHON_INCLUDE) EXTRA_DIST = lttng.i.in nodist_python_PYTHON = lttng.py diff --git a/extras/core-handler/Makefile.am b/extras/core-handler/Makefile.am index eaa6b16c5..63ee13bb0 100644 --- a/extras/core-handler/Makefile.am +++ b/extras/core-handler/Makefile.am @@ -1,6 +1,3 @@ -AM_CFLAGS = -O2 -g -AM_LDFLAGS = - noinst_PROGRAMS = crash crash_SOURCES = crash.c diff --git a/src/bin/lttng-consumerd/Makefile.am b/src/bin/lttng-consumerd/Makefile.am index b7401de88..9d54309cf 100644 --- a/src/bin/lttng-consumerd/Makefile.am +++ b/src/bin/lttng-consumerd/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src - lttnglibexec_PROGRAMS = lttng-consumerd lttng_consumerd_SOURCES = lttng-consumerd.c \ diff --git a/src/bin/lttng-crash/Makefile.am b/src/bin/lttng-crash/Makefile.am index ae4776f7e..2b61ec263 100644 --- a/src/bin/lttng-crash/Makefile.am +++ b/src/bin/lttng-crash/Makefile.am @@ -1,5 +1,4 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src \ - -DINSTALL_BIN_PATH=\""$(bindir)"\" +AM_CPPFLAGS += -DINSTALL_BIN_PATH=\""$(bindir)"\" if EMBED_HELP AM_CPPFLAGS += -I$(top_builddir)/doc/man diff --git a/src/bin/lttng-relayd/Makefile.am b/src/bin/lttng-relayd/Makefile.am index 31859b564..c7dd37e1a 100644 --- a/src/bin/lttng-relayd/Makefile.am +++ b/src/bin/lttng-relayd/Makefile.am @@ -1,13 +1,10 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src \ - -DINSTALL_BIN_PATH=\""$(lttnglibexecdir)"\" \ - -DINSTALL_LIB_PATH=\""$(libdir)"\" +AM_CPPFLAGS += -DINSTALL_BIN_PATH=\""$(lttnglibexecdir)"\" \ + -DINSTALL_LIB_PATH=\""$(libdir)"\" if EMBED_HELP AM_CPPFLAGS += -I$(top_builddir)/doc/man endif -AM_CFLAGS = -fno-strict-aliasing - bin_PROGRAMS = lttng-relayd lttng_relayd_SOURCES = main.c lttng-relayd.h utils.h utils.c cmd.h \ diff --git a/src/bin/lttng-sessiond/Makefile.am b/src/bin/lttng-sessiond/Makefile.am index 4b4e7ec99..529887b8a 100644 --- a/src/bin/lttng-sessiond/Makefile.am +++ b/src/bin/lttng-sessiond/Makefile.am @@ -1,13 +1,10 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src \ - -DINSTALL_BIN_PATH=\""$(lttnglibexecdir)"\" \ - -DINSTALL_LIB_PATH=\""$(libdir)"\" +AM_CPPFLAGS +=-DINSTALL_BIN_PATH=\""$(lttnglibexecdir)"\" \ + -DINSTALL_LIB_PATH=\""$(libdir)"\" if EMBED_HELP AM_CPPFLAGS += -I$(top_builddir)/doc/man endif -AM_CFLAGS = -fno-strict-aliasing - bin_PROGRAMS = lttng-sessiond lttng_sessiond_SOURCES = utils.c utils.h \ diff --git a/src/bin/lttng/Makefile.am b/src/bin/lttng/Makefile.am index c60c0ee6d..c1c2cf6f9 100644 --- a/src/bin/lttng/Makefile.am +++ b/src/bin/lttng/Makefile.am @@ -1,5 +1,4 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src \ - -DINSTALL_BIN_PATH=\""$(bindir)"\" +AM_CPPFLAGS += -DINSTALL_BIN_PATH=\""$(bindir)"\" if EMBED_HELP AM_CPPFLAGS += -I$(top_builddir)/doc/man diff --git a/src/bin/lttng/commands/enable_events.c b/src/bin/lttng/commands/enable_events.c index 0c001fd9e..97a36b311 100644 --- a/src/bin/lttng/commands/enable_events.c +++ b/src/bin/lttng/commands/enable_events.c @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include diff --git a/src/common/Makefile.am b/src/common/Makefile.am index bdba28f19..3b5077779 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src - AUTOMAKE_OPTIONS = subdir-objects SUBDIRS = string-utils @@ -58,8 +56,6 @@ if BUILD_LIB_CONSUMER SUBDIRS += consumer endif -AM_CFLAGS = -fno-strict-aliasing - noinst_HEADERS = lttng-kernel.h defaults.h macros.h error.h futex.h \ uri.h utils.h lttng-kernel-old.h \ align.h bitfield.h bug.h time.h diff --git a/src/common/compat/Makefile.am b/src/common/compat/Makefile.am index 2d2b02a0d..c5418baeb 100644 --- a/src/common/compat/Makefile.am +++ b/src/common/compat/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src - noinst_LTLIBRARIES = libcompat.la if COMPAT_EPOLL diff --git a/src/common/config/Makefile.am b/src/common/config/Makefile.am index afc83f26f..dbb47b818 100644 --- a/src/common/config/Makefile.am +++ b/src/common/config/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src - noinst_LTLIBRARIES = libconfig.la libconfig_la_SOURCES = ini.c ini.h session-config.c session-config.h \ diff --git a/src/common/consumer/Makefile.am b/src/common/consumer/Makefile.am index 029fb1d68..c62831289 100644 --- a/src/common/consumer/Makefile.am +++ b/src/common/consumer/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src - # Consumer library noinst_LTLIBRARIES = libconsumer.la diff --git a/src/common/daemonize.c b/src/common/daemonize.c index b12194ee9..88ec9f134 100644 --- a/src/common/daemonize.c +++ b/src/common/daemonize.c @@ -25,8 +25,8 @@ #include -#include -#include +#include +#include LTTNG_HIDDEN int lttng_daemonize(pid_t *child_ppid, int *completion_flag, diff --git a/src/common/defaults.h b/src/common/defaults.h index e0d0d86dc..1e6a1171d 100644 --- a/src/common/defaults.h +++ b/src/common/defaults.h @@ -21,7 +21,7 @@ #define _DEFAULTS_H #include -#include +#include /* Default unix group name for tracing. */ #define DEFAULT_TRACING_GROUP "tracing" diff --git a/src/common/hashtable/Makefile.am b/src/common/hashtable/Makefile.am index 765f64953..000afd05d 100644 --- a/src/common/hashtable/Makefile.am +++ b/src/common/hashtable/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src - noinst_LTLIBRARIES = libhashtable.la libhashtable_la_SOURCES = hashtable.c hashtable.h \ diff --git a/src/common/health/Makefile.am b/src/common/health/Makefile.am index d82f9de9e..727c2f900 100644 --- a/src/common/health/Makefile.am +++ b/src/common/health/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src - noinst_LTLIBRARIES = libhealth.la libhealth_la_SOURCES = health.c diff --git a/src/common/index/Makefile.am b/src/common/index/Makefile.am index 054b0aa54..ee73ea2ca 100644 --- a/src/common/index/Makefile.am +++ b/src/common/index/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src - noinst_LTLIBRARIES = libindex.la libindex_la_SOURCES = index.c index.h ctf-index.h diff --git a/src/common/kernel-consumer/Makefile.am b/src/common/kernel-consumer/Makefile.am index ed5462a65..008041e1d 100644 --- a/src/common/kernel-consumer/Makefile.am +++ b/src/common/kernel-consumer/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src - # Kernel consumer library noinst_LTLIBRARIES = libkernel-consumer.la diff --git a/src/common/kernel-ctl/Makefile.am b/src/common/kernel-ctl/Makefile.am index ab057dd36..0766499f5 100644 --- a/src/common/kernel-ctl/Makefile.am +++ b/src/common/kernel-ctl/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src - noinst_LTLIBRARIES = libkernel-ctl.la libkernel_ctl_la_SOURCES = kernel-ctl.c kernel-ctl.h kernel-ioctl.h diff --git a/src/common/relayd/Makefile.am b/src/common/relayd/Makefile.am index 274da87be..84eee1b8e 100644 --- a/src/common/relayd/Makefile.am +++ b/src/common/relayd/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src - # Relayd library noinst_LTLIBRARIES = librelayd.la diff --git a/src/common/sessiond-comm/Makefile.am b/src/common/sessiond-comm/Makefile.am index 8f0a839b6..501746a2c 100644 --- a/src/common/sessiond-comm/Makefile.am +++ b/src/common/sessiond-comm/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src - # Session daemon communication lib noinst_LTLIBRARIES = libsessiond-comm.la diff --git a/src/common/string-utils/Makefile.am b/src/common/string-utils/Makefile.am index bbdb4ed2c..1910042d6 100644 --- a/src/common/string-utils/Makefile.am +++ b/src/common/string-utils/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src - noinst_LTLIBRARIES = libstring-utils.la libstring_utils_la_SOURCES = string-utils.h string-utils.c diff --git a/src/common/testpoint/Makefile.am b/src/common/testpoint/Makefile.am index 7d3df162f..5c15725eb 100644 --- a/src/common/testpoint/Makefile.am +++ b/src/common/testpoint/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = - noinst_LTLIBRARIES = libtestpoint.la libtestpoint_la_SOURCES = testpoint.h testpoint.c diff --git a/src/common/ust-consumer/Makefile.am b/src/common/ust-consumer/Makefile.am index ab8d38add..1acdc7f12 100644 --- a/src/common/ust-consumer/Makefile.am +++ b/src/common/ust-consumer/Makefile.am @@ -1,7 +1,5 @@ if HAVE_LIBLTTNG_UST_CTL -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src - noinst_LTLIBRARIES = libust-consumer.la libust_consumer_la_SOURCES = ust-consumer.c ust-consumer.h diff --git a/src/lib/lttng-ctl/Makefile.am b/src/lib/lttng-ctl/Makefile.am index b5156caf9..03c073c9d 100644 --- a/src/lib/lttng-ctl/Makefile.am +++ b/src/lib/lttng-ctl/Makefile.am @@ -1,7 +1,7 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(builddir) - SUBDIRS = filter +AM_CPPFLAGS += -I$(srcdir) -I$(builddir) + lib_LTLIBRARIES = liblttng-ctl.la liblttng_ctl_la_SOURCES = lttng-ctl.c snapshot.c lttng-ctl-helper.h \ diff --git a/src/lib/lttng-ctl/filter/Makefile.am b/src/lib/lttng-ctl/filter/Makefile.am index 2c0d74880..e338eee6e 100644 --- a/src/lib/lttng-ctl/filter/Makefile.am +++ b/src/lib/lttng-ctl/filter/Makefile.am @@ -1,5 +1,4 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src \ - -I$(srcdir) -I$(builddir) +AM_CPPFLAGS += -I$(srcdir) -I$(builddir) noinst_PROGRAMS = filter-grammar-test noinst_LTLIBRARIES = libfilter.la @@ -22,7 +21,7 @@ libfilter_la_SOURCES = \ filter-bytecode.h \ filter-ir.h \ memstream.h -libfilter_la_CFLAGS = -include filter-symbols.h +libfilter_la_CFLAGS = -include filter-symbols.h $(AM_CFLAGS) libfilter_la_LIBADD = $(top_builddir)/src/common/string-utils/libstring-utils.la AM_YFLAGS = -t -d -v diff --git a/tests/regression/kernel/Makefile.am b/tests/regression/kernel/Makefile.am index e9ec04ea9..92c21bc9f 100644 --- a/tests/regression/kernel/Makefile.am +++ b/tests/regression/kernel/Makefile.am @@ -1,4 +1,3 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src EXTRA_DIST = test_event_basic test_all_events test_syscall \ test_clock_override test_rotation_destroy_flush \ test_select_poll_epoll @@ -6,7 +5,7 @@ EXTRA_DIST = test_event_basic test_all_events test_syscall \ noinst_PROGRAMS = select_poll_epoll select_poll_epoll_SOURCES = select_poll_epoll.c select_poll_epoll_LDADD = -lpthread -lpopt -select_poll_epoll_CFLAGS = -fno-stack-protector -D_FORTIFY_SOURCE=0 +select_poll_epoll_CFLAGS = -fno-stack-protector -D_FORTIFY_SOURCE=0 $(AM_CFLAGS) all-local: @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ diff --git a/tests/regression/tools/crash/Makefile.am b/tests/regression/tools/crash/Makefile.am index 627a47838..5cfca6527 100644 --- a/tests/regression/tools/crash/Makefile.am +++ b/tests/regression/tools/crash/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include - noinst_SCRIPTS = test_crash EXTRA_DIST = test_crash diff --git a/tests/regression/tools/filtering/Makefile.am b/tests/regression/tools/filtering/Makefile.am index f96ac89bd..712edefb6 100644 --- a/tests/regression/tools/filtering/Makefile.am +++ b/tests/regression/tools/filtering/Makefile.am @@ -1,5 +1,4 @@ -AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests -I$(srcdir) -O2 -g -AM_LDFLAGS = +AM_CPPFLAGS += -I$(top_srcdir)/tests -I$(srcdir) if LTTNG_TOOLS_BUILD_WITH_LIBDL LIBS += -ldl diff --git a/tests/regression/tools/health/Makefile.am b/tests/regression/tools/health/Makefile.am index 4d835f3df..3cb2936cc 100644 --- a/tests/regression/tools/health/Makefile.am +++ b/tests/regression/tools/health/Makefile.am @@ -1,5 +1,4 @@ -AM_CFLAGS = -I. -O2 -g -I$(top_srcdir)/include -AM_LDFLAGS = +AM_CPPFLAGS += -I. -I$(top_srcdir)/include if LTTNG_TOOLS_BUILD_WITH_LIBDL LIBS += -ldl diff --git a/tests/regression/tools/live/Makefile.am b/tests/regression/tools/live/Makefile.am index 8bc213d7c..44e449010 100644 --- a/tests/regression/tools/live/Makefile.am +++ b/tests/regression/tools/live/Makefile.am @@ -1,5 +1,4 @@ -AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils/ -I$(srcdir) -AM_LDFLAGS = +AM_CPPFLAGS += -I$(top_srcdir)/tests/utils/ -I$(srcdir) if LTTNG_TOOLS_BUILD_WITH_LIBDL LIBS += -ldl diff --git a/tests/regression/tools/mi/Makefile.am b/tests/regression/tools/mi/Makefile.am index f26efe0d0..b1b28f4a7 100644 --- a/tests/regression/tools/mi/Makefile.am +++ b/tests/regression/tools/mi/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src - noinst_PROGRAMS = validate_xml extract_xml validate_xml_SOURCES = validate_xml.c validate_xml_CPPFLAGS = $(libxml2_CFLAGS) $(AM_CPPFLAGS) diff --git a/tests/regression/tools/wildcard/Makefile.am b/tests/regression/tools/wildcard/Makefile.am index b95b495e4..1261baa38 100644 --- a/tests/regression/tools/wildcard/Makefile.am +++ b/tests/regression/tools/wildcard/Makefile.am @@ -1,5 +1,4 @@ -AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests -I$(srcdir) -O2 -g -AM_LDFLAGS = +AM_CPPFLAGS += -I$(top_srcdir)/tests -I$(srcdir) if LTTNG_TOOLS_BUILD_WITH_LIBDL LIBS += -ldl diff --git a/tests/regression/ust/baddr-statedump/Makefile.am b/tests/regression/ust/baddr-statedump/Makefile.am index 7caf45766..bf3271797 100644 --- a/tests/regression/ust/baddr-statedump/Makefile.am +++ b/tests/regression/ust/baddr-statedump/Makefile.am @@ -2,7 +2,7 @@ objcopy_verbose = $(objcopy_verbose_@AM_V@) objcopy_verbose_ = $(objcopy_verbose_@AM_DEFAULT_V@) objcopy_verbose_0 = @echo OBJCOPY $@; -AM_CPPFLAGS = -I$(srcdir) -g +AM_CPPFLAGS += -I$(srcdir) -g noinst_PROGRAMS = prog prog_SOURCES = prog.c tp.c tp.h diff --git a/tests/regression/ust/clock-override/Makefile.am b/tests/regression/ust/clock-override/Makefile.am index 2a226303a..8559ef02e 100644 --- a/tests/regression/ust/clock-override/Makefile.am +++ b/tests/regression/ust/clock-override/Makefile.am @@ -9,8 +9,6 @@ EXTRA_DIST = test_clock_override lttng-ust-clock-override-test.c else -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir)/src - # The rpath is necessary because libtool won't build a shared library # if it's noinst_ GETCPU_LIBTOOL_FLAGS = \ diff --git a/tests/regression/ust/daemon/Makefile.am b/tests/regression/ust/daemon/Makefile.am index 76a34ef07..cc63b63b7 100644 --- a/tests/regression/ust/daemon/Makefile.am +++ b/tests/regression/ust/daemon/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(srcdir) +AM_CPPFLAGS += -I$(srcdir) noinst_PROGRAMS = daemon daemon_SOURCES = daemon.c ust_tests_daemon.h diff --git a/tests/regression/ust/exit-fast/Makefile.am b/tests/regression/ust/exit-fast/Makefile.am index 539803d7b..4424b0d20 100644 --- a/tests/regression/ust/exit-fast/Makefile.am +++ b/tests/regression/ust/exit-fast/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(srcdir) +AM_CPPFLAGS += -I$(srcdir) noinst_PROGRAMS = exit-fast exit_fast_SOURCES = exit-fast.c ust_tests_exitfast.h diff --git a/tests/regression/ust/fork/Makefile.am b/tests/regression/ust/fork/Makefile.am index 89a2ec985..b07cf9dba 100644 --- a/tests/regression/ust/fork/Makefile.am +++ b/tests/regression/ust/fork/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(srcdir) +AM_CPPFLAGS += -I$(srcdir) noinst_PROGRAMS = fork fork2 fork_SOURCES = fork.c ust_tests_fork.h diff --git a/tests/regression/ust/getcpu-override/Makefile.am b/tests/regression/ust/getcpu-override/Makefile.am index 21076e134..a6487d9bb 100644 --- a/tests/regression/ust/getcpu-override/Makefile.am +++ b/tests/regression/ust/getcpu-override/Makefile.am @@ -10,8 +10,6 @@ EXTRA_DIST = test_getcpu_override run-getcpu-override \ else -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir)/src - # The rpath is necessary because libtool won't build a shared library # if it's noinst_ GETCPU_LIBTOOL_FLAGS = \ diff --git a/tests/regression/ust/high-throughput/Makefile.am b/tests/regression/ust/high-throughput/Makefile.am index 25913c3f4..22a31e18b 100644 --- a/tests/regression/ust/high-throughput/Makefile.am +++ b/tests/regression/ust/high-throughput/Makefile.am @@ -1,5 +1,4 @@ -AM_CFLAGS = -I$(srcdir) -O2 -AM_LDFLAGS = -llttng-ust +AM_CPPFLAGS += -I$(srcdir) if LTTNG_TOOLS_BUILD_WITH_LIBDL LIBS += -ldl diff --git a/tests/regression/ust/libc-wrapper/Makefile.am b/tests/regression/ust/libc-wrapper/Makefile.am index d35ca8129..2a800728e 100644 --- a/tests/regression/ust/libc-wrapper/Makefile.am +++ b/tests/regression/ust/libc-wrapper/Makefile.am @@ -1,5 +1,3 @@ -AM_CPPFLAGS = -I$(srcdir) - noinst_PROGRAMS = prog prog_SOURCES = prog.c prog_LDADD = -llttng-ust -llttng-ust-libc-wrapper diff --git a/tests/regression/ust/linking/Makefile.am b/tests/regression/ust/linking/Makefile.am index 1c80ae839..c70bc53a2 100644 --- a/tests/regression/ust/linking/Makefile.am +++ b/tests/regression/ust/linking/Makefile.am @@ -1,6 +1,6 @@ # -Wsystem-headers is needed to print warnings in the tracepoint # description file. -AM_CPPFLAGS = -I$(srcdir) -I$(top_builddir)/include -Wsystem-headers +AM_CPPFLAGS += -I$(srcdir) -Wsystem-headers # Set LIBS to nothing so the application does not link on useless # libraries. @@ -10,7 +10,7 @@ LIBS = demo_builtin_SOURCES = demo.c tp.c tp2.c tp3.c ust_tests_demo.h \ ust_tests_demo2.h ust_tests_demo3.h demo_builtin_LDADD = -llttng-ust -demo_builtin_CFLAGS = -Werror=old-style-definition +demo_builtin_CFLAGS = -Werror=old-style-definition $(AM_CFLAGS) # Build a version statically linked to the providers # contains ust_tests_demo.h and ust_tests_demo2.h provider probes @@ -79,7 +79,7 @@ liblttng_ust_provider_ust_tests_demo3_la_LDFLAGS = \ noinst_PROGRAMS += demo demo_SOURCES = demo.c ust_tests_demo.h -demo_CFLAGS = -DTEST_DYNAMIC_LINKAGE +demo_CFLAGS = -DTEST_DYNAMIC_LINKAGE $(AM_CFLAGS) if LTTNG_TOOLS_BUILD_WITH_LIBDL demo_LDADD = -ldl diff --git a/tests/regression/ust/low-throughput/Makefile.am b/tests/regression/ust/low-throughput/Makefile.am index 630d797b3..8ce8f2439 100644 --- a/tests/regression/ust/low-throughput/Makefile.am +++ b/tests/regression/ust/low-throughput/Makefile.am @@ -1,5 +1,4 @@ -AM_CFLAGS = -I$(srcdir) -O2 -AM_LDFLAGS = -llttng-ust +AM_CPPFLAGS += -I$(srcdir) if LTTNG_TOOLS_BUILD_WITH_LIBDL LIBS += -ldl diff --git a/tests/regression/ust/multi-session/Makefile.am b/tests/regression/ust/multi-session/Makefile.am index c821e5a1e..744a27ef9 100644 --- a/tests/regression/ust/multi-session/Makefile.am +++ b/tests/regression/ust/multi-session/Makefile.am @@ -1,5 +1,4 @@ -AM_CFLAGS = -I$(srcdir) -O2 -AM_LDFLAGS = -llttng-ust +AM_CFLAGS += -I$(srcdir) if LTTNG_TOOLS_BUILD_WITH_LIBDL LIBS += -ldl diff --git a/tests/regression/ust/overlap/demo/Makefile.am b/tests/regression/ust/overlap/demo/Makefile.am index 15f5600d6..4d4efb154 100644 --- a/tests/regression/ust/overlap/demo/Makefile.am +++ b/tests/regression/ust/overlap/demo/Makefile.am @@ -10,7 +10,7 @@ EXTRA_DIST = demo-trace demo.c ust_tests_demo.h \ else -AM_CFLAGS=-I$(srcdir) +AM_CPPFLAGS += -I$(srcdir) # Force the shared flag on the noinst libraries since they are # only built static by default diff --git a/tests/regression/ust/type-declarations/Makefile.am b/tests/regression/ust/type-declarations/Makefile.am index be4978be3..593f6dc36 100644 --- a/tests/regression/ust/type-declarations/Makefile.am +++ b/tests/regression/ust/type-declarations/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(srcdir) +AM_CPPFLAGS += -I$(srcdir) noinst_PROGRAMS = type-declarations type_declarations_SOURCES = type-declarations.c ust_tests_td.h diff --git a/tests/regression/ust/ust-dl/Makefile.am b/tests/regression/ust/ust-dl/Makefile.am index 385d44824..5a60c1679 100644 --- a/tests/regression/ust/ust-dl/Makefile.am +++ b/tests/regression/ust/ust-dl/Makefile.am @@ -15,7 +15,7 @@ objcopy_verbose = $(objcopy_verbose_@AM_V@) objcopy_verbose_ = $(objcopy_verbose_@AM_DEFAULT_V@) objcopy_verbose_0 = @echo OBJCOPY $@; -AM_CPPFLAGS = -I$(srcdir) -g +AM_CPPFLAGS += -I$(srcdir) -g noinst_PROGRAMS = prog prog_SOURCES = prog.c diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 798e57d93..2c7365912 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -1,7 +1,6 @@ SUBDIRS = ini_config -AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils/ -I$(srcdir) -AM_LDFLAGS = +AM_CPPFLAGS += -I$(top_srcdir)/tests/utils/ -I$(srcdir) LOG_DRIVER_FLAGS='--merge' LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ diff --git a/tests/unit/ini_config/Makefile.am b/tests/unit/ini_config/Makefile.am index 0a4d58286..450237047 100644 --- a/tests/unit/ini_config/Makefile.am +++ b/tests/unit/ini_config/Makefile.am @@ -1,4 +1,4 @@ -AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils/ +AM_CPPFLAGS += -I$(top_srcdir)/tests/utils/ LIBTAP=$(top_builddir)/tests/utils/tap/libtap.la LIBCONFIG=$(top_builddir)/src/common/config/libconfig.la diff --git a/tests/unit/test_utils_expand_path.c b/tests/unit/test_utils_expand_path.c index 44173f6f0..5fc383c62 100644 --- a/tests/unit/test_utils_expand_path.c +++ b/tests/unit/test_utils_expand_path.c @@ -26,8 +26,7 @@ #include -#include - +#include #include /* For error.h */ diff --git a/tests/unit/test_utils_parse_size_suffix.c b/tests/unit/test_utils_parse_size_suffix.c index a950a0891..14438ad32 100644 --- a/tests/unit/test_utils_parse_size_suffix.c +++ b/tests/unit/test_utils_parse_size_suffix.c @@ -21,7 +21,7 @@ #include -#include +#include /* For error.h */ int lttng_opt_quiet = 1; diff --git a/tests/utils/Makefile.am b/tests/utils/Makefile.am index d2eb49fa6..9d327e0ec 100644 --- a/tests/utils/Makefile.am +++ b/tests/utils/Makefile.am @@ -1,6 +1,5 @@ SUBDIRS = . tap testapp -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src EXTRA_DIST = utils.sh test_utils.py babelstats.pl warn_processes.sh dist_noinst_SCRIPTS = utils.sh test_utils.py babelstats.pl noinst_LTLIBRARIES = libtestutils.la diff --git a/tests/utils/testapp/gen-ust-events/Makefile.am b/tests/utils/testapp/gen-ust-events/Makefile.am index 0cc7575d7..9700eac69 100644 --- a/tests/utils/testapp/gen-ust-events/Makefile.am +++ b/tests/utils/testapp/gen-ust-events/Makefile.am @@ -1,5 +1,4 @@ -AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src \ - -I$(top_srcdir)/tests/utils -I$(srcdir) -O2 -g +AM_CPPFLAGS += -I$(top_srcdir)/tests/utils -I$(srcdir) if LTTNG_TOOLS_BUILD_WITH_LIBDL LIBS += -ldl diff --git a/tests/utils/testapp/gen-ust-nevents-str/Makefile.am b/tests/utils/testapp/gen-ust-nevents-str/Makefile.am index 57f8350b4..405f05b74 100644 --- a/tests/utils/testapp/gen-ust-nevents-str/Makefile.am +++ b/tests/utils/testapp/gen-ust-nevents-str/Makefile.am @@ -1,5 +1,4 @@ -AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(srcdir) \ - -I$(top_srcdir)/tests/utils -O2 -g +AM_CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/tests/utils if LTTNG_TOOLS_BUILD_WITH_LIBDL LIBS += -ldl diff --git a/tests/utils/testapp/gen-ust-nevents/Makefile.am b/tests/utils/testapp/gen-ust-nevents/Makefile.am index b3212228f..24f64b2c6 100644 --- a/tests/utils/testapp/gen-ust-nevents/Makefile.am +++ b/tests/utils/testapp/gen-ust-nevents/Makefile.am @@ -1,5 +1,4 @@ -AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(srcdir) \ - -I$(top_srcdir)/tests/utils -O2 -g +AM_CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/tests/utils if LTTNG_TOOLS_BUILD_WITH_LIBDL LIBS += -ldl diff --git a/tests/utils/testapp/gen-ust-tracef/Makefile.am b/tests/utils/testapp/gen-ust-tracef/Makefile.am index 06171fa92..293a79c8c 100644 --- a/tests/utils/testapp/gen-ust-tracef/Makefile.am +++ b/tests/utils/testapp/gen-ust-tracef/Makefile.am @@ -1,11 +1,11 @@ -AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(srcdir) -O2 -g +AM_CPPFLAGS += -I$(srcdir) AM_LDFLAGS = if LTTNG_TOOLS_BUILD_WITH_LIBDL -LIBS += -ldl +AM_LDFLAGS += -ldl endif if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -LIBS += -lc +AM_LDFLAGS += -lc endif if HAVE_LIBLTTNG_UST_CTL