From: Enrico Forestieri Date: Tue, 8 Sep 2015 23:54:49 +0000 (+0200) Subject: Make it compile on cygwin in c++11 mode X-Git-Tag: 2.2.0alpha1~358 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=bde1bee24e26b586b20eb3813396e2d49f1aee91;p=lyx.git Make it compile on cygwin in c++11 mode When using -std=c++11, the cygwin compiler automatically defines __STRICT_ANSI__ which is used as a guard for not declaring essential unix standard calls such as setenv, popen, etc. As a result, compilation stops with errors such as "xxxx has not been declared". By undefining the guard, compilation succeeds and lyx works Ok. --- diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index 67a110b989..057caf491c 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -362,7 +362,8 @@ if test x$GXX = xyes; then dnl the deprecated-register warning is very annoying with Qt4.x right now. AM_CXXFLAGS="$AM_CXXFLAGS -std=c++11 -Wno-deprecated-register";; *) - AM_CXXFLAGS="$AM_CXXFLAGS -std=c++11";; + AM_CXXFLAGS="$AM_CXXFLAGS -std=c++11" + AS_CASE([$host], [*cygwin*], [AM_CXXFLAGS="$AM_CXXFLAGS -U__STRICT_ANSI__"]);; esac fi