MitchBradley / cforth

Mitch Bradley's CForth implementation
Other
155 stars 41 forks source link

MOre of a question: FreeBSD #87

Closed andrewtholt closed 2 years ago

andrewtholt commented 2 years ago

Hi,

I'm taking a look at FReeBSD at the moment. I was wondering if tou have ever build cforth for a BSD os (not including SunOS 4.x of course)

Regards, Andrew

MitchBradley commented 2 years ago

I used FreeBSD briefly in the late 90s so I am pretty sure that I built cforth for it back then. There has been a lot of water under the bridge since then.

andrewtholt commented 2 years ago

Any tips, or pitfalls that you can recall ?

MitchBradley commented 2 years ago

From 25 years ago, after version drift in every conceivable component? You are just going to have to try it.

andrewtholt commented 2 years ago

I'll give it a shot

andrewtholt commented 2 years ago

FYI Had a few minutes so I gave it a try. Figured the macos version was closest, so in directory build/host-serial-macos64

defined APPLE in the makefile and ran gmake

CC ../../src/cforth/lineedit.c
CC ../../src/cforth/getc-kbd.c
CC ../../src/lib/sha256.c
MAKING FORTH
CC main.o io.o nullbi.o dictfile.o mallocl.o lineedit.o getc-kbd.o sha256.o forth.o compiler.o syscall.o floatops.o extend.o -o forth
ld: error: undefined symbol: fmod
>>> referenced by floatops.c:68 (../../src/cforth/floatops.c:68)
>>>               floatops.o:(floatop)

ld: error: undefined symbol: sin
>>> referenced by floatops.c:72 (../../src/cforth/floatops.c:72)
>>>               floatops.o:(floatop)

So I deleted -DFLOATING from the make file and tried again.

Built fine, runs. Just need to sort out floatops. Though, I confess, for most of my uses I don't need them.

Noticed wasn't linking libm, so added that:

CC main.o io.o nullbi.o dictfile.o mallocl.o lineedit.o getc-kbd.o sha256.o forth.o compiler.o syscall.o floatops.o extend.o -o forth -lm
ld: error: undefined symbol: ecvt
>>> referenced by floatops.c:316 (../../src/cforth/floatops.c:316)
>>>               floatops.o:(fintop)

Almost there.

MitchBradley commented 2 years ago

I found this patch to FreeBSD. If you can't figure out how to get ecvt from the library, maybe you could add the source from that patch directly to the CForth tree.