Skip to content

Commit

Permalink
Added --enable-debug
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritloose committed Oct 17, 2009
1 parent 27f555f commit 3cd211b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
8 changes: 2 additions & 6 deletions Makefile.in
Expand Up @@ -14,12 +14,8 @@ top_srcdir=@AP_TOP_SRCDIR@
top_builddir=@AP_TOP_BUILDDIR@ top_builddir=@AP_TOP_BUILDDIR@
include @AP_INSTALLBUILDDIR@/special.mk include @AP_INSTALLBUILDDIR@/special.mk


ifdef MOD_PSGI_DEBUG DEFS=@DEBUG_DEFS@ -DMOD_PSGI_VERSION=\"$(PACKAGE_VERSION)\"
DEBUG_DEFS=-DDEBUG EXTRA_CFLAGS+=@EXTRA_CFLAGS@
else
DEBUG_DEFS=
endif
DEFS=-DMOD_PSGI_VERSION=\"$(PACKAGE_VERSION)\" $(DEBUG_DEFS)
INCLUDES=@PERL_CCOPTS@ INCLUDES=@PERL_CCOPTS@
LDFLAGS=@PERL_LDOPTS@ LDFLAGS=@PERL_LDOPTS@


Expand Down
16 changes: 16 additions & 0 deletions configure.ac
Expand Up @@ -45,6 +45,22 @@ PERL_LDOPTS=`$PERL -MExtUtils::Embed -e ldopts`
AC_SUBST(PERL_CCOPTS) AC_SUBST(PERL_CCOPTS)
AC_SUBST(PERL_LDOPTS) AC_SUBST(PERL_LDOPTS)


AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
[enable debug mode]),
[ENABLE_DEBUG="$enable_debug"],
[ENABLE_DEBUG="no"])
AP_LIBTOOL=`$APXS -q LIBTOOL`
eval `$AP_LIBTOOL --config | grep "^CC"`
if test "$CC" = "gcc"; then
EXTRA_CFLAGS="-Wall"
if test "$ENABLE_DEBUG" = "yes"; then
EXTRA_CFLAGS+=" -g"
DEBUG_DEFS="-DMOD_PSGI_DEBUG"
AC_SUBST(DEBUG_DEFS)
fi
AC_SUBST(EXTRA_CFLAGS)
fi

AC_OUTPUT([Makefile t/Config.pm]) AC_OUTPUT([Makefile t/Config.pm])


echo " echo "
Expand Down
2 changes: 1 addition & 1 deletion mod_psgi.c
Expand Up @@ -58,7 +58,7 @@


#define PSGI_HANDLER_NAME "psgi" #define PSGI_HANDLER_NAME "psgi"


#ifdef DEBUG #ifdef MOD_PSGI_DEBUG
#define TRACE(...) ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, NULL, __VA_ARGS__) #define TRACE(...) ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, NULL, __VA_ARGS__)
#endif #endif


Expand Down

0 comments on commit 3cd211b

Please sign in to comment.