fix CFLAGS

- always use the predefined ones
- be careful about setting CFLAGS after whatever the variables that depend on it.
This commit is contained in:
Vítor Santos Costa 2010-07-29 17:02:25 +01:00
parent d59fa6c28b
commit ca964a9e5b
2 changed files with 22 additions and 34 deletions

26
configure vendored
View File

@ -4361,21 +4361,19 @@ fi
if test "$GCC" = "yes" if test "$GCC" = "yes"
then then
if test -z "${mycflags}"
then
if test "$debugyap" = "yes" if test "$debugyap" = "yes"
then then
CFLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" CXXFLAGS="-O -g -Wall $CFLAGS"
CXXFLAGS="-O -g -Wall"
C_INTERF_FLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" C_INTERF_FLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
CFLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
else else
CFLAGS="-O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
CXXFLAGS="-O3 -fomit-frame-pointer -Wall $CFLAGS" CXXFLAGS="-O3 -fomit-frame-pointer -Wall $CFLAGS"
C_INTERF_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
C_PARSER_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
CFLAGS="-O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
case "`$CC --version < /dev/null`" in case "`$CC --version < /dev/null`" in
*3.4*) CFLAGS="-fno-gcse -fno-crossjumping $CFLAGS" ;; *3.4*) CFLAGS="-fno-gcse -fno-crossjumping $CFLAGS" ;;
esac esac
C_INTERF_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
C_PARSER_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
case "$target_cpu" in case "$target_cpu" in
i*86*) i*86*)
CFLAGS="-DBP_FREE $CFLAGS" CFLAGS="-DBP_FREE $CFLAGS"
@ -4417,7 +4415,6 @@ then
;; ;;
esac esac
fi fi
fi
fi fi
if test "$CC" = "sslittle-na-sstrix-gcc" if test "$CC" = "sslittle-na-sstrix-gcc"
then then
@ -4427,13 +4424,11 @@ then
INSTALL_ENV="sim-fast" INSTALL_ENV="sim-fast"
fi fi
else else
if test -z "${mycflags}"
then
case "$target_cpu" in case "$target_cpu" in
i?86*) i?86*)
if test "$CC" = "lcc" if test "$CC" = "lcc"
then then
CFLAGS="-A -A" CFLAGS="-A -A $CFLAGS"
elif test "$CC" = "cl" elif test "$CC" = "cl"
then then
CFLAGS="/nologo" CFLAGS="/nologo"
@ -4446,16 +4441,15 @@ else
then then
if test "$debugyap" = "yes" if test "$debugyap" = "yes"
then then
CFLAGS="-Ae -g -O" CXXFLAGS="-Ae -g -O $CFLAGS"
CXXFLAGS="-Ae -g -O" CFLAGS="-Ae -g -O $CFLAGS"
else else
CFLAGS="-Ae +O3 +Onolimit" CXXFLAGS="-Ae +O3 +Onolimit $CFLAGS"
CXXFLAGS="-Ae +O3 +Onolimit" CFLAGS="-Ae +O3 +Onolimit $CFLAGS"
fi fi
fi fi
;; ;;
esac esac
fi
C_INTERF_FLAGS="$CFLAGS" C_INTERF_FLAGS="$CFLAGS"
C_PARSER_FLAGS="$CFLAGS" C_PARSER_FLAGS="$CFLAGS"
fi fi

View File

@ -430,21 +430,19 @@ fi
dnl Compilation Flags dnl Compilation Flags
if test "$GCC" = "yes" if test "$GCC" = "yes"
then then
if test -z "${mycflags}"
then
if test "$debugyap" = "yes" if test "$debugyap" = "yes"
then then
CFLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" CXXFLAGS="-O -g -Wall $CFLAGS"
CXXFLAGS="-O -g -Wall"
C_INTERF_FLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" C_INTERF_FLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
CFLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
else else
CFLAGS="-O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
CXXFLAGS="-O3 -fomit-frame-pointer -Wall $CFLAGS" CXXFLAGS="-O3 -fomit-frame-pointer -Wall $CFLAGS"
C_INTERF_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
C_PARSER_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
CFLAGS="-O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
case "`$CC --version < /dev/null`" in case "`$CC --version < /dev/null`" in
*3.4*) CFLAGS="-fno-gcse -fno-crossjumping $CFLAGS" ;; *3.4*) CFLAGS="-fno-gcse -fno-crossjumping $CFLAGS" ;;
esac esac
C_INTERF_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
C_PARSER_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
case "$target_cpu" in case "$target_cpu" in
i*86*) i*86*)
CFLAGS="-DBP_FREE $CFLAGS" CFLAGS="-DBP_FREE $CFLAGS"
@ -487,7 +485,6 @@ then
;; ;;
esac esac
fi fi
fi
fi fi
if test "$CC" = "sslittle-na-sstrix-gcc" if test "$CC" = "sslittle-na-sstrix-gcc"
then then
@ -497,17 +494,15 @@ then
INSTALL_ENV="sim-fast" INSTALL_ENV="sim-fast"
fi fi
else else
if test -z "${mycflags}"
then
case "$target_cpu" in case "$target_cpu" in
i?86*) i?86*)
if test "$CC" = "lcc" if test "$CC" = "lcc"
then then
CFLAGS="-A -A" CFLAGS="-A -A $CFLAGS"
elif test "$CC" = "cl" elif test "$CC" = "cl"
then then
CFLAGS="/nologo" CXXFLAGS="-/nologo $CFLAGS"
CXXFLAGS="-/nologo" CFLAGS="/nologo $CFLAGS"
CPP="/nologo /E" CPP="/nologo /E"
fi fi
;; ;;
@ -516,17 +511,16 @@ else
then then
if test "$debugyap" = "yes" if test "$debugyap" = "yes"
then then
CFLAGS="-Ae -g -O" CXXFLAGS="-Ae -g -O $CFLAGS"
CXXFLAGS="-Ae -g -O" CFLAGS="-Ae -g -O $CFLAGS"
else else
CFLAGS="-Ae +O3 +Onolimit" CXXFLAGS="-Ae +O3 +Onolimit $CFLAGS"
CXXFLAGS="-Ae +O3 +Onolimit" CFLAGS="-Ae +O3 +Onolimit $CFLAGS"
fi fi
fi fi
dnl LDFLAGS="+e UserCPredicate $LDFLAGS" dnl LDFLAGS="+e UserCPredicate $LDFLAGS"
;; ;;
esac esac
fi
C_INTERF_FLAGS="$CFLAGS" C_INTERF_FLAGS="$CFLAGS"
C_PARSER_FLAGS="$CFLAGS" C_PARSER_FLAGS="$CFLAGS"
fi fi