summaryrefslogtreecommitdiff
path: root/make_ext.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-01-30 23:39:15 +0000
committerNicholas Clark <nick@ccl4.org>2009-01-30 23:39:15 +0000
commitc337d41ae5b7ea3e2fe8b0bea5a5b578908a841b (patch)
tree5b33245413ae1784d4e301ea8ee7df68832812bd /make_ext.pl
parentd793a8a7f7f2bd8f80c6af1cbf5a405a3d09d08a (diff)
downloadperl-c337d41ae5b7ea3e2fe8b0bea5a5b578908a841b.tar.gz
Move the target generic logic above the extension specific logic.
This will make it easier to refactor to converge on the Win32 (and VMS) equivalents, which set things up, then loop around all appropriate extensions.
Diffstat (limited to 'make_ext.pl')
-rw-r--r--make_ext.pl61
1 files changed, 30 insertions, 31 deletions
diff --git a/make_ext.pl b/make_ext.pl
index 555ed2d1b2..b7daf700ef 100644
--- a/make_ext.pl
+++ b/make_ext.pl
@@ -66,6 +66,36 @@ if (!defined($extspec) or $extspec eq '') {
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') {
+ $passthru = "LINKTYPE=dynamic $passthru";
+ $target = 'all';
+}
+elsif ($target eq 'static') {
+ $passthru = "LINKTYPE=static CCCDLFLAGS= $passthru";
+ $target = 'all';
+}
+elsif ($target eq 'static_pic') {
+ $passthru = "LINKTYPE=static $passthru";
+ $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";
+ exit(1);
+}
+else {
+ # for the time being we are strict about what make_ext is used for
+ print "make_ext: unknown make target '$target'\n";
+ exit(1);
+}
+
# The Perl Makefile.SH will expand all extensions to
# lib/auto/X/X.a (or lib/auto/X/Y/Y.a if nested)
# A user wishing to run make_ext might use
@@ -113,37 +143,6 @@ print "\tMaking $mname ($target)\n";
chdir("ext/$pname");
-# 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') {
- $passthru = "LINKTYPE=dynamic $passthru";
- $target = 'all';
-}
-elsif ($target eq 'static') {
- $passthru = "LINKTYPE=static CCCDLFLAGS= $passthru";
- $target = 'all';
-}
-elsif ($target eq 'static_pic') {
- $passthru = "LINKTYPE=static $passthru";
- $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";
- exit(1);
-}
-else {
- # for the time being we are strict about what make_ext is used for
- print "make_ext: unknown make target '$target'\n";
- exit(1);
-}
-
-
if (not -f $makefile) {
if (-f "Makefile.PL") {
my $cross = $opts{cross} ? ' -MCross' : '';