Add a --enable-debug flag, with a DEBUG_FLAGS env variable to set the

debugging flag (default: -g)

Originally committed to SVN as r1886.
This commit is contained in:
Amar Takhar 2008-03-04 16:59:01 +00:00
parent 7b9af6a159
commit 3ec3b42c3d
1 changed files with 21 additions and 1 deletions

View File

@ -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
###################################################