From: pbickers@tamaluit.phys.uidaho.edu (Paul Bickerstaff)
Newsgroups: comp.windows.x
Subject: X11R5 PL21 build problem under RISCos4.51
Date: 6 Jan 1993 18:51:15 -0600
Organization: UTexas Mail-to-News Gateway
NNTP-Posting-Host: cs.utexas.edu

I have found that clients/xdm/sessreg.c and clients/xterm/main.c
won't compile in building X11R5 patchlevel 21 under RISCos 4.51
(on a Mips Magnum 3000).

The problem is associated with a missing ut_host functionality
and so I don't think my configuration is at fault --- or is there
something I've overlooked?

Basically, RISCos is SYSV but has (most) BSD43 functionality. Thus
we find in the Mips.cf file

 * X11r5 only builds using the berkeley libraries and compiler.  Make
 * sure your path includes /bsd43/bin before /bin/ or /usr/bin.

and

#define StandardDefines -DMips -DBSD43

but this crashes in the clients/xdm section:

cc -O -signed -systype bsd43 -Olimit 2000 -Wf,-XNd8400,-XNp12000   -I../
../.  -DMips -DBSD43   -DBINDIR=\"/usr/local/X11/R5/bin\" -DXDMDIR=\"/usr/local/
X11/R5/lib/X11/xdm\"  -DSIGNALRETURNSINT -DHASXDMAUTH    -DTCPCONN -DUNIXCONN  -
DOSMAJORVERSION=4  -DOSMINORVERSION=51 -c sessreg.c
ccom: Error: sessreg.c, line 293: syntax error
                (void) strncpy (u->???UT_HOST NOT AVAILABLE???, host, sizeof (u-
>???UT_HOST NOT AVAILABLE???));
      -----------------------------^
ccom: Error: sessreg.c, line 295: syntax error
                bzero (u->???UT_HOST NOT AVAILABLE???, sizeof (u->???UT_HOST NOT
 AVAILABLE???));
      --------------------^

and if we push on, again in clients/xterm:

 cc -c -O -signed -systype bsd43 -Olimit 2000 -Wf,-XNd8400,-XNp12000   -I
../../.  -DMips -DBSD43    -DUTMP -DUSE_TTY_GROUP   -DOSMAJORVERSION=4  -DOSMINO
RVERSION=51 main.c
cpp: warning /bsd43/usr/include/stdio.h:103: NULL redefined
ccom: Error: main.c, line 2265: syntax error
                                (void) strncpy(utmp.???UT_HOST NOT AVAILABLE???,

      ----------------------------------------------^
*** Error code 1


Both of these sections of code clearly indicate that problems can be
expected here with missing ut_host functionality in SYSV systems (while
at the same time commenting that SYSV actually provides superior
alternatives). 

Hence I managed to compile sessreg.c by hand simply by switching the
-DBSD43 compilation flag to -DSYSV and in main.c I turned off the
HAS_UTMP_UT_HOST switch:

% diff -c main.c~ main.c
*** main.c~     Tue Jan  5 14:53:29 1993
--- main.c      Wed Jan  6 15:04:09 1993
***************
*** 154,159 ****
--- 154,163 ----
  #include <sgtty.h>
  #include <sys/resource.h>
  #define HAS_UTMP_UT_HOST
+ /* add Mips fix: RISCos is really SYSV */
+ #ifdef Mips
+ #undef HAS_UTMP_UT_HOST
+ #endif /* Mips */
  #define HAS_BSD_GROUPS
  #endif        /* !SYSV */

but I don't understand the dependencies on this code and so can't be sure
this will work; nor can I understand how this flaw has survived without
being fixed by now. 

Is there a known workaround? I would have expected this code to have
Mips dependencies extensively built in to take advantage of the SysV
nature of RISCos. But no. What gives? Wouldn't something like
HAS_UTMP_UT_HOST be useful in sessreg.c?

If you e-mail a reply please note my address below. This is being
posted by roundabout means and hitting reply almost certainly
won't work.


Paul Bickerstaff                 Internet: pbickers@tamaluit.phys.uidaho.edu
Physics Dept., Univ. of Idaho    Phone:    (208) 885 6809
Moscow ID 83843, USA             FAX:      (208) 885 6173
Xref: sparky comp.windows.x:21016 comp.windows.x.intrinsics:745 comp.windows.x.motif:8499