I tried today for the first time to compile plperl, and didn't have
much success.  After fixing a couple of simple problems, I was left
with

cc -c -D_HPUX_SOURCE -Aa -I/usr/local/include  -I/opt/perl5/lib/5.00503/PA-RISC2.0/CORE  +z -I../../../src/interfaces/libpq -I../../../src/include -I../../../src/backend plperl.c
cpp: "perl.h", line 136: warning 2001: Redefinition of macro VOIDUSED.
cpp: "perl.h", line 1474: warning 2001: Redefinition of macro DEBUG.
cc: "../../../src/include/utils/int8.h", line 34: error 1681: Must use +e or -Ae for long long in ANSI mode.
make: *** [plperl.o] Error 1

This is with a plain-vanilla installation of perl 5.005_03 on HPUX 10.20.
Perl's configure script chooses HP's cc in strict-ANSI (-Aa) mode,
and I let it have its head on the issue.  I could work around it by
reinstalling Perl using gcc and/or forcing -Ae (not-so-strict ANSI mode)
in Perl's installation CFLAGS, but if I'm running into this problem with
the standard setup then so will a lot of other people on HPUX.  I don't
think we can say "you have to have a nonstandard Perl installation to
use this".

But short of that I don't see a clean answer.  We select -Ae in the
hpux_cc template, but I usually don't use the hpux_cc template ---
I prefer hpux_gcc for development.  (In fact, the first problem I had to
fix was that plperl's makefile tried to use CFLAGS taken from postgres's
configuration with CC taken from perl's.  HP's cc does not like gcc-
specific compiler switches, nor vice versa.)  So there's noplace for
plperl to cleanly pull -Ae from.

The only thing I can think of at the moment is to do something like

if (platform-is-HPUX-and-CC-is-cc)
CFLAGS+= -Ae
endif

in plperl's Makefile.PL, but that sure strikes me as awfully ugly.
Anyone have a better answer?

			regards, tom lane

Sat, 19 Feb 2000 14:21:18 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Nasty portability glitch in plperl