|
1 | 1 | #-------------------------------------------------------
|
2 | 2 | #
|
3 |
| -# $Id: Makefile.PL,v 1.7 1998/04/14 21:14:34 mergl Exp $ |
| 3 | +# $Id: Makefile.PL,v 1.8 1998/06/01 16:41:19 mergl Exp $ |
4 | 4 | #
|
5 |
| -# Copyright (c) 1997 Edmund Mergl |
| 5 | +# Copyright (c) 1997, 1998 Edmund Mergl |
6 | 6 | #
|
7 | 7 | #-------------------------------------------------------
|
8 | 8 |
|
9 | 9 | use ExtUtils::MakeMaker;
|
10 | 10 | use Config;
|
11 | 11 | use strict;
|
12 | 12 |
|
13 |
| -print "\nConfiguring Pg\n"; |
14 |
| -print "Remember to actually read the README file !\n"; |
15 |
| -die "\nYou didn't read the README file !\n" unless ($] >= 5.002); |
| 13 | +# because the perl5 interface is always contained in the source tree, |
| 14 | +# we can be sure about the location of the include files and libs. |
| 15 | +# For development and testing we still test for POSTGRES_HOME. |
| 16 | +# |
| 17 | +#print "\nConfiguring Pg\n"; |
| 18 | +#print "Remember to actually read the README file !\n"; |
| 19 | +#die "\nYou didn't read the README file !\n" unless ($] >= 5.002); |
| 20 | +# |
| 21 | +#if (! $ENV{POSTGRES_HOME}) { |
| 22 | +# warn "\$POSTGRES_HOME not defined. Searching for PostgreSQL...\n"; |
| 23 | +# foreach(qw(../../../ /usr/local/pgsql /usr/pgsql /home/pgsql /opt/pgsql /usr/local/postgres /usr/postgres /home/postgres /opt/postgres)) { |
| 24 | +# if (-d "$_/lib") { |
| 25 | +# $ENV{POSTGRES_HOME} = $_; |
| 26 | +# last; |
| 27 | +# } |
| 28 | +# } |
| 29 | +#} |
| 30 | +# |
| 31 | +#if (-d "$ENV{POSTGRES_HOME}/lib") { |
| 32 | +# print "Found PostgreSQL in $ENV{POSTGRES_HOME}\n"; |
| 33 | +#} else { |
| 34 | +# die "Unable to determine PostgreSQL\n"; |
| 35 | +#} |
| 36 | + |
| 37 | +my %opts; |
16 | 38 |
|
17 | 39 | if (! $ENV{POSTGRES_HOME}) {
|
18 |
| - warn "\$POSTGRES_HOME not defined. Searching for PostgreSQL...\n"; |
19 |
| - foreach(qw(/usr/local/pgsql /usr/pgsql /home/pgsql /opt/pgsql /usr/local/postgres /usr/postgres /home/postgres /opt/postgres)) { |
20 |
| - if (-d "$_/lib") { |
21 |
| - $ENV{POSTGRES_HOME} = $_; |
22 |
| - last; |
23 |
| - } |
24 |
| - } |
25 |
| -} |
26 | 40 |
|
27 |
| -if (-d "$ENV{POSTGRES_HOME}/lib") { |
28 |
| - print "Found PostgreSQL in $ENV{POSTGRES_HOME}\n"; |
| 41 | + my $cwd = `pwd`; |
| 42 | + chop $cwd; |
| 43 | + |
| 44 | + %opts = ( |
| 45 | + NAME => 'Pg', |
| 46 | + VERSION_FROM => 'Pg.pm', |
| 47 | + INC => "-I$cwd/../libpq -I$cwd/../../include", |
| 48 | + OBJECT => "Pg\$(OBJ_EXT)", |
| 49 | + LIBS => ["-L$cwd/../libpq -lpq"], |
| 50 | + ); |
| 51 | + |
29 | 52 | } else {
|
30 |
| - die "Unable to determine PostgreSQL\n"; |
31 |
| -} |
32 | 53 |
|
33 |
| -my %opts = ( |
34 |
| - NAME => 'Pg', |
35 |
| - VERSION_FROM => 'Pg.pm', |
36 |
| - INC => "-I$ENV{POSTGRES_HOME}/include -I/usr/local/include/pgsql -I/usr/include/pgsql", |
37 |
| - OBJECT => "Pg\$(OBJ_EXT)", |
38 |
| - LIBS => ["-L$ENV{POSTGRES_HOME}/lib -lpq"], |
39 |
| -); |
| 54 | + %opts = ( |
| 55 | + NAME => 'Pg', |
| 56 | + VERSION_FROM => 'Pg.pm', |
| 57 | + INC => "-I$ENV{POSTGRES_HOME}/include", |
| 58 | + OBJECT => "Pg\$(OBJ_EXT)", |
| 59 | + LIBS => ["-L$ENV{POSTGRES_HOME}/lib -lpq"], |
| 60 | + ); |
| 61 | +} |
40 | 62 |
|
41 | 63 |
|
42 | 64 | WriteMakefile(%opts);
|
|
0 commit comments