ka (04/27/83)
Notes won't compile under UNIX 4.0 as distributed.
PROBLEM: globs.h #includes the nonexistant file <whoami.h>.
SOLUTION: Call uname to find out the system name. The preprocessor
variable UNAME functions like the variable PORTBINARY except
that it calls uname instead of gethost.
CHANGES:
In parms.h, add the line
#define UNAME
between the lines
#if defined(UNIX40)
#endif
In globs.h, replace lines 13 through 17:
#if defined(PORTBINARY)
char sysname[32]; /* holds system name */
#else
#include <whoami.h>
#endif defined(PORTBINARY)
with the code:
#if defined(PORTBINARY) || defined(UNAME)
char sysname[32]; /* holds system name */
#else
#include <whoami.h>
#endif defined(PORTBINARY) || defined(UNAME)
#if defined(UNAME)
#include <sys/utsname.h> /* for uname sys call */
#endif defined(UNAME)
Append the following code to main.i:
#if defined(UNAME) /* like PORTBINARY but use uname */
{
struct utsname name;
uname(&name);
strcpy(sysname, name.nodename);
}
#endif defined(UNAME)
PROBLEM: The routine ttystrt references nonexistant members of the termio
structure sg_erase and sg_kill.
SOLUTION: Use c_cc[VERASE] and c_cc[VKILL] instead.
CHANGES:
In miscio.c change lines 88 through 102:
#if defined(UNIX40)
tty.c_lflag & = NOT ICANON;
tty.c_cc[VEOF] = 1;
tty.c_cc[VEOL] = 1;
ospeed = tty.c_cflag & CBAUD;
#endif defined(UNIX40)
#if defined(BSD41)|| defined(BSD41A) || defined(BSD28) || defined(V7)
oldmode = tty.sg_flags;
tty.sg_flags | = CBREAK;
ospeed = tty.sg_ospeed; /* speed of terminal */
#endif defined(BSD41)|| defined(BSD41A) || defined(BSD28) || defined(V7)
ttyerase = tty.sg_erase; /* grab erase character */
ttykill = tty.sg_kill; /* and kill character */
with the following code:
#if defined(UNIX40)
tty.c_lflag & = NOT ICANON;
tty.c_cc[VEOF] = 1;
tty.c_cc[VEOL] = 1;
ospeed = tty.c_cflag & CBAUD;
ttyerase = tty.c_cc[VERASE]; /* grab erase char */
ttykill = tty.c_cc[VKILL]; /* and kill char */
#endif defined(UNIX40)
#if defined(BSD41)|| defined(BSD41A) || defined(BSD28) || defined(V7)
oldmode = tty.sg_flags;
tty.sg_flags | = CBREAK;
ospeed = tty.sg_ospeed; /* speed of terminal */
ttyerase = tty.sg_erase; /* grab erase character */
ttykill = tty.sg_kill; /* and kill character */
#endif defined(BSD41)|| defined(BSD41A) || defined(BSD28) || defined(V7)
PROBLEM: Newsinput.c calls nonexistant routines index and rindex.
SOLUTION: Use strchr and strrchr.
CHANGES:
In parms.h, insert the lines:
#define index strchr
#define rindex strrchr
inside the "#if defined(UNIX40)" section
PROBLEM: Makefile attempts to execute the nonexistant program ranlib.
SOLUTION: Don't run it.
CHANGES:
I didn't bother to write code to call ranlib only on Berkeley systems.
Instead I just deleted the call.
Kenneth Almquist