head	1.10;
access;
symbols
	REL7_2_8:1.6
	REL7_2_7:1.6
	REL7_2_6:1.6
	REL7_2_5:1.6
	REL7_2_4:1.6
	REL7_2_3:1.6
	REL7_2_STABLE:1.6.0.2
	REL7_2:1.6
	REL7_2_RC2:1.6
	REL7_2_RC1:1.6
	REL7_2_BETA5:1.6
	REL7_2_BETA4:1.6
	REL7_2_BETA3:1.6
	REL7_2_BETA2:1.6
	REL7_2_BETA1:1.6
	REL7_1_2:1.5
	REL7_1_STABLE:1.5.0.2
	REL7_1_BETA:1.5
	REL7_1_BETA3:1.5
	REL7_1_BETA2:1.5
	REL7_1:1.5;
locks; strict;
comment	@# @;


1.10
date	2002.08.30.13.06.21;	author scrappy;	state dead;
branches;
next	1.9;

1.9
date	2002.08.27.03.57.11;	author momjian;	state Exp;
branches;
next	1.8;

1.8
date	2002.06.02.21.37.26;	author momjian;	state Exp;
branches;
next	1.7;

1.7
date	2002.05.28.16.57.53;	author petere;	state Exp;
branches;
next	1.6;

1.6
date	2001.08.26.22.28.04;	author petere;	state Exp;
branches;
next	1.5;

1.5
date	2000.11.17.00.08.57;	author tgl;	state Exp;
branches;
next	1.4;

1.4
date	2000.11.16.16.21.55;	author petere;	state Exp;
branches;
next	1.3;

1.3
date	2000.10.24.16.59.59;	author tgl;	state Exp;
branches;
next	1.2;

1.2
date	2000.08.31.16.11.58;	author petere;	state Exp;
branches;
next	1.1;

1.1
date	2000.06.28.18.29.56;	author petere;	state Exp;
branches;
next	;


desc
@@


1.10
log
@
perl5 interface moved to gborg
@
text
@# $Header: /cvsroot/pgsql-server/src/interfaces/perl5/GNUmakefile,v 1.9 2002/08/27 03:57:11 momjian Exp $

subdir = src/interfaces/perl5
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global

# This would allow a non-root install of the Perl module, but it's not
# quite implemented yet.
ifeq ($(mysterious_feature),yes)
perl_installsitearch	= $(pkglibdir)
perl_installsitelib	= $(pkglibdir)
perl_installman3dir	= $(mandir)/man3
endif

override CPPFLAGS := -I$(libpq_srcdir) -I$(top_srcdir)/src/include $(CPPFLAGS) -I$(perl_archlibexp)/CORE -I$(top_srcdir)/$(subdir)
override CFLAGS += $(CFLAGS_SL)
override CPPFLAGS += -DXS_VERSION=\"$(shell sed -n "s/\$$.*::VERSION.*=.*'\(.*\)';/\1/p" $(srcdir)/Pg.pm)\"

# The code isn't clean with regard to these warnings.
ifeq ($(GCC),yes)
override CFLAGS := $(filter-out -Wall -Wmissing-declarations -Wmissing-prototypes, $(CFLAGS))
endif

POD2MAN = pod2man


NAME = Pg
OBJS = Pg.o
SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 0
SHLIB_LINK = -L$(libpq_builddir) -lpq

include $(top_srcdir)/src/Makefile.shlib


all: all-lib Pg.pm Pg.bs auto/Pg/autosplit.ix Pg.$(perl_man3ext)

all-lib: libpq-all

.PHONY: libpq-all
libpq-all:
	$(MAKE) -C $(libpq_builddir) all

Pg.c: Pg.xs typemap
	$(PERL) $(perl_privlibexp)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap -typemap $(srcdir)/typemap $(srcdir)/Pg.xs >$@@

auto/Pg/autosplit.ix: Pg.pm
	@@$(mkinstalldirs) auto
	$(PERL) -MAutoSplit -e 'autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1);' $< auto

Pg.bs:
	$(PERL) -MExtUtils::Mkbootstrap -e "Mkbootstrap('Pg', '');"
	touch $@@

Pg.$(perl_man3ext): Pg.pm
	$(POD2MAN) --section=$(perl_man3ext) $< > Pg.$(perl_man3ext)


# During install, we must guard against the likelihood that we don't
# have permissions to install into the Perl module library.  It's not
# exactly fun to have to scan the build output, but...

install-warning-msg := { \
echo ""; \
echo "*** Skipping the installation of the Perl module for lack"; \
echo "*** of permissions.  To install it, change to the directory"; \
echo "***     `pwd`,"; \
echo "*** become the appropriate user, and enter '$(MAKE) install'."; \
echo ""; }

