From 8ccf86bf32d72c2b8f234ee328caf79966f5df9c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 18 Oct 1998 02:36:48 +0000 Subject: Still another round of Perl-module installation tweaks. Now, src/interfaces/perl5/Makefile.PL is pretty simple, and instead we work a little harder in src/interfaces/Makefile. --- src/interfaces/perl5/Makefile.PL | 58 +++++++++++++++++++++++++++++++++++++ src/interfaces/perl5/Makefile.PL.in | 44 ---------------------------- 2 files changed, 58 insertions(+), 44 deletions(-) create mode 100644 src/interfaces/perl5/Makefile.PL delete mode 100644 src/interfaces/perl5/Makefile.PL.in (limited to 'src') diff --git a/src/interfaces/perl5/Makefile.PL b/src/interfaces/perl5/Makefile.PL new file mode 100644 index 00000000000..147c0bd1e45 --- /dev/null +++ b/src/interfaces/perl5/Makefile.PL @@ -0,0 +1,58 @@ +#------------------------------------------------------- +# +# $Id: Makefile.PL,v 1.14 1998/10/18 02:36:48 tgl Exp $ +# +# Copyright (c) 1997, 1998 Edmund Mergl +# +#------------------------------------------------------- + +use ExtUtils::MakeMaker; +use Config; +use strict; + +my %opts; + +if (! $ENV{POSTGRES_HOME}) { + + # 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 variable POSTGRES_HOME to point to +where Postgres is installed (often /usr/local/pgsql).\n"; + } + + # Setup for build/test inside a Postgres source tree + + # Perl may complain if path to libpq isn't absolute + my $cwd = `pwd`; + chop $cwd; + + %opts = ( + NAME => 'Pg', + VERSION_FROM => 'Pg.pm', + INC => "-I../libpq -I../../include", + OBJECT => "Pg\$(OBJ_EXT)", + LIBS => ["-L$cwd/../libpq -lpq"], + ); + +} else { + + # Setup for final install of Pg using an already-installed libpq, + # or for standalone installation when Postgres already is installed. + + %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 diff --git a/src/interfaces/perl5/Makefile.PL.in b/src/interfaces/perl5/Makefile.PL.in deleted file mode 100644 index 115203ede33..00000000000 --- a/src/interfaces/perl5/Makefile.PL.in +++ /dev/null @@ -1,44 +0,0 @@ -#------------------------------------------------------- -# -# $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 -- cgit v1.2.3