esac
pldlflags="$cccdlflags"
- static_target='static_pic'
+ static_ldflags=''
case "${osname}${osvers}" in
next4*)
ld=libtool
;;
*) pldlflags=''
- static_target='static'
+ static_ldflags='CCCDLFLAGS='
;;
esac
# if building a shared libperl.so that might later be linked into
# another application, then it might be appropriate to also build static
# extensions (usually just DynaLoader) with relocatable code (e.g. -fPIC
-# for GNU cc). This is handled by make_ext.pl.
-STATIC = $static_target
+# for GNU cc).
+STATIC_LDFLAGS = $static_ldflags
# The following is used to include the current directory in
# the dynamic loader path you are building a shared libperl.
# DynaLoader may be needed for extensions that use Makefile.PL.
$(DYNALOADER): miniperl$(EXE_EXT) preplibrary FORCE
- $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --target=$(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
+ $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS)
d_dummy $(dynamic_ext): miniperl$(EXE_EXT) preplibrary makeppport $(DYNALOADER) FORCE
- $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --target=dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
+ $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
s_dummy $(static_ext): miniperl$(EXE_EXT) preplibrary makeppport $(DYNALOADER) FORCE
- $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --target=$(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
+ $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS)
n_dummy $(nonxs_ext): miniperl$(EXE_EXT) preplibrary FORCE
- $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --target=nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
+ $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
!NO!SUBS!
$spitshell >>$Makefile <<EOF
unshift @pass_through, 'PERL_CORE=1';
my $target = $opts{target};
+$target = 'all' unless defined $target;
my $extspec = $extspec[0];
# Previously, $make was taken from config.sh. However, the user might
exit(1);
}
-# check link type and do any preliminaries. Valid link types are
-# 'dynamic', 'static', and 'static_pic' (the last one respects
-# CCCDLFLAGS such as -fPIC -- see static_target in the main Makefile.SH)
-if ($target eq 'dynamic') {
- unshift @pass_through, 'LINKTYPE=dynamic';
- $target = 'all';
-}
-elsif ($target eq 'static') {
- unshift @pass_through, 'LINKTYPE=static', 'CCCDLFLAGS=';
- $target = 'all';
-}
-elsif ($target eq 'static_pic') {
- unshift @pass_through, 'LINKTYPE=static';
- $target = 'all';
-}
-elsif ($target eq 'nonxs') {
- $target = 'all';
-}
-elsif ($target =~ /clean$/) {
-}
-elsif ($target eq '') {
- print "make_ext: no make target specified (eg static or dynamic)\n";
+if ($target eq '') {
+ print "make_ext: no make target specified (eg all or clean)\n";
exit(1);
}
-else {
+elsif ($target !~ /(?:^all|clean)$/) {
# for the time being we are strict about what make_ext is used for
print "make_ext: unknown make target '$target'\n";
exit(1);