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