From cca33e1d25508987651af3c73e3fff14959608cb Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Mon, 2 Dec 2013 21:18:44 -0500 Subject: [PATCH] Add support for as504 assembler --- configure.ac | 23 ++++++++++++++++++----- tests/Makefile.am | 13 +++++++++++-- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 3dff646..058a47a 100644 --- a/configure.ac +++ b/configure.ac @@ -50,13 +50,26 @@ fi AM_CONDITIONAL([USE_GTK], [test x${ac_cv_enable_gui} = xyes]) -dnl Try to locate asem 8051 compiler to generate test files (.hex) -AC_CHECK_PROG(ASEM_CHECK,asem,yes) -if test x"$ASEM_CHECK" != x"yes" ; then - AC_MSG_WARN([Please install asem (http://plit.de/asem-51) to run test suite.]) +dnl Try to locate valid 8051 assembler to generate test files (.hex) +run_tests=no + +AC_CHECK_PROG(AS504_CHECK,as504,yes) +if test x"$AS504_CHECK" = x"yes" ; then + run_tests=yes +fi + +AC_CHECK_PROG(ASEM51_CHECK,asem,yes) +if test x"$ASEM51_CHECK" = x"yes" ; then + run_tests=yes +fi + +if test x"$run_tests" != x"yes" ; then + AC_MSG_WARN([Please install as504 (http://www.vanwal.nl/as504/) or ASEM-51 (http://plit.de/asem-51) to run test suite.]) fi -AM_CONDITIONAL([RUN_TESTS],[test x"$ASEM_CHECK" = x"yes"]) +AM_CONDITIONAL([RUN_TESTS],[test x"$run_tests" = x"yes"]) +AM_CONDITIONAL([USE_AS504],[test x"$AS504_CHECK" = x"yes"]) +AM_CONDITIONAL([USE_AS51],[test x"$ASEM51_CHECK" = x"yes"]) AC_SUBST(CFLAGS) AC_SUBST(LIBS) diff --git a/tests/Makefile.am b/tests/Makefile.am index 6caffd7..514384f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,6 @@ # Regression tests for emu8051 +AS504 = as504 AS51 = asem SUFFIXES = .hex .asm .sh @@ -28,10 +29,18 @@ TESTS = \ @ln -sf $(srcdir)/opcodes.sh $@ # Tell make how to generate a .hex file from a .asm source file. -# Warning: make distcheck will fail because asem doesn't have option to specify -# output filename (and path): +# Warning: make distcheck will fail because asem nor as504 have option to +# specify output filename (and path): .asm.hex: +if USE_AS504 + $(AS504) -Fhex $< +else +if USE_AS51 $(AS51) $< +else + echo error +endif +endif else TESTS = -- 2.20.1