Author Topic: Compile under ArcaOS  (Read 6335 times)

Rick Smith

  • Full Member
  • ***
  • Posts: 119
  • Karma: +4/-0
    • View Profile
Compile under ArcaOS
« on: November 22, 2020, 06:46:28 am »
Greetings,

Now that I have arca running well, vmodem installed and working I want to try an recreate my bbs from the 90’s.. to effectively do this I will need to compile the src.. I have done this in Linux but never in os2.. it’s Lora bbs I am looking to compile can anyone point me in a good direction?

Hope you all are well

Rick
« Last Edit: November 22, 2020, 03:21:37 pm by Martin Iturbide »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4788
  • Karma: +99/-1
    • View Profile
Re: Compile under arca
« Reply #1 on: November 22, 2020, 08:29:07 am »
If you have done it in Linux, odds are it should compile with GCC on OS/2.
You have to use ANPM to install the build environment. Unluckily there is no meta-package so you have to install all of the build environment piece by piece using ANPM (or YUM on the cmd line).
To start, install GCC and its dependencies. Libc-devel, libcx-devel, various *nix utilities such as flex, bison etc, kbuild-make for make. Likely the autotools such as autoconf, libtool and such.
Building on OS/2 isn't too different then building on Linux, assuming the source is portable.
Gotchas include, having to rebuild the autotools stuff so configure etc knows about OS/2. Usually with
Code: [Select]
sh x:/usr/bin/autreconf -fis
Replacing x: with your @UNIXROOT, likely your boot volume.
Other Gotchas is needing LDFLAGS=-Zomf to get the right object format and use the system linker and allow debugging with -g (don't forget to install gcc-wlink) often linking with -lcx as libcx is some libc extensions and various others I'm sure I'm forgetting.
Best is once you get the above installed, ask here for advice if you run into problems. I have no idea how experienced you are at porting or how well Lore bbs supports OS/2 out of the box. OS/2 is DOSish, needs files opened in binary mode and things like that.
Good luck and keep us posted.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4714
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compile under arca
« Reply #2 on: November 22, 2020, 03:18:50 pm »
Hi Rick.

I'm not a developer, I only had tried to organize some developers resources on the EDM/2 Wiki. I recommend that wiki for information and resources that may help you.

On my very simple tests I had wrote this very basic article: "The Quick and Dirty "Hello World" with GCC " and for a GUI sample "Compiling "OS/2 Presentation Manager Programming" Samples on 2016"

I know these articles are very basic, but I hope it give you some some hints.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4714
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compile under ArcaOS
« Reply #3 on: November 22, 2020, 04:31:09 pm »
Hi Rick

Also, thanks to the Internet Archive, we have a lot of OS/2 Development related books available online. But I guess none of that covers gcc, but you may find some interesting information there too.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 306
  • Karma: +27/-0
    • View Profile
Re: Compile under ArcaOS
« Reply #4 on: November 23, 2020, 10:00:27 am »
I'd like to add to Dave's comment about -Zomf, that sometimes -Zexe is required, especially on configure scripts, because they sometimes assume, that you are a Unix box and so have no exe extension. -Zexe appends .exe, if it is not given as part of the -o outfile.
« Last Edit: November 24, 2020, 09:43:01 am by Jochen Schäfer »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4788
  • Karma: +99/-1
    • View Profile
Re: Compile under ArcaOS
« Reply #5 on: November 24, 2020, 12:07:48 am »
Should almost never need -Zexe now a days. Last time I used it was for testing building something that only had a makefile. When it worked I fixed the makefile to use $exeext which on OS/2 was set to .exe, eg foo$(exeext)
Autoconf on OS/2 will set $exeext correctly and for configure scripts created somewhere else, export exeext=.exe in the environment (I prefer config.site) will add the .exe suffix.

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 306
  • Karma: +27/-0
    • View Profile
Re: Compile under ArcaOS
« Reply #6 on: November 24, 2020, 09:44:48 am »
Should almost never need -Zexe now a days. Last time I used it was for testing building something that only had a makefile. When it worked I fixed the makefile to use $exeext which on OS/2 was set to .exe, eg foo$(exeext)
Autoconf on OS/2 will set $exeext correctly and for configure scripts created somewhere else, export exeext=.exe in the environment (I prefer config.site) will add the .exe suffix.
Yes, you are correct, if it's a autoconf system. Otherwise, you have to add -Zexe, which does not hurt anyway ;-)

Rick Smith

  • Full Member
  • ***
  • Posts: 119
  • Karma: +4/-0
    • View Profile
Re: Compile under arca
« Reply #7 on: November 25, 2020, 05:13:40 am »
If you have done it in Linux, odds are it should compile with GCC on OS/2.
You have to use ANPM to install the build environment. Unluckily there is no meta-package so you have to install all of the build environment piece by piece using ANPM (or YUM on the cmd line).
To start, install GCC and its dependencies. Libc-devel, libcx-devel, various *nix utilities such as flex, bison etc, kbuild-make for make. Likely the autotools such as autoconf, libtool and such.

I got most of this installed on arca no problem...


Building on OS/2 isn't too different then building on Linux, assuming the source is portable.
Gotchas include, having to rebuild the autotools stuff so configure etc knows about OS/2. Usually with
Code: [Select]
sh x:/usr/bin/autreconf -fis
Replacing x: with your @UNIXROOT, likely your boot volume.


Are you tips meant for me to try and build this on Linux?

Other Gotchas is needing LDFLAGS=-Zomf to get the right object format and use the system linker and allow debugging with -g (don't forget to install gcc-wlink) often linking with -lcx as libcx is some libc extensions and various others I'm sure I'm forgetting.
Best is once you get the above installed, ask here for advice if you run into problems. I have no idea how experienced you are at porting or how well Lore bbs supports OS/2 out of the box. OS/2 is DOSish, needs files opened in binary mode and things like that.

Lora actually has a native build of os2 version, the problem being is developer long gone so installing the binary fails because it wants a reg code that can no longer be obtained. So someone I assume the developer released src that requires no reg.  My build skills are limited but I have been reading and trying, trouble is I do not know what I am looking at for os2 build files. So far the error I can’t get past as of yet is system reports cannot locate Ld.exe. Another thing I thought of is maybe I do not have good src. If you have knowledge of this maybe take a look and let me know if I’m wasting my time? GitHub.com/maccasoft/lora3
Good luck and keep us posted.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4788
  • Karma: +99/-1
    • View Profile
Re: Compile under ArcaOS
« Reply #8 on: November 25, 2020, 07:46:35 am »
Those were OS/2 instructions. The LDFLAGS=-Zomf is partially to use the system linker instead of LD. I'll take a quick look at it.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4788
  • Karma: +99/-1
    • View Profile
Re: Compile under ArcaOS
« Reply #9 on: November 25, 2020, 08:06:18 am »
Those were OS/2 instructions. The LDFLAGS=-Zomf is partially to use the system linker instead of LD. I'll take a quick look at it.

Ah, it is originally compiled with Watcom 10.6, not GCC, so should compile with OpenWatcom, see http://www.openwatcom.org/, site seems to be in maintenance mode due to hurricanes. Frank usually has the latest OS/2 builds at, https://efbe.musca.uberspace.de/ which also seems broken right now :( Anyways ver1.9 is available at openwatcom.org and should be good enough. Don't use the fork that is hosted at GitHub.
At least OpenWatcom has a IDE, though primitive and hopefully you can just use the wpj file in the os2 subdirectory. I don't have much experience with the IDE, others here may have.