Subject: #include in R6 patches
To: None <dennis@ans.net>
From: Greg Earle <earle@isolar.Tujunga.CA.US>
List: port-sparc
Date: 09/04/1994 16:25:44
I just tried to build R6 last night (12 hours - geez, IPCs are slow (-: ).

There were two glitches and several warnings about mismatched select arguments
& mismatched sys_errlist declarations (X doesn't claim it to be "const ... ").
The warnings made me a little nervous; I'll look into those later.

Ignoring the warnings for a moment, let's turn the glitches:

(1) Tries to build Fresco; gagged because there's no "CC".

    This is because I defined "HasCplusplus" in site.def, thinking that
    if I had g++, I should.  Guess not (-:  Not knowing whether gcc 2.6.0 can
    as yet compile Fresco, I suppose I shouldn't care about this one at this
    point ... oh well.

    One related question to this: xc/config/cf/sunLib.rules checks for
    "HasGcc2ForCplusplus", and if true, defines these:

#ifndef PositionIndependentCplusplusFlags
#if HasGcc2ForCplusplus
#define PositionIndependentCplusplusFlags -fpic
#else
#define PositionIndependentCplusplusFlags -pic
#endif
#endif

    These aren't defined in bsdLib.rules, however (which I assume is being
    used in the NetBSD/SPARC build).  Does this mean that NetBSD's g++ can't
    generate PIC code (or generate it properly)?  Probably a question for pk...

    Then again, maybe this is moot since gcc 2.4.5 can't build Fresco anyway?

(2) The NetBSD/SPARC patches contain the following patch to xc/hw/sun/sunCfb.c:

------------------------------------------------------------------------------
+ #ifdef __NetBSD__
+ #include <machine/cgtworeg.h>
+ #else
  #ifdef SVR4
  #include <sys/cg2reg.h>
  #else
  #include <pixrect/cg2reg.h>
  #endif
+ #endif        /* __NetBSD__ */
------------------------------------------------------------------------------

The build gagged because it couldn't find "<machine/cgtworeg.h>":

rm -f sunCfb.o
gcc -c -O2   -I. -I../.. -I../../mi -I../../mfb -I../../cfb -I../../cfb32
      -I../../include -I../../../../X11 -I../../../../include/fonts  -I../../../
..  -DSHAPE    -DGCCUSESGAS       sunCfb.c
sunCfb.c:271: machine/cgtworeg.h: No such file or directory
*** Error code 1 (continuing)

According to "locate":

netbsd4me:1:103 % locate /cg | egrep "(two|three|six)" | egrep \.h
/usr/src/sys/arch/sparc/compile/NETBSD4ME/cgsix.h
/usr/src/sys/arch/sparc/compile/NETBSD4ME/cgthree.h
/usr/src/sys/arch/sparc/include/cgtworeg.h
/usr/src/sys/arch/sparc/sbus/cgsixreg.h
/usr/src/sys/arch/sparc/sbus/cgthreereg.h

The date on "/usr/src/sys/arch/sparc/include/cgtworeg.h" is August 13th, and
the latest files in /usr/include/machine from Theo's last snapshot are dated
July 21st, so I think it's safe to say that the following caveat applies:

	If you are using Theo's latest binary snapshot (and nothing newer):

	If you want to build R6 using the NetBSD/SPARC patches, you'll need
	to either have a completely up-to-date -current /usr/include tree, or
	at the very least you'll need a current /usr/src/sys/arch/sparc/include
	so you can copy "cgtworeg.h" to /usr/include/machine.

I think this is a safe assumption ...

	- Greg


------------------------------------------------------------------------------