configure: Introduce "debug" variable set to yes by --enable-debug.
authorMichael Adam <obnox@samba.org>
Tue, 19 Feb 2008 15:34:43 +0000 (16:34 +0100)
committerMichael Adam <obnox@samba.org>
Tue, 19 Feb 2008 16:39:40 +0000 (17:39 +0100)
Michael

source/configure.in

index 2c7ebdd8e6e6b331ef25ff9358b4d0548bb17c71..e9b93eeb4ba2642cf29a0a3eccd7973be434627f 100644 (file)
@@ -410,10 +410,11 @@ AC_SUBST(NSCD_LIBS)
 
 ## check for --enable-debug first before checking CFLAGS before
 ## so that we don't mix -O and -g
+debug=no
 AC_ARG_ENABLE(debug,
 [AS_HELP_STRING([--enable-debug], [Turn on compiler debugging information (default=no)])],
     [if eval "test x$enable_debug = xyes"; then
-       CFLAGS="${CFLAGS} -g"
+       debug=yes
     fi])
 
 # compile with optimization and without debugging by default, but
@@ -424,6 +425,11 @@ AC_ARG_ENABLE(debug,
 if test "x$CFLAGS" = x; then
   CFLAGS="-O"
 fi
+if test "x$debug" = "xyes" ; then
+       CFLAGS="${CFLAGS} -g"
+else
+       CFLAGS="-O"
+fi
 
 CFLAGS="${CFLAGS} -D_SAMBA_BUILD_=3"