[gegl] Use -O3 by default with GCC and Clang



commit f7e29d3208835e9df0cf5dd300b1d439453a2ae3
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Sat Apr 12 13:00:40 2014 -0700

    Use -O3 by default with GCC and Clang

 configure.ac |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f567090..2703290 100644
--- a/configure.ac
+++ b/configure.ac
@@ -164,6 +164,14 @@ if test -z "$CXX" && test -n "$prefered_cc"; then
   CXX=$prefered_cxx
 fi
 
+if test -n "$CFLAGS"; then
+  user_set_cflags=yes
+fi
+
+if test -n "$CXXFLAGS"; then
+  user_set_cxxflags=yes
+fi
+
 dnl Checks for programs.
 
 AC_PROG_CC
@@ -172,6 +180,26 @@ AC_PROG_CXX
 AC_PROG_INSTALL
 AC_PROG_MAKE_SET
 
+case "$CC" in
+  clang* | gcc*)
+    if test -z $user_set_cflags; then
+      CFLAGS="-g -O3"
+    fi
+    ;;
+  *)
+    ;;
+esac
+
+case "$CXX" in
+  clang* | g++*)
+    if test -z $user_set_cxxflags; then
+      CXXFLAGS="-g -O3"
+    fi
+    ;;
+  *)
+    ;;
+esac
+
 dnl Large file support.
 AC_SYS_LARGEFILE
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]