Readme file for Gambit-C 3.0 distribution (May 6, 1998)
-----------------------------------------

The Gambit-C Scheme system version 3.0 is available on the Gambit web
page at the following URL:

  http://www.iro.umontreal.ca/~gambit

The sources for UNIX, PC and Macintosh are distributed in the archive
file "gambc30.tar.gz".

Gambit-C also comes prebuilt for PC and Macintosh.  Since the Gambit-C
compiler works in conjunction with the C compiler installed on your
computer, you need to get the archive that was built with the C
compiler available.  The choices are:

  ARCHIVE       OS               C COMPILER

  gc30-msc.zip  Windows-NT/95   Microsoft Visual C++ 4.0 compiler
  gc30-bor.zip  Windows-NT/95   Borland C++ 5.0 compiler
  gc30-wat.zip  Windows-NT/95   Watcom C/C++ 11.0 compiler
  gc30-dj.zip   MSDOS           DJGPP system v2.0 (see http://www.delorie.com)
  gc30-cw.hqx   MACOS system 7  for the Macintosh CodeWarrior 11, Pro 1, Pro 2
                                and Pro 3 compilers (native 68K and PowerPC
                                versions are included)

Under Windows-NT/95 you can pick any version if you plan to only use
the interpreter but the version built with the Watcom C/C++ compiler
is suggested because it is the most efficient, roughly twice the speed
of the one built with the Microsoft Visual C++ 4.0 compiler.

If you are going to use Gambit more than casually, it is a good idea
to install Emacs for Windows-NT/95 (see
http://www.cs.wasington.edu/homes/voelker/ntemacs.html) because it
offers a nice user-interface for Gambit.  In particular, the Gambit
debugger is well integrated with Emacs (error highlighting, single
stepping, etc).


Copyright and distribution information
--------------------------------------

The Gambit system (including the Gambit-C version) is Copyright (c)
1994-1998 by Marc Feeley, all rights reserved.

The Gambit system and programs developed with it may be distributed
only under the following conditions: they must not be sold or
transferred for compensation and they must include this copyright and
distribution notice.  In particular, this allows Gambit to be used
freely for academic research and education.  For a commercial license
please contact gambit@iro.umontreal.ca.


Prebuilt archives content
-------------------------

==> These files are common to all prebuilt archives:

 readme       this file
 gambit-c.txt user manual in plain ASCII (for Postscript see Gambit web page)
 gambit.h     header file needed to compile programs generated by Gambit-C
 _gambc.c     Gambit runtime library link file

==> gc30-msc.zip and gc30-bor.zip:

 gsi.exe      Gambit-C interpreter (dynamically linked to gambc.dll)
 gsc.exe      Gambit-C compiler (dynamically linked to gambc.dll)
 libgambc.lib Gambit runtime library needed to statically link standalone prgms
 gambc.dll    Gambit runtime library needed to run dynamically linked prgms
 gambc.lib    import library for gambc.dll
 gambit.el    package to run the Gambit interpreter or compiler in Emacs

==> gc30-wat.zip:

 gsi.exe      Gambit-C interpreter (statically linked)
 gsc.exe      Gambit-C compiler (statically linked)
 gsi-win.exe  Gambit-C interpreter (statically linked windowed application)
 gsc-win.exe  Gambit-C compiler (statically linked windowed application)
 libgambc.lib Gambit runtime library needed to statically link standalone prgms
 gambit.el    package to run the Gambit interpreter or compiler in Emacs

==> gc30-dj.zip:

 gsi.exe      Gambit-C interpreter (statically linked)
 gsc.exe      Gambit-C compiler (statically linked)
 libgambc.a   Gambit runtime library needed to statically link standalone prgms
 gambit.el    package to run the Gambit interpreter or compiler in Emacs
 cwsdpmi.exe  DPMI server for virtual memory support (check .doc files)
 cwsdpmi.doc
 cwsparam.exe
 cwsparam.doc

==> gc30-cw.hqx:

 gsi-ppc      PowerPC native Gambit-C interpreter (statically linked)
 gsc-ppc      PowerPC native Gambit-C compiler (statically linked)
 gsi-68k      68K native Gambit-C interpreter (statically linked)
 gsc-68k      68K native Gambit-C compiler (statically linked)
 compile-file.cw11    project  file needed to dynamically compile
                      Scheme files using gsc-ppc and CodeWarrior 11
 compile-file.cwpro1  project  file needed to dynamically compile
                      Scheme files using gsc-ppc and CodeWarrior Pro 1
 compile-file.cwpro2  project  file needed to dynamically compile
                      Scheme files using gsc-ppc and CodeWarrior Pro 2
 compile-file.cwpro3  project  file needed to dynamically compile
                      Scheme files using gsc-ppc and CodeWarrior Pro 3
 MacGambit-C 3.0 Manual  This MSWORD document contains the information in
                         the online help (MacGambit-C specific stuff and
                         the R4RS)

Installation
------------

Under Windows-NT/95 and MSDOS, create the directory "c:\gambc" and
unpack the archive using PKUNZIP into that directory and add the
directory to your PATH.  For example:

  mkdir c:\gambc
  cd c:\gambc
  pkunzip c:\gc30-wat.zip
  set path=c:\gambc;%path%

Under MACOS system 7, create the folder "Gambit-C" in the
"Preferences" folder (which is in the System folder) and then create
the folder "gambc" in the "Gambit-C" folder.  After unpacking the
archive place the files "compile-file.cw*" and "gambit.h" in the
folder "gambc".


Sample use of the Gambit-C compiler
-----------------------------------

Here is a sample use of the Gambit-C compiler to compile and link the
standalone program "hi" containing a C module and two Scheme modules.
Assuming files "foo.c", "h.scm" and "w.scm" contain respectively:

  foo.c:     #include <stdio.h>
             void bonjour (int n) { while (n-- > 0) printf ("hello "); }

  h.scm:     (c-declare "extern void bonjour (int);")
             (define bonjour (c-lambda (int) void "bonjour"))

  w.scm:     (bonjour 2)
             (display "world")
             (newline)

The program must first be compiled and linked at the Scheme level
using the command:

  gsc h w

This will produce the files "h.c", "w.c", and the link file "w_.c".

The program must then be compiled and linked at the C level using the
following commands on the specified platforms:

- Microsoft Visual C++ 4.0 compiler as a statically linked application:

   cl -Ic:/gambc -MD -o hi foo.c h.c w.c w_.c c:/gambc/libgambc.lib

- Microsoft Visual C++ 4.0 compiler as a dynamically linked application:

   cl -D___SHARED -Ic:/gambc -MD -o hi foo.c h.c w.c w_.c c:/gambc/gambc.lib

- Borland C++ 5.0 compiler as a statically linked application:

   bcc32 -Ic:/gambc -tWM -ehi foo.c h.c w.c w_.c c:/gambc/libgambc.lib

- Borland C++ 5.0 compiler as a dynamically linked application:

   bcc32 -D___SHARED -Ic:/gambc -tWM -ehi foo.c h.c w.c w_.c c:/gambc/gambc.lib

- Watcom C/C++ 11.0 compiler as a statically linked application:

   wcl386 -i=c:\gambc -bm -bt=nt -fe=hi foo.c h.c w.c w_.c c:\gambc\libgambc.lib

- DJGPP system v2.0 as a statically linked application:

   gcc -Ic:/gambc -o hi foo.c h.c w.c w_.c c:/gambc/libgambc.a -lm -lemu
