summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDan Nicholson <[email protected]>2007-12-12 09:02:31 -0800
committerDan Nicholson <[email protected]>2007-12-12 09:02:31 -0800
commit23656c47c9f50c3e074362f2fa857c0ce5ddaf14 (patch)
tree1e25798cb0f1a8612596e0b18f515599a026704a /configure.ac
parent41b00707e20f0c07e0dce055884c773de4b82612 (diff)
autoconf: Optional debug build with --enable-debug
Allow the user to set the compiler debug flags and macros through the option --enable-debug. This addes -DDEBUG to the macros and -g to the CFLAGS and CXXFLAGS if gcc and g++ are in use.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 40c39b99122..6330cf85e0a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -131,6 +131,24 @@ if test "$enable_static" = yes; then
fi
AC_SUBST(MKLIB_OPTIONS)
+dnl
+dnl other compiler options
+dnl
+AC_ARG_ENABLE(debug,
+ [AS_HELP_STRING([--enable-debug],
+ [use debug compiler flags and macros @<:@default=disabled@:>@])],
+ enable_debug="$enableval",
+ enable_debug=no
+)
+if test "x$enable_debug" = xyes; then
+ DEFINES="$DEFINES -DDEBUG"
+ if test "x$GCC" = xyes; then
+ CFLAGS="$CFLAGS -g"
+ fi
+ if test "x$GXX" = xyes; then
+ CXXFLAGS="$CXXFLAGS -g"
+ fi
+fi
dnl
dnl library names