37 ## |
37 ## |
38 ## |
38 ## |
39 ## $QT_END_LICENSE$ |
39 ## $QT_END_LICENSE$ |
40 ## |
40 ## |
41 ############################################################################# |
41 ############################################################################# |
|
42 |
|
43 # return status of 1 if absolute path as first argument |
|
44 # also prints the return status |
|
45 function isAbsPath() { |
|
46 slash=$(echo $1 | cut -c 1) |
|
47 if [ "$slash" != "/" ]; then |
|
48 echo 0 |
|
49 return 0 |
|
50 fi |
|
51 echo 1 |
|
52 return 1 |
|
53 } |
|
54 |
|
55 # Returns the absolute path for $1 for target $2 |
|
56 # as an example $2 might have value "maemo5". |
|
57 # This is required because when building in scratchbox for |
|
58 # maemo we do not want to follow symbolic links that are |
|
59 # introduced by scratchbox |
|
60 function absPath() { |
|
61 |
|
62 if [ "$2" = "maemo5" -o "$2" = "maemo6" ]; then |
|
63 if [ `isAbsPath $1` = '1' ]; then |
|
64 echo $1; |
|
65 else |
|
66 echo "Relative prefix paths are not supported for Maemo" |
|
67 exit 1; |
|
68 fi |
|
69 else |
|
70 RESULT=`(cd "$1"; /bin/pwd)` |
|
71 echo $RESULT |
|
72 fi |
|
73 } |
|
74 |
42 |
75 |
43 # the current directory (shadow build dir) |
76 # the current directory (shadow build dir) |
44 shadowpath=`/bin/pwd` |
77 shadowpath=`/bin/pwd` |
45 # the name of this script |
78 # the name of this script |
46 relconf=`basename $0` |
79 relconf=`basename $0` |
246 fi |
279 fi |
247 fi |
280 fi |
248 |
281 |
249 #process PREFIX |
282 #process PREFIX |
250 if [ -d "$QT_MOBILITY_PREFIX" ]; then |
283 if [ -d "$QT_MOBILITY_PREFIX" ]; then |
251 QT_MOBILITY_PREFIX=`(cd "$QT_MOBILITY_PREFIX"; /bin/pwd)` |
284 QT_MOBILITY_PREFIX=`absPath $QT_MOBILITY_PREFIX $LINUX_TARGET` |
252 else |
285 else |
253 mkdir -p "$QT_MOBILITY_PREFIX" |
286 mkdir -p "$QT_MOBILITY_PREFIX" |
254 absPath=`(cd "$QT_MOBILITY_PREFIX"; /bin/pwd)` |
287 QT_MOBILITY_PREFIX=`absPath $QT_MOBILITY_PREFIX $LINUX_TARGET` |
255 rm -rf "$QT_MOBILITY_PREFIX" |
288 rm -rf "$QT_MOBILITY_PREFIX" |
256 QT_MOBILITY_PREFIX="$absPath" |
|
257 fi |
289 fi |
258 echo "QT_MOBILITY_PREFIX = $QT_MOBILITY_PREFIX" >> "$CONFIG_IN" |
290 echo "QT_MOBILITY_PREFIX = $QT_MOBILITY_PREFIX" >> "$CONFIG_IN" |
259 |
291 |
260 #process include path |
292 #process include path |
261 if [ -z "$QT_MOBILITY_INCLUDE" ]; then |
293 if [ -z "$QT_MOBILITY_INCLUDE" ]; then |
262 QT_MOBILITY_INCLUDE="$QT_MOBILITY_PREFIX/include" |
294 QT_MOBILITY_INCLUDE="$QT_MOBILITY_PREFIX/include" |
263 elif [ -d "$QT_MOBILITY_INCLUDE" ]; then |
295 elif [ -d "$QT_MOBILITY_INCLUDE" ]; then |
264 QT_MOBILITY_INCLUDE=`(cd "$QT_MOBILITY_INCLUDE"; /bin/pwd)` |
296 QT_MOBILITY_INCLUDE=`absPath $QT_MOBILITY_INCLUDE $LINUX_TARGET` |
265 else |
297 else |
266 mkdir -p "$QT_MOBILITY_INCLUDE" |
298 mkdir -p "$QT_MOBILITY_INCLUDE" |
267 absPath=`(cd "$QT_MOBILITY_INCLUDE"; /bin/pwd)` |
299 QT_MOBILITY_INCLUDE=`absPath $QT_MOBILITY_INCLUDE $LINUX_TARGET` |
268 rm -rf "$QT_MOBILITY_INCLUDE" |
300 rm -rf "$QT_MOBILITY_INCLUDE" |
269 QT_MOBILITY_INCLUDE="$absPath" |
|
270 fi |
301 fi |
271 echo "QT_MOBILITY_INCLUDE = $QT_MOBILITY_INCLUDE" >> "$CONFIG_IN" |
302 echo "QT_MOBILITY_INCLUDE = $QT_MOBILITY_INCLUDE" >> "$CONFIG_IN" |
272 |
303 |
273 |
304 |
274 #process library path |
305 #process library path |
275 if [ -z "$QT_MOBILITY_LIB" ]; then |
306 if [ -z "$QT_MOBILITY_LIB" ]; then |
276 QT_MOBILITY_LIB="$QT_MOBILITY_PREFIX/$LIB_PATH" |
307 QT_MOBILITY_LIB="$QT_MOBILITY_PREFIX/$LIB_PATH" |
277 elif [ -d "$QT_MOBILITY_LIB" ]; then |
308 elif [ -d "$QT_MOBILITY_LIB" ]; then |
278 QT_MOBILITY_LIB=`(cd "$QT_MOBILITY_LIB"; /bin/pwd)` |
309 QT_MOBILITY_LIB=`absPath $QT_MOBILITY_LIB $LINUX_TARGET` |
279 else |
310 else |
280 mkdir -p "$QT_MOBILITY_LIB" |
311 mkdir -p "$QT_MOBILITY_LIB" |
281 absPath=`(cd "$QT_MOBILITY_LIB"; /bin/pwd)` |
312 QT_MOBILITY_LIB=`absPath $QT_MOBILITY_LIB $LINUX_TARGET` |
282 rm -rf "$QT_MOBILITY_LIB" |
313 rm -rf "$QT_MOBILITY_LIB" |
283 QT_MOBILITY_LIB="$absPath" |
|
284 fi |
314 fi |
285 echo "QT_MOBILITY_LIB = $QT_MOBILITY_LIB" >> "$CONFIG_IN" |
315 echo "QT_MOBILITY_LIB = $QT_MOBILITY_LIB" >> "$CONFIG_IN" |
286 |
316 |
287 #process binary path |
317 #process binary path |
288 if [ -z "$QT_MOBILITY_BIN" ]; then |
318 if [ -z "$QT_MOBILITY_BIN" ]; then |
289 QT_MOBILITY_BIN="$QT_MOBILITY_PREFIX/$BIN_PATH" |
319 QT_MOBILITY_BIN="$QT_MOBILITY_PREFIX/$BIN_PATH" |
290 elif [ -d "$QT_MOBILITY_BIN" ]; then |
320 elif [ -d "$QT_MOBILITY_BIN" ]; then |
291 QT_MOBILITY_BIN=`(cd "$QT_MOBILITY_BIN"; /bin/pwd)` |
321 QT_MOBILITY_BIN=`absPath $QT_MOBILITY_BIN $LINUX_TARGET` |
292 else |
322 else |
293 mkdir -p "$QT_MOBILITY_BIN" |
323 mkdir -p "$QT_MOBILITY_BIN" |
294 absPath=`(cd "$QT_MOBILITY_BIN"; /bin/pwd)` |
324 QT_MOBILITY_BIN=`absPath $QT_MOBILITY_BIN $LINUX_TARGET` |
295 rm -rf "$QT_MOBILITY_BIN" |
325 rm -rf "$QT_MOBILITY_BIN" |
296 QT_MOBILITY_BIN="$absPath" |
|
297 fi |
326 fi |
298 echo "QT_MOBILITY_BIN = $QT_MOBILITY_BIN" >> "$CONFIG_IN" |
327 echo "QT_MOBILITY_BIN = $QT_MOBILITY_BIN" >> "$CONFIG_IN" |
299 |
328 |
300 echo "QT_MOBILITY_SOURCE_TREE = $relpath" >> "$QMAKE_CACHE" |
329 echo "QT_MOBILITY_SOURCE_TREE = $relpath" >> "$QMAKE_CACHE" |
301 echo "QT_MOBILITY_BUILD_TREE = $shadowpath" >> "$QMAKE_CACHE" |
330 echo "QT_MOBILITY_BUILD_TREE = $shadowpath" >> "$QMAKE_CACHE" |
386 #compile tests |
415 #compile tests |
387 compileTest QMF qmf |
416 compileTest QMF qmf |
388 compileTest NetworkManager networkmanager |
417 compileTest NetworkManager networkmanager |
389 compileTest "CoreWLAN (MacOS 10.6)" corewlan |
418 compileTest "CoreWLAN (MacOS 10.6)" corewlan |
390 compileTest "Maemo ICD" maemo-icd |
419 compileTest "Maemo ICD" maemo-icd |
|
420 compileTest "Maemo ICD WLAN" maemo-icd-network-wlan |
391 |
421 |
392 # Now module selection |
422 # Now module selection |
393 # using 'expr match ....' should help a bit |
423 # using 'expr match ....' should help a bit |
394 #if [ -n "$MOBILITY_MODULES_UNPARSED" ]; then |
424 #if [ -n "$MOBILITY_MODULES_UNPARSED" ]; then |
395 # In theory we should do some sanity checking here. |
425 # In theory we should do some sanity checking here. |
398 |
428 |
399 # It's a lot easier to make qmake do the dependency checking... |
429 # It's a lot easier to make qmake do the dependency checking... |
400 echo "mobility_modules = $MOBILITY_MODULES" >> "$CONFIG_IN" |
430 echo "mobility_modules = $MOBILITY_MODULES" >> "$CONFIG_IN" |
401 echo "contains(mobility_modules,versit): mobility_modules *= contacts" >> "$CONFIG_IN" |
431 echo "contains(mobility_modules,versit): mobility_modules *= contacts" >> "$CONFIG_IN" |
402 echo "maemo5|maemo6:contains(maemo-icd_enabled, no): mobility_modules -= bearer" >> "$CONFIG_IN" |
432 echo "maemo5|maemo6:contains(maemo-icd_enabled, no): mobility_modules -= bearer" >> "$CONFIG_IN" |
|
433 |
|
434 # If libicd-network-wlan-dev.h is not present, use own copy. |
|
435 # At time of writing, libicd-network-wlan-dev is not released for maemo5. |
|
436 echo "maemo5:contains(maemo-icd-network-wlan_enabled, no): INCLUDEPATH += $relpath/src/3rdparty/icd-network-wlan" >> "$CONFIG_IN" |
403 |
437 |
404 # Ideally we'd skip generating headers for modules that are not enabled |
438 # Ideally we'd skip generating headers for modules that are not enabled |
405 echo "Generating Mobility Headers..." |
439 echo "Generating Mobility Headers..." |
406 #remove old headers |
440 #remove old headers |
407 rm -rf $shadowpath/include |
441 rm -rf $shadowpath/include |