OS/2 C-Kermit 5A(190)                                                 June 1994


		  INSTRUCTIONS FOR BUILDING FROM SOURCE CODE

Last update: Wed Jun  1 18:32:05 1994

OS/2 C-Kermit can be built using Microsoft C 6.00A, IBM C Set/2, or GNU CC.
One makefile supports all three: CKOKER.MAK.

Command                    Development Environment

nmake -f ckoker.mak msc    Microsoft C 6.00.  Builds a 16-bit version.
nmake -f ckoker.mak mscd   Microsoft C 6.00, with debugging info included.

In the MSC link step, you might get a message about LLIBCEP.LIB not found.
At the LINK prompt, simply type: LLIBCE.

nmake -f ckoker.mak ibmc   IBM C Set/2, 32-bit, static linking
nmake -f ckoker.mak ibmcd  IBM C Set/2, 32-bit, static linking, debug info.

nmake -f ckoker.mak gcc    EMX 0.8e + GNU CC 2.2.2, 32-bit, dynamic linking
nmake -f ckoker.mak gccd   Same, debugging info included.

For the IBM C version, you must use LINK386 2.01.012 or later.  Earlier
versions have bugs that can prevent C-Kermit from working correctly, or at
all.

Note the -G2 switch in the MSC CFLAGS string.  This builds the program
optimized for the 80286 processor.  When building a 32-bit version with IBM C
or GCC, you can change this to G3 for the 386, to G4 for the 486, and G5 for
the Pentium.  Reportedly, G4 makes the program run noticably faster on the 486
and above (by optimizing instruction sequences for pipelining) without
seriously affecting its performance on the 386.  However, G4 makes the program
about 30K bigger so we normally build the distribution version without it so
it'll fit on the 720K diskette.  Since no -Gn is specified in the 32-bit
makefile entries, -G3 is the default for the 32-bit versions.

For IBM C, adding -Oi<n> (where <n> is a number) will enable inlining of
functions <n> bytes or smaller.  E.g. -Oi20 results in an overall increase in
the .EXE size of about 5K, and (hopefully) speeds up execution.  But given all
the other optimizer bugs, this is probably not a good idea at present.

For the 16-bit version, you can't change -G2 to a higher -Gn value, because
MSC (6.00, at any rate) doesn't support any higher value.

GNU EMX/GCC does not come with a MAKE program, but Microsoft or IBM NMAKE
can be used, or also the public-domain DMAKE (available from OS/2 archive
sites like ftp-os2.nmsu.edu), or GNU make.  C-Kermit programs built with GNU
CC can only be run on OS/2 systems that have the dynamic libraries from the
OS/2 developers kit on disk.

As of version 5A(189), OS/2 C-Kermit supports TCP/IP connections if you have
TCP/IP installed on your OS/2 system.  Linking is still static except for the
TCP/IP library, which is linked dynamically to (a) keep the size of the
program down, and (b) to allow the program to take advantage of updated
versions of TCP/IP without needing to be rebuilt (IBM issues CSD's about once
a month).

To build C-Kermit with TCP/IP support (for which you need the IBM TCP/IP
libraries and header files, and probably also IBM C Set/2), edit CKOKER.MAK to
include -DTCPSOCKET and -DTCPIBM in the "DEFINES =" section, and just below
it, "TCPLIBS =" should indicate TCPIPDLL.LIB -- NOTE THE COMMENTS in this
section of the makefile -- different developers have different setups, and so
this section has to be edited by each developer.

With DEFINES and TCPLIBS set up for a TCP/IP build, an additional file is
produced, called CKOTCP16.DLL or CKOTCP32.DLL, depending on whether it is
16-bit or 32-bit build.

A 16-bit version can be produced using the MSC entry with the DEFINES and LIBS
set up for TCP/IP as just described, if you have Microsoft C 6.00 *and* the
IBM TCP/IP libraries and include files on your disk.

  NOTE: If the IBM-supplied TCPIP\INCLUDE\NETLIB.H file contains the
  following line:

  #define SIGALRM 0

  You must remove it.

The optional SYSLEVEL.CKO files, CKOSYSL.CK1 (16-bit) and CKOSYSL.CK2 (32-bit),
must be created by hand using the OS/2 EDTSYSLV.EXE program.

