]> granicus.if.org Git - libjpeg-turbo/commitdiff
Set CFLAGS=CXXFLAGS=-O3 if using GCC and the flags are not already set
authorDRC <dcommander@users.sourceforge.net>
Sun, 14 Feb 2010 07:39:07 +0000 (07:39 +0000)
committerDRC <dcommander@users.sourceforge.net>
Sun, 14 Feb 2010 07:39:07 +0000 (07:39 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@90 632fc199-4ca6-4c93-a231-07263d6284db

configure.ac

index 2b6a87edf98542e225a8eb5420373941a97003ac..b8a985f97f87ef1b9840e416c5c19bfaf73daf4a 100644 (file)
@@ -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.