@@ -3,23 +3,27 @@ use ExtUtils::Embed;
3
3
use DynaLoader;
4
4
use Config;
5
5
6
- #
7
- # Can't build a shared plperl unless libperl is shared too.
8
- # (Actually, it would be enough if code in libperl.a is compiled
9
- # to be position-independent, but that is hard to check for and
10
- # seems pretty unlikely anyway.)
11
- #
12
- if ($Config {' useshrplib' } ne ' true' ) {
6
+ # On some platforms you can't build plperl unless libperl is a shared
7
+ # library. (Actually, it would be enough if code in libperl.a is
8
+ # compiled to be position-independent, but that is hard to check for
9
+ # and seems pretty unlikely anyway.) On some platforms it doesn't
10
+ # matter and they can pass in the --force flag to build anyway.
11
+ # (Having a shared libperl is still a lot better for efficiency,
12
+ # though.)
13
+
14
+ if ($Config {' useshrplib' } ne ' true' && $ARGV [0] ne ' --force' ) {
13
15
open (OUT, " >Makefile" ) or die " Can't write Makefile: $! \n " ;
14
16
print OUT <<'EndOfMakefile' ;
15
17
# Dummy Makefile for use when we can't build plperl
16
18
17
- all install:
18
- @echo "*****"; \
19
- echo "* Cannot build PL/Perl because libperl is not a shared library." ; \
20
- echo "* Skipped."; \
21
- echo "*****"
19
+ all:
20
+ @echo ""; \
21
+ echo "*** Cannot build PL/Perl because libperl is not a shared library." ; \
22
+ echo "*** You might have to rebuild your Perl installation. Refer to"; \
23
+ echo "*** the documentation for details."; \
24
+ echo ""
22
25
26
+ install:
23
27
24
28
clean realclean:
25
29
rm -f Makefile
@@ -34,7 +38,6 @@ $ldopts=~s/$Config{ccdlflags}//;
34
38
35
39
WriteMakefile( ' NAME' => ' plperl' ,
36
40
dynamic_lib => { ' OTHERLDFLAGS' => $ldopts } ,
37
- INC => " $ENV {EXTRA_INCLUDES}" ,
38
41
XS => { ' SPI.xs' => ' SPI.c' },
39
42
OBJECT => ' plperl.o eloglvl.o SPI.o' ,
40
43
);
@@ -66,3 +69,30 @@ install :: all
66
69
] ;
67
70
68
71
}
72
+
73
+
74
+ sub MY ::xs_o {
75
+ ' ' ;
76
+ }
77
+
78
+ sub MY ::makefile {
79
+ ' ' ;
80
+ }
81
+
82
+ # VPATH-aware version of this rule
83
+ sub MY ::xs_c {
84
+ my ($self ) = shift ;
85
+ return ' ' unless $self -> needs_linking();
86
+ '
87
+ .xs.c:
88
+ $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $< > $@
89
+ ' ;
90
+ }
91
+
92
+ # somebody doesn't know how to write make rules...
93
+ sub MY ::c_o {
94
+ package MY ; # so that "SUPER" works right
95
+ my $inherited = shift -> SUPER::c_o(@_ );
96
+ $inherited =~ s /\$\*\.\S +/ \$\< / g ;
97
+ $inherited ;
98
+ }
0 commit comments