

        Dear OS/2 2.0 User!
        Thank you for reading this file FIRST.


OS/2 2.0 Port README by Andreas T"onne. 4.2.1992

Purpose:

This file explains how to compile and install the OS/2 port of SWI-Prolog.
Read this file carefully, especially the requirements section below. Also
read the original README and the LICENCE agreement. When in doubt ask the
author of this port. Also check out the differences section at the end of
this document.

Author:

Andreas T"onne
Max-Planck-Institut f"ur Informatik
Im Stadtwald
6600 Saarbr"ucken     (new ZIP in summer!)
Germany

e-mail: atoenne@mpi-sb.mpg.de

Copyright:

The original copyright restrictions for SWI-Prolog apply to this version as
well. See the document LICENCE. I'd like to emphasize that there is no
copyright or copyleft for my work in this port but a COPYOBLIGATION.
No parts of my port may be distributed or utilized separately from the
full distribution copy of SWI-Prolog. :-)

Requirements:

OS/2 2.0 or higher, HPFS file-system, 12MB free diskspace.

Currently this port requires the following software to compile successfully.
- the full EMX software development environment including
-- GCC 2.2.2 or higher
-- emx libraries version 0.8e or higher
-- emx Unix(TM) support (include, libraries, tools)
- GNU make
- GNU sed
- Unix(TM) compatible version of rm.exe and cp.exe

This software is available for free on the Internet or from public-domain
software services. Do not ask the author for a copy.


Compiling  & Installation:

When you are installing the binary distribution look at 4. and 5a.

1. Setting up the directories

Do not try to run the 'setup' script. Is is a Unix(tm) shell script anyway.
Change to the SWI directory 'pl', create a new directory named 'OS2' and copy
every file from the directory 'src' to the new directory 'OS2'. You do not
need the 'gnu' subdirectory of 'src'. Change to the directory 'OS2' and 
copy 'md-os2.h' to 'md.h'. You are now ready for compilation.

2. Adaption of the Makefile

The official Makefile assumes that your compiler is named cc. Most of these
assumptions are taken care of during the creation of xmakefile. You have
to change in the file 'Makefile' the definition for 
          CPP= cc -E 
to 
          CPP= gcc -E 
however. See the header section of your 'Makefile'. Probably you want to 
edit the file 'pl/config.h' as well. Here you may specify the paths for
the SWI-Prolog home. Please follow the comments carefully. Especially note
that you have to specify almost every path twice. Once for the Prolog internal
path which is similiar to a Unix(tm) path. And the second time for OS/2 tools
that do not know how to handle Unix(tm) filenames.
Furthermore you may now edit the top-section of 'pl/OS2/md.h'. Do not fiddle
with the remaining switches unless you really know what you are doing.
This port is approved for the current switches only!

3. Run the statement 'make' in 'pl/OS2'. This will first create a new
makefile named 'xmakefile' that is adapted for your environment. This
process needs 'sed.exe', 'cmd.exe' and 'gcc.exe'. Next make calls
itself recursively with the new makefile. A binary called 'pl.exe' is created
and the initial startup state is computed.

4.Check your environment for the following variables:
- HOME		an OS/2 path to your working directory. Default is \
- TMP		an OS/2 path to a directory for temporary files.
- PATH		a ; separated list of OS/2 paths. Add the new 'bin'-directory.
- LIBPATH	like PATH but points to the places where dynamic-linked 
		libraries are stored. The EMX runtime module 'emx.dll' must
		be accessible through LIBPATH.
- TERMCAP 	OS/2 path to your termcap.dat. This file is part of the EMX
		development system.The binary distribution includes a copy
		which resides in a directory 'etc'.
- SWI_HOME_DIR	the OS/2 path of your SWI-Prolog directory. The default path is
		'C:\usr\public\swi'.

ls
5. The installation from sources is performed by the statement
	make install
in 'pl\OS2'. Normally this creates the following:
$(M_SYSTEMDIR)
$(M_SYSTEMDIR)\bin
$(M_SYSTEMDIR)\bin\pl-bite.exe
$(M_SYSTEMDIR)\bin\pl.cmd		Self-starting initial state
$(M_SYSTEMDIR)\runtime
$(M_SYSTEMDIR)\runtime\PC
$(M_SYSTEMDIR)\runtime\PC\pl.exe	The real executable. Do not move it!
$(M_SYSTEMDIR)\library			A copy of 'pl/library'
$(M_SYSTEMDIR)\startup\startup.PC	Boot-start
This may vary for different setting of $(M_PROLOG), $(M_SYS) and $(M_BINDIR).

5a. The installation from binaries is performed by copying the uncompressed
binaries to a proper place on a HPFS volume. Make sure that the directories
stay in place (see above). The binary distribution includes an extra directory
'etc' with a termcap-definition file 'termcap.dat'. The same directory includes
a copy of the EMX runtime module 'emx.dll'. Copy this to a place in your
LIBPATH. Next change to the root of the SWI tree and execute 'dump.cmd'.
This will create a initial saved state as 'bin\pl.cmd'. 


***************************************************************************
Differences to the Unix(tm) version:

- filenames are automatically converted from OS/2 HPFS style to an internal
  Unix(tm) compatible form and vice versa. Backslash is converted to slash and
  drive letters X: are converted to /X:/. Case is preserved. Only the internal
  form of filenames is available from inside SWI-Prolog.
  OS/2 filenames are understood by many predicates but their use is
  discouraged.
- the environment variable CANONICAL_PATHS is not needed. HPFS does not support
  links or join/subst/assign like DOS and thus absolute paths are unique.
- filename completion expands any pattern '~Username' to the value of the
  HOME environment variable or to '/'.
- access_file/2 always suceeds for execute.
- same_file/2 only checks for same names.
- no profiling primitives. Do not even think of it!
- no foreign language interface. This may be changed in the future.

***************************************************************************
Bugs:

- filename conversions assume HPFS.
- open_null_stream is not yet supports. Reason? The creation of ATOMS is
  too inflexible. We need to change the name of /dev/null to /dev/nul
  for EMX.
