HOW TO BUILD THE GL LIBRARY

1)  Edit the Makefile file for your system.  Microport System V/AT and 
SCO Xenix for 286 machines, and MS-DOS for any PC, are currently supported.
For Microsoft C under MS-DOS, use the MSC.MAK file.  For Turbo-C under 
MS-DOS, use the TCC.MAK file.

2)  Edit the config.h file.  Define your target system and compiler, along 
with other parameters that may be specific to your hardware and operating 
system.

3)  Run make.  For UNIX, just type "make."  For Xenix, type "make xenix."
To compile an MS-DOS executable under Xenix, type "make dos."  For 
Microsoft C under MS-DOS, type "MAKE MSC.MAK".  For Turbo-C under MS-DOS, 
type "MAKE -FTCC.MAK".

HOW TO INSTALL THE GL LIBRARY

Before running the demonstration programs "demo" and "xdemo," you
must do a few things.

Microport System V/AT:
---------------------

1)  Mode switch program:  The GL library will switch video graphics
modes by executing a program or shell script.  The name of the program
is defined in config.h as follows:

	#define MODEPROG "mode"

You must have a working script or program called "mode" in your
path, or (if you prefer), you can use a different program name for your
system.  For most systems and video adapters (CGA and EGA compatible), 
you can use the "mode.sh" script, and rename it to "mode" (use the
command "mv mode.sh mode").

If you have an Everex Edge (hercules compatible), use mode.c ("mv 
modeprog mode").  For other adapters (possibly including actual 
Hercules boards), you may have to modify mode.c and setmode.c.  

If you use mode.c, you must make the executable (mode) suid and 
owned by root.  Put it in a safe path, of course.
For example, sign as root, then:

  $ mv mode /usr/bin/mode
  $ chmod 4555 /usr/bin/mode

Be sure the mode program works before trying anything else.  You should,
for example, be able to type "mode 4" and have your graphics adapter 
switch to 640x200 color graphics mode, and type "mode" to return to 
normal text mode.

2)  Graphics shared memory:  The GL library must be able to attach to
a shared memory segment that corresponds to your graphics adapter.  You
must use a kernel that has shared memory enabled.  The standard kernel
for large memory systems should already be configured this way; if not,
use the link kit (edit the last three lines of dfile.wini).

Next, you must sign on as root, and run the shmcreate(1) program to 
create one or more shared memory keys.  Once you have the key or keys 
defined correctly, you should put the shmcreate commands into your 
/etc/rc.d/shm.rc file, so the keys will be defined each time the 
system is booted.

The key values are actually arbitrary, but have been chosen to match
the physical memory addresses that they point to.  Thus the "b8000" 
key is used for CGA graphics modes, and the "b0000" is used for 
hercules compatible adapters.  The "a0000" key can be used for EGA 
modes.  Define keys for each mode you expect to use.

Following is a sample shm.rc file for a system with a video adapter
which supports CGA modes and hercules compatible mode:  

	#  Setup for shared memory segments used for graphics

	# /etc/shmcreate 0xa0000 a0000 65535		# ega high res
	/etc/shmcreate 0xb0000 b0000 65535		# ega low res
	/etc/shmcreate 0xb8000 b8000 32768		# cga
	# /etc/shmcreate 0xc6000 c6000  4096		# pga

3)  Double check.  Use the ipcs(1) command to make sure your shared memory
keys are installed.  Run the mode script (or program) with arguments
corresponding to each mode you want to use.

4)  If you want to be able to do graphics printing, be sure you have a
printer device in the lp spooler which is capable of raw output.  The
name of this device should match the PRINTDEV macro in config.h.  See the
"Readme" file for more information.

5)  You should now be ready to run GL programs.  Try either "demo" or
"xdemo."  If something is not set up correctly, the error messages should
give a good indication of the problem.  


Xenix System V 286:
------------------

1)  Mode switch program:  The GL library will switch video graphics
modes by executing a program or shell script.  The name of the program
is defined in config.h as follows:

	#define MODEPROG "mode"

You must have a working script or program called "mode" in your
path, or (if you prefer), you can use a different program name for your
system.  For most systems and video adapters (CGA and EGA compatible), 
you can use the "mode.xenix" script, and rename it to "mode" (use the
command "mv mode.xenix mode").

2)  Double check.  Run the mode script (or program) with arguments
corresponding to each mode you want to use.

3)  If you want to be able to do graphics printing, be sure you have a
printer device in the lp spooler which is capable of raw output.  The
name of this device should match the PRINTDEV macro in config.h.  See the
"Readme" file for more information.

4)  You should now be ready to run GL programs.  Try either "demo" or
"xdemo."  If something is not set up correctly, the error messages should
give a good indication of the problem.  Note that as of this writing,
GL has been tested ONLY on an EGA board for Xenix.  It will probably 
work for CGA cards, but hercules compatibles may take some experimenting.  
Any required modifications to the code will be in the g_init.c module.


MS-DOS, cross compiled from Xenix System V 286:
-----------------------------------------------

1)  Mode switch program:  None required, unless a Hercules compatible
video board is used, in which case you will have to hack the code to
use some or all of the mode.c and modeset.c routines.

2)  Compile under Xenix, and copy to an MS-DOS disk or partition.

3)  You should now be ready to run GL programs.  


MS-DOS with Microsoft C
-----------------------

Just try running the DEMO.EXE and XDEMO.EXE programs ("DEMO 4" to run
the demo in video mode 4).  Graphics modes 4, 6, and 16 (EGA) will work,
as will mode 256 for an IBM/Epson printer on PRN:.  Hercules support is
not currently in the MS-DOS version, but all you need to do is borrow the 
mode switching code in SETMODE.C and add it to g_init.c module.


MS-DOS with Turbo-C
-------------------
This works the same as Microsoft C, although it compiles faster and runs
a little slower.


					d t lewis
					Mon Feb 20 20:09:41 EST 1989
					system5 dtlewis 2 2.4.0-U AT
