HAWQ-1277. Fix build problem on CentOS 7, with --with-plperl. See earlier discussion on this on pgsql-hackers, message-id [email protected]. We'd get this fix eventually as we merge with later PostgreSQL versions, but let's make life easier for people hitting this issue now.
This is a backpatch of the following upstream commit, sans the MSVC build parts, as I have no environment to test that and we don't support Windows anyway. We'll get the MSVC parts later, as we merge. commit ba00ab0b111a0cbbac612e8ea8b0d5f96534102e Author: Andrew Dunstan <[email protected]> Date: Sat Nov 26 15:22:32 2011 -0500 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. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/afac2dfe Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/afac2dfe Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/afac2dfe Branch: refs/heads/2.1.0.0-incubating Commit: afac2dfe6d1be9434b93b5065c00b743c8243098 Parents: 368dbc9 Author: Ed Espino <[email protected]> Authored: Mon Jan 16 18:55:18 2017 -0800 Committer: Ed Espino <[email protected]> Committed: Mon Jan 16 21:38:02 2017 -0800 ---------------------------------------------------------------------- src/pl/plperl/GNUmakefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/afac2dfe/src/pl/plperl/GNUmakefile ---------------------------------------------------------------------- diff --git a/src/pl/plperl/GNUmakefile b/src/pl/plperl/GNUmakefile index d480268..a1e0a05 100644 --- a/src/pl/plperl/GNUmakefile +++ b/src/pl/plperl/GNUmakefile @@ -56,6 +56,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 @@ -69,10 +72,10 @@ perlchunks.h: $(PERLCHUNKS) all: all-lib SPI.c: SPI.xs - $(PERL) $(perl_privlibexp)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@ - + $(PERL) $(XSUBPPDIR)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@ + Util.c: Util.xs - $(PERL) $(perl_privlibexp)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@ + $(PERL) $(XSUBPPDIR)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@ install: all installdirs install-lib
