Difference between revisions of "Compiling HWMan WPS Class on ArcaOS 5.x"

From EDM2
Jump to: navigation, search
(Software Required)
m
(34 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
By Martin Iturbide
 
By Martin Iturbide
  
This article is the result of my exercise of trying to compile a WPS class on 2018. On this case I had choosen to compile HWMan WPS Class to learn about the built procedure.  
+
This article is the result of my exercise of trying to compile a WPS class on 2018. In this case I have chosen to compile HWMan WPS Class to learn about the build procedure.
  
 
==Software Required==
 
==Software Required==
 
{|class="wikitable"
 
{|class="wikitable"
!Tool||Link||Components
+
!Tool||Components||Link
 
|-
 
|-
|VisualAge C++ V3.6.5 (with fixpack 2) || || It contains icc.exe, alp.exe ...
+
|[[IBM C and C++ Compilers, Version 3.6.5‎]] with fixpack 2|| It contains icc.exe, alp.exe ...|| [https://archive.org/details/IBMCAndCPPCompilers3.6.5]
 
|-
 
|-
|IBM Device Driver Kit || ||  
+
|[[OS/2 Device Driver Kit On-Line]] || This program makes a reference to "RMCALLS.H" that is included on the DDK, that is why it is required. || [https://archive.org/details/IBMDDKit2004]
 
|-
 
|-
|NMAKE || ||  
+
|[[IBM OS/2 Developer's Toolkit]] version 4.5|| It contains nmake.exe and required libraries to compile. ||  
 
|-
 
|-
|emxupd.exe ||[http://hobbes.nmsu.edu/download/pub/os2/dev/emx/v0.9d/emxrt.zip] ||
+
|emxupd.exe ||emxupd unlocks and replaces a DLL.||  [http://hobbes.nmsu.edu/download/pub/os2/dev/emx/v0.9d/emxrt.zip]
 
|-
 
|-
|HWMan Source Code || ||  
+
|HWMan Source Code || The source code (WPS Class) that we are going to compile ||[https://github.com/OS2World/UTIL-WPS-HWMan]
 
|-
 
|-
 
|}
 
|}
  
 
==Preparing the Environment==
 
==Preparing the Environment==
 +
===Installing IBM C and C++ Compilers, Version 3.6.5===
 +
Installing "IBM C and C++ Compilers Version 3.6.5" can be tricky since you need Netscape navigator to work as the installer tool. The good thing is that the installer includes Netscape on the list. So you can install Netscape on ArcaOS (if you didn't install it when you install the OS) from it.
  
===Installing VisualAge C++ V3.6.5===
+
[[Image:ComWPS-001.png|500px]]
Installing VisualAge C++ can be tricky since you need Netscape navigator to work as the installer tool. The good thing is that the installer includes Netscape on the list. So you can install Netscape on ArcaOS (if you didn't install it when you install the OS) from it.  
+
  
 
The install procedure is just straightforward. You can only install the "basic" components of this tool and it will work for this exercise.
 
The install procedure is just straightforward. You can only install the "basic" components of this tool and it will work for this exercise.
 +
 +
[[Image:ComWPS-002.png|300px]]    [[Image:ComWPS-003.png|300px]]
 +
 +
Once it finish installing you will need to reboot and you will see the icon on you desktop. (it may vary according the options you installed)
 +
 +
[[Image:ComWPS-004.png|300px]]
 +
 +
After that you need to install the Fixpack 2. It is also using the same kind of installer using Netscape navigator and it is also very straightforward.
 +
 +
==IBM OS/2 Developer's Toolkit version 4.5 ==
 +
I preferred to install the IBM OS/2 Developer's Toolkit version 4.5 from a installer created some time ago that included some patches. This package is key because it has the SOM compiler that we need for WPS Classes and the required SOM libraries.
 +
 +
[[image:ComWPS-005.png|500px]]
  
 
===CONFIG.SYS===
 
===CONFIG.SYS===
Here it is a final view of some key elements of the config.sys paths and libpaths.
+
Here it is a final view of some key elements of the config.sys path and libpath.
  
==Compile Procedure==
+
LIBPATH=......;H:\IBMCXXO\RUNTIME;H:\IBMCXXO\RUNTIME;H:\IBMCXXO\RUNTIME;H:\OS2TK45\SOM\LIB;
 +
                H:\OS2TK45\DLL;H:\OS2TK45\SAMPLES\MM\DLL;H:\NETQOS2;
 +
 +
SET PATH=.....;H:\OS2TK45\som\common;H:\OS2TK45\som\bin;H:\OS2TK45\bin;H:\Netqos2;
 +
 +
SET DPATH=.....:H:\Ibmcxxo\Runtime;H:\Ibmcxxo\Runtime;H:\Ibmcxxo\Runtime;H:\OS2TK45\som\common\system;
 +
                H:\OS2TK45\som\msg;H:\OS2TK45\msg;H:\Netqos2;
 +
 +
SET INCLUDE=C:\usr\include\os2tk45\inc;C:\usr\include\os2tk45\gl;C:\usr\include\os2tk45;
 +
              H:\OS2TK45\som\include;H:\OS2TK45\inc;H:\OS2TK45\h;H:\OS2TK45\h\gl;
 +
              H:\OS2TK45\h\libc;.;H:\OS2TK45\speech\h;H:\DDK\base\h;
 +
 +
SET LIB=C:\usr\lib;H:\OS2TK45\som\lib;H:\OS2TK45\lib;H:\OS2TK45\samples\mm\lib;
 +
          H:\OS2TK45\speech\lib;H:\DDK\base\lib;
 +
 +
SET IPFC=H:\OS2TK45\ipfc
 +
SET SOMBASE=H:\OS2TK45\som
 +
SET SOMRUNTIME=H:\OS2TK45\som\common
 +
SET SMINCLUDE=H:\OS2TK45\h;H:\OS2TK45\idl;.;H:\OS2TK45\som\include;
  
 +
;Why some paths are not in the config.sys
 +
: I don't have some programs like icc.exe (IBM C Compiler) on the path because the "Command Line" icon on the previously installed "IBM C and C++ Compilers, Version 3.6.5" does a very good job loading the environment paths, so if it worked, I didn't see it necessary to change more the config.sys.
 +
 +
==Compile Procedure==
  
 
===Checking the "make" file===
 
===Checking the "make" file===
 +
The makefile is a text file that contains the instruction and procedure to compile the applications. Since there are several kind of make programs, sometimes it can change a lot from one to another. On this case, this makefile was created to be used with "nmake.exe".
 +
 +
Checking the makefile can understand a little bit about the procedure:
 +
 +
.idl.cpp:
 +
        @echo " Compile::SOM Compiler "
 +
        [[sc.exe]] -C200000 -S200000 -sxc;xh;xih $<
 +
 +
.asm.obj:
 +
        @echo " Assemble::Assembler "
 +
        [[alp.exe]] -Mb +Fl -Li -Lr +Ls +Lm $(AFLAGS) $<
 +
 +
.cpp.obj:
 +
        @echo " Compile::C++ Compiler "
 +
        [[icc.exe]] -Q -Sp2 -D__IBMC__ -W2 $(CFLAGS) -Gm -Gd -Ge- -G5 -C $<
 +
 +
.rc.res:
 +
        @echo " Compile::Resource Compiler "
 +
        [[RC.EXE|rc.exe]] -n -r $<
 +
 +
Here you can see the compiler calls to create the object and res files.
 +
 +
Later you can see the procedure to link the libraries, object files and create the DLL file.
 +
 +
hwman.dll: $(OBJS) $(RES) $(DEF)
 +
        @echo " Link::Linker "
 +
        -7 [[ILINK.EXE|ilink.exe]] -nol -nobas $(LFLAGS) -dll -packc -packd -e:2 -m -o:$@ $(OBJS) $(LIBS) $(DEF)
 +
        rc.exe -n -x2 $(RES) $@
 +
        [[dllrname.exe]] $@ CPPOM30=OS2OM30 /n /q
 +
        [[emxupd.exe]] $@ $(OS2_SHELL:CMD.EXE=DLL)
 +
 +
There are more details on the makefile that it may be good for you to check also.
  
 
===Make Procedure===
 
===Make Procedure===
 +
The way to start the compile process is to run the "Command line" of the development environment, change to the directory where you copied the source code and run "nmake".
 +
 +
[[image:ComWPS-010.png|500px]]
 +
 +
The procedure will stop without errors
 +
 +
[[image:ComWPS-011.png|500px]]
 +
 +
Remember that you can also log the output of the command in case you want to read the full text. You can do that by running:
 +
nmake >out.txt
 +
 +
Take a moment to see the files that had been generated.
 +
 +
[[image:ComWPS-012.png|500px]]
 +
 +
You can see that some .obj .res and .map files were generated and the most important file is '''hwman.dll''' which is the DLL that contains the compiled and linked WPS class application.
 +
 +
Lars has also shared with me some other tips to run "nmake" on different ways:
 
* "nmake" to do a normal build
 
* "nmake" to do a normal build
 
* "nmake "DEBUG=1"" to build with debug info
 
* "nmake "DEBUG=1"" to build with debug info
Line 46: Line 132:
 
!Tool||Date||File Size||Version||Source
 
!Tool||Date||File Size||Version||Source
 
|-
 
|-
|[[icc.exe]] || 2000-11-24 12:44a || 57,078 bytes || 3.6 FP2 || From VAC++ 3.6.5 with FP2
+
|IBM C/C++ ([[icc.exe]]) || 2000-11-24 ||style="text-align: right;" | 57,078 bytes || 3.6 FP2 || rowspan=3 | [[IBM C and C++ Compilers, Version 3.6.5]] with FP2
 
|-
 
|-
|[[sc.exe]] || 1999-06-30 11:12p  || 50,296 bytes || || OS2TK45
+
|IBM Linker for OS/2 ([[ILINK.EXE]])|| 2000-11-24 ||style="text-align: right;" | 110,247 bytes||03.06.PPK1001120
 
|-
 
|-
|[[alp.exe]] || 2001-05-25 || 466,944 bytes || 4.00.008 || OS2TK45
+
|DLL Rename Utility ([[dllrname.exe]])|| 2000-11-24 ||style="text-align: right;" | 35,679 bytes||
 
|-
 
|-
|[[rc.exe]] || 2003-01-30 / 5.00.007 || 399,538 bytes || IBM RC (Resource Compiler) Version 5.00.007 Jan 30 2003 || Included on ArcaOS 5.x
+
|Program Maintenance Utility ([[nmake.exe]]) || 2001-10-04 ||style="text-align: right;" | 121,716 bytes || 4.00.001 || rowspan=3 | IBM OS/2 Developer's Toolkit Version 4.5
 
|-
 
|-
|[[ilink.exe]]|| 2000-11-24 1:27a    / 03.06.PPK1001120  || 110,247 bytes   ||IBM Version. Version 3.6 with Fixpack 2. || From VAC++ 3.6.5 with FP2
+
|SOMobjects Compiler ([[sc.exe]]) || 1996-07-30 ||style="text-align: right;" | 50,296 bytes || 2.54
 
|-
 
|-
|[[dllrname.exe]] || 2000-11-24 1:26a || 35,679 bytes || IBM C/C++ Tools Version 2.0 - DLL Rename Utility || From VAC++ 3.6.5 with FP2
+
|Assembly Language Processor ([[alp.exe]])||2001-05-25 ||style="text-align: right;" | 466,944 bytes || 4.00.008
 
|-
 
|-
|[[emxupd.exe]] || 1998-12-19 9:27p  || 34,304 bytes ||   || From hobbes
+
|Resource Compiler ([[RC.EXE|rc.exe]]) ||2003-01-30 ||style="text-align: right;" | 399,538 bytes || 5.00.007 || IBM OS/2 Developer's Toolkit Version 4.5
 
|-
 
|-
 +
|[[emxupd.exe]] || 1998-12-19 || style="text-align: right;" |34,304 bytes|| || From hobbes
 
|}
 
|}
  
[[Category:Draft]]
+
[[Category:SOM Articles]]

Revision as of 14:30, 3 May 2021

By Martin Iturbide

This article is the result of my exercise of trying to compile a WPS class on 2018. In this case I have chosen to compile HWMan WPS Class to learn about the build procedure.

Software Required

Tool Components Link
IBM C and C++ Compilers, Version 3.6.5‎ with fixpack 2 It contains icc.exe, alp.exe ... [1]
OS/2 Device Driver Kit On-Line This program makes a reference to "RMCALLS.H" that is included on the DDK, that is why it is required. [2]
IBM OS/2 Developer's Toolkit version 4.5 It contains nmake.exe and required libraries to compile.
emxupd.exe emxupd unlocks and replaces a DLL. [3]
HWMan Source Code The source code (WPS Class) that we are going to compile [4]

Preparing the Environment

Installing IBM C and C++ Compilers, Version 3.6.5

Installing "IBM C and C++ Compilers Version 3.6.5" can be tricky since you need Netscape navigator to work as the installer tool. The good thing is that the installer includes Netscape on the list. So you can install Netscape on ArcaOS (if you didn't install it when you install the OS) from it.

ComWPS-001.png

The install procedure is just straightforward. You can only install the "basic" components of this tool and it will work for this exercise.

ComWPS-002.png ComWPS-003.png

Once it finish installing you will need to reboot and you will see the icon on you desktop. (it may vary according the options you installed)

ComWPS-004.png

After that you need to install the Fixpack 2. It is also using the same kind of installer using Netscape navigator and it is also very straightforward.

IBM OS/2 Developer's Toolkit version 4.5

I preferred to install the IBM OS/2 Developer's Toolkit version 4.5 from a installer created some time ago that included some patches. This package is key because it has the SOM compiler that we need for WPS Classes and the required SOM libraries.

ComWPS-005.png

CONFIG.SYS

Here it is a final view of some key elements of the config.sys path and libpath.

LIBPATH=......;H:\IBMCXXO\RUNTIME;H:\IBMCXXO\RUNTIME;H:\IBMCXXO\RUNTIME;H:\OS2TK45\SOM\LIB;
               H:\OS2TK45\DLL;H:\OS2TK45\SAMPLES\MM\DLL;H:\NETQOS2;

SET PATH=.....;H:\OS2TK45\som\common;H:\OS2TK45\som\bin;H:\OS2TK45\bin;H:\Netqos2;

SET DPATH=.....:H:\Ibmcxxo\Runtime;H:\Ibmcxxo\Runtime;H:\Ibmcxxo\Runtime;H:\OS2TK45\som\common\system;
                H:\OS2TK45\som\msg;H:\OS2TK45\msg;H:\Netqos2;

SET INCLUDE=C:\usr\include\os2tk45\inc;C:\usr\include\os2tk45\gl;C:\usr\include\os2tk45;
             H:\OS2TK45\som\include;H:\OS2TK45\inc;H:\OS2TK45\h;H:\OS2TK45\h\gl;
             H:\OS2TK45\h\libc;.;H:\OS2TK45\speech\h;H:\DDK\base\h;

SET LIB=C:\usr\lib;H:\OS2TK45\som\lib;H:\OS2TK45\lib;H:\OS2TK45\samples\mm\lib;
         H:\OS2TK45\speech\lib;H:\DDK\base\lib;

SET IPFC=H:\OS2TK45\ipfc
SET SOMBASE=H:\OS2TK45\som
SET SOMRUNTIME=H:\OS2TK45\som\common
SET SMINCLUDE=H:\OS2TK45\h;H:\OS2TK45\idl;.;H:\OS2TK45\som\include;
Why some paths are not in the config.sys
I don't have some programs like icc.exe (IBM C Compiler) on the path because the "Command Line" icon on the previously installed "IBM C and C++ Compilers, Version 3.6.5" does a very good job loading the environment paths, so if it worked, I didn't see it necessary to change more the config.sys.

Compile Procedure

Checking the "make" file

The makefile is a text file that contains the instruction and procedure to compile the applications. Since there are several kind of make programs, sometimes it can change a lot from one to another. On this case, this makefile was created to be used with "nmake.exe".

Checking the makefile can understand a little bit about the procedure:

.idl.cpp:
       @echo " Compile::SOM Compiler "
       sc.exe -C200000 -S200000 -sxc;xh;xih $<

.asm.obj:
       @echo " Assemble::Assembler "
       alp.exe -Mb +Fl -Li -Lr +Ls +Lm $(AFLAGS) $<
.cpp.obj:
       @echo " Compile::C++ Compiler "
       icc.exe -Q -Sp2 -D__IBMC__ -W2 $(CFLAGS) -Gm -Gd -Ge- -G5 -C $<
.rc.res:
       @echo " Compile::Resource Compiler "
       rc.exe -n -r $<

Here you can see the compiler calls to create the object and res files.

Later you can see the procedure to link the libraries, object files and create the DLL file.

hwman.dll: $(OBJS) $(RES) $(DEF)
       @echo " Link::Linker "
       -7 ilink.exe -nol -nobas $(LFLAGS) -dll -packc -packd -e:2 -m -o:$@ $(OBJS) $(LIBS) $(DEF)
       rc.exe -n -x2 $(RES) $@
       dllrname.exe $@ CPPOM30=OS2OM30 /n /q
       emxupd.exe $@ $(OS2_SHELL:CMD.EXE=DLL)

There are more details on the makefile that it may be good for you to check also.

Make Procedure

The way to start the compile process is to run the "Command line" of the development environment, change to the directory where you copied the source code and run "nmake".

ComWPS-010.png

The procedure will stop without errors

ComWPS-011.png

Remember that you can also log the output of the command in case you want to read the full text. You can do that by running:

nmake >out.txt

Take a moment to see the files that had been generated.

ComWPS-012.png

You can see that some .obj .res and .map files were generated and the most important file is hwman.dll which is the DLL that contains the compiled and linked WPS class application.

Lars has also shared with me some other tips to run "nmake" on different ways:

  • "nmake" to do a normal build
  • "nmake "DEBUG=1"" to build with debug info
  • "nmake -a" to rebuild all
  • "nmake -a "DEBUG=1"" to rebuild all with debug info

Tools and Compiler Versions

This are the versions of each tool and compiler I used:

Tool Date File Size Version Source
IBM C/C++ (icc.exe) 2000-11-24 57,078 bytes 3.6 FP2 IBM C and C++ Compilers, Version 3.6.5 with FP2
IBM Linker for OS/2 (ILINK.EXE) 2000-11-24 110,247 bytes 03.06.PPK1001120
DLL Rename Utility (dllrname.exe) 2000-11-24 35,679 bytes
Program Maintenance Utility (nmake.exe) 2001-10-04 121,716 bytes 4.00.001 IBM OS/2 Developer's Toolkit Version 4.5
SOMobjects Compiler (sc.exe) 1996-07-30 50,296 bytes 2.54
Assembly Language Processor (alp.exe) 2001-05-25 466,944 bytes 4.00.008
Resource Compiler (rc.exe) 2003-01-30 399,538 bytes 5.00.007 IBM OS/2 Developer's Toolkit Version 4.5
emxupd.exe 1998-12-19 34,304 bytes From hobbes