diff options
Diffstat (limited to 'src/interfaces/perl5')
-rw-r--r-- | src/interfaces/perl5/GNUmakefile.in | 71 | ||||
-rw-r--r-- | src/interfaces/perl5/Makefile.PL | 16 |
2 files changed, 79 insertions, 8 deletions
diff --git a/src/interfaces/perl5/GNUmakefile.in b/src/interfaces/perl5/GNUmakefile.in new file mode 100644 index 00000000000..29bd818ee66 --- /dev/null +++ b/src/interfaces/perl5/GNUmakefile.in @@ -0,0 +1,71 @@ +# This file is an interface from the Autoconf world to Perl's +# MakeMaker world, so that the latter behaves (kind of) like the +# former would prefer. Internally, we call Perl to create another +# Makefile according to it's own ideas and then invoke the rules from +# that file. +# +# $Header: /cvsroot/pgsql/src/interfaces/perl5/Attic/GNUmakefile.in,v 1.1 2000/06/10 18:01:56 petere Exp $ + +srcdir = @srcdir@ +VPATH = @srcdir@ + +top_srcdir = @top_srcdir@ +top_builddir = ../../.. + +PERL = @PERL@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +libdir = @libdir@ +includedir = @includedir@ + + +all: Makefile libpq-all + $(MAKE) -f $< all + +Makefile: Makefile.PL + $(PERL) $< POLLUTE=1 + +libpq-all: + $(MAKE) -C $(top_builddir)/src/interfaces/libpq all + +# The klugery here is to ensure that the perl5 shared library gets +# built with the correct path to the installed location of libpq +# during `make install', but is built against the local tree during +# ordinary building and testing. +# +# During install, we must also guard against the likelihood that we +# don't have permissions to install into the Perl module library. The +# purer alternative would naturally be the ability to select the +# installation directory somewhere. + +install: Makefile libpq-install + $(MAKE) -f Makefile clean + POSTGRES_LIB="$(libdir)" \ + POSTGRES_INCLUDE="$(includedir)" \ + $(PERL) $(srcdir)/Makefile.PL POLLUTE=1 + $(MAKE) -f Makefile all + -@if [ -w "`$(MAKE) --quiet -f Makefile echo-installdir`" ]; then \ + $(MAKE) -f Makefile install; \ + rm -f Makefile; \ + else \ + echo "*****" ;\ + echo "* Skipping the installation of the Perl module for lack of permissions."; \ + echo "* To install it, change to the directory "`pwd`","; \ + echo "* become the appropriate user, and do \`$(MAKE) install'."; \ + echo "*****"; \ + fi + +libpq-install: + $(MAKE) -C $(top_builddir)/src/interfaces/libpq install + +# Note: Perl's idea of "clean" is a little different, so we use "realclean" + +clean: + -[ -f Makefile ] && $(MAKE) -f Makefile realclean + +distclean maintainer-clean: clean + rm -f GNUmakefile + + +.PHONY: all install clean distclean maintainer-clean libpq-all libpq-install diff --git a/src/interfaces/perl5/Makefile.PL b/src/interfaces/perl5/Makefile.PL index d63c7e7ad5f..4d5b1e33f18 100644 --- a/src/interfaces/perl5/Makefile.PL +++ b/src/interfaces/perl5/Makefile.PL @@ -1,6 +1,6 @@ #------------------------------------------------------- # -# $Id: Makefile.PL,v 1.15 2000/04/23 04:26:32 tgl Exp $ +# $Id: Makefile.PL,v 1.16 2000/06/10 18:01:56 petere Exp $ # # Copyright (c) 1997, 1998 Edmund Mergl # @@ -12,14 +12,14 @@ use strict; my %opts; -if (! $ENV{POSTGRES_HOME}) { +if (! $ENV{POSTGRES_LIB} || ! $ENV{POSTGRES_INCLUDE}) { # 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"; +"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 @@ -44,9 +44,9 @@ where Postgres is installed (often /usr/local/pgsql).\n"; %opts = ( NAME => 'Pg', VERSION_FROM => 'Pg.pm', - INC => "-I$ENV{POSTGRES_HOME}/include", + INC => "-I$ENV{POSTGRES_INCLUDE}", OBJECT => "Pg\$(OBJ_EXT)", - LIBS => ["-L$ENV{POSTGRES_HOME}/lib -lpq"], + LIBS => ["-L$ENV{POSTGRES_LIB} -lpq"], ); } @@ -57,7 +57,7 @@ WriteMakefile(%opts); sub MY::installbin { q[ -# Create a target that interfaces/Makefile can use to +# Create a target that can be used to # determine the Perl install directory. echo-installdir: @echo $(INSTALLSITELIB) |