I'm developping a software with C and C++ code. I've recently added some code in c++11 standard. In configure.ac I wrote:
for f in '-std=c++11' '-std=c++11 -stdlib=libc++'
do
AX_CHECK_COMPILE_FLAG([$f], [CXXFLAGS="$CXXFLAGS $f" stdpass=true], [], [], [])
${stdpass-false} && break
done
if ! "${stdpass-false}"; then
AC_MSG_ERROR([Unable to tu on C++11 mode with this compiler])
fi
With gcc I've no problem, everything goes well the option -std=c++11 is only applied to g++ and not on gcc. If I try to configure with:
CC=clang ./configure
I have the following error:
checking whether C compiler accepts -std=c++11 -stdlib=libc++... no
configure: error: Unable to tu on C++11 mode with this compiler
It's like if the option was applied on the C compiler and not only on clang++ (like it's done with gcc).
Can someone help me to figure out what I'm doing wrong.
