1998-10-16 07:58:22 +02:00
|
|
|
#-------------------------------------------------------
|
|
|
|
#
|
2000-06-10 20:02:12 +02:00
|
|
|
# $Id: Makefile.PL,v 1.16 2000/06/10 18:01:56 petere Exp $
|
1998-10-16 07:58:22 +02:00
|
|
|
#
|
|
|
|
# Copyright (c) 1997, 1998 Edmund Mergl
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------
|
|
|
|
|
|
|
|
use ExtUtils::MakeMaker;
|
|
|
|
use Config;
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
my %opts;
|
|
|
|
|
2000-06-10 20:02:12 +02:00
|
|
|
if (! $ENV{POSTGRES_LIB} || ! $ENV{POSTGRES_INCLUDE}) {
|
1998-10-16 07:58:22 +02:00
|
|
|
|
1998-10-18 04:36:48 +02:00
|
|
|
# Check that we actually are inside the Postgres source tree
|
|
|
|
if (! -d "../libpq") {
|
|
|
|
die
|
2000-06-10 20:02:12 +02:00
|
|
|
"To install Pg separately from the Postgres distribution, you must
|
|
|
|
set environment variables POSTGRES_LIB and POSTGRES_INCLUDE to point
|
|
|
|
to where Postgres is installed (often /usr/local/pgsql/{lib,include}).\n";
|
1998-10-18 04:36:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Setup for build/test inside a Postgres source tree
|
|
|
|
|
|
|
|
# Perl may complain if path to libpq isn't absolute
|
1998-10-16 07:58:22 +02:00
|
|
|
my $cwd = `pwd`;
|
|
|
|
chop $cwd;
|
|
|
|
|
|
|
|
%opts = (
|
|
|
|
NAME => 'Pg',
|
|
|
|
VERSION_FROM => 'Pg.pm',
|
1998-10-18 04:36:48 +02:00
|
|
|
INC => "-I../libpq -I../../include",
|
1998-10-16 07:58:22 +02:00
|
|
|
OBJECT => "Pg\$(OBJ_EXT)",
|
1998-10-18 04:36:48 +02:00
|
|
|
LIBS => ["-L$cwd/../libpq -lpq"],
|
1998-10-16 07:58:22 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
1998-10-18 04:36:48 +02:00
|
|
|
# Setup for final install of Pg using an already-installed libpq,
|
|
|
|
# or for standalone installation when Postgres already is installed.
|
|
|
|
|
1998-10-16 07:58:22 +02:00
|
|
|
%opts = (
|
|
|
|
NAME => 'Pg',
|
|
|
|
VERSION_FROM => 'Pg.pm',
|
2000-06-10 20:02:12 +02:00
|
|
|
INC => "-I$ENV{POSTGRES_INCLUDE}",
|
1998-10-16 07:58:22 +02:00
|
|
|
OBJECT => "Pg\$(OBJ_EXT)",
|
2000-06-10 20:02:12 +02:00
|
|
|
LIBS => ["-L$ENV{POSTGRES_LIB} -lpq"],
|
1998-10-16 07:58:22 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
WriteMakefile(%opts);
|
|
|
|
|
|
|
|
|
2000-04-23 06:26:32 +02:00
|
|
|
sub MY::installbin {
|
|
|
|
|
|
|
|
q[
|
2000-06-10 20:02:12 +02:00
|
|
|
# Create a target that can be used to
|
2000-04-23 06:26:32 +02:00
|
|
|
# determine the Perl install directory.
|
|
|
|
echo-installdir:
|
|
|
|
@echo $(INSTALLSITELIB)
|
|
|
|
];
|
|
|
|
|
|
|
|
}
|