I use AX_CXX_COMPILE_STDCXX_0X
(can look on autoconf-archive) to check for c++11 capabilities of the compiler. It correctly determines that -std=c++0x
required, but does not add it to CXXFLAGS
. I took a look at the macro source and it actually checks but then restores previous flags.
What should I do to get CXXFLAGS
set to be able to compile c++11 source?
Just adding -std=c++0x
to AM_CXXFLAGS
is not nice solution, because I'd like to put the burden of making the compiler compile in C++11 mode on the autoconf developers, not me.
configure.ac:15: error: AC_LANG_ASSERT: current language is not C++: C ../../lib/autoconf/lang.m4:156: AC_LANG_ASSERT is expanded from... m4/ax_cxx_compile_stdcxx_11.m4:48: AX_CXX_COMPILE_STDCXX_11 is expanded from... configure.ac:15: the top level autom4te: /usr/bin/m4 failed with exit status: 1 aclocal: error: /usr/bin/autom4te failed with exit status: 1 autoreconf: aclocal failed with exit status: 1
I put it just afterAC_PROG_CXX
. What I do wrong? – Eugenaeugene