From: Matthias Maennich Date: Mon, 22 Jul 2019 08:39:40 +0000 (+0100) Subject: Ensure a consistent C++ standard use X-Git-Tag: upstream/1.7~61 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d7ae619ff3360480348f7f1ab58fdb3be85aa079;p=platform%2Fupstream%2Flibabigail.git Ensure a consistent C++ standard use On older compilers (such as g++ 4.8), the default C++ standard is set to gnu++98. When compiling libabigail with --enable-cxx11=yes, src/ and tests/ where compiled with the correct flag, while tools/ was compiled without specifying a standard. With a compiler falling back to gnu++98 that leads to unresolved references when linking the tools against the libabigail library. Fix that by consistently using the std= flag across the code base. * configure.ac: add -std=c++11 flag to CXXFLAGS when compiling for C++11 * src/Makefile.am: drop now obsolete setting of the -std flag * tests/Makefile.am: likewise Reported-by: Chun-Hung Wu Signed-off-by: Matthias Maennich Signed-off-by: Dodji Seketeli --- diff --git a/configure.ac b/configure.ac index afcc1db0..44e951f5 100644 --- a/configure.ac +++ b/configure.ac @@ -545,6 +545,7 @@ AC_SUBST(DEPS_CPPFLAGS) dnl Handle conditional use of a C++11 compiler if test x$ENABLE_CXX11 = xyes; then + CXXFLAGS="$CXXFLAGS -std=c++11" AC_DEFINE([WITH_CXX11], 1, [Defined to 1 if a C++11 compiler is used]) fi diff --git a/src/Makefile.am b/src/Makefile.am index 7c02d538..1d0e2dce 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,7 +7,6 @@ if ENABLE_CXX11 CXX11_SOURCES = abg-viz-common.cc \ abg-viz-dot.cc \ abg-viz-svg.cc -AM_CXXFLAGS += "-std=c++11" else CXX11_SOURCES = endif diff --git a/tests/Makefile.am b/tests/Makefile.am index 2104300a..14e83608 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -13,7 +13,6 @@ AM_CXXFLAGS = $(VISIBILITY_FLAGS) CXX11_TESTS = if ENABLE_CXX11 CXX11_TESTS += runtestsvg -AM_CXXFLAGS += "-std=c++11" endif FEDABIPKGDIFF_TEST =