OS2 World Community Forum
OS/2, eCS & ArcaOS - Technical => Programming => Topic started by: Mentore on February 05, 2024, 09:22:11 am
-
Hello all, starting a new topic which I hope will be useful to other people.
I'm about to finish a complete ArcaOS VM - meaning I installed all the system, the applications that I want to work with (Graphics, DTP, Math, Emulators, Games and so on) and now I'm finishing a big development section.
So I went and installed VACPP 4 (the text editor and the CLI compiler are my needs), OpenWatcom, various REXX environments, and os on. But now I'm stuck with GCC environment.
In the past I heavily relied on Paul Smedley's build environment, but as far as I can see, there's no mention of it in his website. Since there are many interesting projects involving GCC I'd really like to get a complete GCC based build environment, but somehow feel a little stuck (too used to Visual Studio I'm afraid).
From where can I start? I guess a GCC recent version (not sure of what would be the best), discarding EMX, then make, autoconf suite, cmake, what else?
Any help will gladly be appreciated - we may use this thread to estabilish an up to date information source for us programmers out there...
TIA
Mentore
-
My advice is -
yum install gcc (*)
yum install ostk45 (?)
yum install wlink
(*) (?) search for the correct packet name f.i. with 'yum list *tk45*'
I'm sure I've forgot something but...
-
My advice is -
yum install gcc (*)
yum install ostk45 (?)
yum install wlink
(*) (?) search for the correct packet name f.i. with 'yum list *tk45*'
I'm sure I've forgot something but...
Seems a good starting point. I'll begin with this as soon as I get hando on my Arca VM. Thanks!
-
libc-devel
libcx-devel
kbuild-make
autotools (autoconf, automake, libtool, m4)
bison
flex
groff
lxlite
nasm
patch (careful about the one in \os2)
pthread-devel
sed
watcom-wrc
watcom-wipf
Various devel packages as required
Should be a good start along with what you listed.
Really most of this stuff should be in a meta package along with whatever I forgot.
Need at least some of this in your environment too,
SET SHELL=sh.exe
SET EMXSHELL=sh.exe
SET CONFIG_SHELL=sh.exe
SET MAKESHELL=sh.exe
SET EXECSHELL=sh.exe
-
libc-devel
libcx-devel
kbuild-make
autotools (autoconf, automake, libtool, m4)
bison
flex
groff
lxlite
nasm
patch (careful about the one in \os2)
pthread-devel
sed
watcom-wrc
watcom-wipf
Various devel packages as required
Should be a good start along with what you listed.
Really most of this stuff should be in a meta package along with whatever I forgot.
Need at least some of this in your environment too,
SET SHELL=sh.exe
SET EMXSHELL=sh.exe
SET CONFIG_SHELL=sh.exe
SET MAKESHELL=sh.exe
SET EXECSHELL=sh.exe
Thanks a billion to you too, Dave. Going to install these as soon as I can.
Mentore
-
Just for completeness in this valuable thread, we also need -
yum install binutils
and probably
yum install os2tk45
-
Need at least some of this in your environment too,
SET SHELL=sh.exe
SET EMXSHELL=sh.exe
SET CONFIG_SHELL=sh.exe
SET MAKESHELL=sh.exe
SET EXECSHELL=sh.exe
Be very careful with SET EMXSHELL -- in my experience, having this defined will cause many programs built with the old EMX+GCC to break horribly. I never set this (and make sure to remove it if any RPM adds it), and I've never needed it to build modern gcc stuff.
-
Need at least some of this in your environment too,
SET SHELL=sh.exe
SET EMXSHELL=sh.exe
SET CONFIG_SHELL=sh.exe
SET MAKESHELL=sh.exe
SET EXECSHELL=sh.exe
Be very careful with SET EMXSHELL -- in my experience, having this defined will cause many programs built with the old EMX+GCC to break horribly. I never set this (and make sure to remove it if any RPM adds it), and I've never needed it to build modern gcc stuff.
Thanks Alex. Didn't have the time to correctly test the environment (just some projects already too complex to be easily configure/make'd).
Thanks also Andi, binutils is one of many mandatory packages.
Guess I'll need to set my C:\ virtual drive more than 2 GB space...
Mentore
-
I have adapted Paul's environment script to my needs, and run it from an copied shell object by calling the script via parameter. This confines the scope of the environment values and everything apart from development remains untouched.
Also, I have cmake installed, since many projects use that and we have good support for it.
-
I have adapted Paul's environment script to my needs, and run it from an copied shell object by calling the script via parameter. This confines the scope of the environment values and everything apart from development remains untouched.
Also, I have cmake installed, since many projects use that and we have good support for it.
Hi Jochen,
this was my first intention since my old OS/2 machine was already perfectly set up for the job (but currently I can't use it). Sadly, I seem unable to access Paul's build environment anymore - every link I tried was broken.
I'd have preferred his way simply because I like to keep OS volume and application on separated units - albeit logically, or even better on separate drives, in order to keep the OS volume clean and hosting only the system (as much as possible).
Should you have some link for Paul's B.E. may you put it here? TIA.
Mentore
-
because I like to keep OS volume and application on separated units - albeit logically, or even better on separate drives,
SET UNIXROOT=x: where x: is your separate drive. It's that easy with BWWs rpm packages.
-
Should you have some link for Paul's B.E. may you put it here? TIA.
I uploaded mine. I use gcc9, but I just didn't change the filename ;-)
-
because I like to keep OS volume and application on separated units - albeit logically, or even better on separate drives,
SET UNIXROOT=x: where x: is your separate drive. It's that easy with BWWs rpm packages.
Stupid me didn't think about this.
Thanks a million!
Mentore
-
this was my first intention since my old OS/2 machine was already perfectly set up for the job (but currently I can't use it). Sadly, I seem unable to access Paul's build environment anymore - every link I tried was broken.
I'd have preferred his way simply because I like to keep OS volume and application on separated units - albeit logically, or even better on separate drives, in order to keep the OS volume clean and hosting only the system (as much as possible).
Should you have some link for Paul's B.E. may you put it here? TIA.
Did you think to ask me? I don't recommend it anymore, it's just too hard to maintain, but I can generate a fresh zip from that vbox machine as required.
-
because I like to keep OS volume and application on separated units - albeit logically, or even better on separate drives,
SET UNIXROOT=x: where x: is your separate drive. It's that easy with BWWs rpm packages.
Stupid me didn't think about this.
Thanks a million!
Mentore
Of course you've to decide this when you install ArcaOS as a lot of things depend on the files there. I don't recommend moving it afterwards.
-
because I like to keep OS volume and application on separated units - albeit logically, or even better on separate drives,
SET UNIXROOT=x: where x: is your separate drive. It's that easy with BWWs rpm packages.
Stupid me didn't think about this.
Thanks a million!
Mentore
Of course you've to decide this when you install ArcaOS as a lot of things depend on the files there. I don't recommend moving it afterwards.
Too late 8) already made many modifications on my system. I'll fix broken things as I see them, but it's all working (for now).
Now I'm hitting my head trying to port mup from arkkra enterprise, it's gotten really complex since the last version I ported... Gonna let you know.
Mentore
-
A copy of my buildenv from April last year is at https://drive.google.com/file/d/1VPR-z1EPTzrkYwrsvrRw3UOSQ_v7yZV_/view?usp=drive_link - nothing significant would have changed since then...
-
A copy of my buildenv from April last year is at https://drive.google.com/file/d/1VPR-z1EPTzrkYwrsvrRw3UOSQ_v7yZV_/view?usp=drive_link - nothing significant would have changed since then...
Wow Paul, thanks a lot for this pointer.
I've already started porting some rather simple applications like normalize, moving forward to SDL apps as soon as possible. I'm finding myself sometimes stuck in configure script troubles like trying to compile some C dummy code to check for gcc and failing, but I'm starting to understand these little quirks.
Mentore
-
If you can, use cmake. It makes life easier.
-
If you can, use cmake. It makes life easier.
Cmake will be the next step. Many projects I'm woking on use configure (for example ngspice 4.2, mup and others) so I'm basically stuck on noticing many other developers are seeing the same behavior (like configure not finding gcc RIGHT AFTER FINDING IT... 8))
After playing with these gcc command line programs I want to work on some SDL and Qt ports, then try to get back on "real" OS/2 development like REXX GUI and C++ software. Wish me luck.
Mentore
-
If you can, use cmake. It makes life easier.
Cmake will be the next step. Many projects I'm woking on use configure (for example ngspice 4.2, mup and others) so I'm basically stuck on noticing many other developers are seeing the same behavior (like configure not finding gcc RIGHT AFTER FINDING IT... 8))
Are you rebuilding the configure script using the autoconf port? Try running "sh c:/usr/bin/autoreconf -sfy" adjust C: as needed, then run configure.
Autoreconf will also run the other autotools, especially libtool.
-
If you can, use cmake. It makes life easier.
Cmake will be the next step. Many projects I'm woking on use configure (for example ngspice 4.2, mup and others) so I'm basically stuck on noticing many other developers are seeing the same behavior (like configure not finding gcc RIGHT AFTER FINDING IT... 8))
Are you rebuilding the configure script using the autoconf port? Try running "sh c:/usr/bin/autoreconf -sfy" adjust C: as needed, then run configure.
Autoreconf will also run the other autotools, especially libtool.
Thanks Dave, this I didn't know. Guess I have to dig deeper in build tools, even searching through forums didn't help a lot.
Mentore
-
That is an important tip, because otherwise the generated script can fail.
-
This thread is immensely useful and a great complement (or replacement) to BitWise Works wiki page on how to build qt5 (https://github.com/bitwiseworks/qt5-os2/wiki/Developers#building-qt)
Considering there's an official developer page through EDM2, perhaps the very first article should be "how to get started", with this information? Also, should anyone have a script to automate some of this yak shaving setup, it could reduce the friction that many hobbyist developers have to face when approaching OS/2 development...
-
This thread is immensely useful and a great complement (or replacement) to BitWise Works wiki page on how to build qt5 (https://github.com/bitwiseworks/qt5-os2/wiki/Developers#building-qt)
Considering there's an official developer page through EDM2, perhaps the very first article should be "how to get started", with this information? Also, should anyone have a script to automate some of this yak shaving setup, it could reduce the friction that many hobbyist developers have to face when approaching OS/2 development...
Hi,
If I'm not wrong most of it is already covered in some other places of these forums. Yet I must say I'm doing much research (in my almost zero spare time) to try and get up-and-running in as few steps as possible.
I'll try to gather and organize as much information as possible and try to contribute to what has already been written. Ad EDM/2 column would be really useful (provided it doesn't already exist!).
Mentore
-
This thread is immensely useful and a great complement (or replacement) to BitWise Works wiki page on how to build qt5 (https://github.com/bitwiseworks/qt5-os2/wiki/Developers#building-qt)
Considering there's an official developer page through EDM2, perhaps the very first article should be "how to get started", with this information? Also, should anyone have a script to automate some of this yak shaving setup, it could reduce the friction that many hobbyist developers have to face when approaching OS/2 development...
Hi,
If I'm not wrong most of it is already covered in some other places of these forums. Yet I must say I'm doing much research (in my almost zero spare time) to try and get up-and-running in as few steps as possible.
I'll try to gather and organize as much information as possible and try to contribute to what has already been written. Ad EDM/2 column would be really useful (provided it doesn't already exist!).
Mentore
Quoting myself because I came across an interesting problem.
If I try to set variables like CFLAGS like this
set CFLAGS=-O2 -g
configure and autoreconf work correctly. But I can't set options like -march or -mtune. If I try to set these in double quotes as in
set CFLAGS="-O2 -g -march=generic"
even after autoreconf, configure fails giving me troubles in gcc, gxx and cpp - even if I tweak the script.
How can I include -march / -mtune and similar options?
This happens also if I try to use export directive in a shell script...
Mentore
-
What error message do the compilers give you?
-
What error message do the compilers give you?
It's not a compiler error, instead it's configure complaining that the compiler found "can't produce executables". If I set the environment variables without double quotes everything works perfectly (I just finished libfftw-3.3.10).
But, if I don't use double quotes, I can't put -march or -mtune in a CMD file or a shell script.
Mentore
-
I use double quotes in the environment variables, too.
PS: "Couldn't build executables" is configure's answer to the compiler erroring out.
In configure.log everything is logged. You can see, how the compiler gets called by configure and what answer it gets.
-
This thread is immensely useful and a great complement (or replacement) to BitWise Works wiki page on how to build qt5 (https://github.com/bitwiseworks/qt5-os2/wiki/Developers#building-qt)
Considering there's an official developer page through EDM2, perhaps the very first article should be "how to get started", with this information? Also, should anyone have a script to automate some of this yak shaving setup, it could reduce the friction that many hobbyist developers have to face when approaching OS/2 development...
Hi,
If I'm not wrong most of it is already covered in some other places of these forums. Yet I must say I'm doing much research (in my almost zero spare time) to try and get up-and-running in as few steps as possible.
I'll try to gather and organize as much information as possible and try to contribute to what has already been written. Ad EDM/2 column would be really useful (provided it doesn't already exist!).
Mentore
Quoting myself because I came across an interesting problem.
If I try to set variables like CFLAGS like this
set CFLAGS=-O2 -g
configure and autoreconf work correctly. But I can't set options like -march or -mtune. If I try to set these in double quotes as in
set CFLAGS="-O2 -g -march=generic"
even after autoreconf, configure fails giving me troubles in gcc, gxx and cpp - even if I tweak the script.
How can I include -march / -mtune and similar options?
This happens also if I try to use export directive in a shell script...
Mentore
Try,
sh configure 'CFLAGS=-O2 -g -march=generic' 'LDFLAGS=-Zomf -Zhigh-mem'
-
You can also create a config.site file in $PREFIX/share, usually /usr/local/share/config.site. Mine for Mozilla, or IIRC, where %CONFIG_SITE% points.
export CFLAGS=-Zomf
export CXXFLAGS=-Zomf
export ASFLAGS=-Zomf
export 'CPPFLAGS=-idirafter w:/usr/include/os2tk45'
export 'LIBS=-lcx -Zomf'
The -idirafter is to search the toolkit for includes after the usual locations such as /@unixroot/usr/include.