+dnl ---------------------------------------------------------------------------
+dnl debugging options
+dnl ---------------------------------------------------------------------------
+
+dnl don't use WX_ARG_ENABLE as it just gets in the way instead of helping with
+dnl this rather unusual option
+AC_MSG_CHECKING([for --enable-debug])
+AC_ARG_ENABLE(debug, [ --enable-debug build library for debugging],
+ [
+ if test "$enableval" = yes; then
+ wxUSE_DEBUG=yes
+ elif test "$enableval" = no; then
+ wxUSE_DEBUG=no
+ elif test "$enableval" = max; then
+ wxUSE_DEBUG=yes
+ WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -DwxDEBUG_LEVEL=2"
+ else
+ AC_MSG_ERROR([Invalid --enable-debug value, must be yes, no or max])
+ fi
+ ],
+ wxUSE_DEBUG=default
+)
+AC_MSG_RESULT([${enable_debug-default}])
+
+case "$wxUSE_DEBUG" in
+ yes)
+ dnl build the library for debugging: enable debugging code and generate
+ dnl the debug information for the library itself
+ DEFAULT_wxUSE_DEBUG_FLAG=yes
+ DEFAULT_wxUSE_DEBUG_INFO=yes
+
+ dnl also disable optimizations by default if --enable-debug was used
+ dnl (this can still be overridden by an explicit --enable-optimise)
+ DEFAULT_wxUSE_OPTIMISE=no
+ ;;
+
+ no)
+ dnl --disable-debug is equivalent to both --disable-debug_flag and
+ dnl --disable-debug_info
+ DEFAULT_wxUSE_DEBUG_FLAG=no
+ DEFAULT_wxUSE_DEBUG_INFO=no
+ ;;
+
+ default)
+ dnl the library is built with debugging support by default but without
+ dnl debug information as this requires much, much more disk space
+ DEFAULT_wxUSE_DEBUG_FLAG=yes
+ DEFAULT_wxUSE_DEBUG_INFO=no
+ ;;
+esac
+
+WX_ARG_DISABLE(debug_flag, [ --disable-debug_flag disable all debugging support], wxUSE_DEBUG_FLAG)
+WX_ARG_ENABLE(debug_info, [ --enable-debug_info generate debug information], wxUSE_DEBUG_INFO)
+
+dnl enabled if just --enable-debug_{flag,info} was
+dnl
+dnl in any case, only set the default value and allow overriding it with an
+
+WX_ARG_ENABLE(debug_gdb, [ --enable-debug_gdb create code with extra GDB debugging information], wxUSE_DEBUG_GDB)
+WX_ARG_ENABLE(debug_cntxt, [ --enable-debug_cntxt obsolete, don't use: use wxDebugContext], wxUSE_DEBUG_CONTEXT)
+WX_ARG_ENABLE(mem_tracing, [ --enable-mem_tracing obsolete, don't use: create code with memory tracing], wxUSE_MEM_TRACING)
+