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 <Chun-hung.Wu@mediatek.com>
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
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
CXX11_SOURCES = abg-viz-common.cc \
abg-viz-dot.cc \
abg-viz-svg.cc
-AM_CXXFLAGS += "-std=c++11"
else
CXX11_SOURCES =
endif
CXX11_TESTS =
if ENABLE_CXX11
CXX11_TESTS += runtestsvg
-AM_CXXFLAGS += "-std=c++11"
endif
FEDABIPKGDIFF_TEST =