[comp.windows.x] X11 R3 on IBM RT/PC under 4.3

moore@cygnusx1.cs.utk.edu (Keith Moore) (12/08/88)

Here is how I managed to get X11 R3 running on an RT without too much trouble. 
We are still running a very old version of 4.3 here, but I think this trick 
still may help those who are using later versions.

The program below runs hc first, then if that fails, runs pcc with the
same arguments.  You might have to change "/bin/hc" to "/bin/hc1.4"
to get this to work for you.

Compile this, and call it xcc.  Now install xcc in /bin or wherever,
and change the RT.macros file to use xcc rather than cc as the c compiler.

You might also have to change the c compiler flags in 
server/ddx/ibm/apa16/Imakefile to use -g instead of -O. 

After doing the above I can now recompile the entire X distribution without
any problems.  I get lots of fatal error messages from hc, but pcc compiles
the same files without complaint.  You may still find one or two problems, 
particularly if you haven't applied some of the official patches, but in 
general this hack makes things managable.

Keith Moore
UT Computer Science Dept.	Internet/CSnet: moore@utkcs2.cs.utk.edu
107 Ayres Hall, UT Campus	BITNET: moore@utkcs1
Knoxville Tennessee 37996-1301	Telephone: +1 615 974 0822

---xcc.c---cut here----------------------------------------------------------

/*
 * compile with hc then with pcc if hc fails.
 * I tried doing this with a shell script, but had problems with quoting.
 */

#include <stdio.h>
#include <sys/wait.h>

main (argc, argv, envp)
char **argv, **envp;
{
    int pid;
    int waitval;
    union wait status;
    if (pid = fork ()) {
	/* parent */
	do {
	    waitval = wait (&status);
	} while (waitval != -1 && waitval != pid && !WIFEXITED(status));
	if (status.w_retcode) {
	    argv[0] = "pcc";
	    execve ("/bin/pcc", argv, envp);
	}
    }
    else {
	/* child */
	argv[0] = "hc";
	execve ("/bin/hc", argv, envp);
    }
}
Keith Moore
UT Computer Science Dept.	Internet/CSnet: moore@utkcs2.cs.utk.edu
107 Ayres Hall, UT Campus	BITNET: moore@utkcs1
Knoxville Tennessee 37996-1301	Telephone: +1 615 974 0822