diff --git a/config.d/compiling.m4 b/config.d/compiling.m4 index 7a1e2419c..602ce5f31 100644 --- a/config.d/compiling.m4 +++ b/config.d/compiling.m4 @@ -6,6 +6,23 @@ else cvs_def_disabled="!= xno" fi +if test "x$GCC" = xyes; then + set $CC + shift + args="$*" + AC_MSG_CHECKING(for gcc version) + CCVER="gcc `$CC --version | grep '[[0-9]]\.[[0-9]]' | sed -e 's/.*(GCC)//' -e 's/[[^0-9]]*\([[0-9.]]*\).*/\1/'`" + set $CCVER + save_IFS="$IFS" + IFS="." + set $2 + CC_MAJ=$1 + CC_MIN=$2 + CC_SUB=$3 + IFS="$save_IFS" + AC_MSG_RESULT($CCVER) +fi + AC_ARG_ENABLE(debug, [ --disable-debug compile without debugging], debug=$enable_debug @@ -29,20 +46,6 @@ if test "x$optimize" = xyes; then AC_MSG_RESULT(yes) BUILD_TYPE="$BUILD_TYPE Optimize" if test "x$GCC" = xyes; then - set $CC - shift - args="$*" - AC_MSG_CHECKING(for gcc version) - CCVER="gcc `$CC --version | grep '[[0-9]]\.[[0-9]]' | sed -e 's/.*(GCC)//' -e 's/[[^0-9]]*\([[0-9.]]*\).*/\1/'`" - set $CCVER - save_IFS="$IFS" - IFS="." - set $2 - CC_MAJ=$1 - CC_MIN=$2 - CC_SUB=$3 - IFS="$save_IFS" - AC_MSG_RESULT($CCVER) saved_cflags="$CFLAGS" CFLAGS="" QF_CC_OPTION(-frename-registers) diff --git a/configure.ac b/configure.ac index dc2084439..0b2ba25a3 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,14 @@ AC_PREREQ(2.67) dnl This is the only place where the package name and version appear AC_INIT([QuakeForge], [git-master]) AM_INIT_AUTOMAKE([foreign]) + +dnl LT_INIT messes with CFLAGS (evil bastard) +if test "x${CFLAGS-unset}" = xunset; then + CFLAGS="" +fi +saved_CFLAGS="$CFLAGS" LT_INIT([win32-dll]) +CFLAGS="$saved_CFLAGS" AC_REVISION([$Revision$]) dnl @@ -17,9 +24,6 @@ m4_include(config.d/versions.m4) AC_LANG_C -if test "x${CFLAGS-unset}" = xunset; then - CFLAGS="" -fi if test "$x{AR-unset}" = xunset; then AR="ar" fi