From 5a6374bad7392de947c03868e4da96bae45b757b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Thu, 6 Sep 2007 19:39:05 +0000 Subject: [PATCH] * profiling and debug switches here too. --- webcit/configure.ac | 23 ++++++++++++++++++++++- webcit/debian/rules | 21 +++++++++++++-------- 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/webcit/configure.ac b/webcit/configure.ac index 992c4321a..861089b5e 100644 --- a/webcit/configure.ac +++ b/webcit/configure.ac @@ -94,7 +94,6 @@ dnl AC_HEADER_TIME dnl Checks for library functions. AC_TYPE_SIGNAL dnl AC_FUNC_VPRINTF -AC_CHECK_FUNCS(backtrace) AC_REPLACE_FUNCS(snprintf) dnl Checks for the libical calendaring library. @@ -146,6 +145,7 @@ if test "x$ok_zlib" = xyes ; then AC_DEFINE(HAVE_ZLIB) fi + # The big search for OpenSSL if test "$with_ssl" != "no"; then saved_LIBS="$LIBS" @@ -343,6 +343,27 @@ fi AC_SUBST(SETUP_LIBS) +dnl disable backtrace if we don't want it. +AC_ARG_WITH(gprof, + [ --with-gprof enable profiling], + [ if test "x$withval" != "xno" ; then + CFLAGS="$CFLAGS -pg " + LDFLAGS="$LDFLAGS -pg " + fi + ] +) + +dnl disable backtrace if we don't want it. +AC_ARG_WITH(backtrace, + [ --with-backtrace enable backtrace dumps in the syslog], + [ if test "x$withval" != "xno" ; then + CFLAGS="$CFLAGS -rdynamic " + LDFLAGS="$LDFLAGS -rdynamic " + AC_CHECK_FUNCS(backtrace) + fi + ] +) +echo "$CFLAGS $LDFLAGS" if test "$prefix" = NONE; then LOCALEDIR=$ac_default_prefix diff --git a/webcit/debian/rules b/webcit/debian/rules index 318110962..bbdd4152d 100755 --- a/webcit/debian/rules +++ b/webcit/debian/rules @@ -11,14 +11,18 @@ DESTDIR=$(CURDIR)/debian/citadel-webcit - - -CFLAGS = -Wall -g -ggdb - -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 +EXTRA_ARGS= +PROFILE_ARGS= +#to enable debugging: export DEB_BUILD_OPTIONS="debug profiling" +ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS))) + PROFILE_ARGS= --with-gprof +endif +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 -ggdb -rdynamic -D_GNU_SOURCE -MD -MP + LDFLAGS += -pg + EXTRA_ARGS = --with-backtrace else - CFLAGS += -O0 -ggdb + CFLAGS += -O2 endif configure: configure-stamp @@ -34,7 +38,8 @@ configure-stamp: --with-rundir=/var/run/citadel \ --with-ical --with-db --with-ldap \ --with-zlib --with-ssl --with-libiconf \ - --with-newt --with-included-gettext + --with-newt --with-included-gettext \ + --enable-debug $(EXTRA_ARGS) $(PROFILE_ARGS) touch configure-stamp -- 2.30.2