Hi

If the user's CFLAGS include some other -O level, don't set -O2 in configure.

- Lauri
>From ab7a3a9d9ab199ea51cf05edd06b1a8158254310 Mon Sep 17 00:00:00 2001
From: Lauri Kasanen <[email protected]>
Date: Sun, 16 Dec 2012 13:29:03 +0200
Subject: [PATCH] configure: Conditionally set -O2


Signed-off-by: Lauri Kasanen <[email protected]>
---
 configure |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index c13647f..def2cdb 100755
--- a/configure
+++ b/configure
@@ -1058,7 +1058,8 @@ fi
 [ -n "$relaxed_plugins" ] && DEFS="$DEFS -DRELAXED_PLUGINS"
 
 if test -z "$debug" ; then
-    CFLAGS="$CFLAGS -O2"
+    # Only set -O2 if the user didn't set some optimization level
+    echo "$CFLAGS" | grep -q -e -O || CFLAGS="$CFLAGS -O2"
 else
     DEFS="-DDEBUG -DSAFE_FREE"
     CFLAGS="$CFLAGS -g"
-- 
1.7.2.1

_______________________________________________
Monkey mailing list
[email protected]
http://lists.monkey-project.com/listinfo/monkey

Reply via email to