From: "srikumar (s.) natarajan" <srikumar@bnr.ca>
Date: Wed, 13 Mar 1996 10:51:00 -0500 
Subject: re:[PG95]: PG95 and AIX 4.1 Port 

Hi,

In message "[PG95]: PG95 and AIX 4.1 Port", 
'jhaiskendenew@diw-berlin.de' writes:

>hi all,
>
>I've just added myself to the list. Does anyone have any experience
>with porting to IBM-PowerPC-604-AIX4.1 ? There is a make for AIX3.2.
>It seems that that won't work without bombing in the middle of the
>make. Thanks for any advice.
>
>-john.
>
>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-
>Dr. John P. Haisken-DeNew, GSOEP Group
>German Institute for Economic Research (DIW), 14191 Berlin,  Germany
>+49/30/89789-461    jhaiskendenew@diw-berlin.de    www.diw-berlin.de

Yes, I have ported to IBM-PowerPC-604-AIX4.1.  Below is a cryptic list
of the changes I had to make to get it to build and work.  I will fill
out one of those bug reporting forms with these information later this
week and send it out.

sri
srikumar@bnr.ca
// Disclaimer:
// All opinions are mine and do not reflect policies of BNR or NorTel.
// No warranties implied.  BNR and NorTel are not liable for any kind
// of consequences of the contents of this electronic mail.

// -----------------------------------------------------------------------------
FIX#1
FILE:   postgres95/src/backend/port/aix/mkldexport.sh
- --> The permissions on mkldexport.sh do not allow execution.
chmod ugo+x postgres95/src/backend/port/aix/mkldexport.sh
// -----------------------------------------------------------------------------
FIX#2
FILE:   All
- --> installbsd expects to be run by user 'root';  causes problems in compiling
- --> If this happens, do chown of all files under postgres95 to root, su to root,
    and do a gmake from the backend directory.  Loadbuild will continue where
    it stopped with installbsd problems earlier.  Then do a 'gmake install',
    chown everything to 'postgres' (remember to use a -h flag for the soft
    link in bin/postmaster).

- --> Below are some of the error messages you might see without FIX#2.

Installing /usr/local/pg95opti/postgres95/include/include/postgres.h.
installbsd: /usr/local/pg95opti/postgres95/include/include/postgres.h: Operation not permitted.
Installing /usr/local/pg95opti/postgres95/include/libpq/pqcomm.h.
installbsd: /usr/local/pg95opti/postgres95/include/libpq/pqcomm.h: Operation not permitted.
Installing /usr/local/pg95opti/postgres95/include/libpq/libpq-fs.h.
installbsd: /usr/local/pg95opti/postgres95/include/libpq/libpq-fs.h: Operation not permitted.
Installing /usr/local/pg95opti/postgres95/include/lib/dllist.h.
installbsd: /usr/local/pg95opti/postgres95/include/lib/dllist.h: Operation not permitted.
Installing /usr/local/pg95opti/postgres95/include/utils/geo-decls.h.
installbsd: /usr/local/pg95opti/postgres95/include/utils/geo-decls.h: Operation not permitted.
gmake[1]: *** [install-headers] Error 1
===> bin
===> monitor
cc -c -O3 -DPORTNAME_aix -DPOSTPORT='"5432"' -qchars=signed -qmaxmem=4000 -DHAVE_ANSI_CPP -DDEADLOCK_TIMEOUT=60 -I/usr/local/pg95opti/postgres95/include -I/usr/local/pg95opti/postgres95/src/backend -I/usr/local/pg95opti/postgres95/src/backend/include  monitor.c -o obj/monitor.o
"monitor.c", line 30.10: 1506-296 (S) #include file "libpq-fe.h" not found.
"monitor.c", line 54.38: 1506-277 (S) Syntax error: possible missing ',' or ')'?
"monitor.c", line 54.13: 1506-282 (S) The type of the parameters must be specified in a prototype.
"monitor.c", line 55.37: 1506-277 (S) Syntax error: possible missing ',' or ')'?
"monitor.c", line 55.13: 1506-282 (S) The type of the parameters must be specified in a prototype.
"monitor.c", line 119.1: 1506-166 (S) Definition of function PGconn requires parentheses.
// -----------------------------------------------------------------------------
FIX#3
FILE:   postgres95/src/backend/utils/adt/misc.c
- --> There is a conflict with the signatures for random() and srandom().
    Add "&& !defined(PORTNAME_aix)" to the #if, to use the standard AIX
    declarations.

// OLD:
/* -- sri, modified for AIX 4.1
#if !defined(PORTNAME_linux) && !defined(PORTNAME_BSD44_derived) && \
    !defined(PORTNAME_irix5)
extern int random();
extern int srandom(unsigned);
#endif
sri, modified for AIX 4.1 --- */

// NEW:
#if !defined(PORTNAME_linux) && !defined(PORTNAME_BSD44_derived) && \
    !defined(PORTNAME_irix5) && !defined(PORTNAME_aix)
extern int random();
extern int srandom(unsigned);
#endif
// -----------------------------------------------------------------------------
FIX#4
FILE:   postgres95/src/backend/port/aix/Makefile.inc
- --> mkldexport is in a different directory, that is not likely to be part
    of your PATH specification.  Change the Makefile.inc to use the full
    path name for mkledexport.

# OLD:
# sri, mkldexport changed to $(MKLDEXPORT)
#${PROG}.exp: ${PROG}.noexp
#       mv -f $(objdir)/${PROG}.noexp $(objdir)/${PROG}
#       mkldexport $(objdir)/${PROG} ${BINDIR} > $(objdir)/${PROG}.exp
#       mv -f $(objdir)/${PROG} $(objdir)/${PROG}.noexp

# NEW:
# sri, added definition for MKLDEXPORT
MKLDEXPORT=$(POSTGRESDIR)/src/backend/port/aix/mkldexport.sh
${PROG}.exp: ${PROG}.noexp
        mv -f $(objdir)/${PROG}.noexp $(objdir)/${PROG}
        $(MKLDEXPORT) $(objdir)/${PROG} ${BINDIR} > $(objdir)/${PROG}.exp
        mv -f $(objdir)/${PROG} $(objdir)/${PROG}.noexp
// -----------------------------------------------------------------------------
FIX#5
FILE:   postgres95/src/mk/port/postgres.mk.aix
- --> mkldexport is in a different directory, that is not likely to be part
    of your PATH specification.  Change the postgres.mk.aix.inc to use the
    full path name for mkledexport.

# OLD:
# sri, mkldexport changed to $(MKLDEXPORT)
#%$(EXPSUFF):  %.o
#   mkldexport $(objdir)/$(<F) `pwd` > $(objdir)/$(@F)

# NEW:
# sri, added definition for MKLDEXPORT
MKLDEXPORT=$(POSTGRESDIR)/src/backend/port/aix/mkldexport.sh

%$(EXPSUFF):  %.o
    $(MKLDEXPORT) $(objdir)/$(<F) `pwd` > $(objdir)/$(@F)
// -----------------------------------------------------------------------------

