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.*" ) \
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,
-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)