summaryrefslogtreecommitdiff
path: root/src/interfaces/perl5/Makefile.PL.in
blob: 115203ede3375d8405849abd5ac553235f1f970f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#-------------------------------------------------------
#
# $Id: Makefile.PL.in,v 1.1 1998/10/16 05:58:22 momjian Exp $
#
# Copyright (c) 1997, 1998  Edmund Mergl
#
#-------------------------------------------------------

use ExtUtils::MakeMaker;
use Config;
use strict;

my %opts;

if (! $ENV{POSTGRES_HOME}) {

    my $cwd = `pwd`;
    chop $cwd;

    %opts = (
        NAME         => 'Pg',
        VERSION_FROM => 'Pg.pm',
        INC          => "-I$cwd/../libpq -I$cwd/../../include",
        OBJECT       => "Pg\$(OBJ_EXT)",
        LIBS         => ["-L@prefix@/lib -L$cwd/../libpq -lpq"],
    );

} else {

    %opts = (
        NAME         => 'Pg',
        VERSION_FROM => 'Pg.pm',
        INC          => "-I$ENV{POSTGRES_HOME}/include",
        OBJECT       => "Pg\$(OBJ_EXT)",
        LIBS         => ["-L$ENV{POSTGRES_HOME}/lib -lpq"],
    );
}


WriteMakefile(%opts);

exit(0);

# end of Makefile.PL