Commit | Line | Data |
27da23d5 |
1 | use strict; |
2 | |
ed76c0e4 |
3 | my $SYMBIAN_VERSION; |
4 | my $SYMBIAN_ROOT; |
5 | my $SDK_NAME; |
6 | my $SDK_VARIANT; |
7 | my $SDK_VERSION; |
27da23d5 |
8 | my $WIN; |
9 | |
ed76c0e4 |
10 | if ($ENV{PATH} =~ m!\\Symbian\\(.+?)\\(.+?)\\Epoc32\\gcc\\bin!i) { |
11 | $SYMBIAN_VERSION = $1; |
12 | $SDK_NAME = $2; |
13 | $WIN = ($SDK_NAME =~ m!_CW!i || $SDK_NAME eq '8.1a') ? |
14 | 'winscw' : 'wins'; |
27da23d5 |
15 | $ENV{WIN} = $WIN; |
ed76c0e4 |
16 | if ($SDK_NAME =~ m!Series60_v20!) { |
17 | $SDK_VARIANT = 'S60'; |
db5886f1 |
18 | $SDK_VERSION = $ENV{S60SDK} = '2.0'; |
ed76c0e4 |
19 | } elsif ($SDK_NAME =~ m!Series60_v21!) { |
20 | $SDK_VARIANT = 'S60'; |
21 | $SDK_VERSION = $ENV{S60SDK} = '2.1'; |
22 | } elsif ($SDK_NAME =~ m!S60_2nd_FP2!) { |
23 | $SDK_VARIANT = 'S60'; |
24 | $SDK_VERSION = $ENV{S60SDK} = '2.6'; |
25 | } elsif ($SDK_NAME =~ m!S60_2nd_FP3!) { |
26 | $SDK_VARIANT = 'S60'; |
27 | $SDK_VERSION = $ENV{S60SDK} = '2.8'; |
28 | } elsif ($SDK_NAME =~ m!S80_DP2_0_SDK!) { |
29 | $SDK_VARIANT = 'S80'; |
30 | $SDK_VERSION = $ENV{S80SDK} = '2.0'; |
27da23d5 |
31 | } |
25ca88e0 |
32 | } elsif ($ENV{PATH} =~ m!\\Symbian\\UIQ_(\d)(\d)\\Epoc32\\gcc\\bin!i) { |
33 | $SDK_NAME = 'UIQ'; |
34 | $SDK_VARIANT = 'UIQ'; |
35 | $SDK_VERSION = $ENV{UIQSDK} = "$1.$2"; |
36 | if ($SDK_VERSION =~ /^2\./) { |
37 | $SYMBIAN_VERSION = '7.0s'; |
38 | } else { |
39 | die "$0: Unknown UIQ version '$SDK_VERSION'\n"; |
40 | } |
41 | $WIN = 'winscw'; # This is CodeWarrior, how about Borland? |
42 | $ENV{WIN} = $WIN; |
27da23d5 |
43 | } |
44 | |
25ca88e0 |
45 | if (open(GCC, "gcc -v 2>&1 |")) { |
27da23d5 |
46 | while (<GCC>) { |
db5886f1 |
47 | # print; |
27da23d5 |
48 | if (/Reading specs from ((?:C:)?\\Symbian.+?)\\Epoc32\\/i) { |
ed76c0e4 |
49 | $SYMBIAN_ROOT = $1; |
25ca88e0 |
50 | # The S60SDK tells the Series 60 SDK version. |
ed76c0e4 |
51 | if ($ENV{S60SDK}) { |
52 | if ($SYMBIAN_ROOT eq 'C:\Symbian\6.1\Shared') { # Visual C. |
53 | $SYMBIAN_ROOT = 'C:\Symbian\6.1\Series60'; |
54 | $SDK_VERSION = $ENV{S60SDK} = '1.2'; |
55 | } elsif ($SYMBIAN_ROOT eq 'C:\Symbian\Series60_1_2_CW') { # CodeWarrior. |
56 | $SDK_VERSION = $ENV{S60SDK} = '1.2'; |
57 | } |
27da23d5 |
58 | } |
59 | last; |
60 | } |
61 | } |
62 | close GCC; |
63 | } else { |
64 | die "$0: failed to run gcc: $!\n"; |
65 | } |
66 | |
ed76c0e4 |
67 | die "$0: failed to locate the Symbian SDK\n" unless defined $SYMBIAN_ROOT; |
68 | |
27da23d5 |
69 | my $UARM = $ENV{UARM} ? $ENV{UARM} : "urel"; |
ed76c0e4 |
70 | my $UREL = "$SYMBIAN_ROOT\\epoc32\\release\\-ARM-\\$UARM"; |
71 | if ($SYMBIAN_ROOT eq 'C:\Symbian\6.1\Series60' && $ENV{WIN} eq 'winscw') { |
27da23d5 |
72 | $UREL = "C:\\Symbian\\Series60_1_2_CW\\epoc32\\release\\-ARM-\\urel"; |
73 | } |
74 | $ENV{UREL} = $UREL; |
75 | $ENV{UARM} = $UARM; |
76 | |
ed76c0e4 |
77 | [ $SYMBIAN_ROOT, $SYMBIAN_VERSION, $SDK_NAME, $SDK_VARIANT, $SDK_VERSION ]; |
c8f896e5 |
78 | |
79 | # The following is a cheat sheet for the right S60/S80 SDK settings. |
80 | # |
d0d72822 |
81 | # symbiancommon.bat: |
c8f896e5 |
82 | # set EPOC_BIN=%EPOCROOT%Epoc32\gcc\bin;%EPOCROOT%Epoc32\Tools |
83 | # set MWCW=C:\Program Files\Metrowerks\CodeWarrior for Symbian OEM v2.8 |
84 | # set MSVC=C:\Program Files\Microsoft Visual Studio |
d0d72822 |
85 | # set MSVC_BIN=%MSVC%\VC98\Bin;%MSVC%\Aux\MSDev98\Bin |
db5886f1 |
86 | # set MSVC_INC=%MSVC%\VC98\atl\include;%MSVC%\VC98\include;%MSVC%\mfc\include;%MSVC%\include |
c8f896e5 |
87 | # set MSVC_LIB=%MSVC%\mfc\lib;%MSVC%\lib |
88 | # |
89 | # s60-1.2-cw: |
90 | # |
91 | # set EPOCROOT=\Symbian\Series60_1_2_CW\ |
d0d72822 |
92 | # symbiancommon |
93 | # set PATH=%EPOC_BIN%;%MSVC_BIN%;%MWCW%\Bin;%MWCW%\Symbian_Tools\Command_Line_Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32 |
c8f896e5 |
94 | # set USERDEFS=%USERDEFS% -D__SERIES60_12__ -D__SERIES60_MAJOR__=1 -D__SERIES60_MINOR__=2 -D__SERIES60_1X__ |
95 | # |
96 | # s60-1.2-vc: |
97 | # |
98 | # set EPOCROOT=\Symbian\6.1\Series60\ |
d0d72822 |
99 | # symbiancommon |
100 | # set PATH=\Symbian\6.1\Shared\Epoc32\gcc\bin;\Symbian\6.1\Shared\Epoc32\Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32 |
c8f896e5 |
101 | # set INCLUDE=%MSVC_INC% |
102 | # set LIB=%MSVC_LIB% |
103 | # set USERDEFS=%USERDEFS% -D__SERIES60_12__ -D__SERIES60_MAJOR__=1 -D__SERIES60_MINOR__=2 -D__SERIES60_1X__ |
104 | # |
105 | # s60-2.0-cw: |
106 | # |
107 | # set EPOCROOT=\Symbian\7.0s\Series60_v20_CW\ |
108 | # set EPOCDEVICE=Series60_2_0_CW:com.Nokia.Series60_2_0_CW |
d0d72822 |
109 | # symbiancommon |
110 | # set PATH=%EPOC_BIN%;%MWCW%\Bin;%MWCW%\Symbian_Tools\Command_Line_Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32 |
c8f896e5 |
111 | # set USERDEFS=%USERDEFS% -D__SERIES60_20__ -D__SERIES60_MAJOR__=2 -D__SERIES60_MINOR__=0 -D__SERIES60_2X__ |
112 | # |
113 | # s60-2.0-vc: |
114 | # |
115 | # set EPOCROOT=\Symbian\7.0s\Series60_v20\ |
116 | # set EPOCDEVICE=Series60_v20:com.nokia.series60 |
d0d72822 |
117 | # symbiancommon |
118 | # set PATH=%EPOC_BIN%;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32 |
c8f896e5 |
119 | # set INCLUDE=%MSVC_INC% |
120 | # set LIB=%MSVC_LIB% |
121 | # set USERDEFS=%USERDEFS% -D__SERIES60_20__ -D__SERIES60_MAJOR__=2 -D__SERIES60_MINOR__=0 -D__SERIES60_2X__ |
122 | # |
123 | # s60-2.1-cw: |
124 | # |
125 | # set EPOCROOT=\Symbian\7.0s\Series60_v21_CW\ |
126 | # set EPOCDEVICE=Series60_v21_CW:com.Nokia.series60 |
d0d72822 |
127 | # symbiancommon |
128 | # set PATH=%EPOC_BIN%;%MWCW%\Bin;%MWCW%\Symbian_Tools\Command_Line_Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32 |
c8f896e5 |
129 | # set USERDEFS=%USERDEFS% -D__SERIES60_21__ -D__SERIES60_MAJOR__=2 -D__SERIES60_MINOR__=1 -D__SERIES60_2X__ |
130 | # |
131 | # s60-2.6-cw: |
132 | # |
133 | # set EPOCROOT=\Symbian\8.0a\S60_2nd_FP2_CW\ |
134 | # set EPOCDEVICE=S60_2nd_FP2_CW:com.nokia.series60 |
d0d72822 |
135 | # symbiancommon |
136 | # set PATH=%EPOC_BIN%;%MWCW%\Bin;%MWCW%\Symbian_Tools\Command_Line_Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32 |
c8f896e5 |
137 | # set USERDEFS=%USERDEFS% -D__SERIES60_26__ -D__SERIES60_MAJOR__=2 -D__SERIES60_MINOR__=6 -D__SERIES60_2X__ -D__BLUETOOTH_API_V2__ |
138 | # |
139 | # s60-2.6-vc: |
140 | # |
141 | # set EPOCROOT=\Symbian\8.0a\S60_2nd_FP2\ |
142 | # set EPOCDEVICE=S60_2nd_FP2:com.nokia.Series60 |
d0d72822 |
143 | # symbiancommon |
144 | # set PATH=%EPOC_BIN%;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32 |
c8f896e5 |
145 | # set INCLUDE=%MSVC_INC% |
146 | # set LIB=%MSVC_LIB% |
147 | # set USERDEFS=%USERDEFS% -D__SERIES60_26__ -D__SERIES60_MAJOR__=2 -D__SERIES60_MINOR__=6 -D__SERIES60_2X__ -D__BLUETOOTH_API_V2__ |
148 | # |
149 | # s60-2.8-cw: |
150 | # |
151 | # set EPOCROOT=\Symbian\8.1a\S60_2nd_FP3\ |
152 | # set EPOCDEVICE=S60_2nd_FP3:com.nokia.series60 |
d0d72822 |
153 | # symbiancommon |
154 | # set PATH=%EPOC_BIN%;%MWCW%\Bin;%MWCW%\Symbian_Tools\Command_Line_Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32 |
c8f896e5 |
155 | # set USERDEFS=%USERDEFS% -D__SERIES60_28__ -D__SERIES60_MAJOR__=2 -D__SERIES60_MINOR__=8 -D__SERIES60_2X__ -D__BLUETOOTH_API_V2__ |
156 | # |
157 | # s80-2.0-cw: |
158 | # |
159 | # set EPOCROOT=\Symbian\7.0s\S80_DP2_0_SDK_CW\ |
160 | # set EPOCDEVICE=Series80_DP2_0_SDK_CW:com.nokia.Series80 |
d0d72822 |
161 | # symbiancommon |
162 | # set PATH=%EPOC_BIN%;%MWCW%\Bin;%MWCW%\Symbian_Tools\Command_Line_Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32 |
c8f896e5 |
163 | # set USERDEFS=%USERDEFS% -D__SERIES80_20__ -D__SERIES80_MAJOR__=2 -D__SERIES80_MINOR__=0 -D__SERIES80_2X__ |
164 | # |
165 | # s80-2.0-vc: |
166 | # |
167 | # set EPOCROOT=\Symbian\7.0s\S80_DP2_0_SDK\ |
168 | # set EPOCDEVICE=Series80_DP2_0_SDK:com.nokia.Series80 |
d0d72822 |
169 | # symbiancommon |
170 | # set PATH=%EPOC_BIN%;%MWCW%\Bin;%MWCW%\Symbian_Tools\Command_Line_Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32 |
c8f896e5 |
171 | # set USERDEFS=%USERDEFS% -D__SERIES80_20__ -D__SERIES80_MAJOR__=2 -D__SERIES80_MINOR__=0 -D__SERIES80_2X__ |
172 | # |
d0d72822 |
173 | # UIQ-2.1-vc: |
174 | # set EPOCROOT=\Symbian\UIQ_21\ |
175 | # set EPOCDEVICE= |
176 | # set EPOC_BIN=%EPOCROOT%Epoc32\gcc\bin;%EPOCROOT%Epoc32\Tools |
177 | # set MWCW=C:\APPS\codewarrior_3.0 |
178 | # set MSVC=C:\Program Files\Microsoft Visual Studio |
179 | # set MSVC_BIN=%MSVC%;%MSVC%\Common\MSDev98\Bin |
180 | # set MSVC_INC=%MSVC%\VC98\atl\include;%MSVC%\mfc\include;%MSVC%\include |
181 | # set MSVC_LIB=%MSVC%\mfc\lib;%MSVC%\lib |
182 | # set PATH=%EPOC_BIN%;%MWCW%\Bin;%MWCW%\Symbian_Tools\Command_Line_Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32 |
183 | # set USERDEFS=%USERDEFS% -D__UIQ_21__ -D__UIQ_MAJOR__=2 -D__UIQ_MINOR__=1 -D__UIQ_2X__ |
184 | # |
c8f896e5 |
185 | # EOF |
186 | |