From: Nicholas Clark Date: Fri, 30 Jan 2009 23:39:15 +0000 (+0000) Subject: Move the target generic logic above the extension specific logic. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c337d41ae5b7ea3e2fe8b0bea5a5b578908a841b;p=p5sagit%2Fp5-mst-13.2.git 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. --- diff --git a/make_ext.pl b/make_ext.pl index 555ed2d..b7daf70 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' : '';