From damian@uk.ac.rl.inf Mon Sep  4 02:46:40 1989
Received: from rl.inf by abacu.strath.ac.uk; Mon, 4 Sep 89 02:46:36 GMT
Received: from pyr-a by inf.rl.ac.uk; Fri, 1 Sep 89 16:35:15 BST
Date: Fri, 1 Sep 89 16:33:40-0000
From: damian@uk.ac.rl.inf
Message-Id: <8909011533.AA27319@pyr-a>
To: joe@uk.ac.strath.abacu
Subject: nip errors (duplicate)
Cc: 
Status: R

can't hhkick my original mail message (it goes from the mailserver),
and it has backed off to only retrying every 2-3 hours, so I'm reposting
-------------------

1)  int?mode.c, dec?mode.c and xmatch.c are include files for decomp.c
    and interpre.c.  They are not compiled on their own.  However, when
    compiling interpre.c, any error message will indicate xmatch.c as
    the file in error, just like a error in a .h file is flagged as
    such.  I note that there is no .error file for interpre.c or
    decomp.c - does that mean that they compile ok?  Compiling the
    *mode and xmatch files on their own should give errors like those
    seen, as the necessary declarations (eg for "word") are given in
    nip.h, included by intrepre.c before including xmatch.c.
	Personally, I would have called these files .h, even though
    they contain executable code.  Restricting include files to
    declarations only is not normal C practice (shades of fortran!)

2)  the errors arising in load.c are due to the two things.
 a) the sun a.out.h file is just a switch to load the correct machine
    architecture file, from machine/a.out.h.  In this there is a 
    declaration of the namelist (=symbol table) structure, "nlist".
    Sun have modified this from the standard unix one by changing the
    first field, a char* to the symbol name "char *n_name" to a union
    of this field and a long "long n_strx".  They did this to simplify
    the code needed to look at symbol tables in objects on disk (eg
    when debugging a core file).  I assume MIPS donot nave a union in
    this position.  If so, replace both occurances of "n_un.n_name" in
    load.c with "n_name" - lines 116 and 123.  Use a #ifdef like this

    < line 116 in load.c
		nl[nlptr++].n_un.n_name = 
    > becomes
	#ifdef sun
		nl[nlptr++].n_un.n_name = 
	#else sun
		nl[nlptr++].n_name = 
	#endif
    The sun compiler defines the variable sun, the Hitech will define
    mips or something similar.

 b) the sun machine/a.out.h file #includes the file sys/exec.h.  This
    sys/exec.h file defines the process size table "exec" for the a.out
    type files.  This is needed by the sun a.out.h file so that it can
    dynamically adjust for the different sun architectutes.  I suspect
    that the Hitech a.out.h file does not #include this.  In this case
    you will just have to #include it yourself immediately after the
    #include for a.out.h.

If the n_list and exec structures on the Hitech are sufficiently
different from the suns that the above fixes don't work, I'm afraid you
will have to send me a copy of all its include files so I can work out
what the architecture differences are.  Judging from the code, I think
that once you have nip compiled, it will run - it is a model of well
written portable code for notoriously machine dependent application
(compiler/interpreters).  Best of luck,

Damian
        Damian Mac Randal                Snail Mail: Informatics Dept,
                                                     Rutherford Appleton Lab,
INTERNET: damian%inf.rl.ac.uk@nfsnet-relay.ac.uk     Chilton,    Didcot,
  BITNET: damian%inf.rl.ac.uk@ukacrl.bitnet          Oxon.  OX11 0QX,    U.K.
    UUCP: damian%inf.rl.ac.uk@ukc.uucp        Phone: +44 235 445403
   JANET: damian@uk.ac.rl.inf                   Fax: 445831  Telex: 83159

