Permalink
Browse files

Fix a building problem with perl 5.14.1 on Mac OS X

When building on a Mac OS X with perl 5.14.1 set as the system default,
generating if_perl.c fails with a message about undefined method:

Undefined subroutine &ExtUtils::ParseXS::errors called at [snip] line 41.

The problem occurs because Makefile uses xsubpp from perl's lib
directory. Problem goes away if Makefile uses xsubpp from site_lib. This
patch enables detecting the site_lib location, and using that xsubpp.
  • Loading branch information...
1 parent 9074034 commit bea5e3c0d803cb950d4a411b4c6d39c8904fea27 @knl knl committed with Sep 8, 2011
Showing with 10 additions and 2 deletions.
  1. +7 −2 src/Makefile
  2. +1 −0 src/config.mk.in
  3. +2 −0 src/configure.in
View
9 src/Makefile
@@ -2414,8 +2414,13 @@ lintinstall:
auto/if_perl.c: if_perl.xs
$(PERL) -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $@
- $(PERL) $(PERLLIB)/ExtUtils/xsubpp -prototypes -typemap \
- $(PERLLIB)/ExtUtils/typemap if_perl.xs >> $@
+ -@if test -e $(PERLSITELIB)/ExtUtils/xsubpp; then \
+ $(PERL) $(PERLSITELIB)/ExtUtils/xsubpp -prototypes -typemap \
+ $(PERLLIB)/ExtUtils/typemap if_perl.xs >> $@; \
+ else \
+ $(PERL) $(PERLLIB)/ExtUtils/xsubpp -prototypes -typemap \
+ $(PERLLIB)/ExtUtils/typemap if_perl.xs >> $@; \
+ fi
auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in
CC="$(CC) $(OSDEF_CFLAGS)" srcdir=$(srcdir) sh $(srcdir)/osdef.sh
View
1 src/config.mk.in
@@ -54,6 +54,7 @@ MZSCHEME_MZC = @MZSCHEME_MZC@
PERL = @vi_cv_path_perl@
PERLLIB = @vi_cv_perllib@
+PERLSITELIB = @vi_cv_perlsitelib@
PERL_LIBS = @PERL_LIBS@
SHRPENV = @shrpenv@
PERL_SRC = @PERL_SRC@
View
2 src/configure.in
@@ -715,7 +715,9 @@ if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
shrpenv=""
fi
vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'`
+ vi_cv_perlsitelib=`$vi_cv_path_perl -MConfig -e 'print $Config{sitelibexp}'`
AC_SUBST(vi_cv_perllib)
+ AC_SUBST(vi_cv_perlsitelib)
dnl Remove "-fno-something", it breaks using cproto.
perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//'`

0 comments on commit bea5e3c

Please sign in to comment.