[comp.unix.aux] comments on building emacs-18.55

chet@Advansoft.COM (Chet Wood) (08/15/90)

I just built emacs using the diffs on apple.com-- it has Dave Berry's
name on it:
	emacs-18.55.aux.diffs.Z

I got it built but had to hack things around a little bit. (Guess I'm
spoiled. On the Sun, all you have to do to make gnu things is type
"make.")

The most surprising thing is that, though the symbol AUX is used
liberally in the patches, it is never defined! Things seemed to
compile OK without it-- I only discovered it because I defined
HAVE_X_WINDOWS, so had to change a few things around. Trying to make
my changes dependent on AUX wasn't working, so I checked around
and couldn't find it defined anywhere!

I also ran into the problem someone else mentioned on the net of
clashes between the variable PC in the term*.c and gm.h files, and
the assembler mnemonic for the PC register. Could someone please
explain why this occurs? I haven't used a C compiler in a long time
that would allow such a clash. I saw the term "register prefixes" used
in a posting but I could find no such term in the gcc documentation.

Here are the patches to fix what I found. They can probably be
appended to Dave Berry's patches and applied all at once. I haven't
done extensive testing on the resultant emacs, but it does come up
under X and visit files...

diff -rcN dist-18.55/src/sysdep.c emacs/src/sysdep.c
*** dist-18.55/src/sysdep.c	Tue Aug 14 13:04:59 1990
--- emacs/src/sysdep.c	Tue Aug 14 15:52:37 1990
***************
*** 1785,1791 ****
  }
  #endif BSD4_1
  
! #ifdef USG
  /*
   *	The BSD random(3) returns numbers in the range of
   *	0 to 2e31 - 1.  The USG rand(3C) returns numbers in the
--- 1785,1791 ----
  }
  #endif BSD4_1
  
! #if defined(USG) && !defined(HAVE_X_WINDOWS)
  /*
   *	The BSD random(3) returns numbers in the range of
   *	0 to 2e31 - 1.  The USG rand(3C) returns numbers in the
diff -rcN dist-18.55/src/x11term.c emacs/src/x11term.c
*** dist-18.55/src/x11term.c	Tue Oct 31 14:41:39 1989
--- emacs/src/x11term.c	Tue Aug 14 15:18:56 1990
***************
*** 71,77 ****
  #include "x11term.h"
  
  #ifdef USG
! #ifdef IRIS_4D
  #include <sys/time.h>
  #else
  #include <time.h>
--- 71,77 ----
  #include "x11term.h"
  
  #ifdef USG
! #if defined(IRIS_4D) || defined(AUX)
  #include <sys/time.h>
  #else
  #include <time.h>
diff -rcN dist-18.55/src/cm.h emacs/src/cm.h
*** dist-18.55/src/cm.h	Tue Feb  9 11:12:41 1988
--- emacs/src/cm.h	Tue Aug 14 15:05:29 1990
***************
*** 65,71
  		cc_tab;
  } Wcm;
  
! extern char PC;			/* Pad character */
  extern short ospeed;		/* Output speed (from sg_ospeed) */
  
  /* Shorthand */

--- 65,71 -----
  		cc_tab;
  } Wcm;
  
! extern char _PC;			/* Pad character */
  extern short ospeed;		/* Output speed (from sg_ospeed) */
  
  /* Shorthand */
diff -rcN dist-18.55/src/term.c emacs/src/term.c
*** dist-18.55/src/term.c	Tue May  9 14:45:04 1989
--- emacs/src/term.c	Tue Aug 14 15:01:49 1990
***************
*** 1066,1072
    if (!TS_fwd_scroll)
      TS_fwd_scroll = Down;
  
!   PC = TS_pad_char ? *TS_pad_char : 0;
  
    if (TabWidth < 0)
      TabWidth = 8;

--- 1066,1072 -----
    if (!TS_fwd_scroll)
      TS_fwd_scroll = Down;
  
!   _PC = TS_pad_char ? *TS_pad_char : 0;
  
    if (TabWidth < 0)
      TabWidth = 8;
