OLD | NEW |
1 #!/bin/bash | 1 #!/bin/sh |
2 ## | 2 ## |
3 ## Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 3 ## Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
4 ## | 4 ## |
5 ## Use of this source code is governed by a BSD-style license | 5 ## Use of this source code is governed by a BSD-style license |
6 ## that can be found in the LICENSE file in the root of the source | 6 ## that can be found in the LICENSE file in the root of the source |
7 ## tree. An additional intellectual property rights grant can be found | 7 ## tree. An additional intellectual property rights grant can be found |
8 ## in the file PATENTS. All contributing project authors may | 8 ## in the file PATENTS. All contributing project authors may |
9 ## be found in the AUTHORS file in the root of the source tree. | 9 ## be found in the AUTHORS file in the root of the source tree. |
10 ## | 10 ## |
11 | 11 |
12 | 12 |
13 verbose=0 | 13 verbose=0 |
14 set -- $* | 14 set -- $* |
15 for i; do | 15 for i; do |
16 if [ "$i" == "-o" ]; then | 16 if [ "$i" = "-o" ]; then |
17 on_of=1 | 17 on_of=1 |
18 elif [ "$i" == "-v" ]; then | 18 elif [ "$i" = "-v" ]; then |
19 verbose=1 | 19 verbose=1 |
20 elif [ "$i" == "-g" ]; then | 20 elif [ "$i" = "-g" ]; then |
21 args="${args} --debug" | 21 args="${args} --debug" |
22 elif [ "$on_of" == "1" ]; then | 22 elif [ "$on_of" = "1" ]; then |
23 outfile=$i | 23 outfile=$i |
24 on_of=0 | 24 on_of=0 |
25 elif [ -f "$i" ]; then | 25 elif [ -f "$i" ]; then |
26 infiles="$infiles $i" | 26 infiles="$infiles $i" |
27 elif [ "${i:0:2}" == "-l" ]; then | 27 elif [ "${i#-l}" != "$i" ]; then |
28 libs="$libs ${i#-l}" | 28 libs="$libs ${i#-l}" |
29 elif [ "${i:0:2}" == "-L" ]; then | 29 elif [ "${i#-L}" != "$i" ]; then |
30 libpaths="${libpaths} ${i#-L}" | 30 libpaths="${libpaths} ${i#-L}" |
31 else | 31 else |
32 args="${args} ${i}" | 32 args="${args} ${i}" |
33 fi | 33 fi |
34 shift | 34 shift |
35 done | 35 done |
36 | 36 |
37 # Absolutize library file names | 37 # Absolutize library file names |
38 for f in $libs; do | 38 for f in $libs; do |
39 found=0 | 39 found=0 |
40 for d in $libpaths; do | 40 for d in $libpaths; do |
41 [ -f "$d/$f" ] && infiles="$infiles $d/$f" && found=1 && break | 41 [ -f "$d/$f" ] && infiles="$infiles $d/$f" && found=1 && break |
42 [ -f "$d/lib${f}.so" ] && infiles="$infiles $d/lib${f}.so" && found=1 &&
break | 42 [ -f "$d/lib${f}.so" ] && infiles="$infiles $d/lib${f}.so" && found=1 &&
break |
43 [ -f "$d/lib${f}.a" ] && infiles="$infiles $d/lib${f}.a" && found=1 && b
reak | 43 [ -f "$d/lib${f}.a" ] && infiles="$infiles $d/lib${f}.a" && found=1 && b
reak |
44 done | 44 done |
45 [ $found -eq 0 ] && infiles="$infiles $f" | 45 [ $found -eq 0 ] && infiles="$infiles $f" |
46 done | 46 done |
47 for d in $libpaths; do | 47 for d in $libpaths; do |
48 [ -n "$libsearchpath" ] && libsearchpath="${libsearchpath}," | 48 [ -n "$libsearchpath" ] && libsearchpath="${libsearchpath}," |
49 libsearchpath="${libsearchpath}$d" | 49 libsearchpath="${libsearchpath}$d" |
50 done | 50 done |
51 | 51 |
52 cmd="armlink $args --userlibpath=$libsearchpath --output=$outfile $infiles" | 52 cmd="armlink $args --userlibpath=$libsearchpath --output=$outfile $infiles" |
53 [ $verbose -eq 1 ] && echo $cmd | 53 [ $verbose -eq 1 ] && echo $cmd |
54 $cmd | 54 $cmd |
OLD | NEW |