@ -3,23 +3,27 @@ use ExtUtils::Embed;
u s e D y n a L o a d e r ;
u s e C o n f i g ;
#
# Can't build a shared plperl unless libperl is shared too.
# (Actually, it would be enough if code in libperl.a is compiled
# to be position-independent, but that is hard to check for and
# seems pretty unlikely anyway.)
#
i f ( $ C o n f i g { 'useshrplib' } n e 'true' ) {
# On some platforms you can't build plperl unless libperl is a shared
# library. (Actually, it would be enough if code in libperl.a is
# compiled to be position-independent, but that is hard to check for
# and seems pretty unlikely anyway.) On some platforms it doesn't
# matter and they can pass in the --force flag to build anyway.
# (Having a shared libperl is still a lot better for efficiency,
# though.)
i f ( $ C o n f i g { 'useshrplib' } n e 'true' & & $ A R G V [ 0 ] n e '--force' ) {
open( OUT, ">Makefile" ) or die " Can't write Makefile: $! \n " ;
print OUT <<'EndOfMakefile' ;
# Dummy Makefile for use when we can't build plperl
all install :
@echo "*****" ; \
echo "* Cannot build PL/Perl because libperl is not a shared library." ; \
echo "* Skipped." ; \
echo "*****"
all :
@echo "" ; \
echo "*** Cannot build PL/Perl because libperl is not a shared library." ; \
echo "*** You might have to rebuild your Perl installation. Refer to" ; \
echo "*** the documentation for details." ; \
echo ""
install :
clean realclean :
rm -f Makefile
@ -34,7 +38,6 @@ $ldopts=~s/$Config{ccdlflags}//;
W r i t e M a k e f i l e ( 'NAME' = > 'plperl' ,
dynamic_lib = > { 'OTHERLDFLAGS' = > $ldopts } ,
INC = > " $ENV {EXTRA_INCLUDES} " ,
XS = > { 'SPI.xs' = > 'SPI.c' } ,
OBJECT = > 'plperl.o eloglvl.o SPI.o' ,
) ;
@ -66,3 +69,30 @@ install :: all
] ;
}
sub MY :: xs_o {
'' ;
}
sub MY :: makefile {
'' ;
}
# VPATH-aware version of this rule
sub MY :: xs_c {
my( $self ) = shift;
return '' unless $self ->needs_linking( ) ;
'
.xs.c :
$( PERL) -I$( PERL_ARCHLIB) -I$( PERL_LIB) $( XSUBPP) $( XSPROTOARG) $( XSUBPPARGS) $< > $@
' ;
}
# somebody doesn't know how to write make rules...
sub MY :: c_o {
package MY; # so that "SUPER" works right
my $inherited = shift->SUPER::c_o( @_) ;
$inherited = ~ s/\$ \* \. \S +/\$ \< /g;
$inherited ;
}