postgresql/src/interfaces/perl5/Makefile.PL

67 lines
1.6 KiB
Makefile
Raw Normal View History

1998-10-16 07:58:22 +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;
if (! $ENV{POSTGRES_LIB} || ! $ENV{POSTGRES_INCLUDE}) {
1998-10-16 07:58:22 +02:00
# Check that we actually are inside the Postgres source tree
if (! -d "../libpq") {
die
"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";
}
# 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',
INC => "-I../libpq -I../../include",
1998-10-16 07:58:22 +02:00
OBJECT => "Pg\$(OBJ_EXT)",
LIBS => ["-L$cwd/../libpq -lpq"],
1998-10-16 07:58:22 +02:00
);
} else {
# 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',
INC => "-I$ENV{POSTGRES_INCLUDE}",
1998-10-16 07:58:22 +02:00
OBJECT => "Pg\$(OBJ_EXT)",
LIBS => ["-L$ENV{POSTGRES_LIB} -lpq"],
1998-10-16 07:58:22 +02:00
);
}
WriteMakefile(%opts);
sub MY::installbin {
q[
# Create a target that can be used to
# determine the Perl install directory.
echo-installdir:
@echo $(INSTALLSITELIB)
];
}