Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit df58a90

Browse files
Edmund MerglEdmund Mergl
Edmund Mergl
authored and
Edmund Mergl
committed
adapted Makefile.PL to be build in source tree
1 parent fc06df7 commit df58a90

File tree

10 files changed

+114
-65
lines changed

10 files changed

+114
-65
lines changed

src/interfaces/perl5/Changes

+17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
1+
#-------------------------------------------------------
2+
#
3+
# $Id: Changes,v 1.7 1998/06/01 16:41:18 mergl Exp $
4+
#
5+
# Copyright (c) 1997, 1998 Edmund Mergl
6+
#
7+
#-------------------------------------------------------
8+
19
Revision history for Perl extension Pg.
210

11+
12+
1.7.4 May 28 1998
13+
- applied patches from
14+
Brook Milligan <brook@trillium.NMSU.Edu>:
15+
o changed Makefile.PL to look for include files
16+
and libs in the source tree, except when the
17+
environment variable POSTGRES_HOME is set.
18+
o bug-fix in test.pl
19+
320
1.7.3 Mar 28 1998
421
- linking again with the shared version of libpq
522
due to problems on several operating systems.

src/interfaces/perl5/Makefile.PL

+46-24
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,64 @@
11
#-------------------------------------------------------
22
#
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 $
44
#
5-
# Copyright (c) 1997 Edmund Mergl
5+
# Copyright (c) 1997, 1998 Edmund Mergl
66
#
77
#-------------------------------------------------------
88

99
use ExtUtils::MakeMaker;
1010
use Config;
1111
use strict;
1212

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;
1638

1739
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-
}
2640

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+
2952
} else {
30-
die "Unable to determine PostgreSQL\n";
31-
}
3253

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+
}
4062

4163

4264
WriteMakefile(%opts);

src/interfaces/perl5/Pg.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#-------------------------------------------------------
22
#
3-
# $Id: Pg.pm,v 1.6 1998/04/14 21:14:35 mergl Exp $
3+
# $Id: Pg.pm,v 1.7 1998/06/01 16:41:19 mergl Exp $
44
#
5-
# Copyright (c) 1997 Edmund Mergl
5+
# Copyright (c) 1997, 1998 Edmund Mergl
66
#
77
#-------------------------------------------------------
88

@@ -84,7 +84,7 @@ require 5.002;
8484
PGRES_InvalidOid
8585
);
8686

87-
$Pg::VERSION = '1.7.3';
87+
$Pg::VERSION = '1.7.4';
8888

