
To install xboard on your system, you will need to generate a properly
customized Makefile for it, probably using imake, a program that comes
with the X Window System.  

Before you do this, you may need to edit the Imakefile.  xboard has
special code for certain systems that is enabled or disabled by ifdefs
in xboard.c.  A few systems do not automatically define a symbol that 
can be used to select the right ifdef, so you have to define it yourself
in the Imakefile.  Here is a list of ifdef symbols used in xboard.  To
add one of these, for example FOO, to your Imakefile, add the string -DFOO
to the end of the DEFINES line, separated by a space from what's already
there.

IRIX			-- Silicon Graphics IRIX.
IRIS			-- Old version of Silicon Graphics Iris code; try
			     IRIX first.
AIXV3			-- IBM AIX, version 3.
IBMRTAIX		-- AIX for the IBM RT.  I don't know how this
			     differs from AIXV3.  Use what works for you.
ESIX			-- The ESIX operating system.
SYSTEM_FIVE		-- Unix System V.
SYSV			-- Unix System V.
SVR4			-- Unix System V, release 4.
HPUX or hpux		-- Hewlett-Packard HPUX.
UNIPLUS			-- Uniplus Unix.
sun			-- SUN Microsystems. (**see below**)
RTU			-- I don't know what this is for!
__STDC__		-- Automatically defined by ANSI C compilers.
ATTENTION		-- Define this if your version of gnuchess
			     requires you to get its attention by
			     hitting ^C when you want to move while it
			     is thinking on your time.
HAS_GETTIMEOFDAY	-- Remove this if you don't have the getttimeofday()
			     system call.
HAS_FTIME		-- Add this if you don't have gettimeofday() but you
			     do have ftime().  If you don't define either
			     HAS_GETTIMEOFDAY or HAS_FTIME, xboard will keep
			     time only to the nearest second.
FLEX			-- Add this if you are using "flex" instead of Unix
			     "lex" to process parser.l.  Needed by linux.
OMIT_SOCKETS		-- Add this if you want to omit the code in
			     xboard that uses sockets.  If you do so,
			     xboard will not be able to communicate with
                             the ICS by opening a direct TCP connection,
                             but the -useTelnet and -gateway options will
                             still work.

After editing the Imakefile, you should be able to generate a correct
Makefile by typing the command "xmkmf" in the xboard source directory.
This command is supposed to run imake with the right flags for your
site.  If you get "Command not found," make sure the directory
containing xmkmf is on your search path.  (It is /usr/local/X11/bin on
many systems.)  If xmkmf doesn't work, you can try the following
command, editing the pathnames first if the X release is installed in
a different place on your system:

	/usr/local/X11/mit/config/imake \
	        -I/usr/local/X11/mit/config \
	        -DTOPDIR=/usr/local/X11/mit

Once you have a working Makefile, if you need to make further changes
to the Imakefile, you can use the command "make Makefile" to update
the Makefile after you edit the Imakefile.


********** Information for linux users **************************************
If you have problems building and running xboard on linux, be sure you
have defined FLEX in the Imakefile (see above), and be sure you have
the latest versions of linux and its X package.  xboard is known to
work with "the SLS 1.03 package with the linux 0.99pl12 kernel and
Xfree 1.3".  (This is Greek to me; hope it makes sense to you.)


********** Information for Sun users ****************************************
There are lots of different kinds of Suns with different operating
systems and window systems that run on them.  I don't personally have
access to any of them, but xboard is known to work on at least some.
I would like to collect more information about what has to be put in
the Imakefile to build xboard for each type of Sun and each operating 
system/window system.

** Solaris 2.x *************************
For Solaris 2.x (SunOS 5.x) you need to uncomment a line in the
Imakefile, as shown just below:

# Uncomment the next line for Sun's Solaris 2.x, per Mark Silver:
   SYS_LIBRARIES =  -lsocket -lnsl -lelf -lm -L/usr/ucblib -lucb

Solaris users also need to add /usr/ucblib to their LD_LIBRARY_PATH
environment variable.  To do this, add the following line (or
something like it) to your .login file, then log out and back in:

	setenv LD_LIBRARY_PATH ${OPENWINHOME}/lib:/usr/lib:/usr/ucblib

