+dnl Check if tests are enabled (disabled by default)
+AC_ARG_ENABLE([tests],
+ [AS_HELP_STRING([--enable-tests],[Run test suite])],
+ [run_tests=${enableval}],
+ [run_tests="no"])
+
+dnl If tests are enabled, try to locate asem 8051 compiler
+if test x"${run_tests}" = xyes; then
+ dnl Tests for 8051 assembler to generate hex test files
+ dnl TODO: add argument to specify location of asem executable...
+ AC_CHECK_PROG(ASEM_CHECK,asem,yes)
+ if test x"$ASEM_CHECK" != x"yes" ; then
+ AC_MSG_ERROR([Please install asem (http://plit.de/asem-51) to run test suite.])
+ fi
+fi
+
+AM_CONDITIONAL([RUN_TESTS],[test "x$run_tests" = "xyes"])
+