- # Cool, but it also tries to set -O2. I don't want it with gcc
- saveCFLAGS="$CFLAGS"
- CFLAGS=
- case " $saveCFLAGS " in
- *-g*) CFLAGS="-g" ;;
- esac
- case " $saveCFLAGS " in
- *-O2*) test "x$CC" = xgcc || CFLAGS="$CFLAGS -O2" ;;
+ # Cool, but it also tries to set -O2 and -g.
+ # I don't want it with gcc, but -O3 and -g2, and optimization only when asked by user
+ case $CC in
+ *gcc)
+ if test "$CFLAGS" = "-g -O2" ; then
+ CFLAGS="-g3"
+ fi
+ if test "$CXXFLAGS" = "-g -O2" ; then
+ CXXFLAGS="-g3"
+ fi
+ if test "$GCJFLAGS" = "-g -O2" ; then
+ CXXFLAGS="-g3"
+ fi;;