diff options
author | Andriy Grytsenko <andrej@rep.kiev.ua> | 2014-09-14 17:53:43 +0300 |
---|---|---|
committer | Andriy Grytsenko <andrej@rep.kiev.ua> | 2014-09-14 17:53:43 +0300 |
commit | 7bbb4c016fb96684c540e43f7bc529642cb9defb (patch) | |
tree | 94e3fda6dedd10fcdd305214a2e4cd2526afa1ea | |
parent | 12096fc778697f919805a416b230250fa7b07101 (diff) |
Add --enable-debug option to configure script.
-rw-r--r-- | configure.ac | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 8a3a7a3..f6dd3bb 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,30 @@ done AM_GLIB_GNU_GETTEXT AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.]) +AC_ARG_ENABLE(debug, + [AC_HELP_STRING([--enable-debug], + [build libfm with debug support @<:@default=no@:>@])], + [enable_debug="${enableval}"], + [enable_debug=no] +) + +if test "$enable_debug" = "yes"; then + # turn on debug and disable optimization + CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g" + case "$CC" in + gcc*) + CPPFLAGS="$CPPFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers" + ;; + *) + ;; + esac + dnl Be more strict on portability + CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=700" +else + # turn off glib debug checks + CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS" +fi + AC_ARG_ENABLE(more_warnings, [AC_HELP_STRING([--enable-more-warnings], [Add more warnings @<:@default=no@:>@])], |