install: all installdirs
	@@if test -w $(DESTDIR)$(perl_installsitearch); then \
	  $(INSTALL_DATA) Pg.pm $(DESTDIR)$(perl_installsitearch); \
	  $(INSTALL_DATA) Pg.bs $(DESTDIR)$(perl_installsitearch)/auto/Pg; \
	  $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(perl_installsitearch)/auto/Pg/Pg$(DLSUFFIX); \
	  $(INSTALL_DATA) auto/Pg/autosplit.ix $(DESTDIR)$(perl_installsitearch)/auto/Pg; \
	  $(INSTALL_DATA) Pg.$(perl_man3ext) $(DESTDIR)$(perl_installman3dir); \
	else \
	  $(install-warning-msg); \
	fi

installdirs:
	-$(mkinstalldirs) $(DESTDIR)$(perl_installsitearch)/auto/Pg $(DESTDIR)$(perl_installman3dir)

uninstall:
	rm -f $(addprefix $(DESTDIR)$(perl_installsitearch)/, Pg.pm auto/Pg/Pg.bs auto/Pg/Pg$(DLSUFFIX) auto/Pg/autosplit.ix) $(DESTDIR)$(perl_installman3dir)/Pg.$(perl_man3ext)


clean distclean maintainer-clean: clean-lib
	rm -f $(OBJS) Pg.c Pg.bs Pg.$(perl_man3ext)
	rm -rf auto
@


1.9
log
@This is a 2 line patch to src/interfaces/perl5/GNUMakefile that fixes
the 'override CPPFLAGS' to include the source directory during compile,
and makes the install target look in the proper place for the man page.

Changes are only required when building outside the source directory.

J. R. Nield
@
text
@d1 1
a1 1
# $Header: /cvsroot/pgsql-server/src/interfaces/perl5/GNUmakefile,v 1.8 2002/06/02 21:37:26 momjian Exp $
@


1.8
log
@Allow pod2man 5.005p3 to work with our current sources.
@
text
@d1 1
a1 1
# $Header: /cvsroot/pgsql/src/interfaces/perl5/GNUmakefile,v 1.7 2002/05/28 16:57:53 petere Exp $
d15 1
a15 1
override CPPFLAGS := -I$(libpq_srcdir) -I$(top_srcdir)/src/include $(CPPFLAGS) -I$(perl_archlibexp)/CORE
d77 1
a77 1
	  $(INSTALL_DATA) $(srcdir)/Pg.$(perl_man3ext) $(DESTDIR)$(perl_installman3dir); \
@


1.7
log
@Change PL/Perl and Pg interface build to use configured compiler and
Makefile.shlib system, not MakeMaker.
@
text
@d1 1
a1 1
# $Header$
d56 1
a56 1
	$(POD2MAN) $< $@@
@


1.6
log
@Put the right runpath to libpq into the Perl module shared object on more
platforms and without relinking.

Also support VPATH builds and DESTDIR installs.  One hopes.
@
text
@d1 1
a1 7
# 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 its own ideas and then invoke the rules from
# that file.
#
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/perl5/GNUmakefile,v 1.5 2000/11/17 00:08:57 tgl Exp $
a6 2
.NOTPARALLEL:

d15 19
a34 2
all: Makefile libpq-all
	$(MAKE) -f $< all VPATH=$(VPATH)
d36 3
a38 16
# We need to run Makefile.PL in the source directory because it scans
# the directory for files to build with.  If we ran it in the build
# dir it would miss all the files and not build half the stuff!
Makefile: Makefile.PL Pg.pm
	abs_builddir=`pwd`; \
	abs_libpq_builddir=`cd $(libpq_builddir) && pwd`; \
	cd $(srcdir) && \
	SRCDIR=$(srcdir) \
	PGLIBDIR=$(libdir) \
	$(PERL) $< \
	  INC='-I$(srcdir) -I$(libpq_srcdir) $(filter -I%, $(CPPFLAGS))' \
	  LIBS="-L$$abs_libpq_builddir -lpq" \
	  INSTALLSITEARCH='$$(DESTDIR)$(perl_installsitearch)' \
	  INSTALLSITELIB='$$(DESTDIR)$(perl_installsitelib)' \
	  INSTALLMAN3DIR='$$(DESTDIR)$(perl_installman3dir)' \
	  MAKEFILE="$$abs_builddir/Makefile"
d44 14
a70 2
# We need to massage the packlist after installation to get the
# DESTDIR out of there.
d73 5
a77 4
	  $(MAKE) -f Makefile pure_install DESTDIR=$(DESTDIR) && \
	  mv $(DESTDIR)$(perl_installsitearch)/auto/Pg/.packlist fake-packlist && \
	  sed 's,^$(DESTDIR),,' fake-packlist >$(DESTDIR)$(perl_installsitearch)/auto/Pg/.packlist && \
	  rm fake-packlist; \
