aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2011-11-28 07:54:03 -0500
committerAndrew Dunstan <andrew@dunslane.net>2011-11-28 07:54:03 -0500
commit62fa8562ecf3dc42b04997598d6b04b9ced28ed1 (patch)
treeb012216ba55f04d34a24dae9a093b44eac2260aa
parentb09fc7c39dd69c2eda17c7a3f532cf38ea22a9e9 (diff)
downloadpostgresql-62fa8562ecf3dc42b04997598d6b04b9ced28ed1.tar.gz
postgresql-62fa8562ecf3dc42b04997598d6b04b9ced28ed1.zip
Backpatch "Use the preferred version of xsubpp."
As requested this is backpatched all the way to release 8.2.
-rw-r--r--src/pl/plperl/GNUmakefile7
-rw-r--r--src/tools/msvc/Mkvcbuild.pm8
2 files changed, 10 insertions, 5 deletions
diff --git a/src/pl/plperl/GNUmakefile b/src/pl/plperl/GNUmakefile
index 694a9b2189c..22a59c3af74 100644
--- a/src/pl/plperl/GNUmakefile
+++ b/src/pl/plperl/GNUmakefile
@@ -52,6 +52,9 @@ endif
# where to find psql for running the tests
PSQLDIR = $(bindir)
+# where to find xsubpp for building XS.
+XSUBPPDIR = $(shell $(PERL) -e 'use List::Util qw(first); print first { -r "$$_/ExtUtils/xsubpp" } @INC')
+
include $(top_srcdir)/src/Makefile.shlib
plperl.o: perlchunks.h plperl_opmask.h
@@ -68,11 +71,11 @@ all: all-lib
SPI.c: SPI.xs
@if [ x"$(perl_privlibexp)" = x"" ]; then echo "configure switch --with-perl was not specified."; exit 1; fi
- $(PERL) $(perl_privlibexp)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@
+ $(PERL) $(XSUBPPDIR)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@
Util.c: Util.xs
@if [ x"$(perl_privlibexp)" = x"" ]; then echo "configure switch --with-perl was not specified."; exit 1; fi
- $(PERL) $(perl_privlibexp)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@
+ $(PERL) $(XSUBPPDIR)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@
install: all installdirs install-lib
diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index 72c58751d09..8ad096ab296 100644
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -13,6 +13,8 @@ use Project;
use Solution;
use Cwd;
use File::Copy;
+use Config;
+use List::Util qw(first);
use Exporter;
our (@ISA, @EXPORT_OK);
@@ -101,11 +103,11 @@ sub mkvcbuild
(my $xsc = $xs) =~ s/\.xs/.c/;
if (Solution::IsNewer("$plperlsrc$xsc","$plperlsrc$xs"))
{
- print "Building $plperlsrc$xsc...\n";
+ my $xsubppdir = first { -e "$_\\ExtUtils\\xsubpp" } @INC;
+ print "Building $plperlsrc$xsc...\n";
system( $solution->{options}->{perl}
. '/bin/perl '
- . $solution->{options}->{perl}
- . '/lib/ExtUtils/xsubpp -typemap '
+ . "$xsubppdir/ExtUtils/xsubpp -typemap "
. $solution->{options}->{perl}
. '/lib/ExtUtils/typemap '
. "$plperlsrc$xs "