diff -rcN dist-18.55/src/termcap.c emacs/src/termcap.c
*** dist-18.55/src/termcap.c	Sat Jun 18 06:19:41 1988
--- emacs/src/termcap.c	Tue Aug 14 14:59:16 1990
***************
*** 295,301
  /* Outputting a string with padding */
  
  short ospeed;
! char PC;
  
  /* Actual baud rate if positive;
     - baud rate / 100 if negative.  */

--- 295,301 -----
  /* Outputting a string with padding */
  
  short ospeed;
! char _PC;
  
  /* Actual baud rate if positive;
     - baud rate / 100 if negative.  */
***************
*** 351,357
      }
  
    while (padcount-- > 0)
!     (*outfun) (PC);
  }
  
  /* Finding the termcap entry in the termcap data base */

--- 351,357 -----
      }
  
    while (padcount-- > 0)
!     (*outfun) (_PC);
  }
  
  /* Finding the termcap entry in the termcap data base */
diff -rcN dist-18.55/src/terminfo.c emacs/src/terminfo.c
*** dist-18.55/src/terminfo.c	Fri Jun 12 18:41:15 1987
--- emacs/src/terminfo.c	Tue Aug 14 14:59:38 1990
***************
*** 22,28
     so that we do not need to conditionalize the places in Emacs
     that set them.  */
  
! char *UP, *BC, PC;
  short ospeed;
  
  static buffer[512];

--- 22,28 -----
     so that we do not need to conditionalize the places in Emacs
     that set them.  */
  
! char *UP, *BC, _PC;
  short ospeed;
  
  static buffer[512];
diff -rcN dist-18.55/src/s-aux.h emacs/src/s-aux.h
*** dist-18.55/src/s-aux.h	Tue Aug 14 17:09:41 1990
--- emacs/src/s-aux.h	Tue Aug 14 17:09:17 1990
***************
*** 28,33 ****
--- 28,34 ----
  #define UNIPLUS
  #define USG5
  #define USG
+ #define AUX
  
  /* #define HPUX */
  /* #define UMAX */
--
Chet Wood                       ~                         (408)727-3357 X269
   chet@Advansoft.Com    .  Advansoft Research Corporation
     arc!chet@apple.COM    .      4301 Great America Parkway, 6th floor
            apple!arc!chet   .            Santa Clara, CA 95054, USA

rmtodd@servalan.uucp (Richard Todd) (08/15/90)

chet@Advansoft.COM (Chet Wood) writes:

>I just built emacs using the diffs on apple.com-- it has Dave Berry's
>name on it:
>	emacs-18.55.aux.diffs.Z

>I got it built but had to hack things around a little bit. (Guess I'm
>spoiled. On the Sun, all you have to do to make gnu things is type
>"make.")

(Well, usually you have to at least do a "config" or suchlike to setup the 
proper header files).  But anyway, there's another port of Emacs 18.55 done
by a guy in the Apple Federal Systems Group, Ron Flax.  It is (or at least
was) available for anon. ftp from afsg.apple.com.  All I had to do to get
that one to run was untar it and type make.  Could Ron Flax or Dave Berry
clarify what the differences are between the two ports?  Since my Mac isn't
directly connected to the Internet and I thus have to download everything thru
a 2400bps modem, I'm not really in a position to grab both copies of GNU
Emacs just to see what the differences are....

>I also ran into the problem someone else mentioned on the net of
>clashes between the variable PC in the term*.c and gm.h files, and
>the assembler mnemonic for the PC register. Could someone please
>explain why this occurs? I haven't used a C compiler in a long time
>that would allow such a clash. I saw the term "register prefixes" used
>in a posting but I could find no such term in the gcc documentation.

The problem is that when the compiler generates code for something like, say
"pc = 2", it produces something like 
	mov	2,pc
