get --disable-optimize and --disable-debug working again

LT_INIT messes with CFLAGS, so do a save/restore around the invocation
This commit is contained in:
Bill Currie 2010-08-20 11:31:59 +09:00
parent e236c1dd4e
commit abf3972c84
2 changed files with 24 additions and 17 deletions

View file

@ -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)

View file

@ -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