[news.software.b] problem compiling rn

don@grc.UUCP (Donald D. Woelz) (09/22/89)

I am trying to compile rn, which I haven't done in a long, long time,
to bring it up to date (patch 40).  I am currently running some very
low patch level (I can't even remember which, it has been so long).

Anyway, I am having trouble building rn after applying all the patches.
There appear to be two problem areas, both related in some way to
definitions for typedef DIR.  Here is what the compiler has to say
about the situation:

	cc -c -O ngdata.c
"ngdata.c", line 187: dirp undefined
"ngdata.c", line 187: illegal indirection
*** Error code 1

and:

	cc -c -O util.c
"util.c", line 238: illegal indirection
"util.c", line 260: syntax error
"util.c", line 261: illegal character: 134 (octal)
"util.c", line 261: cannot recover from earlier errors: goodbye! (sic)
*** Error code 1

I am not well versed in the devious natures of C and the file system
structures so it leaves me unable figure out what is happening here.
Any suggestions as to what the problem might be?

I am running System V Release 3.0 on a National Semiconductor 32332 CPU.
(I know, don't tell me to get a real machine 8^).
-- 
Don Woelz              {ames, rutgers, harvard}!uwvax!uwmcsd4!grc!don
GENROCO, Inc.                              Phone: 414-644-8700
205 Kettle Moraine Drive North             Fax:   414-644-6667
Slinger, WI 53086                          Telex: 6717062 or 158279420

karl@ficc.uu.net (Karl Lehenbauer) (09/23/89)

In article <331@grc.UUCP> don@grc.UUCP (Donald D. Woelz) writes:
>I am trying to compile rn...

>Anyway, I am having trouble building rn after applying all the patches.

>	cc -c -O ngdata.c
>"ngdata.c", line 187: dirp undefined
>"ngdata.c", line 187: illegal indirection
>*** Error code 1

Yes, yes.  I just fought through this last night on System V/3.0 on a 386.
("rn" is wonderful, by the way, I'll never go back -- plus I'm kicking myself
for not having it the last three years, but anyway...)

There are three ways "rn" is supposed to be able to work with directories.
This is determined in the "Configure" script.  If you are on Berkeley, I guess,
it's in the system.  If your system has "readdir()" it uses that, otherwise
it (rn) uses its own included directory-reading stuff.  The problem is that
the readdir() stuff doesn't seem to work.  Even if you make it include the
right file from /usr/include or /usr/include/sys that defines the DIR
typedef, there is an illegal pointer/pointer combination because System V
is talking "struct dirent" and rn is talking "struct direct."

The answer is to comment out the stuff in the Configure script that ends
up saying something like "OK, you have readdir() so we'll use that" so
that it uses the builtin stuff instead.  Just comment out the if and
the three or so lines that find readdir, then comment out the else and
endif so Configure says something like "don't have either...using my own 
directory reader."

I haven't communicated this back to Larry Wall because god knows what rev
we're at.  I'll be addressing that, too.
-- 
-- uunet!ficc!karl	"The last thing one knows in constructing a work 
			 is what to put first."  -- Pascal