test if CXXFLAGS/CFLAGS contains the -g or the -O options before adding our -g and -O2 flags: this avoids duplicates in the GCC command line which just generate confusion

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58985 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2009-02-18 11:05:38 +00:00
parent de0573dabb
commit 6ad6ba217a
2 changed files with 62 additions and 40 deletions

40
configure vendored
View File

@@ -1,5 +1,5 @@
#! /bin/sh
# From configure.in Id: configure.in 58743 2009-02-08 00:47:04Z FM .
# From configure.in Id: configure.in 58765 2009-02-08 15:38:30Z FM .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for wxWidgets 2.9.0.
#
@@ -41415,7 +41415,10 @@ _ACEOF
fi
DEBUG_CFLAGS=
if test "$wxUSE_DEBUG_INFO" = "yes" ; then
if `echo $CXXFLAGS $CFLAGS | grep " -g" >/dev/null`; then
{ echo "$as_me:$LINENO: WARNING: CXXFLAGS/CFLAGS already contains -g flag; ignoring the --enable-debug_info option" >&5
echo "$as_me: WARNING: CXXFLAGS/CFLAGS already contains -g flag; ignoring the --enable-debug_info option" >&2;}
elif test "$wxUSE_DEBUG_INFO" = "yes" ; then
DEBUG_CFLAGS="-g"
fi
@@ -41487,22 +41490,27 @@ if test "$GCC" = "yes" ; then
fi
OPTIMISE_CFLAGS=
if test "$wxUSE_OPTIMISE" = "no" ; then
if test "$GCC" = yes ; then
OPTIMISE_CFLAGS="-O0"
fi
if `echo $CXXFLAGS $CFLAGS | grep " -O" >/dev/null`; then
{ echo "$as_me:$LINENO: WARNING: CXXFLAGS/CFLAGS already contains -O flag; ignoring the --disable-optimise option" >&5
echo "$as_me: WARNING: CXXFLAGS/CFLAGS already contains -O flag; ignoring the --disable-optimise option" >&2;}
else
if test "$GCC" = yes ; then
case "${host}" in
*-pc-os2_emx | *-pc-os2-emx )
OPTIMISE_CFLAGS="-O2"
;;
*)
OPTIMISE_CFLAGS="-O2 -fno-strict-aliasing"
;;
esac
if test "$wxUSE_OPTIMISE" = "no" ; then
if test "$GCC" = yes ; then
OPTIMISE_CFLAGS="-O0"
fi
else
OPTIMISE_CFLAGS="-O"
if test "$GCC" = yes ; then
case "${host}" in
*-pc-os2_emx | *-pc-os2-emx )
OPTIMISE_CFLAGS="-O2"
;;
*)
OPTIMISE_CFLAGS="-O2 -fno-strict-aliasing"
;;
esac
else
OPTIMISE_CFLAGS="-O"
fi
fi
fi