Installation notes for xearth, version 1.1
Kirk Lauritz Johnson <tuna@indra.com>
6 November 1999


    NOTE: If you are trying to build xearth under SunOS 4.x using
          /bin/cc, make sure to read the section entitled "BUILDING
          UNDER SUNOS 4.x" (below) regarding a compiler bug.


BUILDING USING IMAKE

    To build xearth using imake:

    (1) Edit "Imakefile" to add any DEFINES necessary for building on
        your platform (see the section entitled "DEFINES" below).

    (2) Run "xmkmf" to build a makefile.

    (3) Run "make all" to build an executable.

        If "make" complains cryptically about lines in the makefile
        that start with "XCOMM" (you'll probably have to eyeball the
        offending lines in the makefile to determine this), something
        went wrong with "xmkmf" (or "imake"). You should be able to
        fix this using something along the lines of

            egrep -v ^XCOMM < Makefile > junk ; mv junk Makefile

        (to strip out all lines that start with XCOMM) and then
        running "make" again.

        If the linker complains about "random", "srandom", and/or
        "setpriority" being undefined, you probably need to add
        "-DNO_RANDOM" and/or "-DNO_SETPRIORITY" to the right hand side
        of the "DEFINES =" line in the Imakefile and start over. (See
        the section entitled "DEFINES" below.)

    (4) Run "make install" and "make install.man" to install the
        executable and man page in whatever places are appropriate for
        your system.


BUILDING USING MAKE

    To build xearth using make:

    (1) Copy the distribution makefile "Makefile.DIST" to "Makefile".

    (2) Edit the makefile if necessary; you may need to:

      - add any DEFINES necessary for building on your platform (see
        the section entitled "DEFINES" below)

      - change the name of the C compiler (CC) from "gcc" to whatever
        compiler you want to use when building

      - change the compiler flags (CFLAGS) -- if your X include files
        aren't found in the usual place (/usr/include), you may have
        to add something along the lines of "-I<path-to-X-includes>"
        to CFLAGS

      - change the loader flags (LDFLAGS) -- if your X libraries
        aren't found in the usual places (perhaps /lib and /usr/lib),
        you may have to add something along the lines of
        "-L<path-to-X-libraries>" to LDFLAGS

    (3) Run "make all" to build an executable.

        If the linker complains about "random", "srandom", and/or
        "setpriority" being undefined, you probably need to add
        "-DNO_RANDOM" and/or "-DNO_SETPRIORITY" to the right hand side
        of the "DEFINES =" line in the Makefile and start over. (See
        the section entitled "DEFINES" below.)

    (4) Install the executable ("xearth") and man page ("xearth.man")
        in whatever the appropriate places are for your environment.


DEFINES

    The xearth source code includes #ifdef-ed workaround/replacement
    code for systems that don't provide the random(), srandom(),
    and/or setpriority() library functions.

    For systems that don't provide random() and srandom(), #define the
    NO_RANDOM symbol (this can be done by adding "-DNO_RANDOM" to the
    right hand side of the "DEFINES =" line in the Makefile or
    Imakefile). Doing so causes xearth to use the lrand48() and
    srand48() functions instead of random() and srandom(). (If your
    system doesn't have lrand48() and srand48() either, you'll have to
    go into xearth.h and change the #defines for random() and
    srandom() to something appropriate for your system.)

    For systems that don't provide setpriority, #define the
    NO_SETPRIORITY symbol (this can be done by adding
    "-DNO_SETPRIORITY" to the right and side of the "DEFINES =" line
    in the Makefile or Imakefile). Doing so causes xearth to use the
    nice() function instead of setpriority().

    If you try to compile xearth and the linker complains that
    random(), srandom(), and/or setpriority() is undefined, try
    defining NO_RANDOM and/or NO_SETPRIORITY, as appropriate, and
    recompiling.


BUILDING UNDER SUNOS 4.x

    I believe something in dither.c exercises an optimizer bug in
    SunOS 4.1.3 /bin/cc. When I compile using -O or -O2, the dither
    code either causes a segmentation violation or (worse) runs
    without crashing but produces incorrect output. This code works
    fine under all the other compilers I can get my hands on,
    however. So, if possible, don't use SunOS 4.1.3 /bin/cc to compile
    xearth, or, if you have no other compilers, don't use optimization
    when compiling dither.c.


MANIFEST

    README              miscellaneous info
    INSTALL             this file
    HISTORY             release history
    BUILT-IN            built-in marker data
    Imakefile           for use with "imake"
    Makefile.DIST       for use with "make"
    xearth.man          man page

    GAMMA-TEST          describes gamma-test.gif
    gamma-test.gif      gamma measurement image

    dither.c            source code
    extarr.[ch]
    gif.c
    gifint.h
    giflib.h
    gifout.c
    kljcpyrt.h
    mapdata.c
    markers.c
    ppm.c
    render.c
    resources.c
    scan.c
    sunpos.c
    x11.c
    xearth.[ch]

----------------------------------------------------------------

Copyright (C) 1989, 1990, 1993-1995, 1999 Kirk Lauritz Johnson

Parts of the source code (as marked) are:
  Copyright (C) 1989, 1990, 1991 by Jim Frost
  Copyright (C) 1992 by Jamie Zawinski <jwz@lucid.com>

Permission to use, copy, modify and freely distribute xearth for
non-commercial and not-for-profit purposes is hereby granted without
fee, provided that both the above copyright notice and this permission
notice appear in all copies and in supporting documentation.

Unisys Corporation holds worldwide patent rights on the Lempel Zev
Welch (LZW) compression technique employed in the CompuServe GIF image
file format as well as in other formats. Unisys has made it clear,
however, that it does not require licensing or fees to be paid for
freely distributed, non-commercial applications (such as xearth) that
employ LZW/GIF technology. Those wishing further information about
licensing the LZW patent should contact Unisys directly at
(lzw_info@unisys.com) or by writing to

  Unisys Corporation
  Welch Licensing Department
  M/S-C1SW19
  P.O. Box 500
  Blue Bell, PA 19424

The author makes no representations about the suitability of this
software for any purpose. It is provided "as is" without express or
implied warranty.

THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
