Fix: Don't override user variables within the build system
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 9 lines · Michael Jeanson
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
Fixes #1095
Signed-off-by Michael Jeanson <[email protected]>
Quoted 11 lines
--- configure.ac | 11 +++++------ doc/examples/Makefile.am | 2 +- doc/examples/Makefile.examples.template | 9 +++------ src/Makefile.am | 8 ++++---- tests/benchmark/Makefile.am | 2 +- tests/common/Makefile.am | 2 +- tests/regression/Makefile.am | 2 +- tests/unit/Makefile.am | 2 +- tests/utils/Makefile.am | 2 +- 9 files changed, 18 insertions(+), 22 deletions(-)
This patch deprecates :
[PATCH urcu v2] Fix: Don't use CFLAGS in configure script
It now has a broader scope than just CFLAGS.
Michael
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Mathieu Desnoyers
AppliedMerged into master. Can you provide a patch for stable-0.9 and 0.8 as well ? The cherry-pick is not straightforward.
Thanks,
Mathieu
Quoted 210 lines · ----- On May 2, 2017, at 5:40 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
Fixes #1095
Signed-off-by Michael Jeanson <[email protected]>---
configure.ac | 11 +++++------ doc/examples/Makefile.am | 2 +- doc/examples/Makefile.examples.template | 9 +++------ src/Makefile.am | 8 ++++---- tests/benchmark/Makefile.am | 2 +- tests/common/Makefile.am | 2 +- tests/regression/Makefile.am | 2 +- tests/unit/Makefile.am | 2 +- tests/utils/Makefile.am | 2 +- 9 files changed, 18 insertions(+), 22 deletions(-)configure.ac +0
-3@@ -89,9 +89,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" # Checks for library functions.
AC_FUNC_MMAPconfigure.ac +0
-0@@ -168,7 +165,7 @@ AS_IF([test "x$SUBARCHTYPE" = xx86compat],[ ])AS_IF([test "$host_cpu" = "armv7l"],[
configure.ac +1
-1- CFLAGS="$CFLAGS -mcpu=cortex-a9 -mtune=cortex-a9 -O1" + AM_CFLAGS="$AM_CFLAGS -mcpu=cortex-a9 -mtune=cortex-a9 -O1"])
# ARM-specific checks
configure.ac +4
-2@@ -367,8 +364,10 @@ AC_CHECK_FUNCS([sched_setaffinity],[ ]) ]) -DEFAULT_INCLUDES="-include config.h" -AC_SUBST(DEFAULT_INCLUDES) +AM_CPPFLAGS="-include config.h" +AC_SUBST(AM_CPPFLAGS) + +AC_SUBST(AM_CFLAGS)AC_CONFIG_LINKS([
include/urcu/arch.h:$ARCHSRCdoc/examples/Makefile.am +0
-4@@ -145,7 +145,7 @@ all-local: echo "Examples: relative top_builddir path $(top_builddir)"; \ rel_build_subdir="../"; \ fi; \ - $(MAKE) -f dist-files/Makefile AM_CC="$(CC)" AM_CPPFLAGS="$(CPPFLAGS) -I$$rel_src_subdir/$(top_srcdir)/include/ -I$$rel_src_subdir/$(top_srcdir)/src/ -I$$rel_build_subdir$(top_builddir)/include/ -I$$rel_build_subdir$(top_builddir)/include/src/" AM_CFLAGS='$(CFLAGS)'AM_LDFLAGS='$(LDFLAGS) -L../../../src/.libs/ -Wl,-rpath "$(PWD)/../../src/.libs/"' $(AM_MAKEFLAGS) all;
doc/examples/Makefile.am +1
-0+ $(MAKE) -f dist-files/Makefile CC="$(CC)" CPPFLAGS="$(CPPLAGS)"AM_CPPFLAGS="$(AM_CPPFLAGS) -I"$${rel_src_subdir}/$(top_srcdir)/include/"
doc/examples/Makefile.am +0
-3-I"$${rel_src_subdir}/$(top_srcdir)/src/" -I"$${rel_build_subdir}$(top_builddir)/include/" -I"$${rel_build_subdir}$(top_builddir)/include/src/"" CFLAGS="$(CFLAGS)"AM_CFLAGS="$(AM_CFLAGS) $(PTHREAD_CFLAGS)" LDFLAGS="$(LDFLAGS)" AM_LDFLAGS="$(AM_LDFLAGS) -L../../../src/.libs/ -Wl,-rpath "$(PWD)/../../src/.libs/"" $(AM_MAKEFLAGS) all;
clean-local:
@$(MAKE) -f dist-files/Makefile $(AM_MAKEFLAGS) clean; \doc/examples/Makefile.examples.template +3
-6@@ -11,19 +11,16 @@ # # This makefile is purposefully kept simple to support GNU and BSD make. -ifdef AM_CC -CC = $(AM_CC) -endif -CFLAGS = -g -O2 -Wall +LOCAL_CFLAGS := -g -O2 -Wall all: $(BINARY) $(BINARY): $(OBJECTS) - $(CC) $(CFLAGS) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \ + $(CC) $(LOCAL_CFLAGS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ $(OBJECTS) $(LIBS) $(OBJECTS): $(SOURCES) $(DEPS) - $(CC) $(CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) $(AM_CFLAGS) \ + $(CC) $(LOCAL_CFLAGS) $(AM_CFLAGS) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) \ -c -o $@ $(SOURCES).PHONY: clean
src/Makefile.am +1
-3@@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src +AM_CPPFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src#Add the -version-info directly here since we are only building
# library that use the version-infosrc/Makefile.am +0
-0@@ -6,7 +6,7 @@ AM_LDFLAGS=-version-info $(URCU_LIBRARY_VERSION)if
USE_CYGWIN
AM_LDFLAGS+=-no-undefined
endifsrc/Makefile.am +1
-1-AM_CFLAGS=-Wall +AM_CFLAGS+=-Wall
include_HEADERS=urcu.hurcu-bp.hurcu-call-rcu.hurcu-defer.h\
urcu-pointer.hurcu-qsbr.hurcu-flavor.hsrc/Makefile.am +0
-0@@ -44,11 +44,11 @@ liburcu_qsbr_la_SOURCES = urcu-qsbr.c urcu-pointer.c $(COMPAT)
liburcu_qsbr_la_LIBADD= liburcu-common.la
liburcu_mb_la_SOURCES=urcu.curcu-pointer.c$(COMPAT)src/Makefile.am +1
-1-liburcu_mb_la_CFLAGS = -DRCU_MB +liburcu_mb_la_CFLAGS = -DRCU_MB $(AM_CFLAGS)
liburcu_mb_la_LIBADD= liburcu-common.la
liburcu_signal_la_SOURCES=urcu.curcu-pointer.c$(COMPAT)src/Makefile.am +1
-1-liburcu_signal_la_CFLAGS = -DRCU_SIGNAL +liburcu_signal_la_CFLAGS = -DRCU_SIGNAL $(AM_CFLAGS)
liburcu_signal_la_LIBADD= liburcu-common.la
liburcu_bp_la_SOURCES=urcu-bp.curcu-pointer.c$(COMPAT)tests/benchmark/Makefile.am +1
-3@@ -1,4 +1,4 @@ -AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/common -g +AM_CFLAGS += $(PTHREAD_CFLAGS) -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/common -gSCRIPT_LIST = common.sh \ run.sh \tests/common/Makefile.am +1
-3@@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src +AM_CPPFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src
noinst_HEADERS=cpuset.hthread-id.htests/regression/Makefile.am +1
-4@@ -1,4 +1,4 @@ -AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common -g +AM_CFLAGS += $(PTHREAD_CFLAGS) -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common -g
SCRIPT_LIST=run.shtests/unit/Makefile.am +1
-4@@ -1,4 +1,4 @@ -AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common -g +AM_CFLAGS += $(PTHREAD_CFLAGS) -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common -g
SCRIPT_LIST=test_looprun.shunit_teststests/utils/Makefile.am +1
-3@@ -1,4 +1,4 @@ -AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src +AM_CFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src
noinst_LIBRARIES= libtap.alibtap_a_SOURCES=tap.ctap.h
--
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