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:
40
configure
vendored
40
configure
vendored
@@ -1,5 +1,5 @@
|
|||||||
#! /bin/sh
|
#! /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.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.61 for wxWidgets 2.9.0.
|
# Generated by GNU Autoconf 2.61 for wxWidgets 2.9.0.
|
||||||
#
|
#
|
||||||
@@ -41415,7 +41415,10 @@ _ACEOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
DEBUG_CFLAGS=
|
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"
|
DEBUG_CFLAGS="-g"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -41487,22 +41490,27 @@ if test "$GCC" = "yes" ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
OPTIMISE_CFLAGS=
|
OPTIMISE_CFLAGS=
|
||||||
if test "$wxUSE_OPTIMISE" = "no" ; then
|
if `echo $CXXFLAGS $CFLAGS | grep " -O" >/dev/null`; then
|
||||||
if test "$GCC" = yes ; then
|
{ echo "$as_me:$LINENO: WARNING: CXXFLAGS/CFLAGS already contains -O flag; ignoring the --disable-optimise option" >&5
|
||||||
OPTIMISE_CFLAGS="-O0"
|
echo "$as_me: WARNING: CXXFLAGS/CFLAGS already contains -O flag; ignoring the --disable-optimise option" >&2;}
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
if test "$GCC" = yes ; then
|
if test "$wxUSE_OPTIMISE" = "no" ; then
|
||||||
case "${host}" in
|
if test "$GCC" = yes ; then
|
||||||
*-pc-os2_emx | *-pc-os2-emx )
|
OPTIMISE_CFLAGS="-O0"
|
||||||
OPTIMISE_CFLAGS="-O2"
|
fi
|
||||||
;;
|
|
||||||
*)
|
|
||||||
OPTIMISE_CFLAGS="-O2 -fno-strict-aliasing"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
else
|
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
62
configure.in
62
configure.in
@@ -624,7 +624,7 @@ if test "$USE_OS2" = 1; then
|
|||||||
WX_ARG_ENABLE(omf, [ --enable-omf use OMF object format], wxUSE_OMF)
|
WX_ARG_ENABLE(omf, [ --enable-omf use OMF object format], wxUSE_OMF)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl --enablle-debug is equivalent to both --enable-debug_flag and
|
dnl --enable-debug is equivalent to both --enable-debug_flag and
|
||||||
dnl --enable-debug_info
|
dnl --enable-debug_info
|
||||||
if test "$wxUSE_DEBUG" = "yes"; then
|
if test "$wxUSE_DEBUG" = "yes"; then
|
||||||
DEFAULT_wxUSE_DEBUG_FLAG=yes
|
DEFAULT_wxUSE_DEBUG_FLAG=yes
|
||||||
@@ -1012,7 +1012,7 @@ dnl defines CFLAGS
|
|||||||
dnl
|
dnl
|
||||||
dnl this magic incantation is needed to prevent AC_PROG_CC from setting the
|
dnl this magic incantation is needed to prevent AC_PROG_CC from setting the
|
||||||
dnl default CFLAGS (something like "-g -O2") -- we don't need this as we add
|
dnl default CFLAGS (something like "-g -O2") -- we don't need this as we add
|
||||||
dnl -g and -O flags ourselves below
|
dnl (if not already present in C*FLAGS) the -g and -O flags ourselves below
|
||||||
CFLAGS=${CFLAGS:=}
|
CFLAGS=${CFLAGS:=}
|
||||||
AC_BAKEFILE_PROG_CC
|
AC_BAKEFILE_PROG_CC
|
||||||
|
|
||||||
@@ -5139,7 +5139,13 @@ fi
|
|||||||
dnl DEBUG_CFLAGS contains debugging options (supposed to be the same for C and C++
|
dnl DEBUG_CFLAGS contains debugging options (supposed to be the same for C and C++
|
||||||
dnl compilers: we'd need a separate DEBUG_CXXFLAGS if this is ever not the case)
|
dnl compilers: we'd need a separate DEBUG_CXXFLAGS if this is ever not the case)
|
||||||
DEBUG_CFLAGS=
|
DEBUG_CFLAGS=
|
||||||
if test "$wxUSE_DEBUG_INFO" = "yes" ; then
|
if `echo $CXXFLAGS $CFLAGS | grep " -g" >/dev/null`; then
|
||||||
|
dnl the CXXFLAGS or the CFLAGS variable already contains the -g flag
|
||||||
|
dnl (e.g. it was specified by the user before running configure); since
|
||||||
|
dnl later they will be merged with DEBUG_CFLAGS, don't set the -g option
|
||||||
|
dnl in DEBUG_CFLAGS to avoid (possibly different) flag duplicates
|
||||||
|
AC_MSG_WARN([CXXFLAGS/CFLAGS already contains -g flag; ignoring the --enable-debug_info option])
|
||||||
|
elif test "$wxUSE_DEBUG_INFO" = "yes" ; then
|
||||||
DEBUG_CFLAGS="-g"
|
DEBUG_CFLAGS="-g"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -5212,29 +5218,37 @@ fi
|
|||||||
|
|
||||||
dnl C/C++ compiler option for optimization (supposed to be the same for both)
|
dnl C/C++ compiler option for optimization (supposed to be the same for both)
|
||||||
OPTIMISE_CFLAGS=
|
OPTIMISE_CFLAGS=
|
||||||
if test "$wxUSE_OPTIMISE" = "no" ; then
|
if `echo $CXXFLAGS $CFLAGS | grep " -O" >/dev/null`; then
|
||||||
if test "$GCC" = yes ; then
|
dnl the CXXFLAGS or the CFLAGS variable already contains -O optimization flag
|
||||||
dnl use -O0 because compiling with it is faster than compiling with no
|
dnl (e.g. it was specified by the user before running configure); since
|
||||||
dnl optimization options at all (at least with g++ 3.2)
|
dnl later they will be merged with OPTIMISE_CFLAGS, don't set the -O option
|
||||||
OPTIMISE_CFLAGS="-O0"
|
dnl in OPTIMISE_CFLAGS to avoid (possibly different) flag duplicates
|
||||||
fi
|
AC_MSG_WARN([CXXFLAGS/CFLAGS already contains -O flag; ignoring the --disable-optimise option])
|
||||||
else
|
else
|
||||||
if test "$GCC" = yes ; then
|
if test "$wxUSE_OPTIMISE" = "no" ; then
|
||||||
case "${host}" in
|
if test "$GCC" = yes ; then
|
||||||
*-pc-os2_emx | *-pc-os2-emx )
|
dnl use -O0 because compiling with it is faster than compiling with no
|
||||||
dnl Not all of the supported gcc versions understand
|
dnl optimization options at all (at least with g++ 3.2)
|
||||||
dnl -fstrict-aliasing and none actually needs it (yet).
|
OPTIMISE_CFLAGS="-O0"
|
||||||
OPTIMISE_CFLAGS="-O2"
|
fi
|
||||||
;;
|
|
||||||
*)
|
|
||||||
dnl Switch on optimisation but keep strict-aliasing off for
|
|
||||||
dnl now (see -fstrict-aliasing in the gcc manual). When it is
|
|
||||||
dnl switched back on consider using -Wstrict-aliasing=2.
|
|
||||||
OPTIMISE_CFLAGS="-O2 -fno-strict-aliasing"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
else
|
else
|
||||||
OPTIMISE_CFLAGS="-O"
|
if test "$GCC" = yes ; then
|
||||||
|
case "${host}" in
|
||||||
|
*-pc-os2_emx | *-pc-os2-emx )
|
||||||
|
dnl Not all of the supported gcc versions understand
|
||||||
|
dnl -fstrict-aliasing and none actually needs it (yet).
|
||||||
|
OPTIMISE_CFLAGS="-O2"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
dnl Switch on optimisation but keep strict-aliasing off for
|
||||||
|
dnl now (see -fstrict-aliasing in the gcc manual). When it is
|
||||||
|
dnl switched back on consider using -Wstrict-aliasing=2.
|
||||||
|
OPTIMISE_CFLAGS="-O2 -fno-strict-aliasing"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
OPTIMISE_CFLAGS="-O"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user