Enable LTO switch for configure script and automake 1.14 fix

This commit is contained in:
phantom
2013-06-29 18:37:57 +02:00
parent 45a2165664
commit eb301edc44
3 changed files with 35 additions and 1 deletions
+2 -1
View File
@@ -60,7 +60,8 @@ src/libtomcrypt/Release-*
src/libtommath/build-*
src/libtommath/Release-*
src/*.old
src/.deps
*/.deps
*/.dirstamp
src/*.a
src/*.so
GtkModule.so
+31
View File
@@ -48,6 +48,37 @@ case $compile in
;;
esac
AC_ARG_ENABLE(lto, AS_HELP_STRING([--enable-lto], [Enable LTO]), enable_lto=$enableval, enable_lto=no)
if test x$enable_lto = xyes; then
if test "$CXX" != "g++"; then
AC_MSG_ERROR([g++ compiler is needed to use lto (if you have it installed, pass CXX=g++ to ./configure)])
fi
gxx_version="`g++ -dumpversion`"
gxx_version_major=$(echo $gxx_version | cut -d'.' -f1)
gxx_version_minor=$(echo $gxx_version | cut -d'.' -f2)
if test [ "$gxx_version_major" -lt "4" ] || test [ "$gxx_version_minor" -lt "5" ]; then
AC_MSG_ERROR([Your g++ version is too old and doesn't support lto])
fi
CFLAGS="$CFLAGS -O0 -flto"
CXXFLAGS="$CXXFLAGS -O0 -flto"
LDFLAGS="$LDFLAGS -flto"
case $compile in
release)
LDFLAGS="$LDFLAGS -O3"
;;
debug)
LDFLAGS="$LDFLAGS -g"
;;
fast)
LDFLAGS="$LDFLAGS -O2 -fno-inline"
;;
esac
if test [ "$gxx_version_minor" -ge "8" ]; then
CFLAGS="$CFLAGS -fno-fat-lto-objects"
CXXFLAGS="$CXXFLAGS -fno-fat-lto-objects"
fi
fi
# Some (broken?) versions of gcc treat char as unsigned, check for that.
AC_LANG_PUSH([C])
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = subdir-objects
## Do not install stepmania in the traditional way.
noinst_PROGRAMS = stepmania
TESTS =