Subject: Problems building bmake on AIX 3.2.5

From: [email-masked] (Paul J Turner)
Date: Mon, 28 Nov 1994 10:55:58 -0800

Hello from Oregon, USA,

I'm trying to build pg on an IBM RS6K 320h with xlc (cc) and 
AIX 3.2.5, but I don't seem to have the right stuff to build 
bmake. I'm getting:

./Bootstrap aix 
make started.
        cc  -DUSE_AIA  -D_BSD  -D_PATH_DEFSYSMK=\"`pwd`/mk-proto/sys.mk\"  -D_PATH_DEFSYSPATH=\"`pwd
`/mk-proto\" -I. -c arch.c buf.c compat.c cond.c dir.c hash.c job.c main.c make.c  parse.c str.c suf
f.c targ.c var.c  setenv.c
arch.c:
buf.c:
compat.c:
"compat.c", line 280.20: 1506-021 (S) Expecting struct or union.
"compat.c", line 282.29: 1506-021 (S) Expecting struct or union.
"compat.c", line 293.23: 1506-021 (S) Expecting struct or union.
cond.c:

in compat.c (and in a couple of other modules further down). The relevant lines
are as follows:

            if (WIFSTOPPED(reason.w_status)) {
                status = reason.w_stopval;              /* stopped */
            } else if (WIFEXITED(reason.w_status)) {
                status = reason.w_retcode;              /* exited */
                if (status != 0) {
                    printf ("*** Error code %d", status);
                }

I checked the header files and it seems to want _POSIX_SOURCE or something.
But throwing _POSIX_SOURCE at it causes other problems. Any clue as to what
can be done to fix this?

Thanks in advance,

--Paul

Paul J Turner

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "[email-masked]".
   If this fails, send mail to "[email-masked]" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
              URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/

---

From: [email-masked] (Paul M. Aoki)
Date: Mon, 28 Nov 94 11:14:08 -0800

> "compat.c", line 280.20: 1506-021 (S) Expecting struct or union.

------- Forwarded Message

 From:  [email-masked] (Paul M. Aoki)
 To:  [email-masked] (Egan F. Ford)
 Cc:  [email-masked] (Postgres Mailing List)
 Subject:  Re: Bmake build fail on aix3.2.5 
 Date:  Fri, 19 Aug 94 12:28:40 -0700

 [email-masked] (Egan F. Ford) writes:
 > I've built postgres for linux and now would like to build it for AIX 3.2.5,
 > the install docs say that it is a tested platform.  I cannot get bmake to
 > build.
 
 go into compat.c and job.c and wherever you see "WIFsomething(foo.w_status)"
 change it to "WIFsomething(foo)".  i broke this for AIX when porting to
 solaris (i checked that it works on everything else just now).
 
 (i ran regress and multiuser tests on everything but only bootstrapped
 from the tar file on about 1/3 of the platforms.  this one slipped through
 the cracks, oh well, sorry.  i don't get paid to do this..)
 --
   Paul M. Aoki          |  University of California at Berkeley
   [email-masked]  |  Dept. of EECS, Computer Science Division (#1776) 
                         |  Berkeley, CA 94720-1776
 
 ==============================================================================
    To add/remove yourself to/from the POSTGRES mailing list: send mail with 
    the subject line ADD or DEL to "[email-masked]"

------- End of Forwarded Message

---

From: [email-masked] (Pekka Kataja)
Date: Tue, 29 Nov 1994 11:04:44 +0200

> But throwing _POSIX_SOURCE at it causes other problems. Any clue as to what

AIX handle union wait and it's macros own ways.

Look at /usr/include/sys/m_wait.h. It's _BSD style union wait.
Look also /usr/include/sys/wait.h

I resolved this 

/* compat.c" The cursor is at line 286 of 627  */

#ifdef _AIX
            } else if (WIFEXITED(reason)) {
#else
            } else if (WIFEXITED(reason.w_status)) {
#endif

I have compat.c and job.c modified , but there aren't many place where WIF*
macros exist.

-----------------------------------------------------------------------------
Pekka Kataja 	  WSOY ( Werner Soderstrom Limited )
email: [email-masked] * fax: +358-0-6168510 * tel: +358-0-6168468
P.O.BOX 222 00121 Helsinki Finland
navigare necesse est, vivere non est necesse
-----------------------------------------------------------------------------