See the comments in the CKOKER.MAK and CKOKER.BWR files for further detail.

TCP/IP VERSIONS

NOTE: OS/2 C-Kermit cannot be built without network support at the present
time.  Various #ifdef's in the source code need adjustment.

C-Kermit (at least in its edit 189-190 form) should be built on a TCP/IP 1.2.1
system, *not* a TCP/IP 2.0 system (but keep reading).  This will produce a
version of C-Kermit that will work with both TCP/IP versions.  However, a
version of C-Kermit produced on a TCP/IP 2.0 will not be backwards compatible
to a TCP/IP 1.2.1 system.

See additional comments at the top of CKONET.H.

If you decide to build C-Kermit for OS/2 with IBM TCP/IP 2.0 SDK then you must
link to the following libraries: SO32DLL.LIB, TCP32DLL.LIB, DPI32DLL.LIB.  The
2.0 SDK has been shipped to all members of OS/2 DAP as part of the Developer
Connection CD Subscription Service.

DEBUGGING

 . For the 32-bit IBM C version, "nmake -f ckoker.mak ibmcd",
   then use IPMD CKOKER.EXE.

 . For the 16-bit MSC version, "nmake -f ckoker.mak mscd",
   then use CVP CKOKER.EXE.

HOW TO DEAL WITH MICROSOFT C AND IBM C SET/2 ON THE SAME SYSTEM

Assuming you have your directories set up the same way I do, you can switch
between MSC and IBMC compiling with the following two command files.  For
best results, execute these files in a fresh command session.

But first, (a) remember to fix NETLIB.H as noted above, and (b) you might
have to edit CONFIG.SYS to change INCLUDE= definition:

  disk:\TOOLKT21\CPLUS\OS2H should come before disk:\TOOLKT21\C\OS2H,
  if you are using IBM CSet++, and vice-versa if you are using older
  compilers like CSet/2.  This explains why there are two different
  REXXSAA.H files.  In any case, you are likely to get compile-time
  warnings (evidently harmless) about the RexxRegisterFunctionExe()
  function.

IBM C:

SET PATH=C:\IBMCPP\BIN;C:\TOOLKT21\OS2BIN;C:\C600\BINP;%PATH%;
SET DPATH=C:\IBMCPP\LOCALE;C:\IBMCPP\HELP;C:\IBMCPP\SYS;%DPATH%;
SET LIB=C:\IBMCPP\LIB;C:\TOOLKT21\OS2LIB;C:\TCPIP\LIB;%LIB%;
SET INCLUDE=C:\IBMCPP\INCLUDE;C:\IBMCPP\IBMCLASS;C:\TCPIP\INCLUDE;%INCLUDE%;
SET HELP=C:\IBMCPP\HELP;%HELP%;
SET BOOKSHELF=C:\IBMCPP\HELP;%BOOKSHELF%;
SET HELPNDX=DDE4.NDX+%HELPNDX%;
SET TMP=C:\IBMCPP\TMP
SET TZ=EST5EDT,0,0,0,0,0,0,0,0,0

IBM C generates all kinds of bad code, particularly during the optimization
phase.  Optimization can be turned off on a per-source-file basis.  See
CKOKER.MAK for how to do this (as of June 1994, most of these problems seem
to be fixed, and so now optimization is back on).

Meanwhile, IBM issues CSDs for C-Set/2 frequently.  These can be picked up
from the IBM BBS at +1 800 874-2881.

To apply patches, make a CSD directory on the PC (the name of this directory
doesn't matter), put the CT?.ZIP file into it, unzip it, then just type
"service".

Microsoft C:

SET PATH=C:\C600\BINB;C:\C600\BINP;%PATH%;
SET LIB=C:\C600\LIB;C:\TCPIP\LIB;C:\TOOLKT21\OS2LIB;%LIB%;
SET INCLUDE=C:\C600\INCLUDE;C:\TCPIP\INCLUDE;%INCLUDE%;
SET HELPFILES=C:\C600\HELP\*.HLP
SET INIT=C:\C600\INIT

(End of CKOMAK.HLP)
