From xemacs-m  Mon Jul  7 12:30:31 1997
Received: from ns1.eds.com (ns1.eds.com [192.85.154.78])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id MAA06288
	for <xemacs-beta@xemacs.org>; Mon, 7 Jul 1997 12:30:30 -0500 (CDT)
Received: from nnsa.eds.com (nnsa.eds.com [130.174.31.78])
	by ns1.eds.com (8.8.6/8.8.5) with ESMTP id NAA01850;
	Mon, 7 Jul 1997 13:30:29 -0400 (EDT)
Received: from kocrsv04.delcoelect.com (kocrsv04.delcoelect.com [144.250.100.205])
	by nnsa.eds.com (8.8.5/8.8.5) with ESMTP id NAA03868;
	Mon, 7 Jul 1997 13:29:58 -0400 (EDT)
Received: from kocrsw12.delcoelect.com (kocrsw12.delcoelect.com [144.250.106.18]) by kocrsv04.delcoelect.com (8.7.5/8.7.3) with SMTP id MAA19138; Mon, 7 Jul 1997 12:29:58 -0500 (EST)
Received: from kocrsw12 by kocrsw12.delcoelect.com (SMI-8.6/SMI-SVR4)
	id MAA13570; Mon, 7 Jul 1997 12:29:56 -0500
X-Mailer: exmh version 2.0gamma 1/27/97
To: Martin Buchholz <mrb@Eng.Sun.COM>
cc: xemacs-beta@xemacs.org
Subject: Re: [PATCH] Compilation problem on Solaris 2.4 fixed 
X-Attribution: mts
X-Face: 4tk3bJx]I+QTZ|=]*1+Z){9+;5u_hK*NBeZK6[+B+iB%bVuOJ%^uK~fIG}O-}%WLX*D
 ^aW>Gv8E3Xtz0\N&fQl^:pj<K{xM`:d>pPt:9lF-YXB%O)?@rd?*/jE!s94`?]:jJ#C5RDP:;M
 r.3lwo`0{vIT+<{%IRwe]vLd]7>\X|*z{TUX_t;?TPcOLBMIv8_V92!Vk(*DJVU~0M[`5D^PAW
 LniO1?YYWArMU*j9o+>?1MWi.lO?F-?aVt:qQ8OaG?R}B:I!7S_+KuzxZ.f9M@$z#n\bG2$Q2{od
Date: Mon, 07 Jul 1997 12:29:56 -0500
Message-ID: <13567.868296596@kocrsw12>
From: Mike Scheidler <c23mts@eng.delcoelect.com>

"Martin" == Martin Buchholz <mrb@Eng.Sun.COM> writes:
 Martin> 
 >>>>>> "mts" == Mike Scheidler <c23mts@eng.delcoelect.com> writes:
 Martin> 
 mts> Both b8 and b9 were DOA for me, so I spent some time yesterday digging
 mts> around in the header files and found the problem.  It seems that Solaris
 mts> 2.4 doesn't like the '#define _XOPEN_SOURCE 1' line that was recently
 mts> added to the sol2.h header file.  (BTW, 2.5 has no problem.)
 Martin> 
 Martin> I'm undoing this patch for b11.  I believe define _XOPEN_SOURCE* is
 Martin> the right thing to do, and works for me on 2.4 with cc and gcc.  As
 Martin> usual, you may have problems if you build with gcc on an OS level even
 Martin> slightly different.  See what gcc -v says.  Let me know what results
 Martin> you get with b11, but first make sure your gcc is correctly installed.

Sorry, Martin, but b11 is DOA as well.  I can't say for sure if my gcc is
correctly installed, but it's worked well for me since November of '95.
BTW, I get the same error with /vol/lang/SUNWspro/bin/cc ('cc -V' shows
SC3.0.1 13 Jul 1994).

Here are my system and gcc info:

    [13]: uname -a
    SunOS kocrsw12 5.4 Generic_101945-32 sun4m sparc

    [14]: gcc -v
    Reading specs from /usr/std/lib/gcc-lib/sparc-sun-solaris2.4/2.7.1/specs
    gcc version 2.7.1

The problem I'm running into is this:

    make[1]: Entering directory `/users/c23mts/xemacs-20.3-b11/sol2/lib-src'
    gcc -g -O -Demacs -I../src  -DHAVE_CONFIG_H -I/usr/std/include -I/usr/dt/include -I/usr/openwin/include /users/c23mts/xemacs-20.3/lib-src/make-path.c -o make-path
    gcc -g -O -Demacs -I../src  -DHAVE_CONFIG_H -I/usr/std/include -I/usr/dt/include -I/usr/openwin/include /users/c23mts/xemacs-20.3/lib-src/wakeup.c  -fno-gnu-linker -L/usr/std/lib -L/usr/ccs/lib -R/usr/std/lib -L/usr/dt/lib -L/usr/openwin/lib -ldb -lgdbm -lcurses /usr/std/lib/libaudio.a -lkvm -lkstat -lm -lsocket -lnsl -lelf -lgen -ldl -o wakeup
    In file included from /usr/include/sys/select.h:14,
                     from /usr/std/lib/gcc-lib/sparc-sun-solaris2.4/2.7.1/include/sys/types.h:274,
                     from /usr/include/sys/wait.h:15,
                     from ../src/../src/s/usg5-4.h:75,
                     from ../src/../src/s/usg5-4-2.h:5,
                     from ../src/../src/s/sol2.h:44,
                     from ../src/../src/config.h:454,
                     from /users/c23mts/xemacs-20.3/lib-src/wakeup.c:3:
    /usr/include/sys/time.h:164: field `it_interval' has incomplete type
    /usr/include/sys/time.h:165: field `it_value' has incomplete type
    make[1]: *** [wakeup] Error 1
    make[1]: Leaving directory `/users/c23mts/xemacs-20.3-b11/sol2/lib-src'
    make: *** [lib-src] Error 2 

My /usr/include/sys/time.h shows this:

    #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \
            (POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__)
    typedef struct itimerspec {             /* definition per POSIX.4 */
            struct timespec it_interval;    /* timer period */
            struct timespec it_value;       /* timer expiration */
    } itimerspec_t;
    #endif /* (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) ... */

and prior to that, timespec is defined thusly:

    #if (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE <= 2)) || \
            defined(_XOPEN_SOURCE)
    typedef struct  _timespec {
            time_t          _tv_sec;        /* seconds */
            long            _tv_nsec;       /* and nanoseconds */
    } timespec_t;
    
    typedef struct _timespec  timestruc_t;  /* definition per SVr4 */
    
    #else
    
    typedef struct  timespec {              /* definition per POSIX.4 */
            time_t          tv_sec;         /* seconds */
            long            tv_nsec;        /* and nanoseconds */
    } timespec_t;
    
    typedef struct timespec timestruc_t;    /* definition per SVr4 */
    #endif /* (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE <= 2)) ... */

The bottom line is that when _XOPEN_SOURCE is defined, '_timespec' is
defined instead of 'timespec', resulting in incomplete definitions for
'it_interval' and 'it_value'.

-- 
Mike Scheidler                     c23mts@eng.delcoelect.com
Corporate Software Technology
Delco Electronics Corporation      PHONE:  (765) 451-0319
Kokomo, IN 46904-9005              GMNET:  8-322-0319


