Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Build system (Linux) updates
[xestiaab/.git] / source / configure.ac
index 42cff2d..cec6ce6 100644 (file)
@@ -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
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy