2013-08-15 03:56:48 +02:00
|
|
|
#!/bin/sh
|
2010-05-18 17:58:33 +02:00
|
|
|
##
|
2010-09-09 14:16:39 +02:00
|
|
|
## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
2010-05-18 17:58:33 +02:00
|
|
|
##
|
2010-06-18 18:39:21 +02:00
|
|
|
## Use of this source code is governed by a BSD-style license
|
2010-06-04 22:19:40 +02:00
|
|
|
## that can be found in the LICENSE file in the root of the source
|
|
|
|
## tree. An additional intellectual property rights grant can be found
|
2010-06-18 18:39:21 +02:00
|
|
|
## in the file PATENTS. All contributing project authors may
|
2010-06-04 22:19:40 +02:00
|
|
|
## be found in the AUTHORS file in the root of the source tree.
|
2010-05-18 17:58:33 +02:00
|
|
|
##
|
|
|
|
|
|
|
|
|
|
|
|
verbose=0
|
|
|
|
set -- $*
|
|
|
|
for i; do
|
2013-08-15 03:56:48 +02:00
|
|
|
if [ "$i" = "-o" ]; then
|
2010-05-18 17:58:33 +02:00
|
|
|
on_of=1
|
2013-08-15 03:56:48 +02:00
|
|
|
elif [ "$i" = "-v" ]; then
|
2010-05-18 17:58:33 +02:00
|
|
|
verbose=1
|
2013-08-15 03:56:48 +02:00
|
|
|
elif [ "$i" = "-g" ]; then
|
2011-02-04 09:21:43 +01:00
|
|
|
args="${args} --debug"
|
2013-08-15 03:56:48 +02:00
|
|
|
elif [ "$on_of" = "1" ]; then
|
2010-05-18 17:58:33 +02:00
|
|
|
outfile=$i
|
2011-02-04 09:21:43 +01:00
|
|
|
on_of=0
|
2010-05-18 17:58:33 +02:00
|
|
|
elif [ -f "$i" ]; then
|
|
|
|
infiles="$infiles $i"
|
2013-08-15 03:56:48 +02:00
|
|
|
elif [ "${i#-l}" != "$i" ]; then
|
2010-05-18 17:58:33 +02:00
|
|
|
libs="$libs ${i#-l}"
|
2013-08-15 03:56:48 +02:00
|
|
|
elif [ "${i#-L}" != "$i" ]; then
|
2011-02-04 09:21:43 +01:00
|
|
|
libpaths="${libpaths} ${i#-L}"
|
2010-05-18 17:58:33 +02:00
|
|
|
else
|
|
|
|
args="${args} ${i}"
|
|
|
|
fi
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
# Absolutize library file names
|
|
|
|
for f in $libs; do
|
|
|
|
found=0
|
|
|
|
for d in $libpaths; do
|
|
|
|
[ -f "$d/$f" ] && infiles="$infiles $d/$f" && found=1 && break
|
|
|
|
[ -f "$d/lib${f}.so" ] && infiles="$infiles $d/lib${f}.so" && found=1 && break
|
|
|
|
[ -f "$d/lib${f}.a" ] && infiles="$infiles $d/lib${f}.a" && found=1 && break
|
|
|
|
done
|
|
|
|
[ $found -eq 0 ] && infiles="$infiles $f"
|
|
|
|
done
|
|
|
|
for d in $libpaths; do
|
|
|
|
[ -n "$libsearchpath" ] && libsearchpath="${libsearchpath},"
|
|
|
|
libsearchpath="${libsearchpath}$d"
|
|
|
|
done
|
|
|
|
|
|
|
|
cmd="armlink $args --userlibpath=$libsearchpath --output=$outfile $infiles"
|
|
|
|
[ $verbose -eq 1 ] && echo $cmd
|
|
|
|
$cmd
|