	INSTALLATION INSTRUCTIONS FOR WINDOWS
	--------------------------------------

There are two ways to install XSB on Windows:
      - Using CygWin emulation of POSIX system calls; and
      - A native build.

For CygWin, the installation process is the same as under Unix --- see the
./INSTALL file.

The native build depends on how you obtained XSB:

    - checked out from the CVS repository at http://xsb.sourceforge.net
    - downloaded a preconfigured version of XSB from http://xsb.sourceforge.net

A. If you checked XSB out using CVS:

   XSB must be configured for the system where it is compiled. Our
   configuration script runs only under Unix shell, so the checked out copy
   must be first configured for Windows under Unix or CygWin as follows:

   cd build
   configure --with-wind

   If you don't have access to either a Unix box or CygWin emulation, then
   this method is not for you and you must download a preconfigured
   version.

   Once the system is configured for Windows, it is ready for native build.

B. Native build.

   You must have a copy of Visual C++ installed in order to build XSB
   natively. If you don't have one (and don't feel like having it), then
   your next best bet is to download a precompiled version of XSB from
   http://xsb.sourceforge.net.

1. Check the file 

       emu\configs\config.h

   You may have to change some variables there. The variables are commented
   so hopefully it should be clear how things might need to be changed.
   The part of the file where changes are allowed is clearly marked.

2. Check the file:

       config\x86-pc-windows\lib\configuration.P

   Again, some settings there might need to be changed.
   The file is commented and the part that might need to be changed is
   clearly marked.

3. IF YOU ARE DEBUGGING:
   Check the files in emu\debugs\ and #define the appropriate debugging
   flags. In particular, the DEBUG flag in emu/debugs/debug.h must be set.

4. If you change the XSB scheduling strategy (batched to local or vice
   versa)  in 1 and 2 or if you are changing the compilation mode from
   DEBUG to optimized, then please also update the file

	 config\x86-pc-windows\banner.msg

   The only purpose of this update is to ensure that the user doesn't get
   an incorrect banner message on startup.
   Changing this files alone won't enable debugging and/or local scheduling 
   strategy. You must also recompile XSB with these options enabled.

5. If you downloaded a precompiled version of XSB, you are done.
   If you need to recompile XSB, then read (6).

6. Compile the .\emu directory.

      cd build
      makexsb_wind "CFG=release" (or "debug")

      Other options are "DLL=yes" and "ORACLE=yes".
      In the latter case, you also have to specify "SITE_LIBS=oracle libraries"
      where Oracle libraries (should be taken from the Oracle manual).

[NOTES on using Microsoft Visual C++:]
To compile from the command line, you should set some environment
variables. First, the path to NMAKE should be in the PATH
env. variable. Also, you should set the following variables:

set LIB=c:\msdev\lib
set INCLUDE=c:\msdev\include

You should change c:\msdev, above, for the correct installation path
of your MS Visual C++

7. The executable will be in

     .\config\x86-pc-windows\bin\xsb.exe

8. If you compiled XSB as a DLL (with DLL=yes) then NMAKE will put the DLL in:

     .\config\x86-pc-windows\bin\xsb.dll

9. If you first compiled XSB as an executable and then want to compile it
   as a DLL, then you should run

        makexsb_wind clean

   before producing the xsb.dll. This will wipe out the object files from
   the previous build, but it will leave xsb.exe in place, so you can use
   both xsb.dll and xsb.exe.

10. If you first compiled XSB as a release version and then decided to
    create a debug version (or vice versa), you must also run 

        makexsb_wind clean

    in between. However, you should be aware of the fact that the debug
    version will replace the release executable (or the other way around).
