diff options
author | P. J. McDermott <pj@pehjota.net> | 2022-03-20 17:55:33 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2022-03-20 17:55:33 (EDT) |
commit | 64b024858ecb68ca89008325c33f73f12a0c2abc (patch) | |
tree | bb51e8814de29f7212047a3c01817e49d7de8816 /configure.ac | |
parent | 3d7338aa51b1f77b4c92df55132b9d42bd39b836 (diff) | |
download | atsign-64b024858ecb68ca89008325c33f73f12a0c2abc.zip atsign-64b024858ecb68ca89008325c33f73f12a0c2abc.tar.gz atsign-64b024858ecb68ca89008325c33f73f12a0c2abc.tar.bz2 |
Add --disable-tests to shrink executable size
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 25 |
1 files changed, 25 insertions, 0 deletions
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])]) |