orc: Add a configure option to disable tests
authorEdward Hervey <edward@centricular.com>
Sun, 19 Nov 2017 17:18:19 +0000 (18:18 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Sun, 19 Nov 2017 17:18:19 +0000 (18:18 +0100)
For targets where it doesn't make sense.

Note that this will disable the build of orc-bugreport since it
depends on the the orc_test helper library

Makefile.am
configure.ac
tools/Makefile.am

index e0436af..bc0db2d 100644 (file)
@@ -1,7 +1,18 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-SUBDIRS = orc orc-test tools examples doc testsuite
+if BUILD_TESTS
+ORCTEST_DIR = orc-test
+TESTSUITE_DIR= testsuite
+else
+ORCTEST_DIR =
+TESTSUITE_DIR =
+endif
+
+SUBDIRS = orc $(ORCTEST_DIR) tools $(TESTSUITE_DIR) examples doc
+
+DIST_SUBDIRS = orc orc-test tools examples testsuite doc
+
 
 EXTRA_DIST = COPYING RELEASE autogen.sh gtk-doc.make orc.m4 \
        $(shell find "$(top_srcdir)" -type f -name meson.build ! -path "$(top_srcdir)/orc-0.4.*" ) \
index 7dc9b30..f0ba61c 100644 (file)
@@ -204,6 +204,19 @@ AM_CONDITIONAL(ENABLE_BACKEND_ARM, test "x$ENABLE_BACKEND_ARM" = "xyes")
 AM_CONDITIONAL(ENABLE_BACKEND_C64X, test "x$ENABLE_BACKEND_C64X" = "xyes")
 AM_CONDITIONAL(ENABLE_BACKEND_MIPS, test "x$ENABLE_BACKEND_MIPS" = "xyes")
 
+dnl building of tests
+AC_ARG_ENABLE(tests,
+  AS_HELP_STRING([--disable-tests],[disable building test apps]),
+  [
+    case "${enableval}" in
+      yes) BUILD_TESTS=yes ;;
+      no)  BUILD_TESTS=no ;;
+      *)   AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
+    esac
+  ],
+[BUILD_TESTS=yes]) dnl Default value
+AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
+
 dnl Check for -Bsymbolic-functions linker flag used to avoid
 dnl intra-library PLT jumps, if available.
 AC_ARG_ENABLE(Bsymbolic,
index d45d0af..eaec4f4 100644 (file)
@@ -1,5 +1,12 @@
 
-bin_PROGRAMS = orcc orc-bugreport
+SOURCES = orcc.c orc-bugreport.c
+
+bin_PROGRAMS = orcc
+
+if BUILD_TESTS
+# orc-bugreport depends on liborc_test
+bin_PROGRAMS += orc-bugreport
+endif
 
 AM_CFLAGS = $(ORC_CFLAGS)
 LDADD = $(ORC_LIBS)