From 3ec3b42c3d2c6c2c93740c6e670b3bc4e7f3d2d5 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Tue, 4 Mar 2008 16:59:01 +0000 Subject: [PATCH] Add a --enable-debug flag, with a DEBUG_FLAGS env variable to set the debugging flag (default: -g) Originally committed to SVN as r1886. --- configure.in | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 35ba657f9..bf0b1f5a9 100644 --- a/configure.in +++ b/configure.in @@ -34,7 +34,6 @@ AM_INIT_AUTOMAKE AC_CONFIG_HEADER([aegisub/posix/acconf.h]) AC_GNU_SOURCE AC_CANONICAL_HOST -AM_MAINTAINER_MODE ######################## @@ -56,6 +55,27 @@ AC_PROG_INSTALL PKG_PROG_PKG_CONFIG([0.20]) +################# +# Developers only +################# +AM_MAINTAINER_MODE + +AC_ARG_VAR([DEBUG_FLAGS], [Debug flag to use with --enable debug (default: -g)]) +if test -z "$DEBUG_FLAGS"; then + DEBUG_FLAGS="-g"; +fi + +AC_MSG_CHECKING([whether to turn on debugging]) +AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging (default=no)]) +if test "$enable_debug" = "yes"; then + AC_MSG_RESULT([yes ($DEBUG_FLAGS)]) + CPPFLAGS="$DEBUG_FLAGS $CPPFLAGS" +else + AC_MSG_RESULT([no]) +fi + + + ################################################### # Check for pthreads and setup variables / compiler ###################################################