If CFLAGS is set when running configure, then just use that.
authorMartin Pool <mbp@samba.org>
Thu, 20 Mar 2003 05:54:03 +0000 (05:54 +0000)
committerMartin Pool <mbp@samba.org>
Thu, 20 Mar 2003 05:54:03 +0000 (05:54 +0000)
Otherwise add -O.

(We used to always set -O, which is sometimes annoying when debugging
and anyhow clashes with normal autoconf behaviour.)
(This used to be commit aee2ad9c3444d59dd6f53dda5379a6c391e00002)

source3/configure.in

index fa8e99c3a45731de7787b0d0cbac9ded58d6e075..e6189aa06f7db7aa0ca62aeb8fa41d55d24adfc7 100644 (file)
@@ -159,9 +159,6 @@ AC_SUBST(EXTRA_BIN_PROGS)
 AC_SUBST(EXTRA_SBIN_PROGS)
 AC_SUBST(EXTRA_ALL_TARGETS)
 
-# compile with optimization and without debugging by default
-CFLAGS="-O ${CFLAGS}"
-
 AC_ARG_ENABLE(debug, 
 [  --enable-debug          Turn on compiler debugging information (default=no)],
     [if eval "test x$enable_debug = xyes"; then
@@ -194,6 +191,13 @@ AC_PROG_INSTALL
 AC_PROG_AWK
 AC_PATH_PROG(PERL, perl)
 
+# compile with optimization and without debugging by default, but
+# allow people to set their own preference.
+if test "x$CFLAGS" = x
+then
+  CFLAGS="-O ${CFLAGS}"
+fi
+
 dnl Check if we use GNU ld
 LD=ld
 AC_PROG_LD_GNU