summaryrefslogtreecommitdiffstats
path: root/scripts/oe-run-native
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/oe-run-native')
-rwxr-xr-xscripts/oe-run-native15
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
24if [ $# -lt 1 -o "$1" = '--help' -o "$1" = '-h' ] ; then 24if [ $# -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
34fi 35fi
35 36
37native_recipe="$1"
38tool="$2"
39shift
40
36SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null` 41SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
37if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then 42if [ -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
40fi 45fi
41. $SYSROOT_SETUP_SCRIPT 46. $SYSROOT_SETUP_SCRIPT $native_recipe
42 47
43OLD_PATH=$PATH 48OLD_PATH=$PATH
44 49
45# look for a tool only in native sysroot 50# look for a tool only in native sysroot
46PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin 51PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin
47tool=`/usr/bin/which $1 2>/dev/null` 52tool=`/usr/bin/which $tool 2>/dev/null`
48 53
49if [ -n "$tool" ] ; then 54if [ -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 $@
52else 57else
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
55fi 60fi