From: Nicholas Clark Date: Sat, 31 Jan 2009 20:16:43 +0000 (+0000) Subject: Move the static/dynamic/nonxs LINKTYPE logic from make_ext.pl to Makefile.SH X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=07f3cc2a611daebb9d83f869d36ef63cf4fa2565;p=p5sagit%2Fp5-mst-13.2.git Move the static/dynamic/nonxs LINKTYPE logic from make_ext.pl to Makefile.SH This simplifies make_ext.pl considerably. Given that the first use of 'passthru' was in 40000a8c37c35cc00114329ca0add46bca36a0ec in 1995, possibly we should have done this particular refactoring a little while ago. --- diff --git a/Makefile.SH b/Makefile.SH index 2e82a8e..f8193a6 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -59,7 +59,7 @@ true) esac pldlflags="$cccdlflags" - static_target='static_pic' + static_ldflags='' case "${osname}${osvers}" in next4*) ld=libtool @@ -175,7 +175,7 @@ EOT ;; *) pldlflags='' - static_target='static' + static_ldflags='CCCDLFLAGS=' ;; esac @@ -272,8 +272,8 @@ SHRPENV = $shrpenv # 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. @@ -1123,16 +1123,16 @@ manicheck: FORCE # 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 <