Skip to contentSkip to conversation

Fix: Don't override user variables within the build system

PATCH Mathieu Desnoyers 1 participant 1 message May 9, 2017 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Merging for master, 2.10, 2.9.

Can you prepare a version for 2.8 ? It does not cherry-pick cleanly.

Thanks,

Mathieu

Quoted 756 lines · ----- On May 9, 2017, at 2:25 PM, Michael Jeanson [email protected] wrote:

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

---

configure.ac                                   | 11 +++++++---
doc/examples/Makefile.am                       |  8 +++----
doc/examples/clock-override/Makefile           | 12 ++++-------
doc/examples/demo-tracef/Makefile              | 10 +++------
doc/examples/demo-tracelog/Makefile            | 10 +++------
doc/examples/demo/Makefile                     | 30 +++++++++++---------------
doc/examples/easy-ust/Makefile                 | 14 +++++-------
doc/examples/gen-tp/Makefile                   | 16 ++++++--------
doc/examples/getcpu-override/Makefile          | 12 ++++-------
doc/examples/hello-static-lib/Makefile         | 14 +++++-------
liblttng-ust-ctl/Makefile.am                   |  2 +-
liblttng-ust-cyg-profile/Makefile.am           |  2 +-
liblttng-ust-dl/Makefile.am                    |  4 ++--
liblttng-ust-fd/Makefile.am                    |  4 ++--
liblttng-ust-fork/Makefile.am                  |  4 ++--
liblttng-ust-java-agent/jni/common/Makefile.am |  2 +-
liblttng-ust-java-agent/jni/jul/Makefile.am    |  2 +-
liblttng-ust-java-agent/jni/log4j/Makefile.am  |  2 +-
liblttng-ust-java/Makefile.am                  |  2 +-
liblttng-ust-libc-wrapper/Makefile.am          |  2 +-
liblttng-ust-python-agent/Makefile.am          |  2 +-
liblttng-ust/Makefile.am                       |  6 +++---
libringbuffer/Makefile.am                      |  4 ++--
snprintf/Makefile.am                           |  4 ++--
tests/benchmark/Makefile.am                    |  2 +-
tests/ctf-types/Makefile.am                    |  2 +-
tests/hello/Makefile.am                        |  2 +-
tests/test-app-ctx/Makefile.am                 |  2 +-
tests/trace_event/Makefile.am                  |  2 +-
tests/tracepoint/Makefile.am                   |  2 +-
tests/tracepoint/benchmark/Makefile.am         |  2 +-
tests/ust-variant/Makefile.am                  |  2 +-
32 files changed, 84 insertions(+), 111 deletions(-)
configure.ac +0 -0
index 77b5db4..6f7c6f1 100644
@@ -187,8 +187,6 @@ dnl AC_CHECK_TYPES([ptrdiff_t])

AC_FUNC_MALLOC
AC_CHECK_FUNCS([gettimeofday munmap socket strerror strtol sched_getcpu sysconf])

configure.ac +0 -2
-CFLAGS="-Wall $CFLAGS"
-

# URCU

# urcu - check if we just find the headers it out of the box.
configure.ac +0 -0
@@ -306,10 +304,13 @@ AS_IF([test "x$jni_interface" = "xyes" || test

"x$java_agent_jul" = "xyes" || te
AX_JNI_INCLUDE_DIR
for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
do

configure.ac +1 -1
-		CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
+		JNI_CPPFLAGS="$JNI_CPPFLAGS -I$JNI_INCLUDE_DIR"

done

configure.ac +2 -0
+	saved_CPPFLAGS="$CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS $JNI_CPPFLAGS"

AX_PROG_JAVAH

configure.ac +1 -0
+	CPPFLAGS="$saved_CPPFLAGS"

])

