From 64b024858ecb68ca89008325c33f73f12a0c2abc Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 20 Mar 2022 17:55:33 -0400 Subject: Add --disable-tests to shrink executable size --- (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 011b7d5..335b927 100644 --- a/configure.ac +++ b/configure.ac @@ -54,6 +54,31 @@ if ${funcs_missing}; then AC_MSG_ERROR([required functions are missing]) fi +AC_ARG_ENABLE([tests], + [AS_HELP_STRING([--enable-tests], + [include test suite support in executable])], + [case "${enableval}" in yes|no) tests=${enableval};; + *) AC_MSG_ERROR( + [bad value ${enableval} for tests option]);; + esac], + [ + tests=no + test -d "${srcdir}/.git" && tests=yes + ] +) +if test x"${tests}" = x'yes'; then + AC_DEFINE([ENABLE_TESTS], [1], + [Define to 1 to include test suite support]) + AC_CHECK_FUNCS( + [strtol], + [], + [AC_MSG_ERROR([required functions are missing])]) +else + AC_DEFINE([ENABLE_TESTS], [0], + [Define to 1 to include test suite support]) +fi +AM_CONDITIONAL([ENABLE_TESTS], [test x"${tests}" = x'yes']) + AX_CFLAGS_WARN_ALL() dnl Adds -Wall or equivalent AX_CHECK_COMPILE_FLAG([-Wpedantic], [AX_APPEND_FLAG([-Wpedantic])]) AX_CHECK_COMPILE_FLAG([-Wextra], [AX_APPEND_FLAG([-Wextra])]) -- cgit v0.9.1