11# -------------------------------------------------------
22#
3- # $Id: Makefile.PL.in ,v 1.1 1998/10/16 05:58:22 momjian Exp $
3+ # $Id: Makefile.PL,v 1.14 1998/10/18 02:36:48 tgl Exp $
44#
55# Copyright (c) 1997, 1998 Edmund Mergl
66#
@@ -14,19 +14,33 @@ my %opts;
1414
1515if (!$ENV {POSTGRES_HOME }) {
1616
17+ # Check that we actually are inside the Postgres source tree
18+ if (!-d " ../libpq" ) {
19+ die
20+ " To install Pg separately from the Postgres distribution,
21+ you must set environment variable POSTGRES_HOME to point to
22+ where Postgres is installed (often /usr/local/pgsql).\n " ;
23+ }
24+
25+ # Setup for build/test inside a Postgres source tree
26+
27+ # Perl may complain if path to libpq isn't absolute
1728my $cwd =` pwd` ;
1829chop $cwd ;
1930
2031%opts = (
2132NAME => ' Pg' ,
2233VERSION_FROM => ' Pg.pm' ,
23- INC => "-I$cwd/ ../libpq -I$cwd/ ../../include",
34+ INC => " -I../libpq -I../../include" ,
2435OBJECT => " Pg\$ (OBJ_EXT)" ,
25- LIBS => ["-L@prefix@/lib -L $cwd/../libpq -lpq"],
36+ LIBS => [" -L$cwd /../libpq -lpq" ],
2637 );
2738
2839}else {
2940
41+ # Setup for final install of Pg using an already-installed libpq,
42+ # or for standalone installation when Postgres already is installed.
43+
3044%opts = (
3145NAME => ' Pg' ,
3246VERSION_FROM => ' Pg.pm' ,