Skip to content

Commit ed7eff8

Browse files
committed
Guard against using plperl's Makefile without specifying --with-perl.
The $(PERL) macro will be set by configure if it finds perl at all, but $(perl_privlibexp) isn't configured unless you said --with-perl. This results in confusing error messages if someone cd's into src/pl/plperl and tries to build there despite the configure omission, as reported by Tomas Vondra in bug #6198. Add simple checks to provide a more useful report, while not disabling other use of the makefile such as "make clean". Back-patch to 9.0, which is as far as the patch applies easily.
1 parent 0962182 commit ed7eff8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pl/plperl/GNUmakefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,21 @@ include $(top_srcdir)/src/Makefile.shlib
5757
plperl.o: perlchunks.h plperl_opmask.h
5858

5959
plperl_opmask.h: plperl_opmask.pl
60+
@if [ x"$(perl_privlibexp)" = x"" ]; then echo "configure switch --with-perl was not specified."; exit 1; fi
6061
$(PERL) $< $@
6162

62-
perlchunks.h: $(PERLCHUNKS)
63+
perlchunks.h: $(PERLCHUNKS)
64+
@if [ x"$(perl_privlibexp)" = x"" ]; then echo "configure switch --with-perl was not specified."; exit 1; fi
6365
$(PERL) $(srcdir)/text2macro.pl --strip='^(\#.*|\s*)$$' $^ > $@
6466

6567
all: all-lib
6668

6769
SPI.c: SPI.xs
70+
@if [ x"$(perl_privlibexp)" = x"" ]; then echo "configure switch --with-perl was not specified."; exit 1; fi
6871
$(PERL) $(perl_privlibexp)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@
6972

7073
Util.c: Util.xs
74+
@if [ x"$(perl_privlibexp)" = x"" ]; then echo "configure switch --with-perl was not specified."; exit 1; fi
7175
$(PERL) $(perl_privlibexp)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@
7276

7377
install: all installdirs install-lib

0 commit comments

Comments
 (0)