gordonjcp / sim6809

Simple 6809 emulator, adapted from work by Jerome Thoen
GNU General Public License v2.0
11 stars 2 forks source link

configure.ac possibly undefined macro #1

Open jxu opened 6 years ago

jxu commented 6 years ago

Running ./configure

./configure: line 2087: syntax error near unexpected token `config.h'
./configure: line 2087: `AM_CONFIG_HEADER(config.h)'

Running autoconf

configure.ac:8: error: possibly undefined macro: AM_CONFIG_HEADER
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:9: error: possibly undefined macro: AM_INIT_AUTOMAKE
configure.ac:15: error: possibly undefined macro: AC_MSG_ERROR

Requires autoreconf -i, then configures and makes correctly

gordonjcp commented 6 years ago

Thanks!

mjwurtz commented 3 years ago

Yes, this worked but was not enough : ld complained about double definitions. Here is a diff to make compilation working :

diff --git a/emu/calc6809.h b/emu/calc6809.h index 7951f1e..f1cdb56 100644 --- a/emu/calc6809.h +++ b/emu/calc6809.h @@ -15,13 +15,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */

-int ccc, ccv, ccz, ccn, cci, cch, ccf, cce; +extern int ccc, ccv, ccz, ccn, cci, cch, ccf, cce;

/ help to compute V bit /

ifdef BIT_V_DELAYED

-tt_u32 ccvx, ccvy, ccvz; -int ccvr, ccv8; +extern tt_u32 ccvx, ccvy, ccvz; +extern int ccvr, ccv8;

define GET_V if (!ccvr) {ccvr=1; if (ccv8) { GET_V8;} else { GET_V16;}}

define PUT_V {ccvr=1;}

@@ -53,10 +53,10 @@ int ccvr, ccv8;

define SET_NZVC8(a,b,r) {SET_NZ8(r);SET_V8(a,b,r);SET_C8(r);}

define SET_NZVC16(a,b,r) {SET_NZ16(r);SET_V16(a,b,r);SET_C16(r);}

-int addrmode; +extern int addrmode;

-tt_u16 (eaddrmodb[7])(); -tt_u16 (eaddrmodw[7])(); +extern tt_u16 (eaddrmodb[7])(); +extern tt_u16 (eaddrmodw[7])();

define GET_EAB (*eaddrmodb[addrmode])()

define GET_EAW (*eaddrmodw[addrmode])()

diff --git a/emu/emu6809.c b/emu/emu6809.c index 5d96b00..a72ffa2 100644 --- a/emu/emu6809.c +++ b/emu/emu6809.c @@ -27,6 +27,8 @@ tt_u16 rpc, rx, ry, ru, rs; tt_u8 ra, rb, rdp;

int ccc, ccv, ccz, ccn, cci, cch, ccf, cce; +tt_u32 ccvx, ccvy, ccvz; +int ccvr, ccv8;

tt_u16 *regp[] = { &rx, &ry, &ru, &rs };

diff --git a/emu/emu6809.h b/emu/emu6809.h index 7f79384..1235c25 100644 --- a/emu/emu6809.h +++ b/emu/emu6809.h @@ -16,17 +16,17 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */

-tt_u16 rpc, rx, ry, ru, rs; -tt_u8 ra, rb, rdp; -int nbcycle; -int err6809; +extern tt_u16 rpc, rx, ry, ru, rs; +extern tt_u8 ra, rb, rdp; +extern int nbcycle; +extern int err6809;

-long cycles; +extern long cycles;

ifdef PC_HISTORY

-tt_u16 pchist[PC_HISTORY_SIZE]; -int pchistidx; -int pchistnbr; +extern tt_u16 pchist[PC_HISTORY_SIZE]; +extern int pchistidx; +extern int pchistnbr;

endif

/ macros / diff --git a/hardware/acia.c b/hardware/acia.c index 45eb3e5..5c26141 100644 --- a/hardware/acia.c +++ b/hardware/acia.c @@ -51,6 +51,7 @@ static void acia_run_pty(); static void acia_run_midi();

void (*acia_run)() = NULL; +struct Acia acia;

static int midi_init() { int i; diff --git a/hardware/acia.h b/hardware/acia.h index e2a9cd2..e2564ea 100644 --- a/hardware/acia.h +++ b/hardware/acia.h @@ -32,11 +32,11 @@

int acia_init(int device); void acia_destroy(); -void (acia_run)(); +extern void (acia_run)(); uint8_t acia_rreg(int reg); void acia_wreg(int reg, uint8_t val);

-struct { +extern struct Acia { uint8_t cr; uint8_t sr; uint8_t tdr;