C++11 support in GNU automake

Posted by sorush-r on Stack Overflow See other posts from Stack Overflow or by sorush-r
Published on 2012-12-15T05:02:08Z Indexed on 2012/12/15 5:03 UTC
Read the original article Hit count: 563

Filed under:
|

I'm trying to port buildsystem of my project to GNU autotools. The code need to be compiled with -std=c++11 or -std=c++0x flag. I want my configure script to check if compiler supports C++11 or not. I tried adding AX_CHECK_COMPILE_FLAG([-std=c++0x], [CXXFLAGS="$CXXFLAGS -std=c++0x"]) to configure.ac file but configure fails with this error:

 ...
./configure: line 2732: syntax error near unexpected token `-std=c++0x,'
./configure: line 2732: `AX_CHECK_COMPILE_FLAG(-std=c++0x, CXXFLAGS="$CXXFLAGS -std=c++0x")'

© Stack Overflow or respective owner

Related posts about c++

Related posts about autotools