PATCH at the end and attached ...
I have a system - and so do most of my customers with the same
architecture - where the base system has postgres installed.
But alas, it is version 7. That will not do. Their install is in /opt,
but as it is *system* postgress, they decided to link /opt/.../libpg.so
to /usr/lib/hpux64, which is the default $LD_LIBRARY_PATH of every
single user on the system.
I set POSTGRES_HOME to /pro/pgsql, which is a symlink to the postgres
version I am currently building against (e.g. /pro/pgsql-8.4.3). I do
have several to match what is installed at the customer. They all have
the /pro/pgsql symlink, so I can rest assured that the libs are found
whatever version I build when distributing.
When I set POSTGRES_HOME and POSTGRES_LIB (POSTGRES_INCLUDE setting
does not propagate into the binary, so I accept the return value of
App::Info), the *compilation* works fine, with just 2 warnings:
DBD-Pg-2.17.1 env POSTGRES_HOME=/pro/pgsql POSTGRES_LIB=/pro/pgsql/lib perl
Makefile.PL
Configuring DBD::Pg 2.17.1
PostgreSQL version: 80403 (default port: 5432)
POSTGRES_HOME: /pro/pgsql
POSTGRES_INCLUDE: /pro/pgsql-8.4.3/include
POSTGRES_LIB: /pro/pgsql/lib
OS: hpux
Using DBI 1.615 (for perl 5.010001 on IA64.ARCHREV_0-LP64) installed in
/pro/lib/perl5/site_perl/5.10.1/IA64.ARCHREV_0-LP64/auto/DBI/
Writing Makefile for DBD::Pg
DBD-Pg-2.17.1 make
cp lib/Bundle/DBD/Pg.pm blib/lib/Bundle/DBD/Pg.pm
cp Pg.pm blib/lib/DBD/Pg.pm
/pro/bin/perl -p -e s/~DRIVER~/Pg/g; s/^do\(/dontdo\(/
/pro/lib/perl5/site_perl/5.10.1/IA64.ARCHREV_0-LP64/auto/DBI/Driver.xst Pg.xsi
/pro/bin/perl /pro/lib/perl5/5.10.1/ExtUtils/xsubpp -typemap
/pro/lib/perl5/5.10.1/ExtUtils/typemap Pg.xs Pg.xsc mv Pg.xsc Pg.c
cc -c -I/pro/pgsql-8.4.3/include
-I/pro/lib/perl5/site_perl/5.10.1/IA64.ARCHREV_0-LP64/auto/DBI -Ae
-DPERL_DONT_CREATE_GVSV +Z -z -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DD64
-I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-DPGLIBVERSION=80403 -DPGDEFPORT=5432 +O2 +Onolimit -DPERL_EXTMALLOC_DEF
-Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc
-Dcalloc=Perl_calloc -DVERSION=\2.17.1\ -DXS_VERSION=\2.17.1\ +Z
-I/pro/lib/perl5/5.10.1/IA64.ARCHREV_0-LP64/CORE Pg.c
cc -c -I/pro/pgsql-8.4.3/include
-I/pro/lib/perl5/site_perl/5.10.1/IA64.ARCHREV_0-LP64/auto/DBI -Ae
-DPERL_DONT_CREATE_GVSV +Z -z -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DD64
-I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-DPGLIBVERSION=80403 -DPGDEFPORT=5432 +O2 +Onolimit -DPERL_EXTMALLOC_DEF
-Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc
-Dcalloc=Perl_calloc -DVERSION=\2.17.1\ -DXS_VERSION=\2.17.1\ +Z
-I/pro/lib/perl5/5.10.1/IA64.ARCHREV_0-LP64/CORE dbdimp.c
dbdimp.c, line 4472: warning #2068-D: integer conversion resulted in a
change of sign
if (!pg_db_end_txn(aTHX_ dbh, imp_dbh, -1==loid ? 0 : 1))
^
cc -c -I/pro/pgsql-8.4.3/include
-I/pro/lib/perl5/site_perl/5.10.1/IA64.ARCHREV_0-LP64/auto/DBI -Ae
-DPERL_DONT_CREATE_GVSV +Z -z -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DD64
-I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-DPGLIBVERSION=80403 -DPGDEFPORT=5432 +O2 +Onolimit -DPERL_EXTMALLOC_DEF
-Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc
-Dcalloc=Perl_calloc -DVERSION=\2.17.1\ -DXS_VERSION=\2.17.1\ +Z
-I/pro/lib/perl5/5.10.1/IA64.ARCHREV_0-LP64/CORE quote.c
quote.c, line 334: warning #2513-D: a value of type const char * cannot be
assigned to an entity of type char *
result = string;
^
cc -c -I/pro/pgsql-8.4.3/include
-I/pro/lib/perl5/site_perl/5.10.1/IA64.ARCHREV_0-LP64/auto/DBI -Ae
-DPERL_DONT_CREATE_GVSV +Z -z -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DD64
-I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-DPGLIBVERSION=80403 -DPGDEFPORT=5432 +O2 +Onolimit -DPERL_EXTMALLOC_DEF
-Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc
-Dcalloc=Perl_calloc -DVERSION=\2.17.1\ -DXS_VERSION=\2.17.1\ +Z
-I/pro/lib/perl5/5.10.1/IA64.ARCHREV_0-LP64/CORE types.c
Running Mkbootstrap for DBD::Pg ()
chmod 644 Pg.bs
rm -f blib/arch/auto/DBD/Pg/Pg.so
But *linking* breaks, because the default -L flags from $LDFLAGS and
$LDDLFLAGS are in front of $EXTRALIBS and/or $LDLOADLIBS and the linker
now picks up the postgres-7 library :( :(
EXTRALIBS = -L/pro/pgsql/lib -lpq
LDLOADLIBS = -L/pro/pgsql/lib -lpq -lm
BSLOADLIBS =
LD_RUN_PATH = /pro/pgsql/lib
LD_RUN_PATH=/pro/pgsq/lib /usr/bin/ld -b +vnocompatwarnings -L/pro/local/lib
-L/usr/lib/hpux64 Pg.o dbdimp.o quote.o types.o -o blib/arch/auto/DBD/Pg/Pg.so
\
-L/pro/pgsql/lib -lpq -lm \
chmod 755 blib/arch/auto/DBD/Pg/Pg.so
cp Pg.bs blib/arch/auto/DBD/Pg/Pg.bs
chmod 644 blib/arch/auto/DBD/Pg/Pg.bs
Manifying blib/man3/Bundle::DBD::Pg.3
Manifying blib/man3/DBD::Pg.3
After I changed my Makefile.PL and started over (see patch below), I
get