[PATCH evemu v2 1/4] configure.ac: add '--disable-tests' option

Peter Seiderer ps.report at gmx.net
Mon Aug 11 13:26:07 PDT 2014


For toolchains without c++ support add option to disable
tests, because this is the only place c++ is needed (to
test the c++ binding).

Signed-off-by: Peter Seiderer <ps.report at gmx.net>

---
Changes v1 -> v2:
  - use BUILD_TESTS conditional (as suggested by Peter Hutterer)
---
 configure.ac     | 10 ++++++++++
 test/Makefile.am |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/configure.ac b/configure.ac
index e222d8d..372a5ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,16 @@ if test "x$XMLTO" = "x" || test "x$ASCIIDOC" = "x"; then
 	AC_MSG_WARN([xmlto or asciidoc not found - cannot create man pages without it])
 fi
 
+AC_ARG_ENABLE([tests],
+	AS_HELP_STRING([--disable-tests], [disable building of tests]),
+	[case "${enableval}" in
+	  yes) tests=true ;;
+	  no)  tests=false ;;
+	  *) AC_MSG_ERROR([bad value ${enableval} for --disable-tests]) ;;
+	esac],[tests=true])
+
+AM_CONDITIONAL(BUILD_TESTS, [test "x$tests" = "xtrue"])
+
 AC_SUBST(AM_CFLAGS,
          "-Wall -Wextra")
 
diff --git a/test/Makefile.am b/test/Makefile.am
index 575a227..70152b4 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,3 +1,4 @@
+if BUILD_TESTS
 noinst_PROGRAMS = test-c-compile test-cxx-compile test-evemu-create
 TESTS = $(noinst_PROGRAMS)
 
@@ -12,5 +13,6 @@ test_cxx_compile_LDADD = $(top_builddir)/src/libevemu.la
 test_evemu_create_SOURCES = test-evemu-create.c
 test_evemu_create_LDADD = $(top_builddir)/src/libevemu.la
 test_evemu_create_LDFLAGS = -static
+endif
 
 CLEANFILES = evemu.tmp.*
-- 
1.8.1.4



More information about the Input-tools mailing list