X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=config%2Flyxinclude.m4;h=cbd9564ce77f4fc05b5a336e163c3c3bcd83eb29;hb=39a450bc3df66faa5c6c22d3b6b4e7c70a5d1c7d;hp=ea8fc35620f3bc6c64123a772998e95d15ecb3c5;hpb=d8bcd73543e3e4b48dd264823813cb555d410f8c;p=lyx.git diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index ea8fc35620..cbd9564ce7 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -183,22 +183,26 @@ dnl Check the version of g++ CXXFLAGS="$ac_save_CXXFLAGS" elif test $ac_cv_prog_cxx_g = yes; then case $gxx_version in - 2.7*) CXXFLAGS="$lyx_opt";; - 2.95.1) CXXFLAGS="-g $lyx_opt -fpermissive -fno-rtti";; - 2.95.*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";; - *) CXXFLAGS="-g $lyx_opt -fno-exceptions -fno-rtti";; + 2.95.1) CXXFLAGS="-g $lyx_opt -fpermissive -fno-rtti -fno-exceptions";; + 2.95.*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";; + 2.96*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";; + *2.91.*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";; + *) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";; esac else CXXFLAGS="$lyx_opt" fi if test x$with_warnings = xyes ; then case $gxx_version in - 2.95.*) CXXFLAGS="$CXXFLAGS -Wall -W -Wconversion";; - *) CXXFLAGS="$CXXFLAGS -ansi -Wall -W";; + 2.95.*) CXXFLAGS="$CXXFLAGS -W -Wall -Wconversion -Winline";; + 2.96*) CXXFLAGS="$CXXFLAGS -W -Wall -Wconversion";; + *) CXXFLAGS="$CXXFLAGS -ansi -W -Wall -Wno-return-type";; esac if test $lyx_devel_version = yes ; then case $gxx_version in 2.95.*) ;; + 2.96*) ;; + *2.91*) ;; *) CXXFLAGS="$CXXFLAGS -pedantic";; esac fi @@ -341,8 +345,10 @@ AC_DEFUN(LYX_CXX_STL_STRING,[ using std::string; ],[ string a("hello there"); - a.clear(); + a.erase(); a = "hey"; + char s[] = "y"; + int t = a.compare(a.length() - 1, 1, s); a.erase(); ],[ with_included_string=no @@ -425,10 +431,11 @@ dnl good enough to suit our needs. AC_DEFUN(LYX_CXX_NAMESPACES,[ AC_CACHE_CHECK(for correct namespaces support,lyx_cv_cxx_namespace, [AC_TRY_COMPILE([ - #include - using std::vector; + namespace foo { + int bar; + } ],[ - vector test; + foo::bar = 0; return 0; ],lyx_cv_cxx_namespace=yes,lyx_cv_cxx_namespace=no) ]) @@ -616,8 +623,9 @@ AC_DEFUN(LYX_FUNC_PUTENV_ARGTYPE, [AC_MSG_CHECKING([type of argument for putenv()]) AC_CACHE_VAL(lyx_cv_func_putenv_arg,dnl [AC_TRY_COMPILE(dnl -[#include -extern int putenv(const char *);],,dnl +[#include ], +[char const * foo = "bar"; + putenv(foo);],dnl [lyx_cv_func_putenv_arg='char const *'],[lyx_cv_func_putenv_arg='char *'])]) AC_MSG_RESULT($lyx_cv_func_putenv_arg) AC_DEFINE_UNQUOTED(PUTENV_TYPE_ARG,$lyx_cv_func_putenv_arg,dnl