X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fconfigure.ac;h=cec6ce6c1b4977f082244097dc310ecc7d1b5d47;hb=34fa97b95a58f99ee51775bafcab7322935f058d;hp=42cff2db88db20be0ddbdea5ec9c7704a21428f4;hpb=b90f5ba691f1ddbe377101b79f31c9a85a0235d2;p=xestiaab%2F.git diff --git a/source/configure.ac b/source/configure.ac index 42cff2d..cec6ce6 100644 --- a/source/configure.ac +++ b/source/configure.ac @@ -6,6 +6,8 @@ AC_INIT([Xestia Address Book], [0.01], [bugs@xestia.co.uk]) #AC_CONFIG_SRCDIR([version.h]) #AC_CONFIG_HEADERS([config.h]) +AC_DEFINE([DEBUG], [1], [Enable debugging build so errors can be examined in detail.]) + # Checks for programs. AC_PROG_CXX AC_PROG_CC @@ -112,7 +114,22 @@ AC_CHECK_HEADERS([stdlib.h string.h iostream iomanip ios algorithm map vector ut AC_HEADER_STDBOOL AC_C_INLINE +# Setup the debug setting. + +AC_ARG_ENABLE([debug], +[ --enable-debug Enable a debugging build], +[case "${enableval}" in + yes) debug=true;; + no) debug=false;; + *) AC_MSG_ERROR([invalid value ${enableval} given for --enable-debug]) ;; + esac],[debug=false]) + # Checks for library functions. +AM_CONDITIONAL([DEBUG], [test x$debug = xtrue]) +AM_COND_IF([DEBUG], [AC_SUBST([DBGOUT], ["-O0"])], [AC_SUBST([DBGOUT], ["-Os"])]) +AM_COND_IF([DEBUG], [AC_SUBST([DBGSTATUS], ["DEBUG=true"])], [AC_SUBST([DBGSTATUS], ["DEBUG=false"])]) +AM_COND_IF([DEBUG], [echo "Debugging mode has been enabled."]) + AC_CONFIG_FILES([Makefile]) AC_OUTPUT