S_del_body is sufficiently small that inlining it is a space win.
[p5sagit/p5-mst-13.2.git] / symbian / sdk.pl
CommitLineData
27da23d5 1use strict;
2
3my $SDK;
4my $WIN;
5
6if ($ENV{PATH} =~ m!\\Symbian\\(.+?)\\gcc\\bin!) {
7 my $cc = $1;
8 $WIN = $cc =~ m!_CW!i ? 'winscw' : 'wins';
9 $ENV{WIN} = $WIN;
10 if ($cc =~ m!Series60_v20!) {
11 $ENV{S60SDK} = '2.0';
12 } elsif ($cc =~ m!Series60_v21!) {
13 $ENV{S60SDK} = '2.1';
14 } elsif ($cc =~ m!S60_2nd_FP2!) {
15 $ENV{S60SDK} = '2.6';
16 }
17}
18
19if (open(GCC, "gcc -v 2>&1|")) {
20 while (<GCC>) {
21 if (/Reading specs from ((?:C:)?\\Symbian.+?)\\Epoc32\\/i) {
22 $SDK = $1;
23 # The S60SDK tells the Series 60 SDK version.
24 if ($SDK eq 'C:\Symbian\6.1\Shared') { # Visual C.
25 $SDK = 'C:\Symbian\6.1\Series60';
26 $ENV{S60SDK} = '1.2';
27 } elsif ($SDK eq 'C:\Symbian\Series60_1_2_CW') { # CodeWarrior.
28 $ENV{S60SDK} = '1.2';
29 }
30 last;
31 }
32 }
33 close GCC;
34} else {
35 die "$0: failed to run gcc: $!\n";
36}
37
38my $UARM = $ENV{UARM} ? $ENV{UARM} : "urel";
39my $UREL = "$SDK\\epoc32\\release\\-ARM-\\$UARM";
40if ($SDK eq 'C:\Symbian\6.1\Series60' && $ENV{WIN} eq 'winscw') {
41 $UREL = "C:\\Symbian\\Series60_1_2_CW\\epoc32\\release\\-ARM-\\urel";
42}
43$ENV{UREL} = $UREL;
44$ENV{UARM} = $UARM;
45
46die "$0: failed to locate the Symbian SDK\n" unless defined $SDK;
47
48$SDK;