[comp.windows.x] Problem Compiling XView

lma@polya.Stanford.EDU (Larry M. Augustin) (09/14/89)

On a Sun 3/110, SunOS 3.5.

I get the following error messages during compilation:

cc -c -DPRE_R4_ICCCM -I/u4/larry/usr/include -I../../../../../X11R3   ndet_auto.c
"ndet_auto.c", line 88: FD_SETSIZE undefined
*** Error code 1

cc -c -DPRE_R4_ICCCM -I/u4/larry/usr/include -I../../../../../X11R3   ndet_loop.c
"ndet_loop.c", line 68: warning: illegal pointer combination
"ndet_loop.c", line 192: FD_SETSIZE undefined
"ndet_loop.c", line 701: warning: illegal pointer combination
"ndet_loop.c", line 725: warning: illegal pointer combination
"ndet_loop.c", line 725: warning: illegal pointer combination
*** Error code 1

cc -c -DPRE_R4_ICCCM -I/u4/larry/usr/include -I../../../../../X11R3   ndis_d_pri.c
"ndis_d_pri.c", line 112: NFDBITS undefined
"ndis_d_pri.c", line 118: NBBY undefined
*** Error code 1

cc -c -DPRE_R4_ICCCM -I/u4/larry/usr/include -I../../../../../X11R3   ntfy_fd_op.c
"ntfy_fd_op.c", line 23: FD_SETSIZE undefined
"ntfy_fd_op.c", line 23: NFDBITS undefined
"ntfy_fd_op.c", line 37: FD_SETSIZE undefined
"ntfy_fd_op.c", line 37: NFDBITS undefined
"ntfy_fd_op.c", line 51: FD_SETSIZE undefined
"ntfy_fd_op.c", line 51: NFDBITS undefined
"ntfy_fd_op.c", line 65: FD_SETSIZE undefined
"ntfy_fd_op.c", line 65: NFDBITS undefined
"ntfy_fd_op.c", line 78: FD_SETSIZE undefined
"ntfy_fd_op.c", line 78: NFDBITS undefined
"ntfy_fd_op.c", line 93: FD_SETSIZE undefined
"ntfy_fd_op.c", line 93: NFDBITS undefined
*** Error code 1

The only definitions that I can find for FD_SETSIZE, NFDBITS, and NBBY are in
ultrix_cpt.h, which is probably not the right file to use on a Sun 3!

I have this nagging feeling that I'm doing something wrong in the
compilation, but I don't know what.  Could someone who has built XView
tell me where these are defined?  Thanks.

Larry M. Augustin			ERL 414
lma@sierra.stanford.edu			Computer Systems Lab
lma@dayton.stanford.edu			Stanford University
(415) 723-9285				Stanford, CA 94305

dmc%satori@Sun.COM (Doug Cook) (09/14/89)

In article <11762@polya.Stanford.EDU> lma@Polya.Stanford.EDU (Larry M. Augustin) 
writes:
>
>On a Sun 3/110, SunOS 3.5.
>
>I get the following error messages during compilation:
[...]
>The only definitions that I can find for FD_SETSIZE, NFDBITS, and NBBY are in
>ultrix_cpt.h, which is probably not the right file to use on a Sun 3!
>
>I have this nagging feeling that I'm doing something wrong in the
>compilation, but I don't know what.  Could someone who has built XView
>tell me where these are defined?  Thanks.

No, if you got that far, then you're compiling XView properly. The problem
is that the XView notifier code makes rather extensive use of the FD_SETSIZE,
etc. macros, which are new to 4.3BSD. Systems such as 4.2BSD, SunOS3.X and
Ultrix 2.X don't have them. The file ultrix_cpt.h is an attempt to provide
these macros to VAXen running older versions of Ultrix. As originally shipped,
it's rather primitive.  I've rewritten this file to work for other 
4.2-based platforms as well. 

Since it's a short file, I've simply appended it to my message. To enable
the code, define the compile-time flag OLD_BSD_FDSETS. Please let me know 
if it works properly on your 3.5 system, since I don't have a 3.5 system
here to test it with.

	-Doug

Doug Cook		(dmc@sun.com)	
Software Engineer, XView Group		This space intentionally left blank.
Sun Microsystems, Inc.	

--------------------------------- CUT HERE ---------------------------------

/*	%Z%%M% %I% %E% SMI	*/


/*
 *      (c) Copyright 1989 Sun Microsystems, Inc. Sun design patents
 *      pending in the U.S. and foreign countries. See LEGAL NOTICE
 *      file for terms of the license.
 */

