From df2b4690a202db572828a1aaa53935a4e10bae17 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 30 Mar 2020 12:29:41 +0900 Subject: [PATCH 01/36] Change the package version --- azure-pipelines.yml | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a40c102..c7e3a79 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,7 +6,7 @@ # this notice are preserved. This file is offered as-is, without any warranty. --- variables: - package.distName: libvm68k-2-alpha.1 + package.distName: libvm68k-2-alpha.2 trigger: - master - release/* diff --git a/configure.ac b/configure.ac index 6f6ab3d..1730639 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([libvm68k], [2-alpha.1], +AC_INIT([libvm68k], [2-alpha.2], [https://bitbucket.org/vx68k/libvm68k/issues/new],, [https://www.vx68k.org/vx68k/libvm68k]) AC_CONFIG_SRCDIR([src/context.cpp]) From f8031d79b66d061bec54adbcbac991ca259930d1 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 30 Mar 2020 12:37:15 +0900 Subject: [PATCH 02/36] Added tag release/2-alpha.1 for changeset 0b9aff908790 --- .hgtags | 1 + 1 file changed, 1 insertion(+) create mode 100644 .hgtags diff --git a/.hgtags b/.hgtags new file mode 100644 index 0000000..4af4d63 --- /dev/null +++ b/.hgtags @@ -0,0 +1 @@ +0b9aff908790e0dc941587209eb3a9ce1057004e release/2-alpha.1 From 2ed8c147aa5f4126aef231f785a5e83a7459fb2c Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 30 Mar 2020 12:44:24 +0900 Subject: [PATCH 03/36] Deconfigure the default build task --- .vscode/tasks.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 37847ab..4ad7c94 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -8,10 +8,7 @@ "args": [ "check" ], - "group": { - "kind": "build", - "isDefault": true - }, + "group": "build", "problemMatcher": [ "$gcc" ] From 78ed1f2ff01073580d633df29df0392e4aa941f6 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 30 Mar 2020 12:44:41 +0900 Subject: [PATCH 04/36] Add comments --- setupkeys.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setupkeys.sh b/setupkeys.sh index 779f4e7..b77d904 100755 --- a/setupkeys.sh +++ b/setupkeys.sh @@ -6,6 +6,12 @@ # permitted in any medium without royalty provided the copyright notice and # this notice are preserved. This file is offered as-is, without any warranty. +# This script set up GnuPG keys for automated signing. +# +# The signing keys are imported from the file given as the first parameter. +# It also reads a passphrase from the standard input for the key specified by +# the 'GPG_KEYNAME' environment variable. + export GNUPGHOME=${GNUPGHOME:-$HOME/.gnupg} mkdir -p -m go-rwx "$GNUPGHOME" From c80a04802ea0251a49fe70c2e234bb9d56e25978 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Tue, 31 Mar 2020 20:21:03 +0900 Subject: [PATCH 05/36] Define '_VM68KAPI_IMPLEMENTATION' for libvm68kapi.la --- libvm68kapi/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvm68kapi/Makefile.am b/libvm68kapi/Makefile.am index 7354209..e0de4a4 100644 --- a/libvm68kapi/Makefile.am +++ b/libvm68kapi/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in. -AM_CPPFLAGS = +AM_CPPFLAGS = -D_VM68KAPI_IMPLEMENTATION lib_LTLIBRARIES = libvm68kapi.la From 1520bba5f3645d955f12a762dfe0bf596b77af85 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Tue, 31 Mar 2020 20:23:22 +0900 Subject: [PATCH 06/36] Update class 'ContextTests' --- test/testcontext.cpp | 52 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/test/testcontext.cpp b/test/testcontext.cpp index 8aa5efc..0ca7f45 100644 --- a/test/testcontext.cpp +++ b/test/testcontext.cpp @@ -30,33 +30,65 @@ #include #include -using namespace std; -using namespace vm68k; +using std::unique_ptr; +using std::shared_ptr; +using std::make_shared; using CppUnit::TestFixture; +using namespace vm68k; + +namespace +{ + class test_memory_map final : public memory_map + { + using inherited = memory_map; + + private: + unique_ptr _memory; + + public: + test_memory_map() + : _memory {new read_write_memory(0x10000)} + { + } + + public: + void read(mode mode, address_type address, size_type size, + void *buffer) override + { + _memory->read(mode, address, size, buffer); + } + + void write(mode mode, address_type address, size_type size, + const void *buffer) override + { + _memory->write(mode, address, size, buffer); + } + }; +} /* - * Tests for 'memory_map'. + * Tests for class 'context'. */ class ContextTests : public TestFixture { CPPUNIT_TEST_SUITE(ContextTests); CPPUNIT_TEST(testMemory); CPPUNIT_TEST_SUITE_END(); +private: + shared_ptr _context; + public: void setUp() override { - // auto memory = make_shared(); - // context = make_shared(move(memory)); + auto memory = make_shared(); + _context.reset(new context(memory)); } void tearDown() override { - context.reset(); + _context.reset(); } void testMemory() { - CPPUNIT_ASSERT(context->memory() != NULL); + CPPUNIT_ASSERT(_context->memory() != NULL); } - -protected: - shared_ptr context; }; CPPUNIT_TEST_SUITE_REGISTRATION(ContextTests); From cc0fe38ae1e2c7ccf874c99b5fe9ed907a7c8ccc Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Tue, 31 Mar 2020 20:24:41 +0900 Subject: [PATCH 07/36] Remove 'context.test' from 'XFAIL_TESTS' --- test/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/test/Makefile.am b/test/Makefile.am index 6107541..891e9ae 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -14,7 +14,6 @@ check_PROGRAMS = data.test memory.test context.test TEST_LOG_COMPILER = ./runtest TESTS += $(check_PROGRAMS) -XFAIL_TESTS += context.test CLEANFILES += $(check_SCRIPTS) test-reports/* endif From 0cdcaacc52acf943d927e5c4651586bd864c1e1b Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Tue, 28 Apr 2020 20:34:53 +0900 Subject: [PATCH 08/36] Add 'LT_PREREQ' --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 1730639..cb6388c 100644 --- a/configure.ac +++ b/configure.ac @@ -6,9 +6,9 @@ AC_INIT([libvm68k], [2-alpha.2], AC_CONFIG_SRCDIR([src/context.cpp]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) +LT_PREREQ([2.4.6]) +LT_INIT() AM_INIT_AUTOMAKE([no-define]) -LT_INIT - # Checks for programs. AC_PROG_CC AC_PROG_CXX From f6e3d7e41fa8785581f8ebddf9fc1133111400da Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Tue, 28 Apr 2020 20:35:19 +0900 Subject: [PATCH 09/36] Remove blank lines --- configure.ac | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index cb6388c..981dc4c 100644 --- a/configure.ac +++ b/configure.ac @@ -12,17 +12,13 @@ AM_INIT_AUTOMAKE([no-define]) # Checks for programs. AC_PROG_CC AC_PROG_CXX - # Checks for libraries. - # Checks for header files. - # Checks for typedefs, structures, and compiler characteristics. - # Checks for library functions. PKG_CHECK_MODULES([CPPUNIT], [cppunit],, [no_cppunit=yes]) AM_CONDITIONAL([CPPUNIT], [test "$no_cppunit" != yes]) - +# Configuration actions. AC_CONFIG_FILES([Makefile config/Makefile libvm68kapi/Makefile src/Makefile test/Makefile]) AC_CONFIG_HEADERS([config.h]) From fab4eed14b4cf1804c909ef03e34771a1bed7472 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Tue, 28 Apr 2020 20:39:14 +0900 Subject: [PATCH 10/36] Change automake options --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 981dc4c..2f6dbe0 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,7 @@ AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) LT_PREREQ([2.4.6]) LT_INIT() -AM_INIT_AUTOMAKE([no-define]) +AM_INIT_AUTOMAKE([foreign no-define tar-ustar]) # Checks for programs. AC_PROG_CC AC_PROG_CXX From 534bb4ea975ce9187cef6dbfc743ea0df1054209 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Tue, 28 Apr 2020 21:41:59 +0900 Subject: [PATCH 11/36] Modify the ignore file lists --- .gitignore | 13 ++++++------- .hgignore | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 968249e..88812f3 100644 --- a/.gitignore +++ b/.gitignore @@ -14,13 +14,12 @@ config.h.in configure aclocal.m4 stamp-* -**/Debug/ -**/Release/ -**/LibrarySupport/ -**/.libs/ -**/.deps/ -**/nbproject/private/ -**/_build/ +Debug +Release +.libs +.deps +LibrarySupport +_build *@quot.po *@boldquot.po *.insert-header diff --git a/.hgignore b/.hgignore index a293a96..106af74 100644 --- a/.hgignore +++ b/.hgignore @@ -15,13 +15,12 @@ syntax: regexp (^|/)configure$ (^|/)aclocal\.m4$ (^|/)stamp-[^/]*$ -(^|/)Debug/ -(^|/)Release/ -(^|/)LibrarySupport/ -(^|/)\.libs/ -(^|/)\.deps/ -(^|/)nbproject/private/ -(^|/)_build/ +(^|/)Debug$ +(^|/)Release$ +(^|/)\.libs$ +(^|/)\.deps$ +(^|/)LibrarySupport$ +(^|/)_build$ @quot\.po$ @boldquot\.po$ \.insert-header$ From e0477cc0f29271ef183f5fb993f7e4b438b03128 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 10:41:15 +0900 Subject: [PATCH 12/36] Remove the '--install' option from the 'autoreconf' invocation --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c7e3a79..ef9fb8c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -34,7 +34,7 @@ stages: libcppunit-dev displayName: Install build dependencies - bash: | - autoreconf --install + autoreconf displayName: Bootstrap - bash: | ./configure --disable-static From 75e58f0a9e3496df1443d2dd19ecffb8b635e21c Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 10:55:16 +0900 Subject: [PATCH 13/36] Correct the bug reporting address --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 2f6dbe0..6b2c196 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) AC_INIT([libvm68k], [2-alpha.2], -[https://bitbucket.org/vx68k/libvm68k/issues/new],, +[https://bitbucket.org/kazssym/libvm68k/issues/new],, [https://www.vx68k.org/vx68k/libvm68k]) AC_CONFIG_SRCDIR([src/context.cpp]) AC_CONFIG_AUX_DIR([build-aux]) From 90740ac1a11b260262dd25f263a3a0f568255edb Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 11:08:09 +0900 Subject: [PATCH 14/36] Rename the '_VM68KAPI_PUBLIC' macro to '_VM68K_API_PUBLIC' --- libvm68kapi/bits/vm68k/data.h | 6 +++--- libvm68kapi/bits/vm68k/memory.h | 12 ++++++------ libvm68kapi/bits/vm68k/virtual_machine.h | 4 ++-- libvm68kapi/bits/vm68kapi.h | 12 ++++++------ 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/libvm68kapi/bits/vm68k/data.h b/libvm68kapi/bits/vm68k/data.h index d561f22..aaf5c81 100644 --- a/libvm68kapi/bits/vm68k/data.h +++ b/libvm68kapi/bits/vm68k/data.h @@ -28,7 +28,7 @@ namespace vm68k /// Byte (8-bit-wide) data. /// /// This type is trivial and standard-layout. - class _VM68KAPI_PUBLIC byte + class _VM68K_API_PUBLIC byte { public: using int_type = std::int8_t; @@ -89,7 +89,7 @@ namespace vm68k /// Word (16-bit-wide) data. /// /// This type is trivial and standard-layout. - class _VM68KAPI_PUBLIC word + class _VM68K_API_PUBLIC word { public: using int_type = std::int16_t; @@ -152,7 +152,7 @@ namespace vm68k /// Long word (32-bit-wide) data. /// /// This type is trivial and standard-layout. - class _VM68KAPI_PUBLIC long_word + class _VM68K_API_PUBLIC long_word { public: using int_type = std::int32_t; diff --git a/libvm68kapi/bits/vm68k/memory.h b/libvm68kapi/bits/vm68k/memory.h index fe73c85..8763363 100644 --- a/libvm68kapi/bits/vm68k/memory.h +++ b/libvm68kapi/bits/vm68k/memory.h @@ -30,7 +30,7 @@ namespace vm68k * Kaz Nishimura * 2.0 */ - class _VM68KAPI_PUBLIC memory + class _VM68K_API_PUBLIC memory { public: enum mode @@ -76,7 +76,7 @@ namespace vm68k }; /// Read-write memory. - class _VM68KAPI_PUBLIC read_write_memory : public memory + class _VM68K_API_PUBLIC read_write_memory : public memory { using inherited = memory; @@ -123,7 +123,7 @@ namespace vm68k * Kaz Nishimura * 2.0 */ - class _VM68KAPI_PUBLIC memory_map + class _VM68K_API_PUBLIC memory_map { public: using mode = memory::mode; @@ -152,7 +152,7 @@ namespace vm68k const void *bytes) = 0; }; - class _VM68KAPI_PUBLIC memory_exception : public std::exception { + class _VM68K_API_PUBLIC memory_exception : public std::exception { typedef std::exception inherited; public: @@ -167,7 +167,7 @@ namespace vm68k memory_map::address_type _error_address; }; - class _VM68KAPI_PUBLIC bus_error : public memory_exception { + class _VM68K_API_PUBLIC bus_error : public memory_exception { typedef memory_exception inherited; public: @@ -177,7 +177,7 @@ namespace vm68k const char *what() const noexcept override; }; - class _VM68KAPI_PUBLIC address_error : public memory_exception { + class _VM68K_API_PUBLIC address_error : public memory_exception { typedef memory_exception inherited; public: diff --git a/libvm68kapi/bits/vm68k/virtual_machine.h b/libvm68kapi/bits/vm68k/virtual_machine.h index d91e529..33ef54e 100644 --- a/libvm68kapi/bits/vm68k/virtual_machine.h +++ b/libvm68kapi/bits/vm68k/virtual_machine.h @@ -26,7 +26,7 @@ namespace vm68k { /// Abstract device. - class _VM68KAPI_PUBLIC device + class _VM68K_API_PUBLIC device { protected: device(); @@ -43,7 +43,7 @@ namespace vm68k }; /// Virtual machine. - class _VM68KAPI_PUBLIC virtual_machine + class _VM68K_API_PUBLIC virtual_machine { private: std::shared_ptr _memory_map; diff --git a/libvm68kapi/bits/vm68kapi.h b/libvm68kapi/bits/vm68kapi.h index db9330c..44d8635 100644 --- a/libvm68kapi/bits/vm68kapi.h +++ b/libvm68kapi/bits/vm68kapi.h @@ -19,24 +19,24 @@ #ifndef _VM68KAPI_H #define _VM68KAPI_H 1 -#ifndef _VM68KAPI_PUBLIC +#ifndef _VM68K_API_PUBLIC #if _WIN32 #if VM68KAPI_DLL -#define _VM68KAPI_PUBLIC __declspec(dllexport) +#define _VM68K_API_PUBLIC __declspec(dllexport) #else -#define _VM68KAPI_PUBLIC __declspec(dllimport) +#define _VM68K_API_PUBLIC __declspec(dllimport) #endif #else /* !_WIN32 */ #if defined __has_attribute #if __has_attribute(visibility) -#define _VM68KAPI_PUBLIC __attribute__((visibility("default"))) +#define _VM68K_API_PUBLIC __attribute__((visibility("default"))) #endif #endif /* defined __has_attribute */ #endif /* !_WIN32 */ #endif -#ifndef _VM68KAPI_PUBLIC -#define _VM68KAPI_PUBLIC +#ifndef _VM68K_API_PUBLIC +#define _VM68K_API_PUBLIC #endif #endif From b1439c9385a39235fd7a55fd5003a1e72c138888 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 11:13:29 +0900 Subject: [PATCH 15/36] Move the 'Rebuild' task to group 'none' --- .vscode/tasks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 4ad7c94..0ee1359 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -21,7 +21,7 @@ "clean", "check" ], - "group": "build", + "group": "none", "problemMatcher": [ "$gcc" ] From 048e6464d5b3c845a39517d197e63f002a4baae1 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 11:14:07 +0900 Subject: [PATCH 16/36] Modify properties for GCC --- .vscode/c_cpp_properties.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 95b3bd1..be64c2e 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -1,7 +1,8 @@ { "configurations": [ { - "name": "POSIX", + "name": "POSIX (GCC)", + "compilerPath": "/usr/bin/gcc", "includePath": [ "${workspaceFolder}", "${workspaceFolder}/libvm68kapi", From e98d8a03dd760ced43d45583dfe1f7bfd8eca2d1 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 11:17:19 +0900 Subject: [PATCH 17/36] Add new file 'vm68kapi.pc.in' --- libvm68kapi/vm68kapi.pc.in | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 libvm68kapi/vm68kapi.pc.in diff --git a/libvm68kapi/vm68kapi.pc.in b/libvm68kapi/vm68kapi.pc.in new file mode 100644 index 0000000..81550c8 --- /dev/null +++ b/libvm68kapi/vm68kapi.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +includedir=@includedir@ +libdir=@libdir@ + +Name: vm68kapi +Description: libvm68kapi +Version: @VERSION@ +Cflags: -I${includedir} +Libs: -L${libdir} -lvm68kapi From e2247d0da8f612e72ca384c2d510db031a620d7b Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 11:32:30 +0900 Subject: [PATCH 18/36] Add a rule to produce a 'vm68kapi.pc' file --- libvm68kapi/Makefile.am | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libvm68kapi/Makefile.am b/libvm68kapi/Makefile.am index e0de4a4..8aa1e55 100644 --- a/libvm68kapi/Makefile.am +++ b/libvm68kapi/Makefile.am @@ -2,11 +2,22 @@ AM_CPPFLAGS = -D_VM68KAPI_IMPLEMENTATION +pkgconfigdir = $(libdir)/pkgconfig + lib_LTLIBRARIES = libvm68kapi.la +EXTRA_DIST = vm68kapi.pc.in + +pkgconfig_DATA = vm68kapi.pc + nobase_include_HEADERS = vm68k/data vm68k/memory \ bits/vm68kapi.h bits/vm68k/data.h bits/vm68k/memory.h \ bits/vm68k/virtual_machine.h libvm68kapi_la_LDFLAGS = -version-info 1:0:0 libvm68kapi_la_SOURCES = data.cpp memory.cpp virtual_machine.cpp + +CLEANFILES = $(pkgconfig_DATA) + +vm68kapi.pc: $(srcdir)/vm68kapi.pc.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status --file=$(subdir)/$@ From 251214cf61b0a830f0353ebad07ba602f3d5d087 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 11:35:46 +0900 Subject: [PATCH 19/36] Update the ignore list [skip ci] --- .gitignore | 1 + .hgignore | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 88812f3..87ab05d 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ _build *.gmo *.trs *.log +*.pc *.lo *.o *.tvsconfig diff --git a/.hgignore b/.hgignore index 106af74..2f55f22 100644 --- a/.hgignore +++ b/.hgignore @@ -27,6 +27,7 @@ syntax: regexp \.gmo$ \.trs$ \.log$ +\.pc$ \.lo$ \.o$ \.tvsconfig$ From 053d30460c8d414d4e5caef6774d98f68db0a025 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 14:52:42 +0900 Subject: [PATCH 20/36] Change the extension for test files --- test/Makefile.am | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 891e9ae..3f98b66 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,42 +1,46 @@ ## Process this file with automake to produce Makefile.in. -AM_CPPFLAGS = -DTEST -I$(top_builddir)/src -I$(top_srcdir)/src \ +AM_CPPFLAGS = -DTEST -I$(top_srcdir)/src -I$(top_builddir)/src \ -I$(top_srcdir)/libvm68kapi -I$(top_builddir)/libvm68kapi AM_CXXFLAGS = $(CPPUNIT_CFLAGS) +TEST_EXTENSIONS = TESTS = XFAIL_TESTS = CLEANFILES = if CPPUNIT +check_PROGRAMS = test_data.exec test_memory.exec test_context.exec check_SCRIPTS = runtest -check_PROGRAMS = data.test memory.test context.test -TEST_LOG_COMPILER = ./runtest +EXEC_TEST_LOG_COMPILER = ./runtest +TEST_EXTENSIONS += .exec TESTS += $(check_PROGRAMS) + CLEANFILES += $(check_SCRIPTS) test-reports/* endif EXTRA_PROGRAMS = vm68k_test +noinst_HEADERS = xmlout.h Test_vm68kdata.h Test_vm68kmem.h -data_test_LDFLAGS = -no-install -data_test_SOURCES = testmain.cpp xmlout.cpp testdata.cpp -data_test_LDADD = $(top_builddir)/libvm68kapi/libvm68kapi.la $(CPPUNIT_LIBS) +test_data_exec_LDFLAGS = -no-install +test_data_exec_SOURCES = testmain.cpp xmlout.cpp testdata.cpp +test_data_exec_LDADD = $(top_builddir)/libvm68kapi/libvm68kapi.la \ +$(CPPUNIT_LIBS) -memory_test_LDFLAGS = -no-install -memory_test_SOURCES = testmain.cpp xmlout.cpp testmemory.cpp -memory_test_LDADD = $(top_builddir)/libvm68kapi/libvm68kapi.la $(CPPUNIT_LIBS) +test_memory_exec_LDFLAGS = -no-install +test_memory_exec_SOURCES = testmain.cpp xmlout.cpp testmemory.cpp +test_memory_exec_LDADD = $(top_builddir)/libvm68kapi/libvm68kapi.la \ +$(CPPUNIT_LIBS) -context_test_LDFLAGS = -no-install -context_test_SOURCES = testmain.cpp xmlout.cpp testcontext.cpp -context_test_LDADD = $(top_builddir)/src/libvm68k.la \ +test_context_exec_LDFLAGS = -no-install +test_context_exec_SOURCES = testmain.cpp xmlout.cpp testcontext.cpp +test_context_exec_LDADD = $(top_builddir)/src/libvm68k.la \ $(top_builddir)/libvm68kapi/libvm68kapi.la $(CPPUNIT_LIBS) vm68k_test_SOURCES = vm68k_test.cpp Test_vm68kdata.cpp Test_vm68kmem.cpp vm68k_test_LDADD = ../src/libvm68k.la -noinst_HEADERS = xmlout.h Test_vm68kdata.h Test_vm68kmem.h - EXTRA_DIST = runtest.in vm68k_test.cbproj runtest: runtest.in Makefile From bd1f720190018fb22bc1a20c0ac2712276da0b1c Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 14:54:45 +0900 Subject: [PATCH 21/36] Update the ignore list --- .gitignore | 6 +++--- .hgignore | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 88812f3..86bb0e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ -test/test-reports/ -test/*.test -test/runtest +TEST-*.xml +test_*.exec +runtest libvm68k.la libvm68kapi.la remove-potcdate.sed diff --git a/.hgignore b/.hgignore index 106af74..809ded9 100644 --- a/.hgignore +++ b/.hgignore @@ -1,7 +1,7 @@ syntax: regexp -^test/test-reports/ -^test/[^/]*\.test$ -^test/runtest$ +(^|/)TEST-[^/]*\.xml$ +(^|/)test_[^/]*\.exec$ +(^|/)runtest$ (^|/)libvm68k\.la$ (^|/)libvm68kapi\.la$ (^|/)remove-potcdate\.sed$ From e11136885ebf47fa42b5c67315acdb84cb24920a Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 15:02:35 +0900 Subject: [PATCH 22/36] Use the 'clean-local' target to remove test reports --- test/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/Makefile.am b/test/Makefile.am index 3f98b66..416ed6b 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -17,7 +17,7 @@ EXEC_TEST_LOG_COMPILER = ./runtest TEST_EXTENSIONS += .exec TESTS += $(check_PROGRAMS) -CLEANFILES += $(check_SCRIPTS) test-reports/* +CLEANFILES += $(check_SCRIPTS) endif EXTRA_PROGRAMS = vm68k_test @@ -46,3 +46,6 @@ EXTRA_DIST = runtest.in vm68k_test.cbproj runtest: runtest.in Makefile cat < $(srcdir)/runtest.in > $@ chmod +x $@ + +clean-local: + rm -rf test-reports From e33477d0ad3c23b6e50a55d5cc17cbb99b5a32cb Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 15:16:35 +0900 Subject: [PATCH 23/36] Rename test source files --- test/Makefile.am | 8 ++++---- test/{testmain.cpp => main.cpp} | 6 +++--- test/{testcontext.cpp => test_context.cpp} | 2 +- test/{testdata.cpp => test_data.cpp} | 2 +- test/{testmemory.cpp => test_memory.cpp} | 2 +- test/{xmlout.cpp => xmlreport.cpp} | 4 ++-- test/{xmlout.h => xmlreport.h} | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) rename test/{testmain.cpp => main.cpp} (95%) rename test/{testcontext.cpp => test_context.cpp} (99%) rename test/{testdata.cpp => test_data.cpp} (99%) rename test/{testmemory.cpp => test_memory.cpp} (99%) rename test/{xmlout.cpp => xmlreport.cpp} (98%) rename test/{xmlout.h => xmlreport.h} (96%) diff --git a/test/Makefile.am b/test/Makefile.am index 416ed6b..20f7f3e 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -21,22 +21,22 @@ CLEANFILES += $(check_SCRIPTS) endif EXTRA_PROGRAMS = vm68k_test -noinst_HEADERS = xmlout.h Test_vm68kdata.h Test_vm68kmem.h +noinst_HEADERS = xmlreport.h Test_vm68kdata.h Test_vm68kmem.h test_data_exec_LDFLAGS = -no-install -test_data_exec_SOURCES = testmain.cpp xmlout.cpp testdata.cpp test_data_exec_LDADD = $(top_builddir)/libvm68kapi/libvm68kapi.la \ $(CPPUNIT_LIBS) +test_data_exec_SOURCES = main.cpp xmlreport.cpp test_data.cpp test_memory_exec_LDFLAGS = -no-install -test_memory_exec_SOURCES = testmain.cpp xmlout.cpp testmemory.cpp test_memory_exec_LDADD = $(top_builddir)/libvm68kapi/libvm68kapi.la \ $(CPPUNIT_LIBS) +test_memory_exec_SOURCES = main.cpp xmlreport.cpp test_memory.cpp test_context_exec_LDFLAGS = -no-install -test_context_exec_SOURCES = testmain.cpp xmlout.cpp testcontext.cpp test_context_exec_LDADD = $(top_builddir)/src/libvm68k.la \ $(top_builddir)/libvm68kapi/libvm68kapi.la $(CPPUNIT_LIBS) +test_context_exec_SOURCES = main.cpp xmlreport.cpp test_context.cpp vm68k_test_SOURCES = vm68k_test.cpp Test_vm68kdata.cpp Test_vm68kmem.cpp vm68k_test_LDADD = ../src/libvm68k.la diff --git a/test/testmain.cpp b/test/main.cpp similarity index 95% rename from test/testmain.cpp rename to test/main.cpp index 89358d0..5168ae0 100644 --- a/test/testmain.cpp +++ b/test/main.cpp @@ -1,5 +1,5 @@ -// testmain.cpp -// Copyright (C) 2012-2019 Kaz Nishimura +// main.cpp +// Copyright (C) 2012-2020 Kaz Nishimura // // This program is free software: you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by the Free @@ -23,7 +23,7 @@ #pragma hdrstop #endif -#include "xmlout.h" +#include "xmlreport.h" #include #include #include diff --git a/test/testcontext.cpp b/test/test_context.cpp similarity index 99% rename from test/testcontext.cpp rename to test/test_context.cpp index 0ca7f45..c61584c 100644 --- a/test/testcontext.cpp +++ b/test/test_context.cpp @@ -1,4 +1,4 @@ -// testcontext.cpp +// test_context.cpp // Copyright (C) 2012-2019 Kaz Nishimura // // This program is free software: you can redistribute it and/or modify it diff --git a/test/testdata.cpp b/test/test_data.cpp similarity index 99% rename from test/testdata.cpp rename to test/test_data.cpp index 6c41efa..98a9423 100644 --- a/test/testdata.cpp +++ b/test/test_data.cpp @@ -1,4 +1,4 @@ -// testdata.cpp +// test_data.cpp // Copyright (C) 2012-2020 Kaz Nishimura // // This program is free software: you can redistribute it and/or modify it diff --git a/test/testmemory.cpp b/test/test_memory.cpp similarity index 99% rename from test/testmemory.cpp rename to test/test_memory.cpp index 8dd457b..720c3d8 100644 --- a/test/testmemory.cpp +++ b/test/test_memory.cpp @@ -1,4 +1,4 @@ -// testmemory.cpp +// test_memory.cpp // Copyright (C) 2012-2019 Kaz Nishimura // // This program is free software: you can redistribute it and/or modify it diff --git a/test/xmlout.cpp b/test/xmlreport.cpp similarity index 98% rename from test/xmlout.cpp rename to test/xmlreport.cpp index 73be54a..2c4dd72 100644 --- a/test/xmlout.cpp +++ b/test/xmlreport.cpp @@ -1,4 +1,4 @@ -// xmlout.cpp +// xmlreport.cpp // Copyright (C) 2020 Kaz Nishimura // // This program is free software: you can redistribute it and/or modify it @@ -20,7 +20,7 @@ #include #endif -#include "xmlout.h" +#include "xmlreport.h" #include #include #include diff --git a/test/xmlout.h b/test/xmlreport.h similarity index 96% rename from test/xmlout.h rename to test/xmlreport.h index cadf802..bc9f9fa 100644 --- a/test/xmlout.h +++ b/test/xmlreport.h @@ -1,4 +1,4 @@ -// xmlout.h +// xmlreport.h // Copyright (C) 2020 Kaz Nishimura // // This program is free software: you can redistribute it and/or modify it @@ -16,8 +16,8 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -#ifndef XMLOUT_H -#define XMLOUT_H 1 +#ifndef XMLREPORT_H +#define XMLREPORT_H 1 #include #include From 27aa9e4c21dc8a3f042d73ee4359d80e0d84bf13 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 15:37:07 +0900 Subject: [PATCH 24/36] Add a 'installcheck-local' target --- libvm68kapi/Makefile.am | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libvm68kapi/Makefile.am b/libvm68kapi/Makefile.am index 8aa1e55..15d3aee 100644 --- a/libvm68kapi/Makefile.am +++ b/libvm68kapi/Makefile.am @@ -21,3 +21,7 @@ CLEANFILES = $(pkgconfig_DATA) vm68kapi.pc: $(srcdir)/vm68kapi.pc.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status --file=$(subdir)/$@ + +installcheck-local: + export PKG_CONFIG_PATH=$(pkgconfigdir); \ + pkg-config --exists --exact-version=$(VERSION) vm68kapi From efeb5de5d1d1cf2af8ea9ae8eaa358eb917f8b03 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 16:18:09 +0900 Subject: [PATCH 25/36] Rename the 'src' directory to 'libvm68k' --- Makefile.am | 2 +- configure.ac | 4 ++-- {src => libvm68k}/Makefile.am | 0 {src => libvm68k}/ModelSupport_vm68k/default.txaPackage | 0 {src => libvm68k}/ModelSupport_vm68k/default.txvpck | 0 .../ModelSupport_vm68k/vm68k/default.txaPackage | 0 {src => libvm68k}/ModelSupport_vm68k/vm68k/default.txvpck | 0 {src => libvm68k}/bits/vm68k/context.h | 0 {src => libvm68k}/bits/vm68k/register.h | 0 {src => libvm68k}/bits/vm68kcore.h | 0 {src => libvm68k}/context.cpp | 0 {src => libvm68k}/vm68k.cbproj | 0 {src => libvm68k}/vm68k/context | 0 {src => libvm68k}/vm68kPCH1.h | 0 {src => libvm68k}/win32dll.cpp | 0 test/Makefile.am | 6 +++--- 16 files changed, 6 insertions(+), 6 deletions(-) rename {src => libvm68k}/Makefile.am (100%) rename {src => libvm68k}/ModelSupport_vm68k/default.txaPackage (100%) rename {src => libvm68k}/ModelSupport_vm68k/default.txvpck (100%) rename {src => libvm68k}/ModelSupport_vm68k/vm68k/default.txaPackage (100%) rename {src => libvm68k}/ModelSupport_vm68k/vm68k/default.txvpck (100%) rename {src => libvm68k}/bits/vm68k/context.h (100%) rename {src => libvm68k}/bits/vm68k/register.h (100%) rename {src => libvm68k}/bits/vm68kcore.h (100%) rename {src => libvm68k}/context.cpp (100%) rename {src => libvm68k}/vm68k.cbproj (100%) rename {src => libvm68k}/vm68k/context (100%) rename {src => libvm68k}/vm68kPCH1.h (100%) rename {src => libvm68k}/win32dll.cpp (100%) diff --git a/Makefile.am b/Makefile.am index 5c5d2ba..8bb7389 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -Im4 -SUBDIRS = config libvm68kapi src test +SUBDIRS = config libvm68kapi libvm68k test EXTRA_DIST = libvm68k.groupproj diff --git a/configure.ac b/configure.ac index 6b2c196..745c364 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.69]) AC_INIT([libvm68k], [2-alpha.2], [https://bitbucket.org/kazssym/libvm68k/issues/new],, [https://www.vx68k.org/vx68k/libvm68k]) -AC_CONFIG_SRCDIR([src/context.cpp]) +AC_CONFIG_SRCDIR([libvm68k/context.cpp]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) LT_PREREQ([2.4.6]) @@ -20,6 +20,6 @@ PKG_CHECK_MODULES([CPPUNIT], [cppunit],, [no_cppunit=yes]) AM_CONDITIONAL([CPPUNIT], [test "$no_cppunit" != yes]) # Configuration actions. AC_CONFIG_FILES([Makefile config/Makefile libvm68kapi/Makefile -src/Makefile test/Makefile]) +libvm68k/Makefile test/Makefile]) AC_CONFIG_HEADERS([config.h]) AC_OUTPUT diff --git a/src/Makefile.am b/libvm68k/Makefile.am similarity index 100% rename from src/Makefile.am rename to libvm68k/Makefile.am diff --git a/src/ModelSupport_vm68k/default.txaPackage b/libvm68k/ModelSupport_vm68k/default.txaPackage similarity index 100% rename from src/ModelSupport_vm68k/default.txaPackage rename to libvm68k/ModelSupport_vm68k/default.txaPackage diff --git a/src/ModelSupport_vm68k/default.txvpck b/libvm68k/ModelSupport_vm68k/default.txvpck similarity index 100% rename from src/ModelSupport_vm68k/default.txvpck rename to libvm68k/ModelSupport_vm68k/default.txvpck diff --git a/src/ModelSupport_vm68k/vm68k/default.txaPackage b/libvm68k/ModelSupport_vm68k/vm68k/default.txaPackage similarity index 100% rename from src/ModelSupport_vm68k/vm68k/default.txaPackage rename to libvm68k/ModelSupport_vm68k/vm68k/default.txaPackage diff --git a/src/ModelSupport_vm68k/vm68k/default.txvpck b/libvm68k/ModelSupport_vm68k/vm68k/default.txvpck similarity index 100% rename from src/ModelSupport_vm68k/vm68k/default.txvpck rename to libvm68k/ModelSupport_vm68k/vm68k/default.txvpck diff --git a/src/bits/vm68k/context.h b/libvm68k/bits/vm68k/context.h similarity index 100% rename from src/bits/vm68k/context.h rename to libvm68k/bits/vm68k/context.h diff --git a/src/bits/vm68k/register.h b/libvm68k/bits/vm68k/register.h similarity index 100% rename from src/bits/vm68k/register.h rename to libvm68k/bits/vm68k/register.h diff --git a/src/bits/vm68kcore.h b/libvm68k/bits/vm68kcore.h similarity index 100% rename from src/bits/vm68kcore.h rename to libvm68k/bits/vm68kcore.h diff --git a/src/context.cpp b/libvm68k/context.cpp similarity index 100% rename from src/context.cpp rename to libvm68k/context.cpp diff --git a/src/vm68k.cbproj b/libvm68k/vm68k.cbproj similarity index 100% rename from src/vm68k.cbproj rename to libvm68k/vm68k.cbproj diff --git a/src/vm68k/context b/libvm68k/vm68k/context similarity index 100% rename from src/vm68k/context rename to libvm68k/vm68k/context diff --git a/src/vm68kPCH1.h b/libvm68k/vm68kPCH1.h similarity index 100% rename from src/vm68kPCH1.h rename to libvm68k/vm68kPCH1.h diff --git a/src/win32dll.cpp b/libvm68k/win32dll.cpp similarity index 100% rename from src/win32dll.cpp rename to libvm68k/win32dll.cpp diff --git a/test/Makefile.am b/test/Makefile.am index 20f7f3e..8241b5e 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in. -AM_CPPFLAGS = -DTEST -I$(top_srcdir)/src -I$(top_builddir)/src \ +AM_CPPFLAGS = -DTEST -I$(top_srcdir)/libvm68k -I$(top_builddir)/libvm68k \ -I$(top_srcdir)/libvm68kapi -I$(top_builddir)/libvm68kapi AM_CXXFLAGS = $(CPPUNIT_CFLAGS) @@ -34,12 +34,12 @@ $(CPPUNIT_LIBS) test_memory_exec_SOURCES = main.cpp xmlreport.cpp test_memory.cpp test_context_exec_LDFLAGS = -no-install -test_context_exec_LDADD = $(top_builddir)/src/libvm68k.la \ +test_context_exec_LDADD = $(top_builddir)/libvm68k/libvm68k.la \ $(top_builddir)/libvm68kapi/libvm68kapi.la $(CPPUNIT_LIBS) test_context_exec_SOURCES = main.cpp xmlreport.cpp test_context.cpp vm68k_test_SOURCES = vm68k_test.cpp Test_vm68kdata.cpp Test_vm68kmem.cpp -vm68k_test_LDADD = ../src/libvm68k.la +vm68k_test_LDADD = ../libvm68k/libvm68k.la EXTRA_DIST = runtest.in vm68k_test.cbproj From 721b520dcd662c2102e35646078b9e3836e7d114 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 16:22:13 +0900 Subject: [PATCH 26/36] Remove the 'config' directory --- Makefile.am | 4 ++-- config/Makefile.am | 1 - configure.ac | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 config/Makefile.am diff --git a/Makefile.am b/Makefile.am index 8bb7389..63f065f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,10 +5,10 @@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -Im4 -SUBDIRS = config libvm68kapi libvm68k test - EXTRA_DIST = libvm68k.groupproj +SUBDIRS = libvm68kapi libvm68k test + dist-hook: $(distdir)/SHA256SUMS if test -n "$$GPG_USERNAME"; then \ gpg -ba -u "$$GPG_USERNAME" $(distdir)/SHA256SUMS; \ diff --git a/config/Makefile.am b/config/Makefile.am deleted file mode 100644 index 05ab994..0000000 --- a/config/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -## Process this file with automake to produce Makefile.in. diff --git a/configure.ac b/configure.ac index 745c364..a2c9f46 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ AC_PROG_CXX PKG_CHECK_MODULES([CPPUNIT], [cppunit],, [no_cppunit=yes]) AM_CONDITIONAL([CPPUNIT], [test "$no_cppunit" != yes]) # Configuration actions. -AC_CONFIG_FILES([Makefile config/Makefile libvm68kapi/Makefile -libvm68k/Makefile test/Makefile]) +AC_CONFIG_FILES([Makefile libvm68kapi/Makefile libvm68k/Makefile +test/Makefile]) AC_CONFIG_HEADERS([config.h]) AC_OUTPUT From 8642356832ab9f0ed38a9b4db59ac44dec749335 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 16:24:15 +0900 Subject: [PATCH 27/36] Remove the 'AUTOMAKE_OPTIONS' macro --- Makefile.am | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 63f065f..dfe932f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,5 @@ ## Process this file with automake to produce Makefile.in. -# Uses foreign for now. -AUTOMAKE_OPTIONS = foreign - ACLOCAL_AMFLAGS = -Im4 EXTRA_DIST = libvm68k.groupproj From 39f44f57e42928c070447bd650f1165e08fc28b0 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 16:34:48 +0900 Subject: [PATCH 28/36] Rename the command-line macro --- libvm68kapi/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvm68kapi/Makefile.am b/libvm68kapi/Makefile.am index e0de4a4..58f82f6 100644 --- a/libvm68kapi/Makefile.am +++ b/libvm68kapi/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in. -AM_CPPFLAGS = -D_VM68KAPI_IMPLEMENTATION +AM_CPPFLAGS = -D_VM68K_API_LIBRARY lib_LTLIBRARIES = libvm68kapi.la From 6347e18601c4675f31cda740f28dc02e04391209 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 16:38:06 +0900 Subject: [PATCH 29/36] Use 'config.status' to produce the 'runtest' script --- test/Makefile.am | 4 ++-- test/runtest.in | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 8241b5e..0ee0bc0 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -43,8 +43,8 @@ vm68k_test_LDADD = ../libvm68k/libvm68k.la EXTRA_DIST = runtest.in vm68k_test.cbproj -runtest: runtest.in Makefile - cat < $(srcdir)/runtest.in > $@ +runtest: $(srcdir)/runtest.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status --file=$(subdir)/$@ chmod +x $@ clean-local: diff --git a/test/runtest.in b/test/runtest.in index 01ec163..3f40b1a 100644 --- a/test/runtest.in +++ b/test/runtest.in @@ -1,4 +1,5 @@ #!/bin/sh +# @configure_input@ test="$1" && shift From 9c36aa3f292fc6371ff9b42cc52014007355c666 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 16:40:34 +0900 Subject: [PATCH 30/36] Add new file 'vm68k.pc.in' --- libvm68k/vm68k.pc.in | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 libvm68k/vm68k.pc.in diff --git a/libvm68k/vm68k.pc.in b/libvm68k/vm68k.pc.in new file mode 100644 index 0000000..05b9931 --- /dev/null +++ b/libvm68k/vm68k.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +includedir=@includedir@ +libdir=@libdir@ + +Name: vm68k +Description: libvm68k +Version: @VERSION@ +Requires.private: vm68kapi +Cflags: -I${includedir} +Libs: -L${libdir} -lvm68k From 80fb86eee514cd0b1826b0782450fbd7c58d81bf Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 16:48:56 +0900 Subject: [PATCH 31/36] Use the 'PKG_CONFIG' macro --- libvm68kapi/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvm68kapi/Makefile.am b/libvm68kapi/Makefile.am index 818ed75..549891d 100644 --- a/libvm68kapi/Makefile.am +++ b/libvm68kapi/Makefile.am @@ -24,4 +24,4 @@ vm68kapi.pc: $(srcdir)/vm68kapi.pc.in $(top_builddir)/config.status installcheck-local: export PKG_CONFIG_PATH=$(pkgconfigdir); \ - pkg-config --exists --exact-version=$(VERSION) vm68kapi + $(PKG_CONFIG) --exists --exact-version=$(VERSION) vm68kapi From 4b4e7633d9a85fb1f58b609b7b99dbf604185d9b Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 16:49:48 +0900 Subject: [PATCH 32/36] Produce and install the 'vm68k.pc' file --- libvm68k/Makefile.am | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/libvm68k/Makefile.am b/libvm68k/Makefile.am index ec06090..fc5212b 100644 --- a/libvm68k/Makefile.am +++ b/libvm68k/Makefile.am @@ -3,8 +3,14 @@ AM_CPPFLAGS = -I$(top_srcdir)/config \ -I$(top_srcdir)/libvm68kapi -I$(top_builddir)/libvm68kapi +pkgconfigdir = $(libdir)/pkgconfig + lib_LTLIBRARIES = libvm68k.la +EXTRA_DIST = vm68k.pc.in vm68k.cbproj ModelSupport_vm68k + +pkgconfig_DATA = vm68k.pc + libvm68k_la_LDFLAGS = -version-info 1:0:0 libvm68k_la_SOURCES = context.cpp EXTRA_libvm68k_la_SOURCES = win32dll.cpp @@ -13,4 +19,11 @@ nobase_include_HEADERS = \ bits/vm68kcore.h bits/vm68k/register.h bits/vm68k/context.h noinst_HEADERS = vm68kPCH1.h -EXTRA_DIST = vm68k.cbproj ModelSupport_vm68k +CLEANFILES = $(pkgconfig_DATA) + +vm68k.pc: $(srcdir)/vm68k.pc.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status --file=$(subdir)/$@ + +installcheck-local: + export PKG_CONFIG_PATH=$(pkgconfigdir); \ + $(PKG_CONFIG) --exists --exact-version=$(VERSION) vm68k From 77930ba8e61dfbe71c77ae9e87cbd6f2c0535adb Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 16:59:08 +0900 Subject: [PATCH 33/36] Modify to run 'pkg-config' only if available --- libvm68k/Makefile.am | 6 ++++-- libvm68kapi/Makefile.am | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/libvm68k/Makefile.am b/libvm68k/Makefile.am index fc5212b..61650d5 100644 --- a/libvm68k/Makefile.am +++ b/libvm68k/Makefile.am @@ -25,5 +25,7 @@ vm68k.pc: $(srcdir)/vm68k.pc.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status --file=$(subdir)/$@ installcheck-local: - export PKG_CONFIG_PATH=$(pkgconfigdir); \ - $(PKG_CONFIG) --exists --exact-version=$(VERSION) vm68k + if test -n '$(PKG_CONFIG)'; then \ + export PKG_CONFIG_PATH=$(pkgconfigdir); \ + $(PKG_CONFIG) --exists --exact-version=$(VERSION) vm68k; \ + fi diff --git a/libvm68kapi/Makefile.am b/libvm68kapi/Makefile.am index 549891d..d831c1c 100644 --- a/libvm68kapi/Makefile.am +++ b/libvm68kapi/Makefile.am @@ -23,5 +23,7 @@ vm68kapi.pc: $(srcdir)/vm68kapi.pc.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status --file=$(subdir)/$@ installcheck-local: - export PKG_CONFIG_PATH=$(pkgconfigdir); \ - $(PKG_CONFIG) --exists --exact-version=$(VERSION) vm68kapi + if test -n '$(PKG_CONFIG)'; then \ + export PKG_CONFIG_PATH=$(pkgconfigdir); \ + $(PKG_CONFIG) --exists --exact-version=$(VERSION) vm68kapi; \ + fi From 0775f53542142f1601df10f61df58f3e5c9459b0 Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 17:27:34 +0900 Subject: [PATCH 34/36] Update the 'includePath' list [skip ci] --- .vscode/c_cpp_properties.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index be64c2e..255b7d6 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -6,7 +6,7 @@ "includePath": [ "${workspaceFolder}", "${workspaceFolder}/libvm68kapi", - "${workspaceFolder}/src" + "${workspaceFolder}/libvm68k" ], "defines": [ "HAVE_CONFIG_H" From 0f314355604f81757d0ae727546d45e50b5f071b Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 17:43:20 +0900 Subject: [PATCH 35/36] Set 'TEST_EXTENSIONS' unconditionally --- test/Makefile.am | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 0ee0bc0..64be36a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -4,7 +4,7 @@ AM_CPPFLAGS = -DTEST -I$(top_srcdir)/libvm68k -I$(top_builddir)/libvm68k \ -I$(top_srcdir)/libvm68kapi -I$(top_builddir)/libvm68kapi AM_CXXFLAGS = $(CPPUNIT_CFLAGS) -TEST_EXTENSIONS = +TEST_EXTENSIONS = .exec TESTS = XFAIL_TESTS = CLEANFILES = @@ -14,9 +14,7 @@ check_PROGRAMS = test_data.exec test_memory.exec test_context.exec check_SCRIPTS = runtest EXEC_TEST_LOG_COMPILER = ./runtest -TEST_EXTENSIONS += .exec TESTS += $(check_PROGRAMS) - CLEANFILES += $(check_SCRIPTS) endif From 98a62866e243a0639aeedb1feddc5fbd3845aacd Mon Sep 17 00:00:00 2001 From: Kaz Nishimura Date: Mon, 4 May 2020 17:46:45 +0900 Subject: [PATCH 36/36] Use the 'SHELL' macro to invoke 'runtest' --- test/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.am b/test/Makefile.am index 64be36a..5c2da46 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -13,7 +13,7 @@ if CPPUNIT check_PROGRAMS = test_data.exec test_memory.exec test_context.exec check_SCRIPTS = runtest -EXEC_TEST_LOG_COMPILER = ./runtest +EXEC_TEST_LOG_COMPILER = $(SHELL) ./runtest TESTS += $(check_PROGRAMS) CLEANFILES += $(check_SCRIPTS) endif