configure.pl (789d489d) configure.pl (d063cc0f)
1#**************************************************************
2#
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance

--- 37 unchanged lines hidden (view full) ---

46$main::OO_SDK_HOME_SUGGESTION = $main::sdkpath;
47
48$main::OFFICE_HOME = "";
49
50#$main::OFFICE_BASE_HOME = substr($main::sdkpath, 0, rindex($main::sdkpath, "/sdk"));
51
52$main::OO_SDK_MAKE_HOME = "";
53$main::makeName = "make";
1#**************************************************************
2#
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance

--- 37 unchanged lines hidden (view full) ---

46$main::OO_SDK_HOME_SUGGESTION = $main::sdkpath;
47
48$main::OFFICE_HOME = "";
49
50#$main::OFFICE_BASE_HOME = substr($main::sdkpath, 0, rindex($main::sdkpath, "/sdk"));
51
52$main::OO_SDK_MAKE_HOME = "";
53$main::makeName = "make";
54if ( $main::operatingSystem =~ m/solaris/ ||
54if ( $main::operatingSystem =~ m/solaris/ ||
55 $main::operatingSystem =~ m/freebsd/ )
56{
55 $main::operatingSystem =~ m/freebsd/ )
56{
57 $main::makeName = "gmake";
57 $main::makeName = "gmake";
58}
59$main::OO_SDK_MAKE_HOME_SUGGESTION = searchprog($main::makeName);
60$main::makeVersion = "3.79.1";
61$main::correctVersion = 0;
62
63$main::OO_SDK_ZIP_HOME = "";
64$main::OO_SDK_ZIP_HOME_SUGGESTION = searchprog("zip");
65$main::zipVersion = "2.3";

--- 29 unchanged lines hidden (view full) ---

95} else {
96 $main::OO_SDK_CPP_HOME_SUGGESTION = searchprog($main::cppName);
97}
98
99$main::OO_SDK_JAVA_HOME = "";
100$main::OO_SDK_JAVA_BIN_DIR = "bin";
101if ( $main::operatingSystem =~ m/darwin/ )
102{
58}
59$main::OO_SDK_MAKE_HOME_SUGGESTION = searchprog($main::makeName);
60$main::makeVersion = "3.79.1";
61$main::correctVersion = 0;
62
63$main::OO_SDK_ZIP_HOME = "";
64$main::OO_SDK_ZIP_HOME_SUGGESTION = searchprog("zip");
65$main::zipVersion = "2.3";

--- 29 unchanged lines hidden (view full) ---

95} else {
96 $main::OO_SDK_CPP_HOME_SUGGESTION = searchprog($main::cppName);
97}
98
99$main::OO_SDK_JAVA_HOME = "";
100$main::OO_SDK_JAVA_BIN_DIR = "bin";
101if ( $main::operatingSystem =~ m/darwin/ )
102{
103 $main::OO_SDK_JAVA_BIN_DIR="Commands";
103 $main::OO_SDK_JAVA_BIN_DIR="Commands";
104}
105$main::OO_SDK_JAVA_HOME_SUGGESTION = searchprog("javac");
106$main::javaVersion = "1.5.0_01";
107
108$main::OO_SDK_BOOST_HOME_SUGGESTION = "";
109$main::boostVersion = "1.48.0";
110$main::skipBoostDir = 0;
111

--- 7 unchanged lines hidden (view full) ---

119$main::return = 0;
120
121if ( $main::operatingSystem =~ m/darwin/ )
122{
123# used for a SDK as part of the office installation
124# $main::OFFICE_HOME = `cd $main::sdkpath/../../.. && pwd`;
125# chomp($main::OFFICE_HOME);
126# print " Used Office = $main::OFFICE_HOME\n";
104}
105$main::OO_SDK_JAVA_HOME_SUGGESTION = searchprog("javac");
106$main::javaVersion = "1.5.0_01";
107
108$main::OO_SDK_BOOST_HOME_SUGGESTION = "";
109$main::boostVersion = "1.48.0";
110$main::skipBoostDir = 0;
111

--- 7 unchanged lines hidden (view full) ---

119$main::return = 0;
120
121if ( $main::operatingSystem =~ m/darwin/ )
122{
123# used for a SDK as part of the office installation
124# $main::OFFICE_HOME = `cd $main::sdkpath/../../.. && pwd`;
125# chomp($main::OFFICE_HOME);
126# print " Used Office = $main::OFFICE_HOME\n";
127 print " Used SDK = $main::OO_SDK_HOME\n\n";
127 print " Used SDK = $main::OO_SDK_HOME\n\n";
128
128
129 $main::OFFICE_HOME_SUGGESTION = searchMacOffice();
130 while ( (! -d "$main::OFFICE_HOME" ) ||
131 ((-d "$main::OFFICE_HOME") && (! -d "$main::OFFICE_HOME/Contents/MacOS")) )
132 {
129 $main::OFFICE_HOME_SUGGESTION = searchMacOffice();
130 while ( (! -d "$main::OFFICE_HOME" ) ||
131 ((-d "$main::OFFICE_HOME") && (! -d "$main::OFFICE_HOME/Contents/MacOS")) )
132 {
133 print " Enter the Office installation directory [$main::OFFICE_HOME_SUGGESTION]: ";
134 $main::OFFICE_HOME = readStdIn();
135 chop($main::OFFICE_HOME);
133 print " Enter the Office installation directory [$main::OFFICE_HOME_SUGGESTION]: ";
134 $main::OFFICE_HOME = readStdIn();
135 chop($main::OFFICE_HOME);
136 if ( $main::OFFICE_HOME eq "" )
136 if ( $main::OFFICE_HOME eq "" )
137 {
137 {
138 $main::OFFICE_HOME = $main::OFFICE_HOME_SUGGESTION;
138 $main::OFFICE_HOME = $main::OFFICE_HOME_SUGGESTION;
139 }
139 }
140
140
141 if ( ! -d "$main::OFFICE_HOME" )
141 if ( ! -d "$main::OFFICE_HOME" )
142 {
143 $main::OFFICE_HOME = "";
144 print " Error: An office installation is required, please specify the path to a valid installation.\n";
145 }
146
142 {
143 $main::OFFICE_HOME = "";
144 print " Error: An office installation is required, please specify the path to a valid installation.\n";
145 }
146
147# $main::OFFICE_BASE_HOME = "$main::OFFICE_HOME/Contents";
147# $main::OFFICE_BASE_HOME = "$main::OFFICE_HOME/Contents";
148 }
149} else
148 }
149} else
150{
150{
151 $main::OFFICE_HOME_SUGGESTION = searchoffice();
152
153 if ( $main::OFFICE_HOME_SUGGESTION eq "" ) {
151 $main::OFFICE_HOME_SUGGESTION = searchoffice();
152
153 if ( $main::OFFICE_HOME_SUGGESTION eq "" ) {
154 # prepare Office path
155 $main::OFFICE_HOME_SUGGESTION = searchprog("soffice");
154 # prepare Office path
155 $main::OFFICE_HOME_SUGGESTION = searchprog("soffice");
156 }
157
158 if ( ! $main::OFFICE_HOME_SUGGESTION eq "" )
159 {
156 }
157
158 if ( ! $main::OFFICE_HOME_SUGGESTION eq "" )
159 {
160 my $tmpOffice = readlink "$main::OFFICE_HOME_SUGGESTION/soffice";
160 my $tmpOffice = readlink "$main::OFFICE_HOME_SUGGESTION/soffice";
161
161
162 if ( $tmpOffice eq "" )
163 {
162 if ( $tmpOffice eq "" )
163 {
164 $tmpOffice = "$main::OFFICE_HOME_SUGGESTION/soffice";
164 $tmpOffice = "$main::OFFICE_HOME_SUGGESTION/soffice";
165 }
165 }
166
166
167 my $offset = rindex($tmpOffice, "/program/soffice");
168 if ( $offset != -1 )
169 {
167 my $offset = rindex($tmpOffice, "/program/soffice");
168 if ( $offset != -1 )
169 {
170 $main::OFFICE_HOME_SUGGESTION = substr($tmpOffice, 0, $offset);
171 } else
170 $main::OFFICE_HOME_SUGGESTION = substr($tmpOffice, 0, $offset);
171 } else
172 {
172 {
173 $offset = rindex($tmpOffice, "/soffice");
174 if ( $offset != -1 )
175 {
173 $offset = rindex($tmpOffice, "/soffice");
174 if ( $offset != -1 )
175 {
176 $main::OFFICE_HOME_SUGGESTION = substr($tmpOffice, 0, $offset);
176 $main::OFFICE_HOME_SUGGESTION = substr($tmpOffice, 0, $offset);
177 } else
178 {
177 } else
178 {
179 $main::OFFICE_HOME_SUGGESTION = "";
179 $main::OFFICE_HOME_SUGGESTION = "";
180 }
180 }
181 }
181 }
182 }
183
184 while ( (! -d "$main::OFFICE_HOME" ) ||
185 ((-d "$main::OFFICE_HOME") && (! -d "$main::OFFICE_HOME/program")) )
186 {
182 }
183
184 while ( (! -d "$main::OFFICE_HOME" ) ||
185 ((-d "$main::OFFICE_HOME") && (! -d "$main::OFFICE_HOME/program")) )
186 {
187 print " Enter the Office installation directory [$main::OFFICE_HOME_SUGGESTION]: ";
188 $main::OFFICE_HOME = readStdIn();
189 chop($main::OFFICE_HOME);
187 print " Enter the Office installation directory [$main::OFFICE_HOME_SUGGESTION]: ";
188 $main::OFFICE_HOME = readStdIn();
189 chop($main::OFFICE_HOME);
190 if ( $main::OFFICE_HOME eq "" )
190 if ( $main::OFFICE_HOME eq "" )
191 {
191 {
192 $main::OFFICE_HOME = $main::OFFICE_HOME_SUGGESTION;
192 $main::OFFICE_HOME = $main::OFFICE_HOME_SUGGESTION;
193 }
193 }
194
194
195 if ( ! -d "$main::OFFICE_HOME" )
195 if ( ! -d "$main::OFFICE_HOME" )
196 {
197 $main::OFFICE_HOME = "";
198 print " Error: An office installation is required, please specify the path to a valid installation.\n";
196 {
197 $main::OFFICE_HOME = "";
198 print " Error: An office installation is required, please specify the path to a valid installation.\n";
199 } else
200 {
199 } else
200 {
201 # special work for a network installation, no prgram directory but a link to the soffice binary
202 if ( (! -d "$main::OFFICE_HOME/program") && (-e "$main::OFFICE_HOME/soffice") )
203 {
201 # special work for a network installation, no program directory but a link to the soffice binary
202 if ( (! -d "$main::OFFICE_HOME/program") && (-e "$main::OFFICE_HOME/soffice") )
203 {
204 my $soserver = `ls -l $OFFICE_HOME_SUGGESTION/soffice | sed -n 's/.* -> //p'`;
205 $soserver= substr($soserver, 0, rindex($soserver, "program") - 1);
204 my $soserver = `ls -l $OFFICE_HOME_SUGGESTION/soffice | sed -n 's/.* -> //p'`;
205 $soserver= substr($soserver, 0, rindex($soserver, "program") - 1);
206
206
207 if ( ! -d $soserver )
208 {
207 if ( ! -d $soserver )
208 {
209 $main::OFFICE_HOME = "";
210 print " Error: An office installation is required, please specify the path to a valid installation.\n";
211 } else
209 $main::OFFICE_HOME = "";
210 print " Error: An office installation is required, please specify the path to a valid installation.\n";
211 } else
212 {
212 {
213 $main::OFFICE_HOME = $soserver;
213 $main::OFFICE_HOME = $soserver;
214 }
214 }
215 }
215 }
216 }
216 }
217 }
217 }
218}
219
220
221# prepare GNU make path
222while ( (!$main::correctVersion) &&
223 ((! -d "$main::OO_SDK_MAKE_HOME" ) ||
224 ((-d "$main::OO_SDK_MAKE_HOME") && (! -e "$main::OO_SDK_MAKE_HOME/$main::makeName"))) )
225{
218}
219
220
221# prepare GNU make path
222while ( (!$main::correctVersion) &&
223 ((! -d "$main::OO_SDK_MAKE_HOME" ) ||
224 ((-d "$main::OO_SDK_MAKE_HOME") && (! -e "$main::OO_SDK_MAKE_HOME/$main::makeName"))) )
225{
226 print " Enter GNU make ($main::makeVersion or higher) tools directory [$main::OO_SDK_MAKE_HOME_SUGGESTION]: ";
227 $main::OO_SDK_MAKE_HOME = readStdIn();
228 chop($main::OO_SDK_MAKE_HOME);
229 if ( $main::OO_SDK_MAKE_HOME eq "" )
230 {
226 print " Enter GNU make ($main::makeVersion or higher) tools directory [$main::OO_SDK_MAKE_HOME_SUGGESTION]: ";
227 $main::OO_SDK_MAKE_HOME = readStdIn();
228 chop($main::OO_SDK_MAKE_HOME);
229 if ( $main::OO_SDK_MAKE_HOME eq "" )
230 {
231 $main::OO_SDK_MAKE_HOME = $main::OO_SDK_MAKE_HOME_SUGGESTION;
231 $main::OO_SDK_MAKE_HOME = $main::OO_SDK_MAKE_HOME_SUGGESTION;
232 }
233 if ( (! -d "$main::OO_SDK_MAKE_HOME") ||
232 }
233 if ( (! -d "$main::OO_SDK_MAKE_HOME") ||
234 ((-d "$main::OO_SDK_MAKE_HOME") && (! -e "$main::OO_SDK_MAKE_HOME/$main::makeName")) )
234 ((-d "$main::OO_SDK_MAKE_HOME") && (! -e "$main::OO_SDK_MAKE_HOME/$main::makeName")) )
235 {
235 {
236 $main::OO_SDK_MAKE_HOME = "";
237 print " Error: GNU make is required, please specify a GNU make tools directory.\n";
236 $main::OO_SDK_MAKE_HOME = "";
237 print " Error: GNU make is required, please specify a GNU make tools directory.\n";
238 } else
239 {
238 } else
239 {
240 #check version
241 my $testVersion = `$OO_SDK_MAKE_HOME/$main::makeName --version`;
242 if ( $testVersion eq "")
243 {
244 print " Set the environment variable OO_SDK_MAKE_HOME to your GNU build tools directory.\n";
245 print " GNU make version $main::makeVersion can be obtained at ftp://ftp.gnu.org/gnu/make/\n";
240 #check version
241 my $testVersion = `$OO_SDK_MAKE_HOME/$main::makeName --version`;
242 if ( $testVersion eq "")
243 {
244 print " Set the environment variable OO_SDK_MAKE_HOME to your GNU build tools directory.\n";
245 print " GNU make version $main::makeVersion can be obtained at ftp://ftp.gnu.org/gnu/make/\n";
246 } else
246 } else
247 {
247 {
248 if ($testVersion =~ m#((\d+\.)+\d+)# )
248 if ($testVersion =~ m#((\d+\.)+\d+)# )
249 {
250 $testVersion = $1;
251 }
252 $main::correctVersion = testVersion($main::makeVersion, $testVersion, "$main::OO_SDK_MAKE_HOME/$main::makeName", 1);
253 if ( !$main::correctVersion )
254 {
255 print " The '$main::makeName' command found at '$main::OO_SDK_MAKE_HOME' has a wrong version\n";
256 $main::OO_SDK_MAKE_HOME = "";
257 }
258 }
259 }
260}
261
262# prepare zip path
263$main::correctVersion = 0;
264while ( (!$main::correctVersion) &&
265 ((! -d "$main::OO_SDK_ZIP_HOME" ) ||
266 ((-d "$main::OO_SDK_ZIP_HOME") && (! -e "$main::OO_SDK_ZIP_HOME/zip"))) )
267{
249 {
250 $testVersion = $1;
251 }
252 $main::correctVersion = testVersion($main::makeVersion, $testVersion, "$main::OO_SDK_MAKE_HOME/$main::makeName", 1);
253 if ( !$main::correctVersion )
254 {
255 print " The '$main::makeName' command found at '$main::OO_SDK_MAKE_HOME' has a wrong version\n";
256 $main::OO_SDK_MAKE_HOME = "";
257 }
258 }
259 }
260}
261
262# prepare zip path
263$main::correctVersion = 0;
264while ( (!$main::correctVersion) &&
265 ((! -d "$main::OO_SDK_ZIP_HOME" ) ||
266 ((-d "$main::OO_SDK_ZIP_HOME") && (! -e "$main::OO_SDK_ZIP_HOME/zip"))) )
267{
268 print " Enter zip ($main::zipVersion or higher) tool directory [$main::OO_SDK_ZIP_HOME_SUGGESTION]: ";
269 $main::OO_SDK_ZIP_HOME = readStdIn();
270 chop($main::OO_SDK_ZIP_HOME);
271 if ( $main::OO_SDK_ZIP_HOME eq "" )
272 {
268 print " Enter zip ($main::zipVersion or higher) tool directory [$main::OO_SDK_ZIP_HOME_SUGGESTION]: ";
269 $main::OO_SDK_ZIP_HOME = readStdIn();
270 chop($main::OO_SDK_ZIP_HOME);
271 if ( $main::OO_SDK_ZIP_HOME eq "" )
272 {
273 $main::OO_SDK_ZIP_HOME = $main::OO_SDK_ZIP_HOME_SUGGESTION;
273 $main::OO_SDK_ZIP_HOME = $main::OO_SDK_ZIP_HOME_SUGGESTION;
274 }
275 if ( (! -d "$main::OO_SDK_ZIP_HOME") ||
274 }
275 if ( (! -d "$main::OO_SDK_ZIP_HOME") ||
276 ((-d "$main::OO_SDK_ZIP_HOME") && (! -e "$main::OO_SDK_ZIP_HOME/zip")) )
276 ((-d "$main::OO_SDK_ZIP_HOME") && (! -e "$main::OO_SDK_ZIP_HOME/zip")) )
277 {
277 {
278 $main::OO_SDK_ZIP_HOME = "";
279 print " Error: zip tool is required, please specify a zip tool directory.\n";
278 $main::OO_SDK_ZIP_HOME = "";
279 print " Error: zip tool is required, please specify a zip tool directory.\n";
280 } else
281 {
280 } else
281 {
282 #check version
282 #check version
283 my $testVersion = `$OO_SDK_ZIP_HOME/zip -h 2>&1 | egrep Zip | head -n 1`;
283 my $testVersion = `$OO_SDK_ZIP_HOME/zip -h 2>&1 | grep -E Zip | head -n 1`;
284 $testVersion =~ s#Zip ([\d.]+) .*#$1#go;
285 if ( $testVersion eq "")
286 {
287 print " Set the environment variable OO_SDK_ZIP_HOME to your zip tool directory.\n";
288 print " zip version $main::zipVersion can be obtained at ftp://www.info-zip.org/\n";
284 $testVersion =~ s#Zip ([\d.]+) .*#$1#go;
285 if ( $testVersion eq "")
286 {
287 print " Set the environment variable OO_SDK_ZIP_HOME to your zip tool directory.\n";
288 print " zip version $main::zipVersion can be obtained at ftp://www.info-zip.org/\n";
289 } else
289 } else
290 {
290 {
291 if ($testVersion =~ m#((\d+\.)+\d+)# )
291 if ($testVersion =~ m#((\d+\.)+\d+)# )
292 {
293 $testVersion = $1;
294 }
295 $main::correctVersion = testVersion($main::zipVersion, $testVersion, "$main::OO_SDK_MAKE_HOME/zip", 1);
296 if ( !$main::correctVersion )
297 {
298 print " The 'zip' command found at '$main::OO_SDK_ZIP_HOME' has a wrong version\n";
299 $main::OO_SDK_ZIP_HOME = "";
300 }
301 }
302 }
303}
304
305# prepare cat path
306$main::correctVersion = 0;
307while ( (!$main::correctVersion) &&
292 {
293 $testVersion = $1;
294 }
295 $main::correctVersion = testVersion($main::zipVersion, $testVersion, "$main::OO_SDK_MAKE_HOME/zip", 1);
296 if ( !$main::correctVersion )
297 {
298 print " The 'zip' command found at '$main::OO_SDK_ZIP_HOME' has a wrong version\n";
299 $main::OO_SDK_ZIP_HOME = "";
300 }
301 }
302 }
303}
304
305# prepare cat path
306$main::correctVersion = 0;
307while ( (!$main::correctVersion) &&
308 ((! -d "$main::OO_SDK_CAT_HOME" ) ||
309 ((-d "$main::OO_SDK_CAT_HOME") && (! -e "$main::OO_SDK_CAT_HOME/cat"))) )
308 ((! -d "$main::OO_SDK_CAT_HOME" ) ||
309 ((-d "$main::OO_SDK_CAT_HOME") && (! -e "$main::OO_SDK_CAT_HOME/cat"))) )
310{
310{
311 print " Enter cat tool directory [$main::OO_SDK_CAT_HOME_SUGGESTION]: ";
312 $main::OO_SDK_CAT_HOME = readStdIn();
313 chop($main::OO_SDK_CAT_HOME);
314 if ( $main::OO_SDK_CAT_HOME eq "" )
315 {
316 $main::OO_SDK_CAT_HOME = $main::OO_SDK_CAT_HOME_SUGGESTION;
317 }
318 if ( (! -d "$main::OO_SDK_CAT_HOME") ||
319 ((-d "$main::OO_SDK_CAT_HOME") && (! -e "$main::OO_SDK_CAT_HOME/cat")) )
320 {
321 $main::OO_SDK_CAT_HOME = "";
322 print " Error: cat tool is required, please specify a cat tool directory.\n";
323 }
324 # else ...
325 # TODO check version
326 # NOTE: only Linux cat understands --version
311 print " Enter cat tool directory [$main::OO_SDK_CAT_HOME_SUGGESTION]: ";
312 $main::OO_SDK_CAT_HOME = readStdIn();
313 chop($main::OO_SDK_CAT_HOME);
314 if ( $main::OO_SDK_CAT_HOME eq "" )
315 {
316 $main::OO_SDK_CAT_HOME = $main::OO_SDK_CAT_HOME_SUGGESTION;
317 }
318 if ( (! -d "$main::OO_SDK_CAT_HOME") ||
319 ((-d "$main::OO_SDK_CAT_HOME") && (! -e "$main::OO_SDK_CAT_HOME/cat")) )
320 {
321 $main::OO_SDK_CAT_HOME = "";
322 print " Error: cat tool is required, please specify a cat tool directory.\n";
323 }
324 # else ...
325 # TODO check version
326 # NOTE: only Linux cat understands --version
327}
328
329# prepare sed path
330$main::correctVersion = 0;
331while ( (!$main::correctVersion) &&
327}
328
329# prepare sed path
330$main::correctVersion = 0;
331while ( (!$main::correctVersion) &&
332 ((! -d "$main::OO_SDK_SED_HOME" ) ||
333 ((-d "$main::OO_SDK_SED_HOME") && (! -e "$main::OO_SDK_SED_HOME/sed"))) )
332 ((! -d "$main::OO_SDK_SED_HOME" ) ||
333 ((-d "$main::OO_SDK_SED_HOME") && (! -e "$main::OO_SDK_SED_HOME/sed"))) )
334{
334{
335 print " Enter sed tool directory [$main::OO_SDK_SED_HOME_SUGGESTION]: ";
336 $main::OO_SDK_SED_HOME = readStdIn();
337 chop($main::OO_SDK_SED_HOME);
338 if ( $main::OO_SDK_SED_HOME eq "" )
339 {
340 $main::OO_SDK_SED_HOME = $main::OO_SDK_SED_HOME_SUGGESTION;
341 }
342 if ( (! -d "$main::OO_SDK_SED_HOME") ||
343 ((-d "$main::OO_SDK_SED_HOME") && (! -e "$main::OO_SDK_SED_HOME/sed")) )
344 {
345 $main::OO_SDK_SED_HOME = "";
346 print " Error: sed tool is required, please specify a sed tool directory.\n";
347 }
348 # else ...
349 # TODO check version
350 # NOTE: only Linux sed understands --version
335 print " Enter sed tool directory [$main::OO_SDK_SED_HOME_SUGGESTION]: ";
336 $main::OO_SDK_SED_HOME = readStdIn();
337 chop($main::OO_SDK_SED_HOME);
338 if ( $main::OO_SDK_SED_HOME eq "" )
339 {
340 $main::OO_SDK_SED_HOME = $main::OO_SDK_SED_HOME_SUGGESTION;
341 }
342 if ( (! -d "$main::OO_SDK_SED_HOME") ||
343 ((-d "$main::OO_SDK_SED_HOME") && (! -e "$main::OO_SDK_SED_HOME/sed")) )
344 {
345 $main::OO_SDK_SED_HOME = "";
346 print " Error: sed tool is required, please specify a sed tool directory.\n";
347 }
348 # else ...
349 # TODO check version
350 # NOTE: only Linux sed understands --version
351}
352
353# prepare C++ compiler path
354$main::correctVersion = 0;
355while ( (!$main::correctVersion) &&
356 ((! -d "$main::OO_SDK_CPP_HOME" ) ||
357 ((-d "$main::OO_SDK_CPP_HOME") && (! -e "$main::OO_SDK_CPP_HOME/$main::cpp"))) )
358{
359 print " C++ compilers where for example a language binding exist:\n";
360 print " - Solaris, Sun WorkShop 6 update 1 C++ 5.2 2000/09/11 or higher\n";
361 print " - Linux, GNU C++ compiler, gcc version 4.0.1 or higher\n";
362 print " - MacOS 64bit, Apple LLVM version 4.2 (clang-425.0.28) or higher\n";
363 print " on MacOS auto detected using xcrun -f clang'\n";
364
365 if ( $main::operatingSystem =~ m/darwin/ )
366 {
367 # xcrun is used to find the correct clang compiler, just print the result as information
368 $main::OO_SDK_CPP_HOME = $main::OO_SDK_CPP_HOME_SUGGESTION;
369 print " Used clang compiler: $main::OO_SDK_CPP_HOME\n";
351}
352
353# prepare C++ compiler path
354$main::correctVersion = 0;
355while ( (!$main::correctVersion) &&
356 ((! -d "$main::OO_SDK_CPP_HOME" ) ||
357 ((-d "$main::OO_SDK_CPP_HOME") && (! -e "$main::OO_SDK_CPP_HOME/$main::cpp"))) )
358{
359 print " C++ compilers where for example a language binding exist:\n";
360 print " - Solaris, Sun WorkShop 6 update 1 C++ 5.2 2000/09/11 or higher\n";
361 print " - Linux, GNU C++ compiler, gcc version 4.0.1 or higher\n";
362 print " - MacOS 64bit, Apple LLVM version 4.2 (clang-425.0.28) or higher\n";
363 print " on MacOS auto detected using xcrun -f clang'\n";
364
365 if ( $main::operatingSystem =~ m/darwin/ )
366 {
367 # xcrun is used to find the correct clang compiler, just print the result as information
368 $main::OO_SDK_CPP_HOME = $main::OO_SDK_CPP_HOME_SUGGESTION;
369 print " Used clang compiler: $main::OO_SDK_CPP_HOME\n";
370 } else
370 } else
371 {
372 print " Enter the directory of the C++ compiler, the directory\n";
373 print " where the compiler is located (optional) [$main::OO_SDK_CPP_HOME_SUGGESTION]: ";
371 {
372 print " Enter the directory of the C++ compiler, the directory\n";
373 print " where the compiler is located (optional) [$main::OO_SDK_CPP_HOME_SUGGESTION]: ";
374
374
375 $main::OO_SDK_CPP_HOME = readStdIn();
376 chop($main::OO_SDK_CPP_HOME);
375 $main::OO_SDK_CPP_HOME = readStdIn();
376 chop($main::OO_SDK_CPP_HOME);
377 if ( $main::OO_SDK_CPP_HOME eq "" )
377 if ( $main::OO_SDK_CPP_HOME eq "" )
378 {
379 $main::OO_SDK_CPP_HOME = $main::OO_SDK_CPP_HOME_SUGGESTION;
380 }
381 }
382
378 {
379 $main::OO_SDK_CPP_HOME = $main::OO_SDK_CPP_HOME_SUGGESTION;
380 }
381 }
382
383 if ( (!$main::operatingSystem =~ m/darwin/) && (! $main::OO_SDK_CPP_HOME eq "") )
383 if ( (!$main::operatingSystem =~ m/darwin/) && (! $main::OO_SDK_CPP_HOME eq "") )
384 {
384 {
385 if ( (! -d "$main::OO_SDK_CPP_HOME") ||
385 if ( (! -d "$main::OO_SDK_CPP_HOME") ||
386 ((-d "$main::OO_SDK_CPP_HOME") && (! -e "$main::OO_SDK_CPP_HOME/$main::cppName")) )
386 ((-d "$main::OO_SDK_CPP_HOME") && (! -e "$main::OO_SDK_CPP_HOME/$main::cppName")) )
387 {
387 {
388 print " Error: Could not find directory '$main::OO_SDK_CPP_HOME'.\n";
389 if ( skipChoice("C++ compiler") == 1 )
390 {
391 $main::correctVersion = 1;
392 }
393 $main::OO_SDK_CPP_HOME = "";
388 print " Error: Could not find directory '$main::OO_SDK_CPP_HOME'.\n";
389 if ( skipChoice("C++ compiler") == 1 )
390 {
391 $main::correctVersion = 1;
392 }
393 $main::OO_SDK_CPP_HOME = "";
394 } else
394 } else
395 {
396 #check version
397 if ( $main::cppName eq "gcc" )
398 {
399 my $testVersion = `$OO_SDK_CPP_HOME/$main::cppName -dumpversion`;
400 if ( $testVersion eq "")
401 {
402 print " The '$main::cppName' command found at $main::OO_SDK_CPP_HOME/$main::cppName is not a ";
403 print " GNU compiler.\nSet the environment variable OO_SDK_CPP_HOME to your GNU build tools ";
404 print " directory.\nA GNU compiler version $main::cppVersion can be obtained at ";
405 print " ftp://ftp.gnu.org/gnu/gcc/\n";
395 {
396 #check version
397 if ( $main::cppName eq "gcc" )
398 {
399 my $testVersion = `$OO_SDK_CPP_HOME/$main::cppName -dumpversion`;
400 if ( $testVersion eq "")
401 {
402 print " The '$main::cppName' command found at $main::OO_SDK_CPP_HOME/$main::cppName is not a ";
403 print " GNU compiler.\nSet the environment variable OO_SDK_CPP_HOME to your GNU build tools ";
404 print " directory.\nA GNU compiler version $main::cppVersion can be obtained at ";
405 print " ftp://ftp.gnu.org/gnu/gcc/\n";
406 } else
406 } else
407 {
408 $main::correctVersion = testVersion($main::cppVersion, $testVersion, "$main::OO_SDK_CPP_HOME/$main::cppName", 1);
409 if ( !$main::correctVersion )
410 {
411 print " The '$main::cppName' command found at '$main::OO_SDK_CPP_HOME' has a wrong version\n";
412 if ( skipChoice("C++ compiler") == 1 )
413 {
414 $main::correctVersion = 1;

--- 7 unchanged lines hidden (view full) ---

422 # for Solaris we have to check the version too
423 open(FILE, "$OO_SDK_CPP_HOME/$main::cppName -V 2>&1 |");
424 my @lines = <FILE>;
425 my $testVersion = $lines[0];
426 if ( $testVersion eq "")
427 {
428 print " The '$main::cppName' command found at $main::OO_SDK_CPP_HOME/$main::cppName is not a ";
429 print " Solaris C++ compiler.\nSet the environment variable OO_SDK_CPP_HOME to your Solaris C++ compiler directory.\n";
407 {
408 $main::correctVersion = testVersion($main::cppVersion, $testVersion, "$main::OO_SDK_CPP_HOME/$main::cppName", 1);
409 if ( !$main::correctVersion )
410 {
411 print " The '$main::cppName' command found at '$main::OO_SDK_CPP_HOME' has a wrong version\n";
412 if ( skipChoice("C++ compiler") == 1 )
413 {
414 $main::correctVersion = 1;

--- 7 unchanged lines hidden (view full) ---

422 # for Solaris we have to check the version too
423 open(FILE, "$OO_SDK_CPP_HOME/$main::cppName -V 2>&1 |");
424 my @lines = <FILE>;
425 my $testVersion = $lines[0];
426 if ( $testVersion eq "")
427 {
428 print " The '$main::cppName' command found at $main::OO_SDK_CPP_HOME/$main::cppName is not a ";
429 print " Solaris C++ compiler.\nSet the environment variable OO_SDK_CPP_HOME to your Solaris C++ compiler directory.\n";
430 } else
430 } else
431 {
431 {
432 if ($testVersion =~ m#((\d+\.)+\d+)# )
432 if ($testVersion =~ m#((\d+\.)+\d+)# )
433 {
434 $testVersion = $1;
435 }
436 $main::correctVersion = testVersion($main::cppVersion, $testVersion, "$main::OO_SDK_CPP_HOME/$main::cppName", 1);
437 if ( !$main::correctVersion )
438 {
439 print " The '$main::cppName' command found at '$main::OO_SDK_CPP_HOME' has a wrong version\n";
440 if ( skipChoice("C++ compiler") == 1 )
441 {
442 $main::correctVersion = 1;
443 }
444
445 $main::OO_SDK_CPP_HOME = "";
446 } else {
447 $main::correctVersion = testVersion("5.5", $testVersion, "$main::OO_SDK_CPP_HOME/$main::cppName", 2);
448 if ( $main::correctVersion ) {
449 $main::OO_SDK_CC_55_OR_HIGHER = $testVersion;
433 {
434 $testVersion = $1;
435 }
436 $main::correctVersion = testVersion($main::cppVersion, $testVersion, "$main::OO_SDK_CPP_HOME/$main::cppName", 1);
437 if ( !$main::correctVersion )
438 {
439 print " The '$main::cppName' command found at '$main::OO_SDK_CPP_HOME' has a wrong version\n";
440 if ( skipChoice("C++ compiler") == 1 )
441 {
442 $main::correctVersion = 1;
443 }
444
445 $main::OO_SDK_CPP_HOME = "";
446 } else {
447 $main::correctVersion = testVersion("5.5", $testVersion, "$main::OO_SDK_CPP_HOME/$main::cppName", 2);
448 if ( $main::correctVersion ) {
449 $main::OO_SDK_CC_55_OR_HIGHER = $testVersion;
450 }
450 }
451 }
452 }
453 }
454 }
455 } else
456 {
457 # the C++ compiler is optional
458 $main::correctVersion = 1;

--- 10 unchanged lines hidden (view full) ---

469{
470 $main::OO_SDK_JAVA_HOME_SUGGESTION = substr($main::OO_SDK_JAVA_HOME_SUGGESTION, 0, $main::offset);
471}
472
473while ( (!$main::correctVersion) &&
474 ((! -d "$main::OO_SDK_JAVA_HOME" ) ||
475 ((-d "$main::OO_SDK_JAVA_HOME") && (! -e "$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/javac"))) )
476{
451 }
452 }
453 }
454 }
455 } else
456 {
457 # the C++ compiler is optional
458 $main::correctVersion = 1;

--- 10 unchanged lines hidden (view full) ---

469{
470 $main::OO_SDK_JAVA_HOME_SUGGESTION = substr($main::OO_SDK_JAVA_HOME_SUGGESTION, 0, $main::offset);
471}
472
473while ( (!$main::correctVersion) &&
474 ((! -d "$main::OO_SDK_JAVA_HOME" ) ||
475 ((-d "$main::OO_SDK_JAVA_HOME") && (! -e "$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/javac"))) )
476{
477 print " Enter Java SDK (1.5, recommendation is 1.6 or higher) installation directory (optional) [$main::OO_SDK_JAVA_HOME_SUGGESTION]: ";
477 print " Enter Java SDK (1.5, recommendation is 1.6 or higher) installation directory (optional) [$main::OO_SDK_JAVA_HOME_SUGGESTION]: ";
478 $main::OO_SDK_JAVA_HOME = readStdIn();
479 chop($main::OO_SDK_JAVA_HOME);
478 $main::OO_SDK_JAVA_HOME = readStdIn();
479 chop($main::OO_SDK_JAVA_HOME);
480 if ( $main::OO_SDK_JAVA_HOME eq "" )
480 if ( $main::OO_SDK_JAVA_HOME eq "" )
481 {
482 $main::OO_SDK_JAVA_HOME = $main::OO_SDK_JAVA_HOME_SUGGESTION;
483 }
481 {
482 $main::OO_SDK_JAVA_HOME = $main::OO_SDK_JAVA_HOME_SUGGESTION;
483 }
484 if ( ! $main::OO_SDK_JAVA_HOME eq "" )
484 if ( ! $main::OO_SDK_JAVA_HOME eq "" )
485 {
485 {
486 if ( (! -d "$main::OO_SDK_JAVA_HOME") ||
486 if ( (! -d "$main::OO_SDK_JAVA_HOME") ||
487 ((-d "$main::OO_SDK_JAVA_HOME") && (! -e "$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/javac")) )
487 ((-d "$main::OO_SDK_JAVA_HOME") && (! -e "$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/javac")) )
488 {
488 {
489 print " Error: Could not find directory '$main::OO_SDK_JAVA_HOME' or '$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/javac'.\n";
490 if ( skipChoice("JAVA SDK") == 1 )
491 {
492 $main::correctVersion = 1;
493 }
494 $main::OO_SDK_JAVA_HOME = "";
489 print " Error: Could not find directory '$main::OO_SDK_JAVA_HOME' or '$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/javac'.\n";
490 if ( skipChoice("JAVA SDK") == 1 )
491 {
492 $main::correctVersion = 1;
493 }
494 $main::OO_SDK_JAVA_HOME = "";
495 } else
495 } else
496 {
497 #check version
496 {
497 #check version
498 my $testVersion = `$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/java -version 2>&1 | egrep "java version" | head -n 1 | sed -e 's#.*version "##' | sed -e 's#".*##'`;
498 my $testVersion = `$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/java -version 2>&1 | grep -E "java version" | head -n 1 | sed -e 's#.*version "##' | sed -e 's#".*##'`;
499 $testVersion =~ s#([^\n]+)\n#$1#go;
499 $testVersion =~ s#([^\n]+)\n#$1#go;
500
500
501 $main::correctVersion = testVersion($main::javaVersion, $testVersion, "$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/java", 1);
502 if ( !$main::correctVersion )
503 {
504 if ( skipChoice("JAVA SDK") == 1 )
505 {
506 $main::correctVersion = 1;
507 }
508 $main::OO_SDK_JAVA_HOME = "";

--- 4 unchanged lines hidden (view full) ---

513 # the Java SDK is optional
514 $main::correctVersion = 1;
515 }
516}
517
518# prepare boost directory (optional)
519while ( (!$main::skipBoostDir) &&
520 ((! -d "$main::OO_SDK_BOOST_HOME" ) ||
501 $main::correctVersion = testVersion($main::javaVersion, $testVersion, "$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/java", 1);
502 if ( !$main::correctVersion )
503 {
504 if ( skipChoice("JAVA SDK") == 1 )
505 {
506 $main::correctVersion = 1;
507 }
508 $main::OO_SDK_JAVA_HOME = "";

--- 4 unchanged lines hidden (view full) ---

513 # the Java SDK is optional
514 $main::correctVersion = 1;
515 }
516}
517
518# prepare boost directory (optional)
519while ( (!$main::skipBoostDir) &&
520 ((! -d "$main::OO_SDK_BOOST_HOME" ) ||
521 ((-d "$main::OO_SDK_BOOST_HOME") && (! -e "$main::OO_SDK_BOOST_HOME/boost/tr1/unordered_map.hpp"))) )
521 ((-d "$main::OO_SDK_BOOST_HOME") && (! -e "$main::OO_SDK_BOOST_HOME/boost/tr1/unordered_map.hpp"))) )
522{
523
522{
523
524 print " Enter boost directory [$main::OO_SDK_BOOST_HOME_SUGGESTION]: ";
525 $main::OO_SDK_BOOST_HOME = readStdIn();
526 chop($main::OO_SDK_BOOST_HOME);
527 if ( $main::OO_SDK_BOOST_HOME eq "" )
528 {
529 $main::OO_SDK_BOOST_HOME = $main::OO_SDK_BOOST_HOME_SUGGESTION;
530 }
531 if ( (! -d "$main::OO_SDK_BOOST_HOME") ||
532 ((-d "$main::OO_SDK_BOOST_HOME") && (! -e "$main::OO_SDK_BOOST_HOME/boost/tr1/unordered_map.hpp")) )
533 {
534 print " Error: boost couldn't be find or verified, please specify a boost directory.\n";
524 print " Enter boost directory [$main::OO_SDK_BOOST_HOME_SUGGESTION]: ";
525 $main::OO_SDK_BOOST_HOME = readStdIn();
526 chop($main::OO_SDK_BOOST_HOME);
527 if ( $main::OO_SDK_BOOST_HOME eq "" )
528 {
529 $main::OO_SDK_BOOST_HOME = $main::OO_SDK_BOOST_HOME_SUGGESTION;
530 }
531 if ( (! -d "$main::OO_SDK_BOOST_HOME") ||
532 ((-d "$main::OO_SDK_BOOST_HOME") && (! -e "$main::OO_SDK_BOOST_HOME/boost/tr1/unordered_map.hpp")) )
533 {
534 print " Error: boost couldn't be find or verified, please specify a boost directory.\n";
535 if ( skipChoice("optional output directory") == 1 )
536 {
537 $main::skipBoostDir = 1;
538 }
535 if ( skipChoice("optional output directory") == 1 )
536 {
537 $main::skipBoostDir = 1;
538 }
539 $main::OO_SDK_BOOST_HOME = "";
540 } else
539 $main::OO_SDK_BOOST_HOME = "";
540 } else
541 {
542 # the boost directory is optional
543 $main::skipBoostDir = 1;
544 }
545}
546
547# prepare output directory (optional)
548while ( (!$main::skipOutputDir) &&
549 (! -d "$main::OO_SDK_OUTPUT_DIR") )
550{
551 print " Default output directory is in your HOME directory.\n";
552 print " Enter an existent directory if you prefer a different output directory (optional) [$main::OO_SDK_OUTPUT_DIR_SUGGESTION]: ";
541 {
542 # the boost directory is optional
543 $main::skipBoostDir = 1;
544 }
545}
546
547# prepare output directory (optional)
548while ( (!$main::skipOutputDir) &&
549 (! -d "$main::OO_SDK_OUTPUT_DIR") )
550{
551 print " Default output directory is in your HOME directory.\n";
552 print " Enter an existent directory if you prefer a different output directory (optional) [$main::OO_SDK_OUTPUT_DIR_SUGGESTION]: ";
553
553
554 $main::OO_SDK_OUTPUT_DIR = readStdIn();
555
556 chop($main::OO_SDK_OUTPUT_DIR);
554 $main::OO_SDK_OUTPUT_DIR = readStdIn();
555
556 chop($main::OO_SDK_OUTPUT_DIR);
557 if ( $main::OO_SDK_OUTPUT_DIR eq "" )
557 if ( $main::OO_SDK_OUTPUT_DIR eq "" )
558 {
559 $main::OO_SDK_OUTPUT_DIR = $main::OO_SDK_OUTPUT_DIR_SUGGESTION;
560 }
558 {
559 $main::OO_SDK_OUTPUT_DIR = $main::OO_SDK_OUTPUT_DIR_SUGGESTION;
560 }
561 if ( ! $main::OO_SDK_OUTPUT_DIR eq "" )
561 if ( ! $main::OO_SDK_OUTPUT_DIR eq "" )
562 {
563 if ( ! -d "$main::OO_SDK_OUTPUT_DIR" )
562 {
563 if ( ! -d "$main::OO_SDK_OUTPUT_DIR" )
564 {
564 {
565 print " Error: Could not find directory '$main::OO_SDK_OUTPUT_DIR'.\n";
566 if ( skipChoice("optional output directory") == 1 )
567 {
568 $main::skipOutputDir = 1;
569 }
570 $main::OO_SDK_OUTPUT_DIR = "";
571 }
572 } else
573 {
574 # the output directory is optional
575 $main::skipOutputDir = 1;
576 }
577}
578
579# prepare auto deployment
565 print " Error: Could not find directory '$main::OO_SDK_OUTPUT_DIR'.\n";
566 if ( skipChoice("optional output directory") == 1 )
567 {
568 $main::skipOutputDir = 1;
569 }
570 $main::OO_SDK_OUTPUT_DIR = "";
571 }
572 } else
573 {
574 # the output directory is optional
575 $main::skipOutputDir = 1;
576 }
577}
578
579# prepare auto deployment
580while ( $main::SDK_AUTO_DEPLOYMENT eq "" ||
581 ((! $main::SDK_AUTO_DEPLOYMENT eq "YES") &&
580while ( $main::SDK_AUTO_DEPLOYMENT eq "" ||
581 ((! $main::SDK_AUTO_DEPLOYMENT eq "YES") &&
582 (! $main::SDK_AUTO_DEPLOYMENT eq "NO")) )
583{
582 (! $main::SDK_AUTO_DEPLOYMENT eq "NO")) )
583{
584 print " Automatic deployment of UNO components (YES/NO) [$main::SDK_AUTO_DEPLOYMENT_SUGGESTION]: ";
585 $main::SDK_AUTO_DEPLOYMENT = uc <STDIN>;
586 chop($main::SDK_AUTO_DEPLOYMENT);
587 if ( $main::SDK_AUTO_DEPLOYMENT eq "" )
588 {
584 print " Automatic deployment of UNO components (YES/NO) [$main::SDK_AUTO_DEPLOYMENT_SUGGESTION]: ";
585 $main::SDK_AUTO_DEPLOYMENT = uc <STDIN>;
586 chop($main::SDK_AUTO_DEPLOYMENT);
587 if ( $main::SDK_AUTO_DEPLOYMENT eq "" )
588 {
589 $main::SDK_AUTO_DEPLOYMENT = "YES";
589 $main::SDK_AUTO_DEPLOYMENT = "YES";
590 }
590 }
591}
592
593prepareScriptFile("setsdkenv_unix.sh.in", "setsdkenv_unix.sh");
594chmod 0644, "$main::OO_SDK_CONFIG_HOME/$main::hostname/setsdkenv_unix.sh";
595
596print "\n";
597print " ************************************************************************\n";
598print " * ... your SDK environment has been prepared.\n";

--- 21 unchanged lines hidden (view full) ---

620 return 1;
621 }
622 }
623 return 0;
624}
625
626sub resolveLink
627{
591}
592
593prepareScriptFile("setsdkenv_unix.sh.in", "setsdkenv_unix.sh");
594chmod 0644, "$main::OO_SDK_CONFIG_HOME/$main::hostname/setsdkenv_unix.sh";
595
596print "\n";
597print " ************************************************************************\n";
598print " * ... your SDK environment has been prepared.\n";

--- 21 unchanged lines hidden (view full) ---

620 return 1;
621 }
622 }
623 return 0;
624}
625
626sub resolveLink
627{
628 my $base= shift;
629 my $link= shift;
628 my $base= shift;
629 my $link= shift;
630
630
631 my $resolvedpath = "$base/$link";
632 my $linktarget = readlink "$resolvedpath";
633 my $resolvedlink = "";
631 my $resolvedpath = "$base/$link";
632 my $linktarget = readlink "$resolvedpath";
633 my $resolvedlink = "";
634
634
635 while ( $linktarget ne "") {
635 while ( $linktarget ne "") {
636
637 if ( $linktarget =~ m/^\/.*/ )
638 {
636
637 if ( $linktarget =~ m/^\/.*/ )
638 {
639 $resolvedpath = "$linktarget";
639 $resolvedpath = "$linktarget";
640 } else {
640 } else {
641 $resolvedpath = `cd $base/$linktarget; pwd`;
642 chop $resolvedpath;
641 $resolvedpath = `cd $base/$linktarget; pwd`;
642 chop $resolvedpath;
643 }
644 $base = dirname("$resolvedpath");
645
646 $linktarget = readlink "$resolvedpath";
643 }
644 $base = dirname("$resolvedpath");
645
646 $linktarget = readlink "$resolvedpath";
647 }
647 }
648
648
649 $resolvedlink = `cd $resolvedpath; pwd`;
650 chop $resolvedlink;
651 return $resolvedlink;
649 $resolvedlink = `cd $resolvedpath; pwd`;
650 chop $resolvedlink;
651 return $resolvedlink;
652}
653
654sub searchprog
655{
656 my $_search= shift;
657 my $tmpPath = `echo "\$PATH"`;
658 my @pathList = split(":" , $tmpPath);
659 my $progDir = "";
660
652}
653
654sub searchprog
655{
656 my $_search= shift;
657 my $tmpPath = `echo "\$PATH"`;
658 my @pathList = split(":" , $tmpPath);
659 my $progDir = "";
660
661 if ( $_search eq "javac" )
662 {
661 if ( $_search eq "javac" )
662 {
663 if ( $main::operatingSystem =~ m/darwin/ ) {
664 $progDir = resolveLink("/System/Library/Frameworks/JavaVM.Framework/Versions", "CurrentJDK");
665
666 if ( -e "$progDir/$main::OO_SDK_JAVA_BIN_DIR/javac" )
667 {
668 return "$progDir/$main::OO_SDK_JAVA_BIN_DIR";
669 }
670 }
671
672 if ( $main::operatingSystem =~ m/solaris/ ) {
673 $progDir = resolveLink("/usr/jdk", "latest");
674 if ( -e "$progDir/$main::OO_SDK_JAVA_BIN_DIR/javac" )
675 {
676 return "$progDir/$main::OO_SDK_JAVA_BIN_DIR";
677 }
678 }
663 if ( $main::operatingSystem =~ m/darwin/ ) {
664 $progDir = resolveLink("/System/Library/Frameworks/JavaVM.Framework/Versions", "CurrentJDK");
665
666 if ( -e "$progDir/$main::OO_SDK_JAVA_BIN_DIR/javac" )
667 {
668 return "$progDir/$main::OO_SDK_JAVA_BIN_DIR";
669 }
670 }
671
672 if ( $main::operatingSystem =~ m/solaris/ ) {
673 $progDir = resolveLink("/usr/jdk", "latest");
674 if ( -e "$progDir/$main::OO_SDK_JAVA_BIN_DIR/javac" )
675 {
676 return "$progDir/$main::OO_SDK_JAVA_BIN_DIR";
677 }
678 }
679 }
679 }
680
680
681 if ( $_search eq "gmake" && $main::operatingSystem =~ m/solaris/ ) {
681 if ( $_search eq "gmake" && $main::operatingSystem =~ m/solaris/ ) {
682 if ( -e "/usr/sfw/bin/gmake" )
683 {
684 return "/usr/sfw/bin";
685 }
682 if ( -e "/usr/sfw/bin/gmake" )
683 {
684 return "/usr/sfw/bin";
685 }
686 }
686 }
687
688 foreach $i (@pathList)
689 {
687
688 foreach $i (@pathList)
689 {
690 chomp ($i);
690 chomp ($i);
691
692 if ( -e "$i/$_search" )
693 {
694
695 if ( index($i, "/") == 0 )
696 {
697 # # absolute path; leave unchanged
698 $progDir = $i;

--- 18 unchanged lines hidden (view full) ---

717sub searchoffice
718{
719 my $offset = rindex($main::sdkpath, "/openoffice");
720 my $tmpOffice = substr($main::sdkpath, 0, $offset);
721 my $officepath = "$tmpOffice/openoffice$main::OO_MAJORVERSION";
722
723# if ( $main::OO_MINORVERSION > 0) {
724# $officepath = "$officepath$main::OO_MINORVERSION";
691
692 if ( -e "$i/$_search" )
693 {
694
695 if ( index($i, "/") == 0 )
696 {
697 # # absolute path; leave unchanged
698 $progDir = $i;

--- 18 unchanged lines hidden (view full) ---

717sub searchoffice
718{
719 my $offset = rindex($main::sdkpath, "/openoffice");
720 my $tmpOffice = substr($main::sdkpath, 0, $offset);
721 my $officepath = "$tmpOffice/openoffice$main::OO_MAJORVERSION";
722
723# if ( $main::OO_MINORVERSION > 0) {
724# $officepath = "$officepath$main::OO_MINORVERSION";
725# }
725# }
726
727 # search corresponding office for this SDK
728 if (-d $officepath && -e "$officepath/program/soffice") {
729 return $officepath;
730 }
731 return "";
732}
733

--- 6 unchanged lines hidden (view full) ---

740 my $toolName = shift;
741 # 1=check + message 2=check only
742 my $checkOnly = shift;
743 my @mustBeVersion = split(/\.|_|-/,$tmpMustBeVersion);
744 my @testVersion = split(/\.|_|-/,$tmpTestVersion);
745 my $length = $#mustBeVersion;
746
747 if ($#testVersion < $#mustBeVersion) {
726
727 # search corresponding office for this SDK
728 if (-d $officepath && -e "$officepath/program/soffice") {
729 return $officepath;
730 }
731 return "";
732}
733

--- 6 unchanged lines hidden (view full) ---

740 my $toolName = shift;
741 # 1=check + message 2=check only
742 my $checkOnly = shift;
743 my @mustBeVersion = split(/\.|_|-/,$tmpMustBeVersion);
744 my @testVersion = split(/\.|_|-/,$tmpTestVersion);
745 my $length = $#mustBeVersion;
746
747 if ($#testVersion < $#mustBeVersion) {
748 $length = $#testVersion;
748 $length = $#testVersion;
749 }
750
751 for ($i=0; $i <= $length; $i++ )
752 {
753 if ( @testVersion[$i] > @mustBeVersion[$i] )
754 {
755 return 1; # 1 indicates a correct version
756 }

--- 11 unchanged lines hidden (view full) ---

768 return 1; # 1 indicates a correct version
769}
770
771sub readStdIn
772{
773 my $tmpstdin = <STDIN>;
774 if ( index($tmpstdin, "\$") != -1)
775 {
749 }
750
751 for ($i=0; $i <= $length; $i++ )
752 {
753 if ( @testVersion[$i] > @mustBeVersion[$i] )
754 {
755 return 1; # 1 indicates a correct version
756 }

--- 11 unchanged lines hidden (view full) ---

768 return 1; # 1 indicates a correct version
769}
770
771sub readStdIn
772{
773 my $tmpstdin = <STDIN>;
774 if ( index($tmpstdin, "\$") != -1)
775 {
776 return `echo $tmpstdin`;
776 return `echo $tmpstdin`;
777 }
778
779 return $tmpstdin;
780}
781
777 }
778
779 return $tmpstdin;
780}
781
782sub prepareScriptFile()
782sub prepareScriptFile()
783{
784 my $inputFile = shift;
785 my $outputFile = shift;
786
787 if ( ! -d "$main::OO_SDK_CONFIG_HOME/$main::hostname" )
788 {
789 system("mkdir -p $main::OO_SDK_CONFIG_HOME/$main::hostname");
790 }

--- 11 unchanged lines hidden (view full) ---

802 $_ =~ s#\@OO_SDK_CAT_HOME\@#$main::OO_SDK_CAT_HOME#go;
803 $_ =~ s#\@OO_SDK_SED_HOME\@#$main::OO_SDK_SED_HOME#go;
804 $_ =~ s#\@OO_SDK_CPP_HOME\@#$main::OO_SDK_CPP_HOME#go;
805 $_ =~ s#\@OO_SDK_CC_55_OR_HIGHER\@#$main::OO_SDK_CC_55_OR_HIGHER#go;
806 $_ =~ s#\@OO_SDK_JAVA_HOME\@#$main::OO_SDK_JAVA_HOME#go;
807 $_ =~ s#\@OO_SDK_BOOST_HOME\@#$main::OO_SDK_BOOST_HOME#go;
808 $_ =~ s#\@SDK_AUTO_DEPLOYMENT\@#$main::SDK_AUTO_DEPLOYMENT#go;
809 $_ =~ s#\@OO_SDK_OUTPUT_DIR\@#$main::OO_SDK_OUTPUT_DIR#go;
783{
784 my $inputFile = shift;
785 my $outputFile = shift;
786
787 if ( ! -d "$main::OO_SDK_CONFIG_HOME/$main::hostname" )
788 {
789 system("mkdir -p $main::OO_SDK_CONFIG_HOME/$main::hostname");
790 }

--- 11 unchanged lines hidden (view full) ---

802 $_ =~ s#\@OO_SDK_CAT_HOME\@#$main::OO_SDK_CAT_HOME#go;
803 $_ =~ s#\@OO_SDK_SED_HOME\@#$main::OO_SDK_SED_HOME#go;
804 $_ =~ s#\@OO_SDK_CPP_HOME\@#$main::OO_SDK_CPP_HOME#go;
805 $_ =~ s#\@OO_SDK_CC_55_OR_HIGHER\@#$main::OO_SDK_CC_55_OR_HIGHER#go;
806 $_ =~ s#\@OO_SDK_JAVA_HOME\@#$main::OO_SDK_JAVA_HOME#go;
807 $_ =~ s#\@OO_SDK_BOOST_HOME\@#$main::OO_SDK_BOOST_HOME#go;
808 $_ =~ s#\@SDK_AUTO_DEPLOYMENT\@#$main::SDK_AUTO_DEPLOYMENT#go;
809 $_ =~ s#\@OO_SDK_OUTPUT_DIR\@#$main::OO_SDK_OUTPUT_DIR#go;
810
811 print FILEOUT $_;
810
811 print FILEOUT $_;
812 }
812 }
813
813
814 close FILEIN;
815 close FILEOUT;
816}
814 close FILEIN;
815 close FILEOUT;
816}