OpenBSD installation notes

32 views
Skip to first unread message

David den Haring

unread,
Jun 2, 2025, 12:42:38 PMJun 2
to 4tH-compiler
I just wanted to share how I got 4tH working on OpenBSD 7.7. This is a less popular, but still important BSD. My comments are in parentheses. The commands below are exhaustive for those folks who don't compile C code every day which includes myself.

doas pkg_add gcc gmake (choose newest version of gcc when prompted)

doas cp /usr/local/bin/egcc /usr/local/bin/gcc

ftp https://sourceforge.net/projects/forth-4th/files/4th-3.64.1/4th-3.64.1-unix.tar.gz 

tar -xcvf 4th-3.64.1-unix.tar.gz

cd 4th-3.64.1/sources

mv Makefile Makefile.org

cp Makefile.BSD Makefile

make

doas make install

make clean (if you want to tidy up)

cd ..

cd 4th

4th (now you’re in the tool...)

(...but it doesn’t fully work. The editor won’t open! So, exit the tool.)

cd include64

cp editor.h ..

cp zeditor.h ..

cp teditor.h ..

cp mon.h ..

cp pp4th.h ..

cd ..

make clean

make

doas make install (now it will work)

(If you ever want to remove 4th)
doas make uninstall

The Beez

unread,
Jun 2, 2025, 12:46:56 PMJun 2
to 4tH-compiler
Thanks for that!

I'll see how I can turn this in a short tutorial for the manual.

Hans Bezemer

The Beez

unread,
Jun 3, 2025, 4:58:37 AMJun 3
to 4tH-compiler
BTW, I wondered why you had to pull in the 64-bit byte code. So I checked the original archive and noticed it still uses the 32-bit byte code by default.
I think we can safely assume that most platforms have moved to 64-bit - even the Raspi has moved to 64-bit AFAIK. 

So, the next version will have 64-bit as default, so this step can be skipped next time ;-)

Hans Bezemer

The Beez

unread,
Jun 3, 2025, 10:15:04 AMJun 3
to 4tH-compiler
Hi!

Okay, I condensed the thing a bit, but it's now part of the 4tH manual.
Again - thanks!

Hans Bezemer

David den Haring

unread,
Jun 3, 2025, 10:15:52 AMJun 3
to 4tH-compiler
Thanks for the clarification on that. I wasn't sure either, but after some trial and error found out that it worked. The clue for me was in your manual's FAQ where it mentioned editor issues were related to a lack of 64-bit ness, as I recall.

David den Haring.

The Beez

unread,
Jun 3, 2025, 10:30:22 AMJun 3
to 4tH-compiler
The clue for me was in your manual's FAQ where it mentioned editor issues were related to a lack of 64-bit ness, as I recall.

Gee - I'm goooood! ;-)
But no kidding - I'm happy you found the information you needed! I assure you it is no small task to cover the widest possible array of platforms - because the names may be different, the APIs may be different, the tools may be different, the skill sets may be different.

I'm happy enough information was there to allow you to port it with relative ease.

As for the "64-bit" issue - back in 1994 (when 4tH was incepted) 32 bit ruled. You will probably still find it in the manual here and there. So, essentially the byte code was universally portable. However, I did include a few things that allowed other configurations - although none were needed at the time. As time progressed, I was happy they were in place (for obvious, 64-bit reasons).

But this also meant I had to support two kinds of byte codes, 64-bit and 32-bit. It is what it is. Now - the problem is that there are 64-bit compilers on 64-bit OSes that still produce 32-bit code. So I can't just advise "If the box of your OS says 64-bit, you know" - because you don't. Therefore, you may have to recompile in order to get it right.

Again - many thanks for sharing your experience! And BTW , your messages on this forum will pop up straight away now. I took care of that.

Hans Bezemer
Reply all
Reply to author
Forward
0 new messages