s3:build: prevent from setting "-O -g", check for $debug first.
[metze/samba/wip.git] / source3 / configure.in
index 12808eb6f56802220020fc1418e9f74894a7cc5f..5f1a5efe7d579a79f0b3debf9fb08beb44cb4162 100644 (file)
@@ -152,12 +152,12 @@ AC_SUBST(NSCD_LIBS)
 # do this here since AC_CACHE_CHECK apparently sets the CFLAGS to "-g -O2"
 # if it has no value.  This prevent *very* large debug binaries from occurring
 # by default.
-if test "x$CFLAGS" = x; then
-  CFLAGS="-O"
-fi
 if test "x$debug" = "xyes" ; then
        CFLAGS="${CFLAGS} -g"
 fi
+if test "x$CFLAGS" = x; then
+  CFLAGS="-O"
+fi
 
 m4_include(../lib/socket_wrapper/config.m4)
 m4_include(../lib/nss_wrapper/config.m4)