From: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>

AM_* variables by design should be set by Makefile.am, not by
configure.ac. Use CFLAGS/CXXFLAGS instead.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
/** Email created from pull request 165 (lumag:improve-build-3)
 ** https://github.com/Linaro/odp/pull/165
 ** Patch: https://github.com/Linaro/odp/pull/165.patch
 ** Base sha: 42184679185ce0c979e065349360167e3fce6ca0
 ** Merge commit sha: c9bd3cdd91bd495988653511548fd4525579db79
 **/
 configure.ac                       | 12 +++---------
 example/Makefile.inc               |  4 ++--
 helper/Makefile.am                 |  4 ++--
 helper/test/Makefile.am            |  4 ++--
 platform/Makefile.inc              |  4 ++--
 platform/linux-generic/Makefile.am |  2 +-
 test/Makefile.inc                  |  4 ++--
 test/linux-generic/Makefile.inc    |  4 ++--
 8 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/configure.ac b/configure.ac
index f6f69942..d4c07a2c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -329,6 +329,7 @@ ODP_CHECK_CFLAG([-Wformat-truncation=0])
 ODP_CHECK_CFLAG([-Wformat-overflow=0])
 
 ODP_CFLAGS="$ODP_CFLAGS -std=c99"
+ODP_CXXFLAGS="$ODP_CXXFLAGS -std=c++11"
 
 # Extra flags for example to suppress certain warning types
 ODP_CFLAGS="$ODP_CFLAGS $ODP_CFLAGS_EXTRA"
@@ -347,8 +348,8 @@ esac
 ##########################################################################
 # Default include setup
 ##########################################################################
