[comp.windows.x] NEED HELP COMPILING XTROFF

lestat@nontech.Berkeley.EDU (David Gonzalez-Nieves) (08/01/90)

Hello:

	I have been trying to compile Xtroff and I always get syntax errors in
the ask.c module of the XtStuff directory. I get the following message:

nontech>> make
cc -O   -I/usr/local/pkg/X11/include -I. -I./lib/X  -I. -I./X1
1    -DXWINDOWS -DDIRENT -DXAW_BC  -sun3 -c  ask.c
ask.c: 161: DIRSIZ: argument mismatch
ask.c: 162: DIRSIZ: argument mismatch
"ask.c", line 161: syntax error at or near symbol )
"ask.c", line 162: syntax error at or near symbol )
*** Error code 1
make: Fatal error: Command failed for target `ask.o'
nontech>>

	Line 161 is the following:

	 ourarray[nentries] = (char *) xmalloc((int) DIRSIZE(entry) + 1);
                null_ncpy(ourarray[nentries], entry->d_name, (int) 		   
DIRSIZE(entry));
	
	I am trying to compile this on a SUN 3/60 running X11R4 and SunOS 4.01.

	If anybody has been able to compile this program I would appreciate any
help given.

Thanks;

--------------------------------------------------------
David Gonzalez          lestat@ctt.bellcore.com
Bellcore                Architecture Technology District
RRC 1M207S
444 Hoes Lane
Piscatway, NJ 08854     VOICE (201) 699-6387
Internet, E-Mail:       lestat@ctt.bellcore.com
----------------------------------------------------------

DISCLAIMER:

Bellcore is not responsible for anything I say, write or think
 if they can be sued. I am not resposible for anything I say,
write or even think if I can be sued. (Doesn't have any logic!
!!)

janzen@bambi.mpr.ca (Martin Janzen) (08/03/90)

In article <25905@bellcore.bellcore.com>, lestat@nontech.Berkeley.EDU
(David Gonzalez-Nieves) writes:

|> 	I have been trying to compile Xtroff and I always get syntax errors in
|> the ask.c module of the XtStuff directory. I get the following message:
|> 
|> nontech>> make
|> cc -O   -I/usr/local/pkg/X11/include -I. -I./lib/X  -I. -I./X1
|> 1    -DXWINDOWS -DDIRENT -DXAW_BC  -sun3 -c  ask.c
|> ask.c: 161: DIRSIZ: argument mismatch
|> ask.c: 162: DIRSIZ: argument mismatch
|> "ask.c", line 161: syntax error at or near symbol )
|> "ask.c", line 162: syntax error at or near symbol )
|> *** Error code 1
|> make: Fatal error: Command failed for target `ask.o'
|> nontech>>
|> [...]
|> 	I am trying to compile this on a SUN 3/60 running X11R4 and SunOS 4.01.

I ran into this the other day, too, on a SPARCstation SLC with SunOS 4.1.
The problem shows up in the file xtroff/XtStuff/ask.c.  If the DIRENT symbol
is defined, it defines DIRSIZE as follows:

#  define DIRSIZE(entry)        DIRSIZ

However, on the Sun, DIRSIZ is a macro (defined in /usr/include/sys/dirent.h),
and so the preprocessor complains because there's no argument list.

I fixed mine by replacing the above line with:

#  define DIRSIZE(entry)        DIRSIZ(entry)

This seems to work correctly, at least with the sample troff.tr file; I
haven't used it a lot yet.  There should be a portable way to do this;
for instance, some kind of #ifdef SUN.  The people who maintain this
thing may have a better idea...

BTW, since you say you're using X11R4, you may also need to add -DR4 to
the DEFINES= line in xtroff/Imakefile; otherwise, it will complain about
missing header files.


-------------------------------------------------------------------------------
Martin Janzen                  Voice:    (604) 293-5309
MPR Teltech Ltd.               FAX:      (604) 293-5787
8999 Nelson Way                Internet: janzen@mprgate.mpr.ca
Burnaby, B.C. CANADA  V5A 4B5            (134.87.131.13)

moraes@cs.toronto.edu (Mark Moraes) (08/03/90)

In XtStuff/Imakefile, change

#ifdef SystemV

to 

#if SystemV

and the DIRENT stuff should work correctly.

One of these days, I'll get around to making up an official patch.

	Mark.