From a4bfdce8ed87d728f5644077ddbe94380c6ff3b5 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 1 Nov 2016 20:38:23 +0100 Subject: Switch from cppunit.m4 to pkgconfig (patch from Jin^Eld) --- autogen.sh | 10 ---------- configure.ac | 11 +++++++++-- test/Makefile.am | 4 ++++ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/autogen.sh b/autogen.sh index 53a2f5d..35edb8b 100755 --- a/autogen.sh +++ b/autogen.sh @@ -11,15 +11,5 @@ then exit 1 fi -# Check for the existence of cppunit.m4. If missing emulate it. -mkdir -p actest -cat << EOF > actest/configure.ac -AC_INIT([actest], [1.0.0]) -AM_PATH_CPPUNIT(1.9.6) -EOF -[ -f acinclude.m4 ] && rm acinclude.m4 -autoreconf -W error actest 2>/dev/null || echo "AC_DEFUN([AM_PATH_CPPUNIT],[echo 'cppunit hack'])" > acinclude.m4 -rm -Rf actest - # Now run autoreconf ${AUTORECONF:-autoreconf} -fiv --warnings=no-unsupported diff --git a/configure.ac b/configure.ac index 7e6695c..0dcf8c0 100644 --- a/configure.ac +++ b/configure.ac @@ -142,10 +142,17 @@ AC_ARG_WITH([test], AS_HELP_STRING([--with-test], [Build unit tests])) AS_IF([test x$with_test == xyes], - [AC_MSG_WARN([*** Building unittests!]) - AM_PATH_CPPUNIT(1.9.6)] + [ + AC_MSG_WARN([*** Building unittests!]) + PKG_CHECK_MODULES([CPPUNIT], [ cppunit >= 1.9.6 ], [], + [ + AC_MSG_ERROR([$CPPUNIT_PKG_ERRORS]) + ]) + ] ) +AM_CONDITIONAL([ENABLE_TESTS], [test "x$with_test" = "xyes"]) + dnl ====================== dnl Compile LV2 plugin dnl ====================== diff --git a/test/Makefile.am b/test/Makefile.am index 2ad9a9c..1f2419e 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,6 +1,8 @@ # Rules for the test code (use `make check` to execute) SUBDIRS = dgreftest +if ENABLE_TESTS + include $(top_srcdir)/src/Makefile.am.drumgizmo include $(top_srcdir)/plugingui/Makefile.am.plugingui @@ -190,3 +192,5 @@ semaphoretest_SOURCES = \ $(top_srcdir)/src/semaphore.cc \ semaphoretest.cc \ test.cc + +endif -- cgit v1.2.3