+dnl Allow building without Catta
+AC_ARG_ENABLE([catta], AS_HELP_STRING([--disable-catta], [disable linking with the Catta library]))
+AS_IF([test "x$enable_catta" != "xno"],
+ AC_DEFINE(HAVE_CATTA, 1, [Link with Catta])
+ AC_CONFIG_SUBDIRS([catta])
+)
+AM_CONDITIONAL(CATTA, test "x$enable_catta" != "xno")
+
+dnl UTCP debug flags
+AC_ARG_ENABLE([utcp_debug], AS_HELP_STRING([--enable-utcp-debug], [compile utcp with debug output]))
+AS_IF([test "x$enable_utcp_debug" = "xyes"],
+ [AX_CHECK_COMPILE_FLAG([-DUTCP_DEBUG], [CPPFLAGS="$CPPFLAGS -DUTCP_DEBUG"])
+ ]
+);
+
+dnl Blackbox test suite
+PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.1.0], [cmocka=true], [cmocka=false])
+PKG_CHECK_MODULES([LXC], [lxc >= 2.0.0], [lxc=true], [lxc=false])
+AM_CONDITIONAL(BLACKBOX_TESTS, test "$cmocka" = true -a "$lxc" = true)
+
+dnl Install test binaries
+AC_ARG_ENABLE([install_tests],
+ [AS_HELP_STRING([--enable-install-tests], [include test binaries in installation])],
+ [AS_IF([test "x$enable_install_tests" = "xyes"], [install_tests=true], [install_tests=false])],
+ [install_tests=false]
+)
+
+AM_CONDITIONAL(INSTALL_TESTS, test "$install_tests" = true)
+