]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
tests: Make unit test building optional
authorThomas Graf <tgraf@suug.ch>
Sat, 27 Apr 2013 12:27:10 +0000 (14:27 +0200)
committerThomas Graf <tgraf@suug.ch>
Sat, 27 Apr 2013 12:27:10 +0000 (14:27 +0200)
Signed-off-by: Thomas Graf <tgraf@suug.ch>
configure.ac
tests/Makefile.am

index 9a7fd65bda5fff6fdf64e88f6f64c088208e71da..8c5ff1c193ad4dec891703d61b6c909a1361fc18 100644 (file)
@@ -75,7 +75,12 @@ AC_CHECK_PROGS(YACC, 'bison -y')
 AC_C_CONST
 AC_C_INLINE
 
-PKG_CHECK_MODULES([CHECK], [check >= 0.9.0])
+PKG_CHECK_MODULES([CHECK], [check >= 0.9.0],
+       [AC_DEFINE([ENABLE_UNIT_TESTS], [1], [Do unit tests])],
+       [AC_MSG_WARN([*** Disabling building of unit tests])
+        AC_DEFINE([ENABLE_UNIT_TESTS], [0], [Do not do unit tests])])
+
+AM_CONDITIONAL([ENABLE_UNIT_TESTS], [test "x$ENABLE_UNIT_TESTS" = "xyes"])
 
 AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
        [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
index 6a5606ac177b90517e32315fa2e58e29021dc9e6..3e9eafefc9ea57e30c42323e1f3662a890fee044 100644 (file)
@@ -1,5 +1,7 @@
 # -*- Makefile -*-
 
+if ENABLE_UNIT_TESTS
+
 AM_CPPFLAGS  = -Wall -I${top_srcdir}/include -I${top_builddir}/include -D_GNU_SOURCE -DSYSCONFDIR=\"$(sysconfdir)/libnl\"
 
 LDADD = \
@@ -45,3 +47,4 @@ test_complex_HTB_with_hash_filters_SOURCES = test-complex-HTB-with-hash-filters.
 check_all_SOURCES = \
        check-all.c \
        check-addr.c
+endif