summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2009-08-31 23:02:53 +0100
committerM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2009-09-03 22:50:38 +0300
commit29e7d6063f7b93dd4fde3d42a2931ec0f55158c3 (patch)
treeae472e5bdd57de7b60ee777d5ac2c8fa3cd4ca22
parente7018685f0618640221ebc61446ee98ea3056bbb (diff)
Default to optimised builds when using a Sun Studio compiler.
Autoconf's AC_PROG_CC sets the default CFLAGS to -O2 -g for gcc and -g for every other compiler. This patch defaults CFLAGS to the equivalent -O -g when we're using Sun Studio's cc if the user or site admin hasn't already set CFLAGS.
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 20c9e7a..832ed8b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,6 +65,8 @@ AM_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
+test_CFLAGS=${CFLAGS+set} # We may override autoconf default CFLAGS.
+
AC_PROG_CC
AC_PROG_LIBTOOL
AC_CHECK_FUNCS([getisax])
@@ -75,6 +77,16 @@ AC_C_INLINE
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
AC_CHECK_DECL([__amd64], [AMD64_ABI="yes"], [AMD64_ABI="no"])
+# Default CFLAGS to -O -g rather than just the -g from AC_PROG_CC
+# if we're using Sun Studio and neither the user nor a config.site
+# has set CFLAGS.
+if test $SUNCC = yes && \
+ test "$test_CFLAGS" == "" && \
+ test "$CFLAGS" = "-g"
+then
+ CFLAGS="-O -g"
+fi
+
#
# We ignore pixman_major in the version here because the major version should
# always be encoded in the actual library name. Ie., the soname is: