Commit | Line | Data |
27da23d5 |
1 | use strict; |
2 | |
3 | my $SDK; |
4 | my $WIN; |
5 | |
6 | if ($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 | |
19 | if (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 | |
38 | my $UARM = $ENV{UARM} ? $ENV{UARM} : "urel"; |
39 | my $UREL = "$SDK\\epoc32\\release\\-ARM-\\$UARM"; |
40 | if ($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 | |
46 | die "$0: failed to locate the Symbian SDK\n" unless defined $SDK; |
47 | |
48 | $SDK; |