On Sat, Feb 7, 2009 at 7:27 PM, Dennis Clarke <dcla...@blastwave.org> wrote:
>
> This is just a question. Hopefully someone can shed some light on what the
> fixincludes stage of "make install" does. I am making the assumption that
> the "make install" stage is where these headers get mangled or modified.
>
> This is on Solaris 8 by the way.
>
> Once make install has finished its job I see symlinks down deep in strange
> places thus :
>
> $ ls -lap $DEST/lib/gcc/sparc-sun-solaris2.8/4.3.3/include-fixed/ | grep
> "^lrwx"
> lrwxrwxrwx   1 dclarke  csw           28 Feb  7 17:19 X11 ->
> root/usr/openwin/include/X11/
> lrwxrwxrwx   1 dclarke  csw           22 Feb  7 17:19 Xm ->
> root/usr/dt/include/Xm/
> lrwxrwxrwx   1 dclarke  csw           29 Feb  7 17:19 kcms ->
> root/usr/openwin/include/kcms/
> lrwxrwxrwx   1 dclarke  csw           28 Feb  7 17:19 xil ->
> root/usr/openwin/include/xil/
>
>
> These guys point to a dir entry called "root" which seems odd also but
> there it is.
>
> Way down deep in there I see this ( for example ) :
>
> $ ls -lap
> $DEST/lib/gcc/sparc-sun-solaris2.8/4.3.3/include-fixed/root/usr/openwin/include/X11/
> total 166
> drwxr-xr-x   3 dclarke  csw          512 Feb  7 09:37 ./
> drwxr-xr-x   5 dclarke  csw          512 Feb  7 09:37 ../
> drwxr-xr-x   2 dclarke  csw          512 Feb  7 09:37 DPS/
> -rw-r--r--   1 dclarke  csw         4087 Feb  7 09:37 Xfuncs.h
> -rw-r--r--   1 dclarke  csw        39002 Feb  7 09:37 Xlibint.h
> -rw-r--r--   1 dclarke  csw         6025 Feb  7 09:37 Xos.h
> -rw-r--r--   1 dclarke  csw         2980 Feb  7 09:37 Xosdefs.h
> -rw-r--r--   1 dclarke  csw        10184 Feb  7 09:37 Xthreads.h
> -rw-r--r--   1 dclarke  csw         8847 Feb  7 09:37 dni.h
> -rw-r--r--   1 dclarke  csw         8366 Feb  7 09:37 nmdefs.h
>
> That all looks to be copies of *standard* headers found in the OS vendors
> /usr/openwin/share/include/X11 area.
>
> What changed ?
>
>
> $ diff /usr/openwin/share/include/X11/Xlibint.h
> $DEST/lib/gcc/sparc-sun-solaris2.8/4.3.3/include-fixed/root/usr/openwin/include/X11/Xlibint.h
> 0a1,9
>> /*  DO NOT EDIT THIS FILE.
>>
>>     It has been auto-edited by fixincludes from:
>>
>>       "/usr/include/X11/Xlibint.h"
>>
>>     This had to be done to correct non-standard usages in the
>>     original, manufacturer supplied header file.  */
>>
> 882c891
> < #ifdef sun /* added by SUNSOFT */
> ---
>> #ifdef __sun__ /* added by SUNSOFT */
>
> So the entire change is a comment and one line which both say "added by
> SUNSOFT" in them.
>
>
> Xfuncs.h is somewhat more interesting :
>
> < #if (__STDC__ && !defined(X_NOT_STDC_ENV) && !defined(sun) &&
> !defined(macII) && !defined(apollo)) || defined(SVR4) || defined(hpux) ||
> defined(_IBMR2) || defined(_SEQUENT_)
> ---
>> #if (__STDC__ && !defined(X_NOT_STDC_ENV) && !defined(__sun__) &&
> !defined(macII) && !defined(apollo)) || defined(SVR4) || defined(hpux)
> || defined(_IBMR2) || defined(_SEQUENT_)
> 88c97
> < #if !defined(X_NOT_STDC_ENV) && (!defined(sun) || defined(SVR4))
> ---
>> #if !defined(X_NOT_STDC_ENV) && (!defined(__sun__) || defined(SVR4))
> 96c105
> < #if defined(SYSV) || defined(luna) || defined(sun) || defined(__sxg__)
> ---
>> #if defined(SYSV) || defined(luna) || defined(__sun__) || defined(__sxg__)
> $
>
> It looks like anywhere you find the string "defined(sun)" you change it to
> "defined(__sun__)".
>
> That is an observation.
>
> But what did this ?
>
> Was it fixincludes or was it the mkheaders script ?
>
>  and why ?

Because system headers should not define something in the users namespace,
certainly not a non-uglified three-letter name such as "sun".

Consider

#include <Xlibint.h>

int sun;

which will not build otherwise.

Richard.

>
> --
> Dennis Clarke
>
>

Reply via email to