OS/2, eCS & ArcaOS - Technical > Programming

Compiling a PM sample with GCC

<< < (5/16) > >>

Dave Yeo:
BTW, it is good practice when using C_INCLUDE_PATH to end it with ;%C_INCLUDE_PATH% in case it has already been set somewhere like if you set up the environment for a different GCC such as Paul's releases.
Same with CPLUS_INCLUDE_PATH and LIBRARY_PATH
As an example, I compiled PMwalker with GCC 9.4.0, part of my environment, (@unixroot=W:)

--- Code: ---[H:\tmp\PMwalker]set C_INCLUDE_PATH
C_INCLUDE_PATH=W:/USR/local940/lib/gcc/i386-pc-os2-emx/9.4.0/include;W:/USR/local940/include;W:/USR/include;%C_INCLUDE_PATH%;

[H:\tmp\PMwalker]set CPLUS_INCLUDE_PATH
CPLUS_INCLUDE_PATH=W:/USR/local940/include/c++/9.4.0;W:/USR/local940/include/c++/9.4.0/i386-pc-os2-emx;W:/USR/local940/include/c++/9.4.0/backward;W:/USR/local940/include;W:/USR/include;%CPLUS_INCLUDE_PATH%;

[H:\tmp\PMwalker]set LIBRARY_PATH
LIBRARY_PATH=W:/USR/local940/lib/gcc/i386-pc-os2-emx/9.4.0;W:/USR/local940/lib;W:/USR/lib;%LIBRARY_PATH%;

[H:\tmp\PMwalker]gcc --version
gcc (GCC) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

--- End code ---

Martin Iturbide:
Thanks Dave, Lars

I learned that gcc does not work with the OS/2 toolkit header files, and that the "os2tk45" package is not the right one, it is "libc-devel" for those files.

I'm uploading here the changes to the sample with the comments suggested by Dave. Later I will upload it to hobbes if there is no any additional change.

Maybe in the future I will try the same sample with gmake and some other PM samples with gcc.

Regards

Lars:
Hi Martin,

just as a side note: for a 32-bit application, the HEAPSIZE keyword in the DEF file is completely superfluous (it has no effect for 32-bit applications). But it won't hurt either, it will just be ignored by any 32-bit linker. It is a remnant of 16-bit linkers (and the original source code dates back to 16-bit times).

The STACKSIZE keyword however is relevant. 8 kBytes is very small stack for a PM application. It's obviously ok for this application but it should definitely be bigger for a "normal sized" PM application. Maybe 64 kByte would be a better choice.

Dave Yeo:
Hi Martin, looks good. Unless you'd rather have a Gnu makefile, upload it.

Martin Iturbide:

--- Quote from: Lars on March 31, 2022, 11:32:50 pm ---Hi Martin,

just as a side note: for a 32-bit application, the HEAPSIZE keyword in the DEF file is completely superfluous (it has no effect for 32-bit applications). But it won't hurt either, it will just be ignored by any 32-bit linker. It is a remnant of 16-bit linkers (and the original source code dates back to 16-bit times).

The STACKSIZE keyword however is relevant. 8 kBytes is very small stack for a PM application. It's obviously ok for this application but it should definitely be bigger for a "normal sized" PM application. Maybe 64 kByte would be a better choice.

--- End quote ---

Hi Lars

Do you mean to put the DEF file like this?

--- Quote ---; WALKER defintion file

NAME            WALKER  WINDOWAPI

DESCRIPTION     'Walker utility, 2022'
STACKSIZE       64512
EXPORTS         ClientWndProc
--- End quote ---

It keeps compiling and working here.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version