diff options
Diffstat (limited to 'scripts/oe-run-native')
-rwxr-xr-x | scripts/oe-run-native | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/oe-run-native b/scripts/oe-run-native index f2453e705a..de3c02ed34 100755 --- a/scripts/oe-run-native +++ b/scripts/oe-run-native | |||
@@ -22,34 +22,39 @@ | |||
22 | # | 22 | # |
23 | 23 | ||
24 | if [ $# -lt 1 -o "$1" = '--help' -o "$1" = '-h' ] ; then | 24 | if [ $# -lt 1 -o "$1" = '--help' -o "$1" = '-h' ] ; then |
25 | echo 'oe-run-native: error: the following arguments are required: <native tool>' | 25 | echo 'oe-run-native: error: the following arguments are required: <native recipe> <native tool>' |
26 | echo 'Usage: oe-run-native tool [parameters]' | 26 | echo 'Usage: oe-run-native native-recipe tool [parameters]' |
27 | echo '' | 27 | echo '' |
28 | echo 'OpenEmbedded run-native - runs native tools' | 28 | echo 'OpenEmbedded run-native - runs native tools' |
29 | echo '' | 29 | echo '' |
30 | echo 'arguments:' | 30 | echo 'arguments:' |
31 | echo ' native-recipe The recipe which provoides tool' | ||
31 | echo ' tool Native tool to run' | 32 | echo ' tool Native tool to run' |
32 | echo '' | 33 | echo '' |
33 | exit 2 | 34 | exit 2 |
34 | fi | 35 | fi |
35 | 36 | ||
37 | native_recipe="$1" | ||
38 | tool="$2" | ||
39 | shift | ||
40 | |||
36 | SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null` | 41 | SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null` |
37 | if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then | 42 | if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then |
38 | echo "Error: Unable to find oe-find-native-sysroot script" | 43 | echo "Error: Unable to find oe-find-native-sysroot script" |
39 | exit 1 | 44 | exit 1 |
40 | fi | 45 | fi |
41 | . $SYSROOT_SETUP_SCRIPT | 46 | . $SYSROOT_SETUP_SCRIPT $native_recipe |
42 | 47 | ||
43 | OLD_PATH=$PATH | 48 | OLD_PATH=$PATH |
44 | 49 | ||
45 | # look for a tool only in native sysroot | 50 | # look for a tool only in native sysroot |
46 | PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin | 51 | PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin |
47 | tool=`/usr/bin/which $1 2>/dev/null` | 52 | tool=`/usr/bin/which $tool 2>/dev/null` |
48 | 53 | ||
49 | if [ -n "$tool" ] ; then | 54 | if [ -n "$tool" ] ; then |
50 | # add old path to allow usage of host tools | 55 | # add old path to allow usage of host tools |
51 | PATH=$PATH:$OLD_PATH $@ | 56 | PATH=$PATH:$OLD_PATH $@ |
52 | else | 57 | else |
53 | echo "Error: Unable to find '$1' in native sysroot" | 58 | echo "Error: Unable to find '$tool' in $PATH" |
54 | exit 1 | 59 | exit 1 |
55 | fi | 60 | fi |