[sword-svn] r3546 - trunk
scribe at crosswire.org
scribe at crosswire.org
Sat Dec 9 17:03:54 MST 2017
Author: scribe
Date: 2017-12-09 17:03:53 -0700 (Sat, 09 Dec 2017)
New Revision: 3546
Modified:
trunk/configure.ac
Log:
fixed optimized compiling on pre-GCC 4.6 compilers (check for -Ofast and replace with -O3 if not present)
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2017-12-09 23:28:34 UTC (rev 3545)
+++ trunk/configure.ac 2017-12-10 00:03:53 UTC (rev 3546)
@@ -117,8 +117,20 @@
AM_CXXFLAGS="-O0 -Wall -Werror -Woverloaded-virtual"
fi
else
- AM_CFLAGS="-Ofast"
- AM_CXXFLAGS="-Ofast"
+ my_save_cxxflags="$CXXFLAGS"
+ CXXFLAGS=-Ofast
+ AC_MSG_CHECKING([whether CXX supports -Ofast])
+ AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
+ [AC_MSG_RESULT([yes])]
+ [AM_CFLAGS=-Ofast]
+ [AM_CXXFLAGS=-Ofast],
+ [AC_MSG_RESULT([no])]
+ [AM_CFLAGS=-O3]
+ [AM_CXXFLAGS=-O3],
+ )
+ CXXFLAGS="$my_save_cxxflags"
+ AC_LANG_POP([C++])
fi
AM_CFLAGS="$AM_CFLAGS -fPIC"
More information about the sword-cvs
mailing list