-AM_CFLAGS="$AM_CFLAGS $ODP_CFLAGS"
-AM_CXXFLAGS="-std=c++11"
+CFLAGS="$CFLAGS $ODP_CFLAGS"
+CXXFLAGS="$CXXFLAGS $ODP_CXXFLAGS"
 
 AC_CONFIG_FILES([Makefile
                 pkgconfig/libodp-linux.pc
@@ -359,11 +360,8 @@ AC_CONFIG_FILES([Makefile
 # distribute the changed variables among the Makefiles
 
 AC_SUBST([LIBS])
-AC_SUBST([AM_CPPFLAGS])
 AC_SUBST([CPPFLAGS])
-AC_SUBST([AM_CFLAGS])
 AC_SUBST([CFLAGS])
-AC_SUBST([AM_LDFLAGS])
 AC_SUBST([LDFLAGS])
 AC_SUBST([EXEEXT])
 
@@ -390,12 +388,8 @@ AC_MSG_RESULT([
        cc:                     ${CC}
        cc version:             ${CC_VERSION}
        cppflags:               ${CPPFLAGS}
-       am_cppflags:            ${AM_CPPFLAGS}
-       am_cxxflags:            ${AM_CXXFLAGS}
        cflags:                 ${CFLAGS}
-       am_cflags:              ${AM_CFLAGS}
        ldflags:                ${LDFLAGS}
-       am_ldflags:             ${AM_LDFLAGS}
        libs:                   ${LIBS}
        defs:                   ${DEFS}
        static libraries:       ${enable_static}
diff --git a/example/Makefile.inc b/example/Makefile.inc
index 7cc21154..cba385b7 100644
--- a/example/Makefile.inc
+++ b/example/Makefile.inc
@@ -1,6 +1,6 @@
 LIB   = $(top_builddir)/lib
 LDADD = $(LIB)/libodp-linux.la $(LIB)/libodphelper.la $(DPDK_PMDS)
-AM_CFLAGS += \
+AM_CFLAGS = \
        -I$(srcdir) \
        -I$(top_srcdir)/example \
        -I$(top_srcdir)/platform/@with_platform@/include \
@@ -11,4 +11,4 @@ AM_CFLAGS += \
        -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
        -I$(top_builddir)/include
 
-AM_LDFLAGS += -L$(LIB)
+AM_LDFLAGS = -L$(LIB)
diff --git a/helper/Makefile.am b/helper/Makefile.am
index fa503f1a..bf75b467 100644
--- a/helper/Makefile.am
+++ b/helper/Makefile.am
@@ -2,7 +2,7 @@ pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = $(top_builddir)/pkgconfig/libodphelper.pc
 
 LIB   = $(top_builddir)/lib
-AM_CPPFLAGS += -I$(srcdir)/include
+AM_CPPFLAGS = -I$(srcdir)/include
 AM_CPPFLAGS += -I$(top_srcdir)/platform/@with_platform@/include
 AM_CPPFLAGS += -I$(top_srcdir)/include
 AM_CPPFLAGS += -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@
@@ -10,7 +10,7 @@ AM_CPPFLAGS += 
-I$(top_builddir)/platform/@with_platform@/include
 AM_CPPFLAGS += -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@
 AM_CPPFLAGS += -I$(top_builddir)/include
 
-AM_LDFLAGS += -version-number '$(ODPHELPER_LIBSO_VERSION)'
+AM_LDFLAGS = -version-number '$(ODPHELPER_LIBSO_VERSION)'
 
 helperincludedir = $(includedir)/odp/helper/
 helperinclude_HEADERS = \
diff --git a/helper/test/Makefile.am b/helper/test/Makefile.am
index fdc15f96..e30a1e71 100644
--- a/helper/test/Makefile.am
+++ b/helper/test/Makefile.am
@@ -17,8 +17,8 @@ INCFLAGS = \
 
 ODP_PLATFORM=${with_platform}
 
-AM_CPPFLAGS += $(INCFLAGS)
-AM_LDFLAGS += -static
+AM_CPPFLAGS = $(INCFLAGS)
+AM_LDFLAGS = -static
 
 EXECUTABLES = chksum$(EXEEXT) \
               cuckootable$(EXEEXT) \
diff --git a/platform/Makefile.inc b/platform/Makefile.inc
index a88e8384..f6722560 100644
--- a/platform/Makefile.inc
+++ b/platform/Makefile.inc
@@ -8,9 +8,9 @@ pkgconfig_DATA = $(top_builddir)/pkgconfig/libodp-linux.pc
 VPATH = $(srcdir) $(builddir)
 lib_LTLIBRARIES = $(LIB)/libodp-linux.la
 
-AM_LDFLAGS += -version-number '$(ODP_LIBSO_VERSION)'
+AM_LDFLAGS = -version-number '$(ODP_LIBSO_VERSION)'
 
-AM_CFLAGS += "-DGIT_HASH=$(VERSION)"
+AM_CFLAGS = "-DGIT_HASH=$(VERSION)"
 AM_CFLAGS += $(VISIBILITY_CFLAGS)
 
 AM_CFLAGS += @PTHREAD_CFLAGS@
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index e644505e..f5f65384 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -3,7 +3,7 @@
 
 include $(top_srcdir)/platform/Makefile.inc
 
-AM_CPPFLAGS +=  -I$(srcdir)/include
+AM_CPPFLAGS =  -I$(srcdir)/include
 AM_CPPFLAGS +=  -I$(top_srcdir)/include
 AM_CPPFLAGS +=  -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@
 AM_CPPFLAGS +=  -I$(top_builddir)/include
diff --git a/test/Makefile.inc b/test/Makefile.inc
index f5bb7674..8bd21432 100644
--- a/test/Makefile.inc
+++ b/test/Makefile.inc
@@ -16,9 +16,9 @@ INCFLAGS = \
        -I$(top_builddir)/include
 
 AM_CPPFLAGS = $(INCFLAGS)
-AM_CFLAGS += $(CUNIT_CFLAGS)
+AM_CFLAGS = $(CUNIT_CFLAGS)
 
-AM_LDFLAGS += -L$(LIB)
+AM_LDFLAGS = -L$(LIB)
 
 @VALGRIND_CHECK_RULES@
 valgrind_tools = memcheck
diff --git a/test/linux-generic/Makefile.inc b/test/linux-generic/Makefile.inc
index ff99fbc9..cfb61441 100644
--- a/test/linux-generic/Makefile.inc
+++ b/test/linux-generic/Makefile.inc
@@ -2,9 +2,9 @@
 # build specific ODP applications, (i.e those whose do more than validation
 # test wrapping)
 
-AM_LDFLAGS += -static
+AM_LDFLAGS = -static
 
-AM_CFLAGS += $(CUNIT_CFLAGS)
+AM_CFLAGS = $(CUNIT_CFLAGS)
 
 LIBCUNIT_COMMON = $(top_builddir)/test/common_plat/common/libcunit_common.la
 LIB   = $(top_builddir)/lib

Reply via email to