summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorStef Walter <stefw@collabora.co.uk>2011-03-01 17:35:41 +0100
committerStef Walter <stefw@collabora.co.uk>2011-03-01 17:47:41 +0100
commit239b1643d07e069760e109dfc3150357553f699b (patch)
tree0b036998b8677fd21a346587bd768ca7bae1c05a /configure.ac
parent1056545f13813681c20c982864daf85a90914458 (diff)
Add --enable-debug option to project.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac23
1 files changed, 21 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 5c9b204..e54f7f3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,8 +24,27 @@ else
AC_MSG_WARN([Not building the salut module. No telepathy-salut.pc file.])
fi
-ERROR_CFLAGS="-Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wdeclaration-after-statement -Wshadow -Wmissing-prototypes -Wmissing-declarations"
-AC_SUBST(ERROR_CFLAGS)
+
+# ------------------------------------------------------------------------------
+
+AC_ARG_ENABLE(debug,
+ AC_HELP_STRING([--enable-debug],
+ [Compile binaries in debug mode]))
+
+AC_MSG_CHECKING(for DEBUG mode)
+if test "$enable_debug" = "yes"; then
+ CFLAGS="$CFLAGS -g -O0 -Werror -DG_DISABLE_DEPRECATED"
+ AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+CFLAGS="$CFLAGS -Wall -Wextra -Wno-missing-field-initializers \
+ -Wno-unused-parameter -Wdeclaration-after-statement -Wshadow \
+ -Wmissing-prototypes -Wmissing-declarations"
+
+AC_SUBST(CFLAGS)
AC_OUTPUT([
Makefile