summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDennis Camera <cdist@dtnr.ch>2021-04-02 15:37:41 +0200
committerDennis Camera <skonfig@dtnr.ch>2022-08-03 17:19:04 +0200
commita2a49a4365691a56b87ac1e723b7c8a33880c74b (patch)
tree33b4573a115a2894b49b12d09e35b0ead5008c06 /configure.ac
parentdd498274f02e043c094e1be85e8e1dc3f13f3e61 (diff)
downloadskonfig-c-a2a49a4365691a56b87ac1e723b7c8a33880c74b.tar.gz
skonfig-c-a2a49a4365691a56b87ac1e723b7c8a33880c74b.zip
Add debug builds
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index ff589cf..6fead6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,12 +13,30 @@ AM_INIT_AUTOMAKE([subdir-objects])
# Checks for programs.
AC_PROG_CC
+AC_LANG([C])
+
# Checks for libraries.
# Checks for header files.
+AC_CHECK_HEADERS([stdio.h])
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
+# Add debug support
+AC_ARG_ENABLE(
+ [debug],
+ AS_HELP_STRING([--enable-debug], [enable debugging, default: no]),
+ [case ${enableval} in
+ (yes) debug=true ;;
+ (no) debug=false ;;
+ (*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
+ esac],
+ [debug=false])
+AM_CONDITIONAL(DEBUG, [test "x${debug}" = xtrue])
+AM_COND_IF(DEBUG,
+ AC_DEFINE(DEBUG, 1, [Define to 0 if this is a release build]),
+ AC_DEFINE(DEBUG, 0, [Define to 1 or higher if this is a debug build]))
+
AC_OUTPUT