From e7b699d6535574ed0b7404e336c8ddfca7cdee00 Mon Sep 17 00:00:00 2001 From: DRC Date: Sun, 14 Feb 2010 07:39:07 +0000 Subject: [PATCH] Set CFLAGS=CXXFLAGS=-O3 if using GCC and the flags are not already set git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@90 632fc199-4ca6-4c93-a231-07263d6284db --- configure.ac | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configure.ac b/configure.ac index 2b6a87e..b8a985f 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,8 @@ AC_DEFINE([HAVE_PROTOTYPES], 1, [Define if your compiler supports prototypes]) AC_DEFINE([INCOMPLETE_TYPES_BROKEN], 1, [Define if you want use complete types]) # Checks for programs. +SAVED_CFLAGS=${CFLAGS} +SAVED_CXXFLAGS=${CXXFLAGS} AC_PROG_CPP AC_PROG_CC AC_PROG_CXX @@ -19,6 +21,15 @@ AC_PROG_INSTALL AC_PROG_LIBTOOL AC_PROG_LN_S +if test "x${GCC}" = "xyes"; then + if test "x${SAVED_CFLAGS}" = "x"; then + CFLAGS=-O3 + fi + if test "x${SAVED_CXXFLAGS}" = "x"; then + CXXFLAGS=-O3 + fi +fi + # Checks for libraries. # Checks for header files. -- 2.40.0