AS_IF([test "x$java_agent_log4j" = "xyes"], [

configure.ac +4 -0
@@ -446,6 +447,10 @@
 _AC_DEFINE_AND_SUBST([LTTNG_UST_DEFAULT_CONSTRUCTOR_TIMEOUT_MS], [3000])
 # By default, do not retry on buffer full condition.
 _AC_DEFINE_AND_SUBST([LTTNG_UST_DEFAULT_BLOCKING_RETRY_TIMEOUT_MS], [0])
 
+AM_CFLAGS="-Wall"
+AC_SUBST(AM_CFLAGS)
+AC_SUBST(JNI_CPPFLAGS)
+

AC_CONFIG_FILES([
Makefile
doc/Makefile

doc/examples/Makefile.am +0 -3
index 239046f..02e449a 100644
@@ -131,7 +131,7 @@ all-local:
 		rel_build_subdir="../"; \
 	fi; \
 	for subdir in $(SUBDIRS_PROXY); do \
-		(cd $$subdir && $(MAKE) AM_CC="$(CC)" AM_CPPFLAGS="$(CPPFLAGS)
-I$$rel_src_subdir$(top_srcdir)/include/
-I$$rel_build_subdir$(top_builddir)/include/" AM_CFLAGS='$(CFLAGS)'

AM_LDFLAGS='$(LDFLAGS) -L../../../liblttng-ust/.libs

doc/examples/Makefile.am +0 -2
-Wl,-rpath="$(PWD)/../../liblttng-ust/.libs/"
-Wl,-rpath-link="$(PWD)/../../liblttng-ust/.libs/"'

LTTNG_GEN_TP_PATH="../../../tools/" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \

doc/examples/Makefile.am +1 -0
+		(cd $$subdir && $(MAKE) CC="$(CC)" CPPFLAGS="$(CPPLAGS)"

AM_CPPFLAGS="$(AM_CPPFLAGS) -I$$rel_src_subdir$(top_srcdir)/include/ -I$$rel_build_subdir$(top_builddir)/include/" CFLAGS='$(CFLAGS)' AM_CFLAGS='$(AM_CFLAGS)' LDFLAGS="$(LDFLAGS)" AM_LDFLAGS='$(AM_LDFLAGS)

doc/examples/Makefile.am +0 -2
-L../../../liblttng-ust/.libs -Wl,-rpath="$(PWD)/../../liblttng-ust/.libs/"
-Wl,-rpath-link="$(PWD)/../../liblttng-ust/.libs/"'
LTTNG_GEN_TP_PATH="../../../tools/" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \
	done; \
	if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
		for subdir in $(SUBDIRS_JUL); do \
doc/examples/Makefile.am +3 -3
@@ -154,9 +154,9 @@ all-local:
 				cmake \
 				-DCMAKE_INCLUDE_PATH="$(abs_top_srcdir)/include;$(abs_top_builddir)/include" \
 				-DCMAKE_LIBRARY_PATH="$(abs_top_builddir)/liblttng-ust/.libs" \
-				-DCMAKE_C_FLAGS="$(CFLAGS) $(CPPFLAGS)" \
-				-DCMAKE_CXX_FLAGS="$(CXXFLAGS) $(CPPFLAGS)" \
-				-DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS)" \
+				-DCMAKE_C_FLAGS="$(AM_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)" \
+				-DCMAKE_CXX_FLAGS="$(AM_CXXFLAGS) $(AM_CPPFLAGS) $(CXXFLAGS) $(CPPFLAGS)" \
+				-DCMAKE_EXE_LINKER_FLAGS="$(AM_LDFLAGS) $(LDFLAGS)" \
 				.. && \
 				$(MAKE) && \
 				cd .. \
doc/examples/clock-override/Makefile +0 -4
index 8f38c4f..5433427 100644
@@ -15,10 +15,6 @@
 #
 # This makefile is purposefully kept simple to support GNU and BSD make.
 
-ifdef AM_CC
-	CC = $(AM_CC)
-endif
-

LIBS = -ldl # On Linux
#LIBS = -lc # On BSD
LOCAL_CPPFLAGS += -I.

doc/examples/clock-override/Makefile +0 -0
@@ -26,12 +22,12 @@ LOCAL_CPPFLAGS += -I.

all: lttng-ust-clock-override-example.so

lttng-ust-clock-override-example.o: lttng-ust-clock-override-example.c

doc/examples/clock-override/Makefile +2 -2
-	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
-		$(AM_CFLAGS) -fpic -c -o $@ $<
+	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+		$(CFLAGS) -fpic -c -o $@ $<

lttng-ust-clock-override-example.so: lttng-ust-clock-override-example.o

doc/examples/clock-override/Makefile +2 -2
-	$(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(CFLAGS) \
-		$(AM_LDFLAGS) $(AM_CFLAGS) lttng-ust-clock-override-example.o
+	$(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
+		$(AM_LDFLAGS) $(CFLAGS) lttng-ust-clock-override-example.o

.PHONY: clean
clean:

doc/examples/demo-tracef/Makefile +0 -4
index 40e9a58..1e4544c 100644
@@ -15,10 +15,6 @@
 #
 # This makefile is purposefully kept simple to support GNU and BSD make.
 
-ifdef AM_CC
-	CC = $(AM_CC)
-endif
-

LIBS = -ldl -llttng-ust # On Linux
#LIBS = -lc # On BSD
LOCAL_CPPFLAGS += -I.

doc/examples/demo-tracef/Makefile +0 -0
@@ -26,11 +22,11 @@ LOCAL_CPPFLAGS += -I.

all: demo-tracef

demo-tracef.o: demo-tracef.c

doc/examples/demo-tracef/Makefile +2 -2
-	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
-		$(AM_CFLAGS) -c -o $@ $<
+	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+		$(CFLAGS) -c -o $@ $<

demo-tracef: demo-tracef.o

doc/examples/demo-tracef/Makefile +1 -1
-	$(CC) $(LDFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \
+	$(CC) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
		-o $@ $< $(LIBS)

.PHONY: clean

doc/examples/demo-tracelog/Makefile +0 -4
index cc6843a..a16d6c5 100644
@@ -15,10 +15,6 @@
 #
 # This makefile is purposefully kept simple to support GNU and BSD make.
 
-ifdef AM_CC
-	CC = $(AM_CC)
-endif
-

LIBS = -ldl -llttng-ust # On Linux
#LIBS = -lc # On BSD
LOCAL_CPPFLAGS += -I.

doc/examples/demo-tracelog/Makefile +0 -0
@@ -26,11 +22,11 @@ LOCAL_CPPFLAGS += -I.

all: demo-tracelog

demo-tracelog.o: demo-tracelog.c

doc/examples/demo-tracelog/Makefile +2 -2
-	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
-		$(AM_CFLAGS) -c -o $@ $<
+	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+		$(CFLAGS) -c -o $@ $<

demo-tracelog: demo-tracelog.o

doc/examples/demo-tracelog/Makefile +1 -1
-	$(CC) $(LDFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \
+	$(CC) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
		-o $@ $< $(LIBS)

.PHONY: clean

doc/examples/demo/Makefile +0 -4
index 9c847b1..6272a2b 100644
@@ -14,10 +14,6 @@
 #
 # This makefile is purposefully kept simple to support GNU and BSD make.
 
-ifdef AM_CC
-	CC = $(AM_CC)
-endif
-

LIBS = -ldl # On Linux
#LIBS = -lc # On BSD
LOCAL_CPPFLAGS += -I.

doc/examples/demo/Makefile +0 -0
@@ -25,31 +21,31 @@ LOCAL_CPPFLAGS += -I.

all: demo lttng-ust-provider-ust-tests-demo.so
lttng-ust-provider-ust-tests-demo3.so

tp.o: tp.c ust_tests_demo.h

doc/examples/demo/Makefile +2 -2
-	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
-		$(AM_CFLAGS) -fpic -c -o $@ $<
+	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+		$(CFLAGS) -fpic -c -o $@ $<

tp2.o: tp2.c ust_tests_demo2.h

doc/examples/demo/Makefile +2 -2
-	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
-		$(AM_CFLAGS) -fpic -c -o $@ $<
+	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+		$(CFLAGS) -fpic -c -o $@ $<

lttng-ust-provider-ust-tests-demo.so: tp.o tp2.o

doc/examples/demo/Makefile +2 -2
-	$(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(CFLAGS) \
-		$(AM_LDFLAGS) $(AM_CFLAGS) -llttng-ust tp.o tp2.o
+	$(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
+		$(AM_LDFLAGS) $(CFLAGS) -llttng-ust tp.o tp2.o

tp3.o: tp3.c ust_tests_demo3.h

doc/examples/demo/Makefile +2 -2
-	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
-		$(AM_CFLAGS) -fpic -c -o $@ $<
+	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+		$(CFLAGS) -fpic -c -o $@ $<

lttng-ust-provider-ust-tests-demo3.so: tp3.o

doc/examples/demo/Makefile +2 -2
-	$(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(CFLAGS) \
-		$(AM_LDFLAGS) $(AM_CFLAGS) -llttng-ust tp3.o
+	$(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
+		$(AM_LDFLAGS) $(CFLAGS) -llttng-ust tp3.o

demo.o: demo.c

doc/examples/demo/Makefile +2 -2
-	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
-		$(AM_CFLAGS) -c -o $@ $<
+	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+		$(CFLAGS) -c -o $@ $<

demo: demo.o

doc/examples/demo/Makefile +1 -1
-	$(CC) $(LDFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \
+	$(CC) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
		-o $@ demo.o $(LIBS)

.PHONY: clean

doc/examples/easy-ust/Makefile +0 -4
index 723780f..0227293 100644
@@ -16,10 +16,6 @@
 #
 # This makefile is purposefully kept simple to support GNU and BSD make.
 
-ifdef AM_CC
-	CC = $(AM_CC)
-endif
-

LIBS = -ldl -llttng-ust # On Linux
#LIBS = -lc -llttng-ust # On BSD
LOCAL_CPPFLAGS += -I.

doc/examples/easy-ust/Makefile +0 -0
@@ -27,16 +23,16 @@ LOCAL_CPPFLAGS += -I.

all: sample

sample: sample.o tp.o

doc/examples/easy-ust/Makefile +1 -1
-	$(CC) -o $@ $(LDFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \
+	$(CC) -o $@ $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
		sample.o tp.o $(LIBS)

sample.o: sample.c sample_component_provider.h

doc/examples/easy-ust/Makefile +2 -2
-	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
-		$(AM_CFLAGS) -c -o $@ $<
+	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+		$(CFLAGS) -c -o $@ $<

tp.o: tp.c sample_component_provider.h

doc/examples/easy-ust/Makefile +2 -2
-	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
-		$(AM_CFLAGS) -c -o $@ $<
+	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+		$(CFLAGS) -c -o $@ $<

html: sample_component_provider.html sample.html tp.html

doc/examples/gen-tp/Makefile +0 -4
index 5c2a78c..6d9ec10 100644
@@ -17,34 +17,30 @@
 #
 # This makefile is purposefully kept simple to support GNU and BSD make.
 
-ifdef AM_CC
-	CC = $(AM_CC)
-endif
-

LIBS = -ldl -llttng-ust #On Linux
#LIBS = -lc -llttng-ust #On BSD

all: sample

sample: sample.o sample_tracepoint.o

doc/examples/gen-tp/Makefile +1 -1
-	$(CC) $(LDFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \
+	$(CC) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
		-o $@ sample.o sample_tracepoint.o $(LIBS)

sample.o: sample.c sample_tracepoint.h

doc/examples/gen-tp/Makefile +1 -1
-	$(CC) $(CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) $(AM_CFLAGS) \
+	$(CC) $(CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) $(CFLAGS) \
		-c -o $@ $<

# Use this command to compile the .c manually #sample_tracepoint.o: sample_tracepoint.c sample_tracepoint.h

doc/examples/gen-tp/Makefile +1 -1
-#	$(CC) $(CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) $(AM_CFLAGS) \
+#	$(CC) $(CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) $(CFLAGS) \

# -I. -c -o $@ $<

# This rule generate .o only and depends on rules for generating

# the .h and .c
%.o: %.tp %.c %.h
doc/examples/gen-tp/Makefile +3 -3
-	CPPFLAGS="$(CPPFLAGS) $(AM_CPPFLAGS)" \
-	CFLAGS="$(CFLAGS) $(AM_CFLAGS)" \
-	LDFLAGS="$(LDFLAGS) $(AM_LDFLAGS)" \
+	CPPFLAGS="$(AM_CPPFLAGS) $(CPPFLAGS)" \
+	CFLAGS="$(AM_CFLAGS) $(CFLAGS)" \
+	LDFLAGS="$(AM_LDFLAGS) $(LDFLAGS)" \
	CC="$(CC)" \
	$(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $<
doc/examples/getcpu-override/Makefile +0 -4
index ec752d7..de295c6 100644
@@ -15,10 +15,6 @@
 #
 # This makefile is purposefully kept simple to support GNU and BSD make.
 
-ifdef AM_CC
-	CC = $(AM_CC)
-endif
-

LIBS = -ldl # On Linux
#LIBS = -lc # On BSD
LOCAL_CPPFLAGS += -I.

doc/examples/getcpu-override/Makefile +0 -0
@@ -26,12 +22,12 @@ LOCAL_CPPFLAGS += -I.

all: lttng-ust-getcpu-override-example.so

lttng-ust-getcpu-override-example.o: lttng-ust-getcpu-override-example.c

doc/examples/getcpu-override/Makefile +2 -2
-	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
-		$(AM_CFLAGS) -fpic -c -o $@ $<
+	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+		$(CFLAGS) -fpic -c -o $@ $<

lttng-ust-getcpu-override-example.so: lttng-ust-getcpu-override-example.o

doc/examples/getcpu-override/Makefile +2 -2
-	$(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(CFLAGS) \
-		$(AM_LDFLAGS) $(AM_CFLAGS) lttng-ust-getcpu-override-example.o
+	$(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
+		$(AM_LDFLAGS) $(CFLAGS) lttng-ust-getcpu-override-example.o

.PHONY: clean
clean:

doc/examples/hello-static-lib/Makefile +0 -4
index ec185c1..cf72b35 100644
@@ -14,10 +14,6 @@
 #
 # This makefile is purposefully kept simple to support GNU and BSD make.
 
-ifdef AM_CC
-	CC = $(AM_CC)
-endif
-

LOCAL_CPPFLAGS += -I.
LIBS = -ldl -llttng-ust # On Linux
#LIBS = -lc -llttng-ust # On BSD

doc/examples/hello-static-lib/Makefile +0 -0
@@ -25,19 +21,19 @@ LIBS = -ldl -llttng-ust	# On Linux

all: hello

lttng-ust-provider-hello.o: tp.c ust_tests_hello.h

doc/examples/hello-static-lib/Makefile +2 -2
-	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
-		$(AM_CFLAGS) -c -o $@ $<
+	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+		$(CFLAGS) -c -o $@ $<

lttng-ust-provider-hello.a: lttng-ust-provider-hello.o
ar -rc $@ lttng-ust-provider-hello.o

hello.o: hello.c

doc/examples/hello-static-lib/Makefile +2 -2
-	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
-		$(AM_CFLAGS) -c -o $@ $<
+	$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+		$(CFLAGS) -c -o $@ $<

hello: hello.o lttng-ust-provider-hello.a

	$(CC) -o $@ $(LDFLAGS) $(CPPFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \
doc/examples/hello-static-lib/Makefile +1 -1
-		hello.o lttng-ust-provider-hello.a $(LIBS)
+		$(CFLAGS) hello.o lttng-ust-provider-hello.a $(LIBS)

.PHONY: clean
clean:

liblttng-ust-ctl/Makefile.am +0 -0
index e10ba8b..6043d17 100644
@@ -1,5 +1,5 @@

AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/liblttng-ust-comm

liblttng-ust-ctl/Makefile.am +1 -2
-I$(top_builddir)/include
-AM_CFLAGS = -fno-strict-aliasing
+AM_CFLAGS += -fno-strict-aliasing

lib_LTLIBRARIES = liblttng-ust-ctl.la

liblttng-ust-cyg-profile/Makefile.am +0 -0
index d325f53..3130282 100644
@@ -1,5 +1,5 @@

AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include

liblttng-ust-cyg-profile/Makefile.am +1 -1
-AM_CFLAGS = -fno-strict-aliasing
+AM_CFLAGS += -fno-strict-aliasing

lib_LTLIBRARIES = liblttng-ust-cyg-profile.la \
liblttng-ust-cyg-profile-fast.la

liblttng-ust-dl/Makefile.am +0 -0
index 049ac65..c0168f3 100644
@@ -1,5 +1,5 @@

AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include

liblttng-ust-dl/Makefile.am +1 -1
-AM_CFLAGS = -fno-strict-aliasing
+AM_CFLAGS += -fno-strict-aliasing

lib_LTLIBRARIES = liblttng-ust-dl.la
liblttng_ust_dl_la_SOURCES = \

liblttng-ust-dl/Makefile.am +0 -0
@@ -16,4 +16,4 @@ if LTTNG_UST_BUILD_WITH_LIBC_DL

liblttng_ust_dl_la_LIBADD += -lc
endif

liblttng-ust-dl/Makefile.am +1 -2
-liblttng_ust_dl_la_CFLAGS = -DUST_COMPONENT=liblttng-ust-dl
-fno-strict-aliasing
+liblttng_ust_dl_la_CFLAGS = -DUST_COMPONENT=liblttng-ust-dl $(AM_CFLAGS)
liblttng-ust-fd/Makefile.am +0 -0
index 52f897d..e9fc3b4 100644
@@ -1,5 +1,5 @@

AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include

liblttng-ust-fd/Makefile.am +1 -1
-AM_CFLAGS = -fno-strict-aliasing
+AM_CFLAGS += -fno-strict-aliasing

lib_LTLIBRARIES = liblttng-ust-fd.la
liblttng_ust_fd_la_SOURCES = \

liblttng-ust-fd/Makefile.am +0 -0
@@ -14,4 +14,4 @@ if LTTNG_UST_BUILD_WITH_LIBC_DL

liblttng_ust_fd_la_LIBADD += -lc
endif

liblttng-ust-fd/Makefile.am +1 -2
-liblttng_ust_fd_la_CFLAGS = -DUST_COMPONENT=liblttng-ust-fd
-fno-strict-aliasing
+liblttng_ust_fd_la_CFLAGS = -DUST_COMPONENT=liblttng-ust-fd $(AM_CFLAGS)
liblttng-ust-fork/Makefile.am +0 -0
index aea276e..2f0976d 100644
@@ -1,5 +1,5 @@

AM_CPPFLAGS = -I$(top_srcdir)/include

liblttng-ust-fork/Makefile.am +1 -1
-AM_CFLAGS = -fno-strict-aliasing
+AM_CFLAGS += -fno-strict-aliasing

lib_LTLIBRARIES = liblttng-ust-fork.la
liblttng_ust_fork_la_SOURCES = ustfork.c

liblttng-ust-fork/Makefile.am +0 -0
@@ -13,4 +13,4 @@ if LTTNG_UST_BUILD_WITH_LIBC_DL

liblttng_ust_fork_la_LIBADD += -lc
endif

liblttng-ust-fork/Makefile.am +1 -2
-liblttng_ust_fork_la_CFLAGS = -DUST_COMPONENT=liblttng-ust-fork
-fno-strict-aliasing
+liblttng_ust_fork_la_CFLAGS = -DUST_COMPONENT=liblttng-ust-fork $(AM_CFLAGS)
liblttng-ust-java-agent/jni/common/Makefile.am +1 -1
index 704f2bb..7612932 100644
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(JNI_CPPFLAGS)
 

lib_LTLIBRARIES = liblttng-ust-context-jni.la liblttng_ust_context_jni_la_SOURCES = lttng_ust_context.c lttng_ust_context.h

liblttng-ust-java-agent/jni/jul/Makefile.am +1 -1
index a94d44e..45bc1b5 100644
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(JNI_CPPFLAGS)
 

lib_LTLIBRARIES = liblttng-ust-jul-jni.la liblttng_ust_jul_jni_la_SOURCES = lttng_ust_jul.c \

liblttng-ust-java-agent/jni/log4j/Makefile.am +1 -1
index 5545631..5e5fe0f 100644
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(JNI_CPPFLAGS)
 

lib_LTLIBRARIES = liblttng-ust-log4j-jni.la liblttng_ust_log4j_jni_la_SOURCES = lttng_ust_log4j.c \

liblttng-ust-java/Makefile.am +0 -0
index 0c2f6a5..399b62c 100644
@@ -7,7 +7,7 @@ dist_noinst_JAVA = $(pkgpath)/LTTngUst.java
 jar_DATA = $(jarfile)

BUILT_SOURCES = org_lttng_ust_LTTngUst.h

liblttng-ust-java/Makefile.am +1 -1
-AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(JNI_CPPFLAGS)

lib_LTLIBRARIES = liblttng-ust-java.la liblttng_ust_java_la_SOURCES = LTTngUst.c lttng_ust_java.h nodist_liblttng_ust_java_la_SOURCES = org_lttng_ust_LTTngUst.h

liblttng-ust-libc-wrapper/Makefile.am +0 -0
index d402d53..e73b4d8 100644
@@ -1,5 +1,5 @@

AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include

liblttng-ust-libc-wrapper/Makefile.am +1 -1
-AM_CFLAGS = -fno-strict-aliasing
+AM_CFLAGS += -fno-strict-aliasing

lib_LTLIBRARIES = liblttng-ust-libc-wrapper.la \
liblttng-ust-pthread-wrapper.la

liblttng-ust-python-agent/Makefile.am +1 -1
index 726ffe4..2c6668a 100644
@@ -1,7 +1,7 @@
 # tracepoint provider: always built/installed (does not depend on Python per se)
 AM_CPPFLAGS = -I$(top_srcdir)/include/ \
 	-I$(top_builddir)/include/
-AM_CFLAGS = -fno-strict-aliasing
+AM_CFLAGS += -fno-strict-aliasing

lib_LTLIBRARIES = liblttng-ust-python-agent.la liblttng_ust_python_agent_la_SOURCES = lttng_ust_python.c lttng_ust_python.h liblttng_ust_python_agent_la_LIBADD = -lc -llttng-ust \

liblttng-ust/Makefile.am +0 -0
index e79591a..982be69 100644
@@ -1,5 +1,5 @@

AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include

liblttng-ust/Makefile.am +1 -1
-AM_CFLAGS = -fno-strict-aliasing
+AM_CFLAGS += -fno-strict-aliasing

noinst_LTLIBRARIES = liblttng-ust-runtime.la liblttng-ust-support.la

liblttng-ust/Makefile.am +0 -0
@@ -17,7 +17,7 @@ liblttng_ust_tracepoint_la_LIBADD = \
 	-lpthread \
 	$(top_builddir)/snprintf/libustsnprintf.la

liblttng_ust_tracepoint_la_LDFLAGS = -no-undefined -version-info $(LTTNG_UST_LIBRARY_VERSION)

liblttng-ust/Makefile.am +1 -2
-liblttng_ust_tracepoint_la_CFLAGS = -DUST_COMPONENT="liblttng_ust_tracepoint"
-fno-strict-aliasing
+liblttng_ust_tracepoint_la_CFLAGS = -DUST_COMPONENT="liblttng_ust_tracepoint"

$(AM_CFLAGS)

liblttng_ust_runtime_la_SOURCES = \
	lttng-ust-comm.c \
liblttng-ust/Makefile.am +1 -1
@@ -100,4 +100,4 @@ liblttng_ust_la_LIBADD = \
 	liblttng-ust-tracepoint.la \
 	liblttng-ust-runtime.la liblttng-ust-support.la
 
-liblttng_ust_la_CFLAGS = -DUST_COMPONENT="liblttng_ust" -fno-strict-aliasing
+liblttng_ust_la_CFLAGS = -DUST_COMPONENT="liblttng_ust" $(AM_CFLAGS)
libringbuffer/Makefile.am +0 -0
index 33db165..9c3b993 100644
@@ -1,5 +1,5 @@

AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include

libringbuffer/Makefile.am +1 -1
-AM_CFLAGS = -fno-strict-aliasing
+AM_CFLAGS += -fno-strict-aliasing

noinst_LTLIBRARIES = libringbuffer.la

libringbuffer/Makefile.am +1 -1
@@ -17,4 +17,4 @@ libringbuffer_la_LIBADD = \
 	-lpthread \
 	-lrt
 
-libringbuffer_la_CFLAGS = -DUST_COMPONENT="libringbuffer" -fno-strict-aliasing
+libringbuffer_la_CFLAGS = -DUST_COMPONENT="libringbuffer" $(AM_CFLAGS)
snprintf/Makefile.am +0 -0
index a32ed4f..b01d13e 100644
@@ -1,5 +1,5 @@

AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/libustcomm

snprintf/Makefile.am +1 -1
-AM_CFLAGS = -fno-strict-aliasing
+AM_CFLAGS += -fno-strict-aliasing

noinst_LTLIBRARIES = libustsnprintf.la
libustsnprintf_la_SOURCES = \

snprintf/Makefile.am +0 -0
@@ -19,4 +19,4 @@ libustsnprintf_la_SOURCES = \
 	patient_write.c
 

libustsnprintf_la_LDFLAGS = -no-undefined -static

snprintf/Makefile.am +1 -2
-libustsnprintf_la_CFLAGS = -DUST_COMPONENT="lttng_ust_snprintf" -fPIC
-fno-strict-aliasing
+libustsnprintf_la_CFLAGS = -DUST_COMPONENT="lttng_ust_snprintf" -fPIC

$(AM_CFLAGS)

tests/benchmark/Makefile.am +0 -0
index 89452d2..4ea420c 100644
@@ -5,7 +5,7 @@ bench1_SOURCES = bench.c tp.c ust_tests_benchmark.h

bench1_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la bench2_SOURCES = bench.c tp.c ust_tests_benchmark.h bench2_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la

tests/benchmark/Makefile.am +1 -1
-bench2_CFLAGS = -DTRACING
+bench2_CFLAGS = -DTRACING $(AM_CFLAGS)

dist_noinst_SCRIPTS = test_benchmark ptime

tests/ctf-types/Makefile.am +0 -1
index 366870e..a9b40b6 100644
@@ -3,7 +3,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
-Wsystem-headers

noinst_PROGRAMS = ctf-types
ctf_types_SOURCES = ctf-types.c tp.c ust_tests_ctf_types.h ctf_types_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la

tests/ctf-types/Makefile.am +1 -1
-ctf_types_CFLAGS = -Werror=old-style-definition
+ctf_types_CFLAGS = -Werror=old-style-definition $(AM_CFLAGS)

if LTTNG_UST_BUILD_WITH_LIBDL
ctf_types_LDADD += -ldl

tests/hello/Makefile.am +0 -1
index 324c2cd..cb4d462 100644
@@ -3,7 +3,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
-Wsystem-headers

noinst_PROGRAMS = hello
hello_SOURCES = hello.c tp.c ust_tests_hello.h hello_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la

tests/hello/Makefile.am +1 -1
-hello_CFLAGS = -Werror=old-style-definition
+hello_CFLAGS = -Werror=old-style-definition $(AM_CFLAGS)

if LTTNG_UST_BUILD_WITH_LIBDL
hello_LDADD += -ldl

tests/test-app-ctx/Makefile.am +0 -1
index 324c2cd..cb4d462 100644
@@ -3,7 +3,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
-Wsystem-headers

noinst_PROGRAMS = hello
hello_SOURCES = hello.c tp.c ust_tests_hello.h hello_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la

tests/test-app-ctx/Makefile.am +1 -1
-hello_CFLAGS = -Werror=old-style-definition
+hello_CFLAGS = -Werror=old-style-definition $(AM_CFLAGS)

if LTTNG_UST_BUILD_WITH_LIBDL
hello_LDADD += -ldl

tests/trace_event/Makefile.am +1 -1
index 3e2fe81..2105a18 100644
@@ -5,6 +5,6 @@ trace_event_test_SOURCES = trace_event_test.c trace_event_test.h
 trace_event_test_LDADD = $(top_builddir)/libust/libust.la \
 			 $(top_builddir)/libust-initializer.o -lpthread -lrt
 
-CFLAGS_trace_event_test.o = -I$(src)
+CFLAGS_trace_event_test.o = -I$(src) $(AM_CFLAGS)

noinst_SCRIPTS = run
EXTRA_DIST = run

tests/tracepoint/Makefile.am +1 -1
index 3c3fe90..cf8aaa0 100644
@@ -9,6 +9,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/include
 #FIXME: this test is broken:
 #ust/tests/tracepoint/tracepoint_test.c:64: undefined reference to
 #`register_trace_ust_event_msg'
-#CFLAGS_tracepoint_test.o = -I$(src)
+#CFLAGS_tracepoint_test.o = -I$(src) $(AM_CFLAGS)

noinst_SCRIPTS = run
EXTRA_DIST = run

tests/tracepoint/benchmark/Makefile.am +0 -0
index 1080b44..4a38707 100644
@@ -4,4 +4,4 @@ noinst_PROGRAMS = tracepoint_benchmark

tracepoint_benchmark_SOURCES = tracepoint_benchmark.c tracepoint_benchmark.h tracepoint_benchmark_LDADD = $(top_builddir)/libust/libust.la $(top_builddir)/libust-initializer.o -lpthread

tests/tracepoint/benchmark/Makefile.am +1 -1
-CFLAGS_tracepoint_benchmark.o = -I$(src) -g
+CFLAGS_tracepoint_benchmark.o = -I$(src) -g $(AM_CFLAGS)
tests/ust-variant/Makefile.am +0 -1
index 3c3d61d..5d741bd 100644
@@ -3,7 +3,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
-Wsystem-headers

noinst_PROGRAMS = ust-variant
ust_variant_SOURCES = ust-variant.c
ust_variant_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la

tests/ust-variant/Makefile.am +1 -1
-ust_variant_CFLAGS = -Werror=old-style-definition
+ust_variant_CFLAGS = -Werror=old-style-definition $(AM_CFLAGS)

if LTTNG_UST_BUILD_WITH_LIBDL
ust_variant_LDADD += -ldl
--
2.7.4

Signature · 7 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev