This file describes how to compile NETPBM with DICE (registered version).
You need a real "make" program (the "dmake" supplied with DICE won't work for
this), and "patch".  The "make" program should ignore a WARN return code.
Compilation requires about 4MB RAM and 6MB of HD space, and takes about
45 minutes on a 25MHz 68030.

Compilation of the TIFF library is not covered in this file. A compiled
TIFF lib is available in the dicelibs archive (see "NETPBM.INTRO" for
FTP addresses).  Copy this library to the netpbm/libtiff directory.


(1) CD into netpbm/amiga and compile dice_stack.c with
        dcc -c dice_stack.c

(2) Set the environment variable "USER" to your name, like this:
        setenv USER "Al Bundy"
    CD into the toplevel netpbm directory and execute the shell-script
    "stamp-date.amiga".  This will create the file "compile.h".

(3) Apply the patch:
        patch -l < amiga/DICE.PATCH
    This installs a workaround for a DICE bug in two source files.  If you
    are using a DICE version newer than 2.07.56R, this bug might already be
    fixed.  To test this, compile this program:
        main() { double d = 0.5; int i = 2; i *= d; printf("%d\n", i); }
    If the result is "0", the bug still exists.

(4) Edit pbmplus.h.  The following symbols should be set:
        A_SMALLSTACK (obsolete, no longer used)
        A_FRAGARRAY
        A_RGBENV     (optional, but recommended)
        A_STRERROR

(5) There is no toplevel Makefile. CD into netpbm/pbm and type
        make -f Makefile.dice all     for separate binaries
    or  make -f Makefile.dice merge   for a merged binary (see "NETPBM.INTRO")
    Repeat this in the directories netpbm/pgm, netpbm/ppm and netpbm/pnm,
    in this order.  If you are changing the compiler options, make sure to
    change them in all four makefiles.

(6) The binaries are now in netpbm/p?m/bin, just move them to a directory in
    your search path.  See the file "NETPBM.INTRO" for more installation info.
    Note that binaries created by you will not use the PBMMEM environment
    variable.


Here is a short explanations of compiler options used in the DICE Makefiles:
    -E xxx      write error messages into file xxx
    -ms         place strings constants in read-only code hunk
    -mu         unix-compat, if there are two definitions for the
                same variable (at the same scope), merge them into one
    -gs         generate stack-checking code (see dice_stack.c: whenever
                available stack falls below _stack_fudge, allocate a new stack
                of size _stack_chunk)
    -proto      strict prototype checking
    -mRR        functions take their args in registers (requires full prototyping)
    -mD         large data model (absolute addressing instead of A4-rel)
    -mC         large code model (absolute addressing instead of PC-rel)
    -r          generate "pure" executable (no -mD and -mC allowed)
    -S          alternate library section naming (used for link libs only)
    -s          DEBUG: don't strip symbol information from executable
    -d1         DEBUG: include LINE information in executable (for Enforcer's FindHit)

Naming conventions in the Makefiles:
    RLIBP?M     small data library, args in registers
    RLLIBP?M    large data library, args in registers
    SLIBP?M     small data library, args on stack
    SLLIB?M     large data library, args on stack

    RALLCFLAGS  options to compile register-args executables
    SALLCFLAGS  options to compile stack-args executables
    MALLCFLAGS  options to compile merged executable

    BINS        small data executables, register-args
    LBINS       large data executables, register-args
    SBINS       small data executables, stack-args
    SLBINS      large data executables, stack-args

    MATHBINS    \
    LMATHBINS    \  same as above, but need floating-point
    SMATHBINS    /  version of printf/scanf (link with math-lib)
    SLMATHBINS  /

    *.or        library object file (small data, reg-args)
    *.os        library object file (small data, stack args)
    *.olr       library object file (large data, reg-args)
    *.ols       library object file (large data, stack args)
    *.om        object file for merged binary (large data, stack args)

I tried to use small data/reg-args whenever possible.  Some programs
had to be compiled with large data, and some with stack-args or the
compiler would complain.



-Ingo
email: Ingo.Wilken@informatik.uni-oldenburg.de

