From 716fc5bdf2ab59aa84f14ec4f6963ecf7f6d004e Mon Sep 17 00:00:00 2001 From: chaoskagami Date: Mon, 26 Sep 2016 22:39:33 -0400 Subject: [PATCH] Make unittests a compile-time option --- configure.ac | 9 ++++++++- include/corbconf.h | 2 -- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index bf60672..4055927 100644 --- a/configure.ac +++ b/configure.ac @@ -17,11 +17,17 @@ LT_INIT AC_ARG_ENABLE([chainloader], AS_HELP_STRING([--disable-chainloader], [Disable chainloading of external programs])) +AC_ARG_ENABLE([unittests], + AS_HELP_STRING([--enable-unittests], [Include unit tests in resultant binary.])) + AC_PREFIX_DEFAULT([/corbenik]) +UNITTESTS=0 +test "$enable_unittests" = "yes" && UNITTESTS=1 +AC_DEFINE_UNQUOTED([UNITTESTS], [$UNITTESTS]) + CHAINLOADER=1 test "$enable_chainloader" = "no" && CHAINLOADER=0 - AC_DEFINE_UNQUOTED([CHAINLOADER], [$CHAINLOADER]) AC_CONFIG_FILES([Makefile source/Makefile external/Makefile include/Makefile]) @@ -46,6 +52,7 @@ ldflags: ${LDFLAGS} ocflags: ${OCFLAGS} Chainloader: ${CHAINLOADER} +Chainloader: ${UNITTESTS} " AC_OUTPUT diff --git a/include/corbconf.h b/include/corbconf.h index 4e74f00..cec84b7 100644 --- a/include/corbconf.h +++ b/include/corbconf.h @@ -3,6 +3,4 @@ #include -#define UNITTESTS 1 - #endif -- 2.39.5