davidgiven / cpmish

An open source sort-of CP/M 2.2 distribution.
http://cowlark.com/cpmish
Other
344 stars 37 forks source link

Having difficulties building under MacOS Mojave #40

Closed tjewell99 closed 3 years ago

tjewell99 commented 3 years ago

I get to here, and the build fails:

[1/83] gcc -c -o .obj/third_party/zmac/zmac/main/y.tab/y.tab.o .obj/third_party/zmac/zmacparser/y.tab.c -I.obj/third_party/zmac/zmacparser -g -Og -Ithird_party/zmac 
FAILED: .obj/third_party/zmac/zmac/main/y.tab/y.tab.o 
gcc -c -o .obj/third_party/zmac/zmac/main/y.tab/y.tab.o .obj/third_party/zmac/zmacparser/y.tab.c -I.obj/third_party/zmac/zmacparser -g -Og -Ithird_party/zmac 
third_party/zmac/zmac.y:1902:7: error: use of undeclared identifier 'UNDECLARED'
        case UNDECLARED: case WASEQUATED:
             ^
third_party/zmac/zmac.y:1902:24: error: use of undeclared identifier 'WASEQUATED'
        case UNDECLARED: case WASEQUATED:
                              ^
third_party/zmac/zmac.y:1903:23: error: use of undeclared identifier 'WASEQUATED'
                if (sym->i_token == WASEQUATED &&
                                    ^
<more errors snipped>

I've had issues recently with yacc (when building Fuzix). I've also installed byacc, and edited yacc.lua to use byacc instead, but that doesn't seem to affect the problem. Many thanks in advance for any pointers!

davidgiven commented 3 years ago

Hmm. Github Actions doesn't do Mojave, and my only test machine is Big Sur. WASEQUATED and UNDECLARED are token name which is defined in zmac.y, so it doesn't make any sense for them not to be in the generated code; if you look at .obj/third_party/zmac/zmacparser/y.tab.h, there should be an enumeration table containing all the token names. Are they in there?

tjewell99 commented 3 years ago

Hi David, thanks for your help! Last time I did stuff like yacc in anger was back in 1989, so I'm a little rusty on all this. But yes, the tokens are in y.tab.h ...

davidgiven commented 3 years ago

Hmm. Try inserting a line saying #include "y.tab.h" just below the #include "mio.h" line in `third_party/zmac/zmac.y, and see if that helps.

tjewell99 commented 3 years ago

That worked perfectly. After a quick 'truncate -s 737280 nc200.img', I'm now running cmpish on my NC200 via a Gotek! Awesome!

davidgiven commented 3 years ago

Great --- Mac yacc must be weird. I'll fix that in the sourcebase and close this bug.