[gnome-keyring/gnome-3-0] Fine tune debug and test build options



commit 122c6a6c541fd7cb323525f4c9a96d9386ea5b24
Author: Stef Walter <stefw collabora co uk>
Date:   Fri Apr 8 15:18:55 2011 +0200

    Fine tune debug and test build options
    
     * Enable test building by default, use --disable-tests to disable
     * Enable logging by default, use --disable-debug to disable
     * Use --enable-debug=full to build without optimizations and with
       disabled deprecated symbols, etc.

 configure.in |   42 +++++++++++++++++++++++++-----------------
 1 files changed, 25 insertions(+), 17 deletions(-)
---
diff --git a/configure.in b/configure.in
index c04d36a..bf1fe61 100644
--- a/configure.in
+++ b/configure.in
@@ -456,24 +456,32 @@ libcap_status=$have_libcap
 
 # --------------------------------------------------------------------
 # Debug mode
+#
+
+AC_MSG_CHECKING([for debug mode])
+AC_ARG_ENABLE(debug,
+              AC_HELP_STRING([--enable-debug=no/yes/full],
+              [Turn on or off debugging]))
+
+if test "$enable_debug" != "no"; then
+	AC_DEFINE_UNQUOTED(WITH_DEBUG, 1, [Print debug output])
+	AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
+fi
 
-AC_ARG_ENABLE(debug, 
-	    AC_HELP_STRING([--enable-debug],
-	    [Compile binaries in debug mode]))
-
-if test "$enable_debug" = "yes"; then
-  CFLAGS="$CFLAGS -g -O0 -Wall"
-  CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED"
-  CFLAGS="$CFLAGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
-  AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
-  echo "enabling debug compile mode"
-  debug_status="yes"
-else 
-  dnl AC_DEFINE_UNQUOTED(G_DISABLE_ASSERT, 1, [Disable glib assertions])
-  echo "disabling debug compile mode"
-  debug_status="no"
+if test "$enable_debug" = "full"; then
+	debug_status="full"
+	CFLAGS="$CFLAGS -g -O0 -Werror"
+	CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED"
+	CFLAGS="$CFLAGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
+elif test "$enable_debug" = "no"; then
+	debug_status="no"
+	AC_DEFINE_UNQUOTED(G_DISABLE_ASSERT, 1, [Disable glib assertions])
+else
+	debug_status="yes"
 fi
 
+AC_MSG_RESULT($debug_status)
+
 # -------------------------------------------------------------------
 # More warnings
 
@@ -514,11 +522,11 @@ fi
 # Tests and Unit Tests
 
 AC_ARG_ENABLE(tests, 
-	    AC_HELP_STRING([--enable-tests],
+	    AC_HELP_STRING([--disable-tests],
 	    [Build test tools, unit tests, and -Werror]))
 
 AC_MSG_CHECKING([build test tools, unit tests, and -Werror])
-if test "$enable_tests" = "yes"; then
+if test "$enable_tests" != "no"; then
 	AC_DEFINE_UNQUOTED(WITH_TESTS, 1, [Build with internal tests and unit tests])
 	AC_MSG_RESULT(yes)
 	CFLAGS="$CFLAGS -Werror"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]