Thanks to Arik Klingensmith for the "setenv" information.

Also, ignore any compiler messages you get that start with the word
"warning."  I try to eliminate those, but there is only so much I can
do to accomodate the many different C compilers in the world.  Sun's
ANSI C compiler is especially picky.

** SunOS 4.x (Solaris 1.x) ***************************
Here is a success story from a SunOS 4.1.3 user.  The details of what
you have to do may vary, unfortunately.  I am still collecting more
information from other users and may add to this in future.

From: Ed Hanway <jeh@raster.Kodak.COM>
Date: Wed, 8 Sep 1993 15:16:14 -0400

Here is the Imakefile that worked for me for 3.0pl4 on SunOS
4.1.3.  Note: CC is defined to use Sun's unbundled ANSI C compiler.

Also, I have my own version of 'xmkmf' that basically does the
following:

  imake -DStandardIncludes=-I/usr/openwin/include -DUseInstalled /usr/openwin/lib/config

Without it, the Makefile will not know about the include files and
libraries in /usr/openwin.

#
# Imakefile -- for instructions on generating a Makefile
#   for xboard from this file, see the file INSTALL
#

   SYS_LIBRARIES = -lm
 LOCAL_LIBRARIES = XawClientLibs
         DEPLIBS = XawClientDepLibs
         DEFINES = -DHAS_GETTIMEOFDAY
     CDEBUGFLAGS = -g
	    CCOPTIONS = -Dsun
	      CC = acc -fast
#             CC = gcc -Wall -pedantic -ansi -Wno-implicit -Wno-comment
#             CC = gcc -Wall -traditional
#ifdef HPArchitecture
       CCOPTIONS = -Aa -D_HPUX_SOURCE
#endif

# Uncomment this for Sun's Solaris 2.x, per Mark Silver:
#  SYS_LIBRARIES =  -lsocket -lnsl -lelf -lm -L/usr/ucblib -lucb

# If you get the following linker error messages on SunOS, you have
# hit a known bug in the SunOS linker (ld).
#	ld: Undefined symbol 
#	  _get_wmShellWidgetClass 
#	  _get_applicationShellWidgetClass 
# To work around it,  try uncommenting this:
         XMULIB = -Bstatic -lXmu -Bdynamic
# Ask Sun for patches 100512-02 and 100573-03 to get the real fix.

# Try uncommenting this if you use gcc and xboard crashes in sscanf.
# Probably needed on VAX Ultrix 3.1 and on IBM PS/2 AIX.
#      CCOPTIONS = -fwritable-strings

SRCS = parser.c xboard.c backend.c
OBJS = parser.o xboard.o backend.o
#SRCS = parser.c xboard.c backend.c zippy.c
#OBJS = parser.o xboard.o backend.o zippy.o

AllTarget(xboard)

depend:: parser.c

clean::
	$(RM) parser.c chess.lst CLp*

ComplexProgramTarget(xboard)



********** Information for Convex users ONLY ********************************
From: Richard Mathar <mathar@fz-rossendorf.de>
Date: Sun, 13 Jun 1993 16:52:37 +0200

xboard-2.0 patchlevel 21 could be compiled using
	imake -I/usr/X11/lib/config -DTOPDIR=/usr/X11/lib
and editing some lines in the Makefile to read afterwards

        CONFIGSRC = $(LIBSRC)/config
     EXTENSIONSRC = $(INCDIR)/extensions
         XILIBSRC = $(EXTENSIONSRC)/Xinput
      PHIGSLIBSRC = $(EXTENSIONSRC)/PEX
  DEPEXTENSIONLIB =  $(LIBSRC)/libXext.a
          DEPXLIB = $(DEPEXTENSIONLIB)  $(LIBSRC)/libX11.a
             XLIB = $(EXTENSIONLIB)   $(LIBSRC)/libX11.a
        DEPXMULIB =  $(LIBSRC)/libXmu.a
      DEPXTOOLLIB =  $(LIBSRC)/libXt.a
************************************************************************

