From 1e8f148fe8f6c7934f1b84e41add465844c2dcdc Mon Sep 17 00:00:00 2001 From: Ben Fuhrmannek Date: Thu, 6 Jan 2022 21:16:39 +0100 Subject: added stderr debug output option to configure instead of CFLAGS --- src/config.m4 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/config.m4') diff --git a/src/config.m4 b/src/config.m4 index e6eed84..a421c0c 100644 --- a/src/config.m4 +++ b/src/config.m4 @@ -18,6 +18,9 @@ PHP_ARG_ENABLE(coverage, whether to enable coverage support, PHP_ARG_ENABLE(debug, whether to enable debug messages, [ --enable-debug Enable debug messages], no, no) +PHP_ARG_ENABLE(debug-stderr, whether to enable debug messages, +[ --enable-debug-stderr Enable debug messages], no, no) + AC_PROG_CC_STDC() CFLAGS="$CFLAGS" @@ -28,8 +31,11 @@ CFLAGS="$CFLAGS -fstack-protector-strong" LDFLAGS="$LDFLAGS `pcre2-config --libs8`" if test "$PHP_DEBUG" = "yes"; then - AC_DEFINE(SP_DEBUG, 1, [Wether you want to enable debug messages]) - CFLAGS="$CFLAGS -g -ggdb -O0" + AC_DEFINE(SP_DEBUG, 1, [Enable SP debug messages]) + CFLAGS="$CFLAGS -g -ggdb -O0" + if test "$PHP_DEBUG_STDERR" = "yes"; then + AC_DEFINE(SP_DEBUG_STDERR, 1, [Print SP debug messages to stderr]) + fi fi AC_CHECK_LIB(pcre, pcre_compile, AC_DEFINE(HAVE_PCRE, 1, [have pcre])) -- cgit v1.3