diff --git a/configure.ac b/configure.ac index 27ffb21..7158f20 100644 --- a/configure.ac +++ b/configure.ac @@ -100,14 +100,19 @@ AM_CONDITIONAL(ENABLE_JSON, test "x$enable_json" = "xyes") # This does not work because configure does not look into /opt/local/include... # AC_CHECK_HEADERS([check.h],[ enable_check=yes ],[ enable_check=unset ]) -AC_ARG_ENABLE(check, AS_HELP_STRING([--enable-check], [enable unit testing])) -if test "$enable_check" = "xyes"; then - PKG_CHECK_MODULES(CHECK,[check >= 0.9.4],:,[ - ifdef([AM_PATH_CHECK], - [AM_PATH_CHECK(,[have_check="yes"])], - AC_MSG_WARN([Check not found; cannot run unit tests!]) - [have_check="no"])] - ]) + + +AC_ARG_ENABLE(check, + AS_HELP_STRING([--enable-check], + [enable unit testing]), + , enable_check=unset) +if test "x$enable_check" != "xunset" ; then +PKG_CHECK_MODULES(CHECK,[check >= 0.9.4],:,[ + ifdef([AM_PATH_CHECK], + [AM_PATH_CHECK(,[have_check="yes"])], + AC_MSG_WARN([Check not found; cannot run unit tests!]) + [have_check="no"])] +]) fi AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes") diff --git a/tests/Makefile.am b/tests/Makefile.am index fb15e51..8b3a270 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,13 +1,7 @@ -# INCLUDES = @CHECK_CFLAGS@ -# if HAVE_CHECK -# TESTS = check_tree -# else -# TESTS = -# endif TESTS = -AM_CFLAGS=$(DEPS_CFLAGS) $(GVC_DEPS_CFLAGS) $(JSONC_CFLAGS) -I$(top_builddir) -I$(top_builddir)/include -I$(top_builddir)/src -I$(top_builddir)/3rdparty -Wall -std=c99 -ggdb -Wall -AM_LDFLAGS=$(DEPS_LIBS) $(GVC_DEPS_LIBS) $(JSONC_LIBS) -L$(top_builddir) -lcheck @CHECK_LIBS@ $(top_builddir)/libr3.la +AM_CFLAGS=$(DEPS_CFLAGS) $(GVC_DEPS_CFLAGS) $(JSONC_CFLAGS) @CHECK_CFLAGS@ -I$(top_builddir) -I$(top_builddir)/include -I$(top_builddir)/src -I$(top_builddir)/3rdparty -Wall -std=c99 -ggdb -Wall +AM_LDFLAGS=$(DEPS_LIBS) $(GVC_DEPS_LIBS) $(JSONC_LIBS) @CHECK_LIBS@ $(top_builddir)/libr3.la if USE_JEMALLOC AM_CFLAGS += -ljemalloc @@ -24,7 +18,6 @@ dist_noinst_DATA = \ TESTS += check_slug check_slug_SOURCES = check_slug.c - TESTS += check_tree check_tree_SOURCES = check_tree.c