8989
sub AUTOLOAD {
9090
# This AUTOLOAD is used to 'autoload' constants from the constant()

src/interfaces/perl5/Pg.xs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*-------------------------------------------------------
22
*
3-
* $Id: Pg.xs,v 1.6 1998/04/14 21:14:36 mergl Exp $
3+
* $Id: Pg.xs,v 1.7 1998/06/01 16:41:19 mergl Exp $
44
*
5-
* Copyright (c) 1997 Edmund Mergl
5+
* Copyright (c) 1997, 1998 Edmund Mergl
66
*
77
*-------------------------------------------------------*/
88

src/interfaces/perl5/README

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#-------------------------------------------------------
22
#
3-
# $Id: README,v 1.6 1998/04/14 21:14:37 mergl Exp $
3+
# $Id: README,v 1.7 1998/06/01 16:41:19 mergl Exp $
44
#
5-
# Copyright (c) 1997 Edmund Mergl
5+
# Copyright (c) 1997, 1998 Edmund Mergl
66
#
77
#-------------------------------------------------------
88

99
DESCRIPTION:
1010
------------
1111

12-
This is version 1.7.3 of pgsql_perl5 (previously called pg95perl5).
12+
This is version 1.7.4 of pgsql_perl5 (previously called pg95perl5).
1313

1414
Pgsql_perl5 is an interface between Larry Wall's language perl version 5 and
1515
the database PostgreSQL (previously Postgres95). This has been done by using
@@ -63,13 +63,16 @@ PLATFORMS:
6363
INSTALLATION:
6464
-------------
6565

66-
Using dynamic loading for perl extensions, the preferred method is to unpack
67-
the tar file outside the perl source tree. This assumes, that you already
68-
have installed perl5.
66+
Since the perl5 interface is always contained in the source tree of PostgreSQL,
67+
it is usually build together with PostgreSQL itself. This can be obtained by
68+
adding the option '--with-perl' to the configure command.
69+
70+
In case you need to build the perl interface stand alone, you need to set the
71+
environment variable POSTGRES_HOME, pointing to the PostgreSQL home-directory.
72+
Also PostgreSQL needs to be installed having the include files in
73+
$POSTGRES_HOME/include and the libs in $POSTGRES_HOME/lib. Then you have to
74+
build the module as any standard perl-module with the following commands:
6975

70-
The Makefile checks the environment variable POSTGRES_HOME as well some
71-
standard locations, to find the root directory of your Postgres installation.
72-
7376
1. perl Makefile.PL
7477
2. make
7578
3. make test
@@ -117,7 +120,6 @@ HP users: if you get error messages like:
117120
Dan Lauterbach <danla@dimensional.com>
118121

119122

120-
121123
DOCUMENTATION:
122124
--------------
123125

@@ -127,6 +129,6 @@ installation to read the documentation.
127129

128130
---------------------------------------------------------------------------
129131

130-
Edmund Mergl <E.Mergl@bawue.de> March 28, 1998
132+
Edmund Mergl <E.Mergl@bawue.de> May 28, 1998
131133

132134
---------------------------------------------------------------------------

src/interfaces/perl5/eg/ApachePg.pl

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/usr/local/bin/perl
22

3+
#-------------------------------------------------------
4+
#
5+
# $Id: ApachePg.pl,v 1.4 1998/06/01 16:41:26 mergl Exp $
6+
#
7+
# Copyright (c) 1997, 1998 Edmund Mergl
8+
#
9+
#-------------------------------------------------------
10+
311
# demo script, tested with:
412
# - PostgreSQL-6.3
513
# - apache_1.3
@@ -37,7 +45,7 @@
3745
print "<P><CENTER><TABLE CELLPADDING=4 CELLSPACING=2 BORDER=1>\n";
3846
my @row;
3947
while (@row = $result->fetchrow) {
40-
print "<TR><TD>", join("</TD><TD>", @row), "</TD></TR>\n";
48+
print "<TR><TD>", join("</TD><TD>", @row), "</TD></TR>";
4149
}
4250
print "</TABLE></CENTER><P>\n";
4351
} else {

src/interfaces/perl5/eg/example.newstyle

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
#-------------------------------------------------------
44
#
5-
# $Id: example.newstyle,v 1.4 1998/04/14 21:14:50 mergl Exp $
5+
# $Id: example.newstyle,v 1.5 1998/06/01 16:41:27 mergl Exp $
66
#
7-
# Copyright (c) 1997 Edmund Mergl
7+
# Copyright (c) 1997, 1998 Edmund Mergl
88
#
99
#-------------------------------------------------------
1010

@@ -122,7 +122,7 @@ cmp_ne("", $port);
122122
######################### create and insert into table
123123
# 8-19
124124

125-
$result = $conn->exec("CREATE TABLE person (id int4, name char16)");
125+
$result = $conn->exec("CREATE TABLE person (id int4, name char(16))");
126126
cmp_eq(PGRES_COMMAND_OK, $result->resultStatus);
127127
cmp_eq("CREATE", $result->cmdStatus);
128128

@@ -143,7 +143,7 @@ $ret = 0;
143143
while (-1 != $ret) {
144144
$ret = $conn->getline($string, 256);
145145
last if $string eq "\\.";
146-
cmp_eq("$i Edmund Mergl", $string);
146+
cmp_eq("$i Edmund Mergl ", $string);
147147
$i ++;
148148
}
149149

@@ -190,8 +190,8 @@ for ($k = 0; $k < $result->nfields; $k++) {
190190
cmp_eq(4, $fsize);
191191
} else {
192192
cmp_eq("name", $fname);
193-
cmp_eq(20, $ftype);
194-
cmp_eq(16, $fsize);
193+
cmp_eq(1042, $ftype);
194+
cmp_eq(-1, $fsize);
195195
}
196196
$fnumber = $result->fnumber($fname);
197197
cmp_eq($k, $fnumber);
@@ -201,7 +201,7 @@ $string = "";
201201
while (@row = $result->fetchrow) {
202202
$string = join(" ", @row);
203203
}
204-
cmp_eq("5 Edmund Mergl", $string);
204+
cmp_eq("5 Edmund Mergl ", $string);
205205

206206
######################### PQnotifies
207207
# 43-46

src/interfaces/perl5/eg/example.oldstyle

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
#-------------------------------------------------------
44
#
5-
# $Id: example.oldstyle,v 1.4 1998/04/14 21:14:52 mergl Exp $
5+
# $Id: example.oldstyle,v 1.5 1998/06/01 16:41:27 mergl Exp $
66
#
7-
# Copyright (c) 1997 Edmund Mergl
7+
# Copyright (c) 1997, 1998 Edmund Mergl
88
#
99
#-------------------------------------------------------
1010

@@ -126,7 +126,7 @@ cmp_ne("", $port);
126126
######################### create and insert into table
127127
# 8-19
128128

129-
$result = PQexec($conn, "CREATE TABLE person (id int4, name char16)");
129+
$result = PQexec($conn, "CREATE TABLE person (id int4, name char(16))");
130130
cmp_eq(PGRES_COMMAND_OK, PQresultStatus($result));
131131
cmp_eq("CREATE", PQcmdStatus($result));
132132
PQclear($result);
@@ -150,7 +150,7 @@ $ret = 0;
150150
while (-1 != $ret) {
151151
$ret = PQgetline($conn, $string, 256);
152152
last if $string eq "\\.";
153-
cmp_eq("$i Edmund Mergl", $string);
153+
cmp_eq("$i Edmund Mergl ", $string);
154154
$i++;
155155
}
156156

@@ -201,8 +201,8 @@ for ($k = 0; $k < PQnfields($result); $k++) {
201201
cmp_eq(4, $fsize);
202202
} else {
203203
cmp_eq("name", $fname);
204-
cmp_eq(20, $ftype);
205-
cmp_eq(16, $fsize);
204+
cmp_eq(1042, $ftype);
205+
cmp_eq(-1, $fsize);
206206
}
207207
$fnumber = PQfnumber($result, $fname);
208208
cmp_eq($k, $fnumber);
@@ -214,7 +214,7 @@ for ($k = 0; $k < PQntuples($result); $k++) {
214214
$string .= PQgetvalue($result, $k, $l) . " ";
215215
}
216216
$i = $k + 1;
217-
cmp_eq("$i Edmund Mergl ", $string);
217+
cmp_eq("$i Edmund Mergl ", $string);
218218
}
219219

