X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=config%2Flyxinclude.m4;h=2e529ea22121254980535454fc584abfbd43c660;hb=66dcc7f62c1e6c9ff0d4e55c6c13e3fbbf806bc6;hp=e532c54d87e17a576784b0a3ab8a6a3d6e9e7f15;hpb=20359572ed1e68b65c689ae84bc46321dc54a04e;p=lyx.git diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index e532c54d87..2e529ea221 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -232,6 +232,10 @@ AC_ARG_ENABLE(pch, enable_pch=no;) lyx_pch_comp=no +AC_ARG_ENABLE(cxx11, + AC_HELP_STRING([--enable-cxx11],[enable C++11 mode]),, + enable_cxx11=no;) + AC_ARG_ENABLE(assertions, AC_HELP_STRING([--enable-assertions],[add runtime sanity checks in the program]),, [AS_CASE([$build_type], [dev*|pre*], [enable_assertions=yes], @@ -306,6 +310,18 @@ if test x$GXX = xyes; then ;; esac fi + if test x$enable_cxx11 = xyes ; then + case $gxx_version in + 4.3*|4.4*|4.5*|4.6*) + lyx_flags="$lyx_flags c++11-mode" + CXXFLAGS="-std=gnu++0x $CXXFLAGS" + ;; + 4.7*|4.8*) + lyx_flags="$lyx_flags c++11-mode" + CXXFLAGS="-std=gnu++11 $CXXFLAGS" + ;; + esac + fi fi test "$lyx_pch_comp" = yes && lyx_flags="$lyx_flags pch" AM_CONDITIONAL(LYX_BUILD_PCH, test "$lyx_pch_comp" = yes)