Article View: net.notes
Article #143compiling notes 1.3 under UNIX 4.0
From: utzoodecvaxharpofloydvax135ariel...
Date: Wed, 27 Apr 1983 13:58
Date: Wed, 27 Apr 1983 13:58
103 lines
3493 bytes
3493 bytes
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
Technical Details
Message-ID:
<bnews.spanky.289>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<1950@uiucdcs.UUCP>Show Full Headers
Complete Article Headers
From: utzoo!decvax!harpo!floyd!vax135!ariel!houca!hogpc!houxm!houxz!hocda!spanky!ka Newsgroups: net.notes Title: compiling notes 1.3 under UNIX 4.0 Article-I.D.: spanky.289 Posted: Wed Apr 27 13:58:00 1983 Received: Thu Apr 28 06:27:32 1983 References: <1950@uiucdcs.UUCP> Subject: compiling notes 1.3 under UNIX 4.0 Date: Wed, 27 Apr 1983 13:58:00 +0000 Message-ID: <bnews.spanky.289>