220220
PQclear($result);

src/interfaces/perl5/test.pl

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
#-------------------------------------------------------
44
#
5-
# $Id: test.pl,v 1.7 1998/04/14 21:14:38 mergl Exp $
5+
# $Id: test.pl,v 1.8 1998/06/01 16:41:20 mergl Exp $
66
#
7-
# Copyright (c) 1997 Edmund Mergl
7+
# Copyright (c) 1997, 1998 Edmund Mergl
88
#
99
#-------------------------------------------------------
1010

@@ -122,7 +122,7 @@
122122
######################### create and insert into table
123123
# 8-19
124124

125-
$result = $conn->exec("CREATE TABLE person (id int4, name char16)");
125+
$result = $conn->exec("CREATE TABLE person (id int4, name char(16))");
126126
cmp_eq(PGRES_COMMAND_OK, $result->resultStatus);
127127
cmp_eq("CREATE", $result->cmdStatus);
128128

@@ -143,8 +143,8 @@
143143
while (-1 != $ret) {
144144
$ret = $conn->getline($string, 256);
145145
last if $string eq "\\.";
146-
cmp_eq("$i Edmund Mergl", $string);
147-
$i ++;
146+
cmp_eq("$i Edmund Mergl ", $string);
147+
$i++;
148148
}
149149

150150
cmp_eq(0, $conn->endcopy);
@@ -190,8 +190,8 @@
190190
cmp_eq(4, $fsize);
191191
} else {
192192
cmp_eq("name", $fname);
193-
cmp_eq(20, $ftype);
194-
cmp_eq(16, $fsize);
193+
cmp_eq(1042, $ftype);
194+
cmp_eq(-1, $fsize);
195195
}
196196
$fnumber = $result->fnumber($fname);
197197
cmp_eq($k, $fnumber);
@@ -201,7 +201,7 @@
201201
while (@row = $result->fetchrow) {
202202
$string = join(" ", @row);
203203
}
204-
cmp_eq("5 Edmund Mergl", $string);
204+
cmp_eq("5 Edmund Mergl ", $string);
205205

206206
######################### debug, PQuntrace
207207

src/interfaces/perl5/typemap

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#-------------------------------------------------------
22
#
3-
# $Id: typemap,v 1.6 1998/04/14 21:14:39 mergl Exp $
3+
# $Id: typemap,v 1.7 1998/06/01 16:41:20 mergl Exp $
44
#
5-
# Copyright (c) 1997 Edmund Mergl
5+
# Copyright (c) 1997, 1998 Edmund Mergl
66
#
77
#-------------------------------------------------------
88

0 commit comments

Comments
 (0)