From: eswu@expo.lcs.mit.edu (Eng-Shien Wu)
Newsgroups: comp.unix.aix
Subject: Hints on building X11R5 with AIX3.2
Summary: Here is some more info on gottas when building X11R5 on AIX3.2
Keywords: X11R5 AIX3.2 xlc
Date: 21 Aug 92 18:56:24 GMT
Organization: X Consortium, MIT Laboratory for Computer Science

These are hints for people building X11R5 with AIX3.2.  BTW, the X11R5
parts of the FAQ is way old: the section by Andy Pierce probably should
be deleted because it is no longer relevant.

Sections of this posting
    1. Fun with xlc 1.2.0.x (AIX3.2)
    2. BSD 4.4 networking (AIX3.2)
    3. xdm and /etc/environments
    4. Contrib patches

--------------------
Fun with xlc 1.2.0.x
--------------------

I've had problems with every version of XLC in AIX3.2 that I've installed.
To find out what version you have, type "lslpp -h xlccmp.obj".

xlc 1.2.0.0:
    Eats >50megs of page space on large files when optimizing; ANSI
    mode flags legitimate constructs as errors. Because of the large
    time and space requirement, it fails to finish in finite time.
    Solution: Don't build optimized, so in the file mit/config/ibm.cf,
    add somewhere after "#ifdef RsArchitecture":
	#define OptimizedCDebugFlags

xlc 1.2.0.5
    Still problem with optimizing: use above solution.

xlc 1.2.0.7
    Faulty inlining of memcpy(). To turn off,
	#define OptimizedCDebugFlags -O -D__STR31__

xlc 1.2.0.12
    Have not installed yet but inlining of memcpy() fixed.


--------------------
 BSD 4.4 networking
--------------------

In AIX3.2, because of changes in the socket address structure for
BSD4.4 networking, mit/lib/X/XConnDis.c must be patched for UNIX
domain sockets to work. Note that these are not full patches, so do
_not_ turn off the network option "compat_43" (to check, type "no -a"
and look for "compat_43 = 1") or else TCP/IP sockets will break. The
full patch, unfortunately, hits a _lot_ of files. Save patch to
sky-aix32.patch and type:

	mv sky-aix32.patch mit/lib/X
	cd mit/lib/X
	cp XConnDis.c XConnDis.c.save
	patch -p -s < sky-aix32.patch
	make libX11.a

*** XConnDis.c-	Fri Sep 13 18:20:28 1991
--- XConnDis.c	Wed Mar 11 11:29:51 1992
***************
*** 442,450 ****
  
      unaddr.sun_family = AF_UNIX;
      sprintf (unaddr.sun_path, "%s%d", X_UNIX_PATH, idisplay);
  
      addr = (struct sockaddr *) &unaddr;
!     addrlen = strlen(unaddr.sun_path) + sizeof(unaddr.sun_family);
  
  #ifdef hpux /* this is disgusting */
      ounaddr.sun_family = AF_UNIX;
--- 442,451 ----
  
      unaddr.sun_family = AF_UNIX;
      sprintf (unaddr.sun_path, "%s%d", X_UNIX_PATH, idisplay);
+     unaddr.sun_len = strlen(unaddr.sun_path);
  
      addr = (struct sockaddr *) &unaddr;
!     addrlen = (sizeof(unaddr) - sizeof(unaddr.sun_path) + unaddr.sun_len);
  
  #ifdef hpux /* this is disgusting */
      ounaddr.sun_family = AF_UNIX;

-------


--------------------
 /etc/environments
--------------------

If you use xdm, you should add this to "/usr/local/lib/X11/xdm/xdm-config"
so that you get the system environment variables set:

	DisplayManager.exportList:      TZ LANG LOCPATH NLSPATH ODMDIR


--------------------
  Contrib patches
--------------------

Patches to improve the performance of the colorgda adapter (aka, skyway)
are available by anonymous ftp from export.lcs.mit.edu. Look for

    contrib/sky.README
    contrib/sky-perf-1.tar.Z
    contrib/sky-cfb.patch

The above BSD4.4 networking patch is also in

    contrib/sky-aix32.patch


--
Eng-Shien Wu (eswu@expo.lcs.mit.edu)
IBM Graphic Systems/MIT X Consortium