-#line 7915 "configure"
+#line 7932 "configure"
#include "confdefs.h"
#include
struct { char filler; double field; } mystruct;
exit(0);
}
EOF
-if { (eval echo configure:7927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pgac_cv_alignof_double=`cat conftestval`
else
echo $ac_n "checking for POSIX signal interface""... $ac_c" 1>&6
-echo "configure:7965: checking for POSIX signal interface" >&5
+echo "configure:7982: checking for POSIX signal interface" >&5
if eval "test \"`echo '$''{'pgac_cv_func_posix_signals'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
-#line 7970 "configure"
+#line 7987 "configure"
#include "confdefs.h"
#include
sigaction(0, &act, &oact);
; return 0; }
EOF
-if { (eval echo configure:7981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
pgac_cv_func_posix_signals=yes
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8011: checking for $ac_word" >&5
+echo "configure:8028: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_TCLSH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
done
echo $ac_n "checking for tclConfig.sh""... $ac_c" 1>&6
-echo "configure:8047: checking for tclConfig.sh" >&5
+echo "configure:8064: checking for tclConfig.sh" >&5
# Let user override test
if test -z "$TCL_CONFIG_SH"; then
pgac_test_dirs="$with_tclconfig"
# Check for Tk configuration script tkConfig.sh
if test "$with_tk" = yes; then
echo $ac_n "checking for tkConfig.sh""... $ac_c" 1>&6
-echo "configure:8080: checking for tkConfig.sh" >&5
+echo "configure:8097: checking for tkConfig.sh" >&5
# Let user override test
if test -z "$TK_CONFIG_SH"; then
pgac_test_dirs="$with_tkconfig $with_tclconfig"
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8119: checking for $ac_word" >&5
+echo "configure:8136: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_NSGMLS'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8155: checking for $ac_word" >&5
+echo "configure:8172: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_JADE'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for DocBook V3.1""... $ac_c" 1>&6
-echo "configure:8186: checking for DocBook V3.1" >&5
+echo "configure:8203: checking for DocBook V3.1" >&5
if eval "test \"`echo '$''{'pgac_cv_check_docbook'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for DocBook stylesheets""... $ac_c" 1>&6
-echo "configure:8219: checking for DocBook stylesheets" >&5
+echo "configure:8236: checking for DocBook stylesheets" >&5
if eval "test \"`echo '$''{'pgac_cv_path_stylesheets'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8258: checking for $ac_word" >&5
+echo "configure:8275: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_SGMLSPL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
s%@RANLIB@%$RANLIB%g
s%@LORDER@%$LORDER%g
s%@TAR@%$TAR%g
-s%@PERL@%$PERL%g
s%@YACC@%$YACC%g
s%@YFLAGS@%$YFLAGS%g
s%@WISH@%$WISH%g
+s%@PERL@%$PERL%g
+s%@perl_installsitearch@%$perl_installsitearch%g
+s%@perl_installsitelib@%$perl_installsitelib%g
+s%@perl_installman3dir@%$perl_installman3dir%g
s%@PYTHON@%$PYTHON%g
s%@python_version@%$python_version%g
s%@python_prefix@%$python_prefix%g
AC_PROG_RANLIB
AC_CHECK_PROGS(LORDER, lorder)
AC_PATH_PROG(TAR, tar)
-AC_CHECK_PROGS(PERL, perl)
AC_CHECK_PROGS(YACC, ['bison -y'])
if test -z "$YACC"; then
test -z "$WISH" && AC_MSG_ERROR(['wish' is required for Tk support])
fi
+PGAC_PATH_PERL
+if test "$with_perl" = yes; then
+ PGAC_CHECK_PERL_DIRS
+fi
+
if test "$with_python" = yes; then
PGAC_PATH_PYTHON
PGAC_CHECK_PYTHON_MODULE_SETUP
# -*-makefile-*-
-# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.132 2001/08/24 14:07:48 petere Exp $
+# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.133 2001/08/26 22:28:04 petere Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
endif
libdir := @libdir@
+pkglibdir = $(libdir)/postgresql
includedir := @includedir@
ifeq "$(findstring pgsql, $(includedir))" ""
LORDER = @LORDER@
X = @EXEEXT@
+# Perl
+
+PERL = @PERL@
+perl_installsitearch = @perl_installsitearch@
+perl_installsitelib = @perl_installsitelib@
+perl_installman3dir = @perl_installman3dir@
+
# Miscellaneous
ANT = @ANT@
LN_S = @LN_S@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
-PERL = @PERL@
PYTHON = @PYTHON@
TAR = @TAR@
WISH = @WISH@
# Makefile according to its own ideas and then invoke the rules from
# that file.
#
-# $Header: /cvsroot/pgsql/src/interfaces/perl5/Attic/GNUmakefile,v 1.5 2000/11/17 00:08:57 tgl Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/perl5/Attic/GNUmakefile,v 1.6 2001/08/26 22:28:04 petere Exp $
subdir = src/interfaces/perl5
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
+.NOTPARALLEL:
+
+# 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
+
all: Makefile libpq-all
- $(MAKE) -f $< all
+ $(MAKE) -f $< all VPATH=$(VPATH)
-Makefile: Makefile.PL
- $(PERL) $<
+# 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"
.PHONY: libpq-all
libpq-all:
$(MAKE) -C $(libpq_builddir) all
-test: Makefile
- $(MAKE) -f $< test
-# 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; \
+# 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 ""; }
+
+# We need to massage the packlist after installation to get the
+# DESTDIR out of there.
+install: all installdirs
+ @if test -w $(DESTDIR)$(perl_installsitearch); then \
+ $(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; \
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 "*****"; \
+ $(install-warning-msg); \
fi
+# Try to make the directories ourselves, otherwise the writability
+# test above may fail because of mere non-existence.
+installdirs:
+ -$(mkinstalldirs) $(DESTDIR)$(perl_installsitearch)/auto/Pg \
+ $(DESTDIR)$(perl_installsitelib) \
+ $(DESTDIR)$(perl_installman3dir)
uninstall:
- @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 "*****"
+ 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
+
+
+installcheck test: Makefile
+ $(MAKE) -f $< test
#-------------------------------------------------------
#
-# $Id: Makefile.PL,v 1.17 2001/03/06 22:07:09 tgl Exp $
+# $Id: Makefile.PL,v 1.18 2001/08/26 22:28:04 petere Exp $
#
# Copyright (c) 1997, 1998 Edmund Mergl
#
use Config;
use strict;
+my $srcdir=$ENV{SRCDIR};
+
my %opts;
+%opts = (
+ NAME => 'Pg',
+ VERSION_FROM => "Pg.pm",
+ OBJECT => "Pg\$(OBJ_EXT)",
+# explicit mappings required for VPATH builds
+ PM => { "$srcdir/Pg.pm" => '$(INST_LIBDIR)/Pg.pm' },
+ MAN3PODS => { "$srcdir/Pg.pm" => '$(INST_MAN3DIR)/Pg.$(MAN3EXT)' },
+);
+
+
if (! -d $ENV{POSTGRES_LIB} || ! -d $ENV{POSTGRES_INCLUDE}) {
# Check that we actually are inside the Postgres source tree
to where Postgres is installed (often /usr/local/pgsql/{lib,include}).\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.
+ # Setup for standalone installation when Postgres already is installed.
%opts = (
- NAME => 'Pg',
- VERSION_FROM => 'Pg.pm',
+ %opts,
INC => "-I$ENV{POSTGRES_INCLUDE}",
- OBJECT => "Pg\$(OBJ_EXT)",
LIBS => ["-L$ENV{POSTGRES_LIB} -lpq"],
);
}
WriteMakefile(%opts);
-sub MY::installbin {
-q[
-# Create a target that can be used to
-# determine the Perl install directory.
-echo-installdir:
- @echo $(INSTALLSITELIB)
-];
+# Put the proper runpath into the shared object.
+
+sub MY::dynamic_lib {
+ package MY;
+ my $inherited= shift->SUPER::dynamic_lib(@_);
+
+ my $pglibdir = $ENV{PGLIBDIR};
+ return $inherited if $pglibdir eq '';
+
+ # Remove any misguided attempts to set the runpath.
+ $inherited =~ s/LD_RUN_PATH=\"\$\(LD_RUN_PATH\)\" //g;
+ $inherited =~ s/-R\S*//g;
+ $inherited =~ s/-rpath\S*//g;
+
+ my $rpath;
+ # Note that this could be different from what Makefile.port has
+ # because a different compiler/linker could be used.
+ SWITCH: for ($Config::Config{'osname'}) {
+ /hpux/ and $rpath = "+b $pglibdir", last;
+ /freebsd/ and $rpath = "-R$pglibdir", last;
+ /irix/ and $rpath = "-R$pglibdir", last;
+ /linux/ and $rpath = "-Wl,-rpath,$pglibdir", last;
+ /netbsd/ and $rpath = "-R$pglibdir", last;
+ /openbsd/ and $rpath = "-R$pglibdir", last;
+ /solaris/ and $rpath = "-R$pglibdir", last;
+ /svr5/ and $rpath = "-R$pglibdir", last;
+ }
+
+ $inherited=~ s,OTHERLDFLAGS =,OTHERLDFLAGS = $rpath , if defined $rpath;
+ $inherited;
+}
+
+
+
+# VPATH-aware version of this rule
+sub MY::xs_c {
+ my($self) = shift;
+ return '' unless $self->needs_linking();
+ '
+.xs.c:
+ $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $< > $@
+';
+}
+
+# Delete this rule. We can use the above one.
+sub MY::xs_o {
+ '';
+}
+
+# This rule tries to rebuild the Makefile from Makefile.PL. We can do
+# that better ourselves.
+sub MY::makefile {
+ '';
}