diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2011-11-28 07:46:47 -0500 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2011-11-28 07:46:47 -0500 |
commit | e53724fd5e8a524dda770995bacb5e77575d5b90 (patch) | |
tree | afa2a8b7867b923a885e0353d570f642419b6ad4 | |
parent | d2202a6987362abc99dad9bb9e72530609642101 (diff) | |
download | postgresql-e53724fd5e8a524dda770995bacb5e77575d5b90.tar.gz postgresql-e53724fd5e8a524dda770995bacb5e77575d5b90.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/GNUmakefile | 5 | ||||
-rw-r--r-- | src/tools/msvc/mkvcbuild.pl | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/pl/plperl/GNUmakefile b/src/pl/plperl/GNUmakefile index fed7508ad8c..b84a3b30033 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 @@ -64,7 +67,7 @@ plperl_opmask.h: plperl_opmask.pl SPI.c: SPI.xs - $(PERL) $(perl_privlibexp)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@ + $(PERL) $(XSUBPPDIR)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@ # When doing a VPATH build, copy over the .sql and .out files so that the # test script can find them. See comments in src/test/regress/GNUmakefile. diff --git a/src/tools/msvc/mkvcbuild.pl b/src/tools/msvc/mkvcbuild.pl index 8bf35aefb4c..5282781fb34 100644 --- a/src/tools/msvc/mkvcbuild.pl +++ b/src/tools/msvc/mkvcbuild.pl @@ -5,6 +5,8 @@ use warnings; use Project; use Solution; use Cwd; +use Config; +use List::Util qw(first); chdir('..\..\..') if (-d '..\msvc' && -d '..\..\..\src'); die 'Must run from root or msvc directory' unless (-d 'src\tools\msvc' && -d 'src'); @@ -52,8 +54,9 @@ if ($solution->{options}->{perl}) { $plperl->AddIncludeDir($solution->{options}->{perl} . '/lib/CORE'); $plperl->AddDefine('PLPERL_HAVE_UID_GID'); if (Solution::IsNewer('src\pl\plperl\SPI.c','src\pl\plperl\SPI.xs')) { + my $xsubppdir = first { -e "$_\\ExtUtils\\xsubpp" } @INC; print 'Building src\pl\plperl\SPI.c...' . "\n"; - system($solution->{options}->{perl} . '/bin/perl ' . $solution->{options}->{perl} . '/lib/ExtUtils/xsubpp -typemap ' . $solution->{options}->{perl} . '/lib/ExtUtils/typemap src\pl\plperl\SPI.xs >src\pl\plperl\SPI.c'); + system($solution->{options}->{perl} . '/bin/perl ' . "$xsubppdir/ExtUtils/xsubpp -typemap " . $solution->{options}->{perl} . '/lib/ExtUtils/typemap src\pl\plperl\SPI.xs >src\pl\plperl\SPI.c'); if ((!(-f 'src\pl\plperl\SPI.c')) || -z 'src\pl\plperl\SPI.c') { unlink('src\pl\plperl\SPI.c'); # if zero size die 'Failed to create SPI.c' . "\n"; |