aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2011-11-26 15:24:57 -0500
committerAndrew Dunstan <andrew@dunslane.net>2011-11-26 15:24:57 -0500
commit403372459efe4c938d6777e9c10cadc2811c835a (patch)
tree44ec99ee84b30f66057bb7ad19c344794b9d8c2e /src
parent19d88c9f82b9a2b0e8497ec16b636dc7fdb46dfb (diff)
downloadpostgresql-403372459efe4c938d6777e9c10cadc2811c835a.tar.gz
postgresql-403372459efe4c938d6777e9c10cadc2811c835a.zip
Use the preferred version of xsubpp, not necessarily the one that came with the
distro version of perl. David Wheeler and Alex Hunsaker. Backpatch to 9.1 where it applies cleanly. A simple workaround is available for earlier branches, and further effort doesn't seem warranted.
Diffstat (limited to 'src')
-rw-r--r--src/pl/plperl/GNUmakefile7
-rw-r--r--src/tools/msvc/Mkvcbuild.pm5
2 files changed, 9 insertions, 3 deletions
diff --git a/src/pl/plperl/GNUmakefile b/src/pl/plperl/GNUmakefile
index 58d5f357b4c..55f48cd401a 100644
--- a/src/pl/plperl/GNUmakefile
+++ b/src/pl/plperl/GNUmakefile
@@ -55,6 +55,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 plperl_helpers.h
@@ -71,11 +74,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 install-lib install-data
diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index 61656e6d6ee..c80752a8618 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);
@@ -106,11 +108,12 @@ sub mkvcbuild
(my $xsc = $xs) =~ s/\.xs/.c/;
if (Solution::IsNewer("$plperlsrc$xsc","$plperlsrc$xs"))
{
+ my $xsubppdir = first { -e "$_\\ExtUtils\\xsubpp.BAT" } @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 "