[Mesa-dev] [PATCH] configure: Don't override user -g or -O options for debug builds
Kenneth Graunke
kenneth at whitecape.org
Mon Jul 14 12:06:21 PDT 2014
On Monday, July 14, 2014 11:49:57 AM Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> I already pass '-ggdb3 -O1' or '-ggdb3 -Og' for CFLAGS, and I don't want
> configure to change them for me.
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
> configure.ac | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 4646212..04abcc0 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -308,10 +308,20 @@ AC_ARG_ENABLE([debug],
> if test "x$enable_debug" = xyes; then
> DEFINES="$DEFINES -DDEBUG"
> if test "x$GCC" = xyes; then
> - CFLAGS="$CFLAGS -g -O0"
> + if ! echo "$CFLAGS" | grep -q -e '-g'; then
> + CFLAGS="$CFLAGS -g"
> + fi
> + if ! echo "$CFLAGS" | grep -q -e '-O'; then
> + CFLAGS="$CFLAGS -O0"
> + fi
> fi
> if test "x$GXX" = xyes; then
> - CXXFLAGS="$CXXFLAGS -g -O0"
> + if ! echo "$CXXFLAGS" | grep -q -e '-g'; then
> + CXXFLAGS="$CXXFLAGS -g"
> + fi
> + if ! echo "$CXXFLAGS" | grep -q -e '-O'; then
> + CXXFLAGS="$CXXFLAGS -O0"
> + fi
> fi
> fi
>
>
Seems reasonable to me.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140714/f89067bf/attachment.sig>
More information about the mesa-dev
mailing list