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'; |
2f2424c0 |
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'; |
53d44271 |
31 | } elsif ($SDK_NAME =~ m!Nokia_7710_SDK!) { |
32 | $SDK_VARIANT = 'S90'; |
33 | $SDK_VERSION = $ENV{S90SDK} = '1.1'; |
27da23d5 |
34 | } |
2f2424c0 |
35 | } elsif ($ENV{PATH} =~ m!\\S60\\devices\\(.+?)\\epoc32\\gcc\\bin!i) { |
36 | $SDK_VARIANT = 'S60'; |
37 | $SDK_NAME = $1; |
38 | $WIN = $ENV{WIN} = 'winscw'; |
39 | $SYMBIAN_VERSION = '9.4'; |
40 | $SDK_VERSION = $ENV{S60SDK} = '5.0'; |
41 | $SYMBIAN_ROOT = $ENV{EPOCROOT}; |
25ca88e0 |
42 | } elsif ($ENV{PATH} =~ m!\\Symbian\\UIQ_(\d)(\d)\\Epoc32\\gcc\\bin!i) { |
43 | $SDK_NAME = 'UIQ'; |
44 | $SDK_VARIANT = 'UIQ'; |
45 | $SDK_VERSION = $ENV{UIQSDK} = "$1.$2"; |
46 | if ($SDK_VERSION =~ /^2\./) { |
47 | $SYMBIAN_VERSION = '7.0s'; |
48 | } else { |
49 | die "$0: Unknown UIQ version '$SDK_VERSION'\n"; |
50 | } |
51 | $WIN = 'winscw'; # This is CodeWarrior, how about Borland? |
2f2424c0 |
52 | $ENV{WIN} = $WIN; |
27da23d5 |
53 | } |
54 | |
25ca88e0 |
55 | if (open(GCC, "gcc -v 2>&1 |")) { |
27da23d5 |
56 | while (<GCC>) { |
db5886f1 |
57 | # print; |
53d44271 |
58 | if (/Reading specs from (.+?)\\Epoc32\\/i) { |
ed76c0e4 |
59 | $SYMBIAN_ROOT = $1; |
25ca88e0 |
60 | # The S60SDK tells the Series 60 SDK version. |
ed76c0e4 |
61 | if ($ENV{S60SDK}) { |
2f2424c0 |
62 | if ($SYMBIAN_ROOT eq 'C:\Symbian\6.1\Shared') { # Visual C. |
ed76c0e4 |
63 | $SYMBIAN_ROOT = 'C:\Symbian\6.1\Series60'; |
64 | $SDK_VERSION = $ENV{S60SDK} = '1.2'; |
65 | } elsif ($SYMBIAN_ROOT eq 'C:\Symbian\Series60_1_2_CW') { # CodeWarrior. |
66 | $SDK_VERSION = $ENV{S60SDK} = '1.2'; |
67 | } |
27da23d5 |
68 | } |
69 | last; |
70 | } |
71 | } |
72 | close GCC; |
73 | } else { |
74 | die "$0: failed to run gcc: $!\n"; |
75 | } |
76 | |
ed76c0e4 |
77 | die "$0: failed to locate the Symbian SDK\n" unless defined $SYMBIAN_ROOT; |
78 | |
27da23d5 |
79 | my $UARM = $ENV{UARM} ? $ENV{UARM} : "urel"; |
ed76c0e4 |
80 | my $UREL = "$SYMBIAN_ROOT\\epoc32\\release\\-ARM-\\$UARM"; |
81 | if ($SYMBIAN_ROOT eq 'C:\Symbian\6.1\Series60' && $ENV{WIN} eq 'winscw') { |
27da23d5 |
82 | $UREL = "C:\\Symbian\\Series60_1_2_CW\\epoc32\\release\\-ARM-\\urel"; |
83 | } |
84 | $ENV{UREL} = $UREL; |
85 | $ENV{UARM} = $UARM; |
86 | |
ed76c0e4 |
87 | [ $SYMBIAN_ROOT, $SYMBIAN_VERSION, $SDK_NAME, $SDK_VARIANT, $SDK_VERSION ]; |
c8f896e5 |
88 | |
89 | # The following is a cheat sheet for the right S60/S80 SDK settings. |
90 | # |
d0d72822 |
91 | # symbiancommon.bat: |
c8f896e5 |
92 | # set EPOC_BIN=%EPOCROOT%Epoc32\gcc\bin;%EPOCROOT%Epoc32\Tools |
93 | # set MWCW=C:\Program Files\Metrowerks\CodeWarrior for Symbian OEM v2.8 |
94 | # set MSVC=C:\Program Files\Microsoft Visual Studio |
d0d72822 |
95 | # set MSVC_BIN=%MSVC%\VC98\Bin;%MSVC%\Aux\MSDev98\Bin |
db5886f1 |
96 | # set MSVC_INC=%MSVC%\VC98\atl\include;%MSVC%\VC98\include;%MSVC%\mfc\include;%MSVC%\include |
c8f896e5 |
97 | # set MSVC_LIB=%MSVC%\mfc\lib;%MSVC%\lib |
98 | # |
4764e399 |
99 | # Note that if you are using Microsoft Visual Studio 8 |
100 | # (for example because you are using the Microsoft Visual C++ |
101 | # 2005 Express Edition), the MSVC settings will be different: |
102 | # set MSVC=C:\Program Files\Microsoft Visual Studio 8\VC |
103 | # set MSVC_BIN=%MSVC%\bin |
104 | # set MSVC_INC=%MSVC%\include |
105 | # set MSVC_LIB=%MSVC%\lib |
106 | # |
c8f896e5 |
107 | # s60-1.2-cw: |
108 | # |
109 | # set EPOCROOT=\Symbian\Series60_1_2_CW\ |
d0d72822 |
110 | # symbiancommon |
4764e399 |
111 | # set PATH=%EPOC_BIN%;%MSVC_BIN%;%MWCW%\Bin;%MWCW%\Symbian_Tools\Command_Line_Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32;%PATH% |
c8f896e5 |
112 | # set USERDEFS=%USERDEFS% -D__SERIES60_12__ -D__SERIES60_MAJOR__=1 -D__SERIES60_MINOR__=2 -D__SERIES60_1X__ |
113 | # |
114 | # s60-1.2-vc: |
115 | # |
116 | # set EPOCROOT=\Symbian\6.1\Series60\ |
d0d72822 |
117 | # symbiancommon |
4764e399 |
118 | # set PATH=\Symbian\6.1\Shared\Epoc32\gcc\bin;\Symbian\6.1\Shared\Epoc32\Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32;%PATH% |
c8f896e5 |
119 | # set INCLUDE=%MSVC_INC% |
120 | # set LIB=%MSVC_LIB% |
121 | # set USERDEFS=%USERDEFS% -D__SERIES60_12__ -D__SERIES60_MAJOR__=1 -D__SERIES60_MINOR__=2 -D__SERIES60_1X__ |
2f2424c0 |
122 | # |
c8f896e5 |
123 | # s60-2.0-cw: |
124 | # |
125 | # set EPOCROOT=\Symbian\7.0s\Series60_v20_CW\ |
126 | # set EPOCDEVICE=Series60_2_0_CW:com.Nokia.Series60_2_0_CW |
d0d72822 |
127 | # symbiancommon |
4764e399 |
128 | # set PATH=%EPOC_BIN%;%MWCW%\Bin;%MWCW%\Symbian_Tools\Command_Line_Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32;%PATH% |
c8f896e5 |
129 | # set USERDEFS=%USERDEFS% -D__SERIES60_20__ -D__SERIES60_MAJOR__=2 -D__SERIES60_MINOR__=0 -D__SERIES60_2X__ |
2f2424c0 |
130 | # |
c8f896e5 |
131 | # s60-2.0-vc: |
132 | # |
133 | # set EPOCROOT=\Symbian\7.0s\Series60_v20\ |
134 | # set EPOCDEVICE=Series60_v20:com.nokia.series60 |
d0d72822 |
135 | # symbiancommon |
4764e399 |
136 | # set PATH=%EPOC_BIN%;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32;%PATH% |
c8f896e5 |
137 | # set INCLUDE=%MSVC_INC% |
138 | # set LIB=%MSVC_LIB% |
139 | # set USERDEFS=%USERDEFS% -D__SERIES60_20__ -D__SERIES60_MAJOR__=2 -D__SERIES60_MINOR__=0 -D__SERIES60_2X__ |
2f2424c0 |
140 | # |
c8f896e5 |
141 | # s60-2.1-cw: |
142 | # |
143 | # set EPOCROOT=\Symbian\7.0s\Series60_v21_CW\ |
144 | # set EPOCDEVICE=Series60_v21_CW:com.Nokia.series60 |
d0d72822 |
145 | # symbiancommon |
4764e399 |
146 | # set PATH=%EPOC_BIN%;%MWCW%\Bin;%MWCW%\Symbian_Tools\Command_Line_Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32;%PATH% |
c8f896e5 |
147 | # set USERDEFS=%USERDEFS% -D__SERIES60_21__ -D__SERIES60_MAJOR__=2 -D__SERIES60_MINOR__=1 -D__SERIES60_2X__ |
2f2424c0 |
148 | # |
c8f896e5 |
149 | # s60-2.6-cw: |
150 | # |
151 | # set EPOCROOT=\Symbian\8.0a\S60_2nd_FP2_CW\ |
152 | # set EPOCDEVICE=S60_2nd_FP2_CW:com.nokia.series60 |
d0d72822 |
153 | # symbiancommon |
4764e399 |
154 | # set PATH=%EPOC_BIN%;%MWCW%\Bin;%MWCW%\Symbian_Tools\Command_Line_Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32;%PATH% |
c8f896e5 |
155 | # set USERDEFS=%USERDEFS% -D__SERIES60_26__ -D__SERIES60_MAJOR__=2 -D__SERIES60_MINOR__=6 -D__SERIES60_2X__ -D__BLUETOOTH_API_V2__ |
2f2424c0 |
156 | # |
c8f896e5 |
157 | # s60-2.6-vc: |
158 | # |
159 | # set EPOCROOT=\Symbian\8.0a\S60_2nd_FP2\ |
160 | # set EPOCDEVICE=S60_2nd_FP2:com.nokia.Series60 |
d0d72822 |
161 | # symbiancommon |
4764e399 |
162 | # set PATH=%EPOC_BIN%;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32;%PATH% |
c8f896e5 |
163 | # set INCLUDE=%MSVC_INC% |
164 | # set LIB=%MSVC_LIB% |
165 | # set USERDEFS=%USERDEFS% -D__SERIES60_26__ -D__SERIES60_MAJOR__=2 -D__SERIES60_MINOR__=6 -D__SERIES60_2X__ -D__BLUETOOTH_API_V2__ |
2f2424c0 |
166 | # |
c8f896e5 |
167 | # s60-2.8-cw: |
168 | # |
169 | # set EPOCROOT=\Symbian\8.1a\S60_2nd_FP3\ |
170 | # set EPOCDEVICE=S60_2nd_FP3:com.nokia.series60 |
d0d72822 |
171 | # symbiancommon |
4764e399 |
172 | # set PATH=%EPOC_BIN%;%MWCW%\Bin;%MWCW%\Symbian_Tools\Command_Line_Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32;%PATH% |
c8f896e5 |
173 | # set USERDEFS=%USERDEFS% -D__SERIES60_28__ -D__SERIES60_MAJOR__=2 -D__SERIES60_MINOR__=8 -D__SERIES60_2X__ -D__BLUETOOTH_API_V2__ |
2f2424c0 |
174 | # |
4764e399 |
175 | # s60-2.8-vc: |
176 | # |
177 | # set EPOCROOT=\Symbian\8.1a\S60_2nd_FP3\ |
178 | # set EPOCDEVICE=S60_2nd_FP3:com.nokia.series60 |
179 | # symbiancommon |
180 | # set PATH=%EPOC_BIN%;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32;%PATH% |
181 | # set USERDEFS=%USERDEFS% -D__SERIES60_28__ -D__SERIES60_MAJOR__=2 -D__SERIES60_MINOR__=8 -D__SERIES60_2X__ -D__BLUETOOTH_API_V2__ |
182 | # |
2f2424c0 |
183 | # s60-5.0 - S60 5th Edition SDK v1.0: |
184 | # |
185 | # set EPOCROOT=\S60\devices\S60_5th_Edition_SDK_v1.0\ |
186 | # set PATH=%EPOCROOT%Epoc32\gcc\bin;%EPOCROOT%Epoc32\tools;%PATH% |
187 | # |
c8f896e5 |
188 | # s80-2.0-cw: |
189 | # |
190 | # set EPOCROOT=\Symbian\7.0s\S80_DP2_0_SDK_CW\ |
191 | # set EPOCDEVICE=Series80_DP2_0_SDK_CW:com.nokia.Series80 |
d0d72822 |
192 | # symbiancommon |
4764e399 |
193 | # set PATH=%EPOC_BIN%;%MWCW%\Bin;%MWCW%\Symbian_Tools\Command_Line_Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32;%PATH% |
c8f896e5 |
194 | # set USERDEFS=%USERDEFS% -D__SERIES80_20__ -D__SERIES80_MAJOR__=2 -D__SERIES80_MINOR__=0 -D__SERIES80_2X__ |
195 | # |
196 | # s80-2.0-vc: |
197 | # |
198 | # set EPOCROOT=\Symbian\7.0s\S80_DP2_0_SDK\ |
199 | # set EPOCDEVICE=Series80_DP2_0_SDK:com.nokia.Series80 |
d0d72822 |
200 | # symbiancommon |
4764e399 |
201 | # set PATH=%EPOC_BIN%;%MWCW%\Bin;%MWCW%\Symbian_Tools\Command_Line_Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32;%PATH% |
c8f896e5 |
202 | # set USERDEFS=%USERDEFS% -D__SERIES80_20__ -D__SERIES80_MAJOR__=2 -D__SERIES80_MINOR__=0 -D__SERIES80_2X__ |
203 | # |
d0d72822 |
204 | # UIQ-2.1-vc: |
205 | # set EPOCROOT=\Symbian\UIQ_21\ |
206 | # set EPOCDEVICE= |
207 | # set EPOC_BIN=%EPOCROOT%Epoc32\gcc\bin;%EPOCROOT%Epoc32\Tools |
208 | # set MWCW=C:\APPS\codewarrior_3.0 |
209 | # set MSVC=C:\Program Files\Microsoft Visual Studio |
210 | # set MSVC_BIN=%MSVC%;%MSVC%\Common\MSDev98\Bin |
211 | # set MSVC_INC=%MSVC%\VC98\atl\include;%MSVC%\mfc\include;%MSVC%\include |
212 | # set MSVC_LIB=%MSVC%\mfc\lib;%MSVC%\lib |
4764e399 |
213 | # set PATH=%EPOC_BIN%;%MWCW%\Bin;%MWCW%\Symbian_Tools\Command_Line_Tools;%MSVC_BIN%;C:\perl\bin;C:\winnt\system32;%PATH% |
d0d72822 |
214 | # set USERDEFS=%USERDEFS% -D__UIQ_21__ -D__UIQ_MAJOR__=2 -D__UIQ_MINOR__=1 -D__UIQ_2X__ |
215 | # |
c8f896e5 |
216 | # EOF |