Change 16356 by jhi@alpha on 2002/05/02 22:30:10

        Subject: [PATCH] Re: Perl 5.8-to-be NetBSD testing?
        From: Andy Dougherty <[EMAIL PROTECTED]>
        Date: Thu, 2 May 2002 12:01:50 -0400 (EDT)
        Message-ID: 
<[EMAIL PROTECTED]>

Affected files ...

.... //depot/perl/Makefile.SH#246 edit
.... //depot/perl/ext/util/make_ext#12 edit

Differences ...

==== //depot/perl/Makefile.SH#246 (text) ====
Index: perl/Makefile.SH
--- perl/Makefile.SH.~1~        Thu May  2 16:45:05 2002
+++ perl/Makefile.SH    Thu May  2 16:45:05 2002
@@ -36,6 +36,7 @@
        esac
 
        pldlflags="$cccdlflags"
+       static_target='static_pic'
        case "${osname}${osvers}" in
        next4*)
                ld=libtool
@@ -97,6 +98,7 @@
         esac
        ;;
 *)     pldlflags=''
+       static_target='static'
        ;;
 esac
 
@@ -188,6 +190,13 @@
 LLIBPERL= $linklibperl
 SHRPENV = $shrpenv
 
+# Static targets are ordinarily built without CCCDLFLAGS.  However,
+# 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 ext/util/make_ext.
+STATIC = $static_target
+
 # The following is used to include the current directory in
 # the dynamic loader path you are building a shared libperl.
 LDLIBPTH = $ldlibpth
@@ -843,13 +852,13 @@
 # DynaLoader may be needed for extensions that use Makefile.PL.
 
 $(DYNALOADER): miniperl$(EXE_EXT) preplibrary FORCE
-       @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
+       @$(LDLIBPTH) sh ext/util/make_ext $(STATIC) $@ MAKE=$(MAKE) 
+LIBPERL_A=$(LIBPERL)
 
 d_dummy $(dynamic_ext):        miniperl$(EXE_EXT) preplibrary $(DYNALOADER) FORCE
        @$(LDLIBPTH) sh ext/util/make_ext dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
 
 s_dummy $(static_ext): miniperl$(EXE_EXT) preplibrary $(DYNALOADER) FORCE
-       @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
+       @$(LDLIBPTH) sh ext/util/make_ext $(STATIC) $@ MAKE=$(MAKE) 
+LIBPERL_A=$(LIBPERL)
 
 n_dummy $(nonxs_ext):  miniperl$(EXE_EXT) preplibrary $(DYNALOADER) FORCE
        @$(LDLIBPTH) sh ext/util/make_ext nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)

==== //depot/perl/ext/util/make_ext#12 (text) ====
Index: perl/ext/util/make_ext
--- perl/ext/util/make_ext.~1~  Thu May  2 16:45:05 2002
+++ perl/ext/util/make_ext      Thu May  2 16:45:05 2002
@@ -85,16 +85,19 @@
 
 cd ext/$pname
 
-# check link type and do any preliminaries
+# 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)
 case "$target" in
-           # convert 'static' or 'dynamic' into 'all LINKTYPE=XXX'
+dynamic)    makeargs="LINKTYPE=dynamic";
+           target=all
+           ;;
 static)     makeargs="LINKTYPE=static CCCDLFLAGS="
            target=all
            ;;
-dynamic)    makeargs="LINKTYPE=dynamic";
+static_pic) makeargs="LINKTYPE=static"
            target=all
            ;;
-
 nonxs)      makeargs="";
            target=all
            ;;
End of Patch.

Reply via email to