Installation on Amiga (AmigaOS):
---------------------------------

1. Install a GNU GCC development platform

   I don't believe CLISP can be compiled with anything else than GCC
   on the Amiga. CLISP source heavily stresses any C compiler.

   I managed to compile early versions of CLISP on my stock B2000 with 5MB
   of RAM and gcc-1.40, throwing every program out of the machine (including
   RAM: and LoadWB) and running each compiler stage separately. Luckily,
   when I hit GCC bugs, newer bug-freed versions were available. Compilation
   of CLISP has lead to several bug-reports in gnu.gcc.bugs. At present
   you'll need at least gcc-2.5.8.

2. Install Amiga includes

   They are copyrighted by Commodore-Amiga and can be obtained on the Amiga
   Developer CD or on Fred Fish CDs. See your Amiga FAQ.

3. Make directory trees

   Leave source in src/ (only *.d, *.h and *.lisp files are needed) and
   utilities in utils/ (only comment5, ansidecl and cvtmsgs are needed).
   Choose the version you want to build (see README.Amiga or README) and
   create directories like make.typ2/ at the same level as src/.

4. IxPrefs and ixemul.library `/' pathname translation

   In order to find include files located in /src/ relatively to the make.*
   directory, ixemul.library shouldn't translate /. As sh (which is called
   by GNU-make) doesn't seem to be able to handle this situation, a
   workaround is to assign src: and utils: to the src/ and utils/ directories
   respectively.

5. Check your stack sizes

   gcc-cc1 uses up to 450000 bytes of stack in EVAL.D.
   gcc-cpp and gcc-as get along with 40000 bytes.
   gcc-ld requires 200000 bytes.

   This is my observed stack usage relative to GCC-2.5.8 and can increase
   when adding new features to CLISP. If your make program cannot set stack
   sizes, you'll have to run everything with the maximum stack. I have my
   own make program which recognizes and honours the stack command.

6. Make the clisp support library found in amiga/jchlib/

   This is a micro C startup library containing the bare minimum to start a
   program from CLI or WorkBench, setjmp() and strlen(). It's used by CLISP
   but could be by other programs too. It doesn't require ixemul.library.
   From WorkBench, it opens the window specified by the WINDOW tooltype,
   initializes argv[] with ARGS if present and supports project icons
   (currently all in the same directory only).

   Compiling CLISP without using my library has never been tested.
   Nevertheless it should work.

7. Makefile

   Due to lack of RAM (I have 10 MB :-), big CLISP source files and the huge
   stack needed by cc1, it was not possible for me to use a generic Makefile
   and simply run gcc with a stack set to 400000 bytes. That's why I'm using
   a private make which nobody but I has. It recognizes the stack command.
   Furthermore my Makefile calls each compiler stage directly, saving the
   space for the gcc driver.

   Now, with a normal (GNU-)make, I nevertheless managed to build CLISP by
   running VMM, a virtual memory manager and setting the maximal stack
   before starting make. It's a huge waste of resources and won't run in a
   10MB system without virtual memory, but you could also try this. Link or
   copy the /bin/true command to make.*/stack so that /bin/sh will find a
   stack command (it's called by the Makefile). If /bin/sh can't find cc1,
   cpp etc. because they are deep inside the gcc-lib hierarchy, set a local
   variable PATH to all the paths. Make and thus sh will inherit this
   variable:

        set PATH /gg/bin:/gg/lib/gcc-lib/m68k-unknown-amigaos/2.x.x:/C:/utils/:.

8. Edit

        make.*/Makefile

   according to your choices and tastes. By default, you'll make the
   international (well, english, french and german) version of CLISP, which
   requires more space than a single language one that can be built by
   adding one of -DENGLISH, -DFRANCAIS or -DDEUTSCH flags to the compiler.
   See src/lispbibl.d for everything that can be defined. The amiga or AMIGA
   define serves to recognize the Amiga (don't set them for now under
   Amiga-UNIX). Interesting preprocessor flags include NO_TYPECODES
   (preferred), AMIGA3000 (don't set when using NO_TYPECODES), MC680Y0 for
   68020 or better (implied by AMIGA3000), MC68000 for 68000 only, and WIDE
   for 64 bit ints (for 32 bit clean pointers).

   Extensions like gettext (must define NO_GETTEXT) and readline cannot
   currently be added as they use stdio and malloc() whereas CLISP uses the
   low-level and unbuffered dos.library routines for i/o and AllocMem() etc.
   for all memory.  Don't mess with it.  Using UNIX-like (open) or ANSI
   (fopen) stdio would require a rewrite of several source files.

   The HAVE_FFI version which provides a linkable CLISP was built and
   provided in the 1996-05-30 release.  It might be dangerous to build in
   the NO_TYPECODES configuration because all linked object and subr tables
   must be longword aligned, which gcc apparently cannot guarantee, although
   LoadSeg() does it (for obvious BCPL reasons).  You have to build, run
   lisp.run and relink in a different order or with a dummy object file
   causing a two byte displacement in case you get an error message.

9. Edit

        src/config.lisp
        src/timezone.lisp

   See README for the one line to modify in timezone.lisp. In config.lisp,
   you may wish to set your favourite editor or restrict the *load-paths*.

10. Remove

   every $ from the file src/ari68020.d
        mv src/ari68020.d src/ari68020.mit.d
        sed > src/ari68020.d -e "s/$//g" src/ari68020.mit.d
   Quote $ according to your shell conventions and sed version.

11. Type

        make    (while in a make.* directory)   (-low)
        make TYP2=1 C20=1                       (-typ2, 68020 version)
        make HIGH=1                             (-high)
        make WIDE=1                             (-wide)
        make C00=1                              (-00)

   and wait for things to happen. One night on a B2000, more than one hour
   on an A4000/40.

   Hint: use FIFO: (by Matt Dillon) in order to get a logfile.
        NewShell FIFO:shell/rwkecs
        Run >nil: remcli shell
        Run >nil: cat FIFO:shell/rmt >>compile.log
        echo "Log going into compile.log."
   Or use KingCon, ConsoleBuffer or else the Recorder program from the
   hacks204 archive by Andy Finkel (doesn't seem to work with 3.0).

12. Patches

   Gcc-2.3.3 -O2 -fomit-frame-pointer put several bugs in the compiler
   output. I previously corrected two of them by hand-patching the assembly
   files. Gcc-2.5.7 produced correct output but for 68020 and above machines
   only. Gcc-2.5.8 produces few bugs and only in the -DWIDE version. Beta
   versions of gcc-2.6.0 were not stable enough for compilation of the
   -DWIDE version. Gcc-2.7.2 from 1996 compiled everything correctly. I'm
   using gcc-2.7.2.

   Here's what to patch in control.s:_C_go with gcc-2.5.8 -DWIDE (before the
   second eql):
        movel a5@(-12),sp@-
        movel a5@(-16),sp@-
#APP
| Should only be incremented once!
|       movel d1,a2
|       addql #8,d1
#NO_APP
        movel d1,a2
        addql #8,d1
        movel a2@(4),sp@-
        movel a2@,sp@-
        movel d1,a5@(-28)
        jbsr _eql

   Here's a patch for predtype.s:_equalp (case_string dotimespL loop):
        movel a5@(-32),d1
        movel d1,a1
        addql #1,d1
        moveb a1@,d0
#APP
| Save incremented address!
        movel d1,a5@(-32)
#NO_APP
        movel d0,sp@-
        jbsr a6@

   Nobody guarantees there aren't more bugs not uncovered by the tests.

13. Type

        make interpreted.mem    a memory image with everything
                                 uncompiled (size 1.7MB)
        make lispinit.mem       makes all *.fas files and
                                 a memory image with everything
                                 compiled (size 500KB, 1MB for wide version)
   The second step is the most time consuming.

14. A test-suite

   The directory clisp/tests/ contains a large number of test files. While in
   CLISP, do

        (cd "/tests/")
        (load "tests")
        (run-all-tests)

   and have a look at possibly resulting .erg files. Only alltest.erg should
   remain in the *-low version and report some trigonometric differences.

15. Documentation

   Unluckily for an Amiga-only site, I generated the .man file on a UNIX
   box and displayed it in an EMACS buffer (M-x man) from where I saved it.
   I'd like to know about better ways to do this.

16. Known compiler warnings

   This gives you an idea of what not to look at. Some warnings, especially
   in LISPARIT.D vary among the versions.

/src/array.d: In function `C_make_array':
/src/array.d:2445: warning: `fillpointer' may be used uninitialized in this function
/src/array.d: In function `C_adjust_array':
/src/array.d:2742: warning: `fillpointer' may be used uninitialized in this function
/src/charstrg.d: In function `test_index_arg':
/src/charstrg.d:1418: warning: `i' may be used uninitialized in this function
/src/charstrg.d: In function `test_string_limits':
/src/charstrg.d:1508: warning: `start' may be used uninitialized in this function
/src/charstrg.d:1509: warning: `end' may be used uninitialized in this function
/src/charstrg.d: In function `test_1_stringsym_limits':
/src/charstrg.d:1587: warning: `start' may be used uninitialized in this function
/src/charstrg.d:1588: warning: `end' may be used uninitialized in this function
/src/charstrg.d: In function `test_2_stringsym_limits':
/src/charstrg.d:1659: warning: `start1' may be used uninitialized in this function
/src/charstrg.d:1660: warning: `end1' may be used uninitialized in this function
/src/charstrg.d:1689: warning: `start2' may be used uninitialized in this function
/src/charstrg.d:1690: warning: `end2' may be used uninitialized in this function
/src/charstrg.d: In function `C_substring':
/src/charstrg.d:2322: warning: `start' may be used uninitialized in this function
/src/charstrg.d:2323: warning: `end' may be used uninitialized in this function
/src/control.d: In function `C_tagbody':
/src/control.d:1439: warning: variable `body' may be clobbered by `longjmp' or `vfork'
/src/eval.d: In function `invoke_handlers':
/src/eval.d:686: warning: variable `other_ranges' may be clobbered by `longjmp' or `vfork'
/src/eval.d:689: warning: variable `FRAME' may be clobbered by `longjmp' or `vfork'
/src/eval.d:702: warning: variable `i' may be clobbered by `longjmp' or `vfork'
/src/eval.d: In function `funcall_iclosure':
/src/eval.d:2371: warning: argument `closure' may be clobbered by `longjmp' or `vfork'
/src/eval.d:2372: warning: argument `args_pointer' may be clobbered by `longjmp' or `vfork'
/src/eval.d:2373: warning: argument `argcount' may be clobbered by `longjmp' or `vfork'
/src/eval.d: In function `eval':
/src/eval.d:2849: warning: variable `_SetSignal_re' may be clobbered by `longjmp' or `vfork'
/src/eval.d:2849: warning: variable `_n1' may be clobbered by `longjmp' or `vfork'
/src/eval.d:2846: warning: argument `form' may be clobbered by `longjmp' or `vfork'
/src/eval.d: In function `eval_no_hooks':
/src/eval.d:2906: warning: argument `form' may be clobbered by `longjmp' or `vfork'
/src/eval.d: In function `interpret_bytecode_':
/src/eval.d:5750: warning: variable `closure' may be clobbered by `longjmp' or `vfork'
/src/eval.d:5755: warning: variable `byteptr' may be clobbered by `longjmp' or `vfork'
/src/eval.d:5763: warning: variable `closureptr' may be clobbered by `longjmp' or `vfork'
/src/eval.d:5746: warning: argument `codeptr' may be clobbered by `longjmp' or `vfork'
/src/hashtabl.d: In function `hashcode':
/src/hashtabl.d:438: warning: statement with no effect
/src/hashtabl.d: In function `C_class_tuple_gethash':
/src/hashtabl.d:1326: warning: statement with no effect
/src/io.d: In function `C_bit_vector_reader':
/src/io.d:3155: warning: `ch' may be used uninitialized in this function
/src/io.d: In function `C_vector_reader':
/src/io.d:3245: warning: `el' may be used uninitialized in this function
/src/lisparit0.d: In function `divu_3232_3232_':
/src/lisparit0.d:1130: warning: statement with no effect
/src/lisparit0.d: In function `make_random_state':
/src/lisparit0.d:22269: warning: assignment makes integer from pointer without a cast
/src/pathname.d: In function `parse_logical_word':
/src/pathname.d:1027: warning: `ch' may be used uninitialized in this function
/src/rexx.d: In function `C_rexx_put':
/src/rexx.d:89: warning: `vargs' may be used uninitialized in this function
/src/spvw.d: In function `speicher_laenge':
/src/spvw.d:2364: warning: control reaches end of non-void function
/src/spvw.d: In function `alive':
/src/spvw.d:3556: warning: control reaches end of non-void function
/src/spvw.d: In function `gc_compact_from_varobject_page':
/src/spvw.d:5786: warning: `p2' may be used uninitialized in this function
/src/spvw.d:5787: warning: `l2' may be used uninitialized in this function
/src/spvw.d: In function `gc_compact_from_cons_page':
/src/spvw.d:5840: warning: `p2' may be used uninitialized in this function
/src/spvw.d:5841: warning: `l2' may be used uninitialized in this function
/src/spvw.d: In function `asciz_out':
/src/spvw.d:7859: warning: initialization discards `const' from pointer target type
/src/spvw.d: In function `main':
/src/spvw.d:9580: warning: variable `argv_memneed' may be clobbered by `longjmp' or `vfork'
/src/spvw.d:9582: warning: variable `argv_stackneed' may be clobbered by `longjmp' or `vfork'
/src/spvw.d: In function `loadmem':
/src/spvw.d:11526: warning: empty body in an else-statement
/src/stream.d: In function `make_file_stream':
/src/stream.d:8793: warning: `art' may be used uninitialized in this function

   Additionaly for the -low and -00 versions:
/src/lisparit0.d: In function `I_to_UL':
/src/lisparit0.d:1954: warning: comparison is always 1 due to limited range of data type
/src/lisparit0.d: In function `I_to_L':
/src/lisparit0.d:2001: warning: comparison is always 1 due to limited range of data type
/src/lisparit0.d:2030: warning: comparison is always 0 due to limited range of data type
/src/lisparit0.d: In function `I_to_UQ':
/src/lisparit0.d:2092: warning: comparison is always 1 due to limited range of data type
/src/lisparit0.d: In function `LF_I_scale_float_LF':
/src/lisparit0.d:16261: warning: comparison is always 1 due to limited range of data type
/src/lisparit0.d:16288: warning: comparison is always 0 due to limited range of data type


Authors:
--------

        Bruno Haible
        Michael Stoll

Email: haible@clisp.cons.org

Amiga Port by:
--------------

        Jörg Höhle

Email: Joerg.Hoehle@gmd.de