a81 2
# Try to make the directories ourselves, otherwise the writability
# test above may fail because of mere non-existence.
d83 1
a83 3
	-$(mkinstalldirs) $(DESTDIR)$(perl_installsitearch)/auto/Pg \
	                  $(DESTDIR)$(perl_installsitelib) \
	                  $(DESTDIR)$(perl_installman3dir)
d86 1
a86 11
	for file in `cat $(DESTDIR)$(perl_installsitearch)/auto/Pg/.packlist`; do \
	  rm -f $(DESTDIR)$$file || exit; \
	done
	rm -f $(DESTDIR)$(perl_installsitearch)/auto/Pg/.packlist
	-rmdir $(DESTDIR)$(perl_installsitearch)/auto/Pg


clean distclean maintainer-clean:
	-[ -f Makefile ] && $(MAKE) -f Makefile clean
	rm -f Makefile Makefile.old
	@@rm -f fake-packlist
d89 3
a91 2
installcheck test: Makefile
	$(MAKE) -f $< test
@


1.5
log
@GNUmakefile failed to provide a way to invoke perl Makefile's
'make test' target.
@
text
@d7 1
a7 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/perl5/GNUmakefile,v 1.4 2000/11/16 16:21:55 petere Exp $
d13 10
d25 1
a25 1
	$(MAKE) -f $< all
d27 16
a42 2
Makefile: Makefile.PL
	$(PERL) $<
a47 2
test: Makefile
	$(MAKE) -f $< test
d49 20
a68 19
# 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
	$(MAKE) -f Makefile clean
	POSTGRES_LIB="$(libdir)" \
	  POSTGRES_INCLUDE="$(includedir)" \
	  $(PERL) $(srcdir)/Makefile.PL
	$(MAKE) -f Makefile all
	-@@if [ -w "`$(MAKE) --quiet -f Makefile echo-installdir`" ]; then \
		$(MAKE) -f Makefile install; \
		$(MAKE) clean; \
d70 1
a70 5
		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 "*****"; \
d73 6
d81 6
a86 8
	@@echo "*****"; \
	 echo "* The Perl module cannot be uninstalled automatically. You can"; \
	 echo "* change into the directory "`pwd`" and do"; \
	 echo "*"; \
	 echo "*     $(MAKE) -f Makefile realclean"; \
	 echo "*"; \
	 echo "* to delete built and installed files."; \
	 echo "*****"
d91 5
@


1.4
log
@Clean files after installing, since those files will most likely be root
owned, which can be annoying.
@
text
@d7 1
a7 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/perl5/GNUmakefile,v 1.3 2000/10/24 16:59:59 tgl Exp $
d23 3
@


1.3
log
@Eliminate POLLUTE=1 hack for cross-Perl-version compatibility by using
Devel::PPPort instead.  Thanks to Gilles Darold for doing the legwork.
@
text
@d7 1
a7 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/perl5/GNUmakefile,v 1.2 2000/08/31 16:11:58 petere Exp $
d42 1
a42 1
		rm -f Makefile; \
@


1.2
log
@Fix relative path references so that make knowns which dependencies refer
to one another. Sort out builddir vs srcdir variable namings. Remove some
now obsoleted make variables.
@
text
@d7 1
a7 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/perl5/GNUmakefile,v 1.1 2000/06/28 18:29:56 petere Exp $
d18 1
a18 1
	$(PERL) $< POLLUTE=1
d38 1
a38 1
	  $(PERL) $(srcdir)/Makefile.PL POLLUTE=1
@


1.1
log
@Makefile cleanup for interface tree. Now essentially with all the
standard targets and behaviour. Replaced Makefile.in's with
Makefile's and declared the respective variables in Makefile.global.

maintainer-clean target now available at top level, although it does
not work in the backend tree yet.

Cleanup pass over Makefile.shlib, renamed some targets and variables.
The shared library symlink tests are now done by make, not the shell.

ecpg: Remove one warning in sloppy flex output.

PL/Perl and Perl interface: the MakeMaker documentation is confusing,
the realclean target *does* "delete derived files", but it also
uninstalls them. Don't use that.

The submake targets in the various bin directories that update libpq
should `make all', not `make libpq.a'. That is a) unportable, and
b) doesn't build the shared library.
@
text
@d7 1
a7 1
# $Header$
d11 1
a11 1
include ../../Makefile.global
d22 1
a22 1
	$(MAKE) -C $(top_builddir)/src/interfaces/libpq all
@
