[comp.windows.x] X11R4 & RS6000

rusho@HYDROGEN.CHEM.UTAH.EDU (08/31/90)

    
	I have successfully transferred the X11R4 source code to the RISC
Sys. 6000, but building it for the RS6000 has become a pain.  Has anyone
successfully built X11R4 on a RS6000 under AIX v3.1?  I have successfully
created a bunch of Makefiles, but during a make Makefiles, I get errors 
depending on which files it is trying to make.  

		<<<Jon>>>
* rusho@hydrogen.chem.utah.edu *

* 2020 Henry Eyring Building *
* University of Utah *
* Salt Lake City, UT  84112 *

glenn@cs.utexas.edu (Glenn G. Lai) (08/31/90)

rusho@hydrogen.chem.utah.edu * wrote:

    
*	I have successfully transferred the X11R4 source code to the RISC
*Sys. 6000, but building it for the RS6000 has become a pain.  Has anyone
*successfully built X11R4 on a RS6000 under AIX v3.1?  I have successfully
*created a bunch of Makefiles, but during a make Makefiles, I get errors 
*depending on which files it is trying to make.  

I haven't built an R4 server for the RS/6000, but I've built all of the
libraries for use with a beta release of `octtools 4.0' from Berkeley.
I used `xlc' instead of `cc' to get rid of some problems, but since
`xlc' complained bitterly about things like incompatible types (e.g.,

	int i;
	unsigned j;
	i = j;

is rejected), I had to put in lots of casts.  The R4 source uses Booleans for
bit fields, which is frowned upon by ANSI C (since R4's Boolean is actually
char) and rejected by `xlc'; the solution:  get rid of the bit fields.  The
only (but don't hold me to this) other change I had to make was to redefine
NULL as 0; NULL is (void *) in ANSI C, and caused lots of incompatible-type
problems for `xlc'. 


Glenn

guy@auspex.auspex.com (Guy Harris) (09/05/90)

>The only (but don't hold me to this) other change I had to make was to
>redefine NULL as 0; NULL is (void *) in ANSI C, and caused lots of
>incompatible-type problems for `xlc'. 

Actually, NULL can either be 0 or "(void *)0" in ANSI C (the actual text
in the ANSI C standard speaks of "integral constant expressions with the
value 0", but anybody who #defines NULL as (1-1) should be shot).  The
problem (as described to me by Mr.  Lai) is that NULL is used in the X
libraries to mean "null character", e.g. in "XrmParseCommand" in
"ParseCmd.c":

	...

    char		*optP, *argP, optchar, argchar;

	...

	    for (argP = *argv, optP = options[i].option;
		 (optchar = *optP++) != NULL &&
		 (argchar = *argP++) != NULL &&
		 argchar == optchar;);

which, if NULL is #defined as "(void *)0" or something such as that,
ends up comparing a "char" variable with "(void *)0".  That ain't a
valid comparison in ANSI C, and IBM's compiler is perfectly justified in
rejecting it.

If somebody insists on spelling '\0' as something pronounced "null", I
suggest NUL, that being the name of the character in ASCII. 
Alternatively, you can just call it '\0' and not worry about it.

In *any* case, please resist the temptation to compare anything other
than pointers with NULL, or to assign NULL to anything other than a
pointer, or to return it from a function returning anything other than a
pointer, etc., and consider fixing up existing code that does any of the
aforementioned.  Those with strict C compilers and C implementations
that define NULL as "(void *)0" (e.g., the RS6000 C implementation, from
what Mr. Lai says) will thank you.

rusho@HYDROGEN.CHEM.UTAH.EDU (09/07/90)

To port X11R4 to an IBM RISC System 6000 running AIX v3.1 the
following must be done:

	1--Leave the server that already exists intact.  Do not build
a new server.  Set the build server flag to NO.

	2--Convert the existing X11R3 information for Imake to X11R4
formats.  This needs to be done by hand.  Convert the site.def file,
the imakemdep.h file and create an AIXV3.cf file from the existing
X11R3 Imake data.

	3--To avoid wiping out the existing X11R3 headers & libraries
(which are needed for the server) set the destination dir to something
else and don't install everything.

	4--If you recreate the server successfully, please send me
e-mail.

	5--Make the X11 include subdirectory (Make includes).

	6--Make the libraries (make from within ./lib).

	7--Make everything else (except the server).


	Enjoy.  

		<<<Jon>>>      (rusho@hydrogen.chem.utah.edu)