diff options
author | daniel <arowser@gmail.com> | 2014-03-04 13:52:42 +0800 |
---|---|---|
committer | arowser <arowser@gmail.com> | 2014-03-10 19:11:01 +0800 |
commit | f5f157b83fdcf4f70c40f47a5001d3e37dbb384a (patch) | |
tree | 67de134e85c7f2f0f3e8dcb504cb9147c7382296 | |
parent | aefbf6e30cadaf77ebee44284c74cc5449dc173f (diff) |
add --enable-debug for configure
-rw-r--r-- | configure.ac | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 3ed4549a88..6f7d8d19a6 100644 --- a/configure.ac +++ b/configure.ac @@ -137,6 +137,23 @@ AC_PATH_PROG(XGETTEXT,xgettext) AC_PATH_PROG(HEXDUMP,hexdump) PKG_PROG_PKG_CONFIG +# Enable debug +AC_ARG_ENABLE([debug], + [AS_HELP_STRING([--enable-debug], + [use debug compiler flags and macros (default is no)])], + [enable_debug=$enableval], + [enable_debug=no]) + +if test "x$enable_debug" = xyes; then + if test "x$GCC" = xyes; then + CFLAGS="-g3 -O0 -DDEBUG" + fi + + if test "x$GXX" = xyes; then + CXXFLAGS="-g3 -O0 -DDEBUG" + fi +fi + ## TODO: Remove these hard-coded paths and flags. They are here for the sake of ## compatibility with the legacy buildsystem. ## |