(possibly not quite this--I'm not a 680x0 assembler guru), and the assembler
interprets this as an instruction to put something in the PC register, instead
of into the variable labeled "pc".  This is a problem that's been biting 
compiler writers for years (I recall having to deal with it when hacking on
Small C for my TRS-80 way back when...).  The solution that John Coolidge
implemented was to change the assembler (he's using GAS, the GNU Assembler) 
so that it expects registers to be referred to by names beginning with %, e.g.
%pc, %sp, etc.  Since % can't ever appear in a variable name in C, this means
register names will never conflict with variable names.  A version of GCC and
GAS rigged to use this modified register syntax (the so-called "register
prefixes") should be  available on wuarchive.wustl.edu.  
--
Richard Todd	rmtodd@uokmax.ecn.uoknor.edu  rmtodd@chinet.chi.il.us

demarsee@gamera.acs.syr.EDU (Darryl E. Marsee) (08/16/90)

>(Well, usually you have to at least do a "config" or suchlike to setup the
>proper header files).  But anyway, there's another port of Emacs 18.55 done
>by a guy in the Apple Federal Systems Group, Ron Flax.  It is (or at least
>was) available for anon. ftp from afsg.apple.com.  All I had to do to get
>that one to run was untar it and type make.

 About this port, I retreived it and tried to do the make.  However, I
 don't have the gcc compiler, so I changed the Makefile to use the cc
 compiler, and I got the following error message:

 cc: can't exec /lib/nas: No such file or directory

 Now, I checked my original CD shipment of A/UX 2.0, and I can't find
 nas anywhere under lib.  Does anyone know where I can find it so I can
 (finally) get emacs compiled on my machine?
--
 
Regards,

Darryl Marsee
Syracuse University
<demarsee@gamera.cns.syr.edu>

rmtodd@uokmax.uucp (Richard Michael Todd) (08/16/90)

demarsee@gamera.acs.syr.EDU (Darryl E. Marsee) writes:

> About this port, I retreived it and tried to do the make.  However, I
> don't have the gcc compiler, so I changed the Makefile to use the cc
> compiler, and I got the following error message:

> cc: can't exec /lib/nas: No such file or directory
  Weird...  Evidently he didn't make sure the Makefile worked right when 
compiling for stock cc; at a guess, he's passing some option that's 
confusing cc and making it look for the assembler with the wrong filename.

> Now, I checked my original CD shipment of A/UX 2.0, and I can't find
> nas anywhere under lib.  Does anyone know where I can find it so I can
> (finally) get emacs compiled on my machine?

Wouldn't it be simpler to just get a copy of GCC and install it?  You *might*
be able to get Emacs to compile with straight cc, but getting other GNU
stuff to compile with cc may not be possible.  Besides, GCC's optimizer is
a whole lot better than cc's...
-- 
Richard Todd   rmtodd@chinet.chi.il.us  or  rmtodd@uokmax.ecn.uoknor.edu  

demarsee@gamera.acs.syr.EDU (Darryl E. Marsee) (08/17/90)

>Wouldn't it be simpler to just get a copy of GCC and install it?  You *might*
>be able to get Emacs to compile with straight cc, but getting other GNU
>stuff to compile with cc may not be possible.  Besides, GCC's optimizer is
>a whole lot better than cc's...

 Well, I retreived gcc and got it to work, but now, another problem.
 While doing the emacs make, I get the following message:

 Warning: lisp library (/users/demarsee/lib/lisp) does not exist.
 
 Where /users/demarsee/lib is my LIBDIR.  Now, I go hunting for lisp,
 and I can't find it anywhere.  Is this something else I need to get
 from elsewhere, or is it just buried where I can't find it in some
 directory somewhere?

 Another question:  If you make private System Folders for each user,
 can they reside on an NFS volume?  I created a user whose home directory
 is on an NFS volume mounted as a directory under / (/home, to be precise),
 but issuing the systemfolder command just gets a

 Shared files ...
 find: getwd: can't open ..
 Private files ...
 find: getwd: can't open ..
 
 and, if I create a System Folder on the local disk, then copy it over
 to the NSF volume, issuing a Mac32 command just gets me a "Can't open
 Toolbox Environment" message and drops me back into the console, even
 though it looks like all the symbolic links are fine.  Anyone got an
 idea why I can't get a System Folder to work on an NFS volume?
--
 
Regards,

Darryl Marsee
Syracuse University
<demarsee@gamera.cns.syr.edu>