/*
 * Ultrix 2.X, SunOS 3.X, BSD 4.2 Compatibility Header File
 *
 * This file provides a limited compatibility with older BSD variants
 * that do not provide macros for dealing with fd sets.
 *
 * BIG NOTE!!! This will only allow fd_sets of N bits , where N is
 * the size of an int.
 *
 */

#ifndef xview_ultrix_compat_DEFINED
#define xview_ultrix_compat_DEFINED

#ifdef OLD_BSD_FDSETS

#ifndef NBBY
#define NBBY    8               /* number of bits in a byte */
#endif

#ifndef NFDBITS
#define	NFDBITS	(sizeof(int) * NBBY)
#define I_DEFINED_NFDBITS	/* register the fact that I defined this */
#endif

#ifndef FD_SETSIZE
#define FD_SETSIZE	NFDBITS
#define I_DEFINED_FDSETSIZE	/* register the fact that I defined this */
#endif

/*
 *	Here we assume that the only use of howmany(x, y) is 
 *	howmany(FD_SETSIZE, NFDBITS). If we defined both FD_SETSIZE and
 * 	NFDBITS, then we already know what howmany(x, y) will be: 1.
 *	If we did not define FD_SETSIZE and NFDBITS, then we'll have
 *	to calculate the value of howmany(x, y).
 */

#if defined(I_DEFINED_FDSETSIZE) && defined(I_DEFINED_NFDBITS)
#define howmany(x, y)	1
#else
#define howmany(x, y)	(((x)+((y)-1))/(y))
#endif

#define FD_SET(n, p)    ((p)->fds_bits[0] |= (1 << ((n) % NFDBITS)))
#define FD_CLR(n, p)    ((p)->fds_bits[0] &= ~(1 << ((n) % NFDBITS)))
#define FD_ISSET(n, p)  ((p)->fds_bits[0] & (1 << ((n) % NFDBITS)))
#define FD_ZERO(p)      ((p)->fds_bits[0] = 0)

#endif OLD_BSD_FDSETS

#endif ~xview_ultrix_compat_DEFINED

graham@fuel.dec.com (kris graham) (09/14/89)

In article <124660@sun.Eng.Sun.COM>, dmc%satori@Sun.COM (Doug Cook) writes:

> No, if you got that far, then you're compiling XView properly. The problem
> is that the XView notifier code makes rather extensive use of the FD_SETSIZE,
> etc. macros, which are new to 4.3BSD. Systems such as 4.2BSD, SunOS3.X and
> Ultrix 2.X don't have them. The file ultrix_cpt.h is an attempt to provide
> these macros to VAXen running older versions of Ultrix. As originally shipped,
> it's rather primitive.  I've rewritten this file to work for other 
> 4.2-based platforms as well. 

Why any anybody working working with X11 would run a version of ULTRIX below 3.X
is well beyond me!


Christopher Graham
Ultrix Resource Center
Digital Equipment Corp
New York City

"limitation is certainly the cheapest form of flattery"

gerry@cs.keele.ac.uk (Gerry Pratt) (09/20/89)

In article <11762@polya.Stanford.EDU> lma@Polya.Stanford.EDU (Larry M. Augustin) 
writes:
>
>On a Sun 3/110, SunOS 3.5.
>
>I get the following error messages during compilation:
[...]
>The only definitions that I can find for FD_SETSIZE, NFDBITS, and NBBY are in
>ultrix_cpt.h, which is probably not the right file to use on a Sun 3!
>
To which dmc@sun.UUCP (Doug Cook) replies (in part):

> No, if you got that far, then you're compiling XView properly. The problem
> is that the XView notifier code makes rather extensive use of the FD_SETSIZE,
> etc. macros, which are new to 4.3BSD. Systems such as 4.2BSD, SunOS3.X and
> Ultrix 2.X don't have them. The file ultrix_cpt.h is an attempt to provide
> these macros to VAXen running older versions of Ultrix. 

I also have this problem trying to build XView and I am not quite sure
what to do with the *.h file that Doug Cook supplied. Is this a replacement
for ultrix_cpt.h or cpt.h itself? And which *.c files need it?

This is Sun 3/50s and 3/60s running SunOS 3.5
I know the short answer is to run 4.0.3 -:)

Could anyone enligthen me?

tia,

gerry pratt - workstation support - university of keele
email: gerry@uk.ac.keele.seq1 * tel: 0782 621111 x 3290
-- 
gerry pratt - workstation support - university of keele
email: gerry@uk.ac.keele.seq1 * tel: 0782 621111 x 3290

abair@turbinia.oakhill.uucp (Alan Bair) (09/21/89)

Just use it as a replacement for the ultrix_cpt.h file.  This worked fine
for me.

Alan