diff options
| author | Robert Yang <liezhi.yang@windriver.com> | 2017-04-12 14:29:12 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-04-13 10:54:10 +0100 |
| commit | 4a0b6af446d257098111d76123a7dd34fa92f943 (patch) | |
| tree | 95daddb216344e023a13e087a139de473c898548 /scripts/oe-find-native-sysroot | |
| parent | 5897c5edc4549dddef7a7b2cbb8d60a9d33b4c10 (diff) | |
| download | poky-4a0b6af446d257098111d76123a7dd34fa92f943.tar.gz | |
oe-find-native-sysroot: work with RSS
The generic STAGING_DIR_NATIVE is gone since RSS, so when find
OECORE_NATIVE_SYSROOT, the user has to specify which recipe's
STAGING_DIR_NATIVE will be used as OECORE_NATIVE_SYSROOT.
* The usage is changed from ". oe-find-native-sysroot" to
". oe-find-native-sysroot <recipe>".
* The oe-run-native's usage has changed from
"oe-run-native tool" to "oe-run-native native-recipe tool".
(From OE-Core rev: e2f6d937bd897083779507ecb9ecd15513b35f1f)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-find-native-sysroot')
| -rwxr-xr-x | scripts/oe-find-native-sysroot | 56 |
1 files changed, 37 insertions, 19 deletions
diff --git a/scripts/oe-find-native-sysroot b/scripts/oe-find-native-sysroot index 13a5c46039..ad7b2d1fe8 100755 --- a/scripts/oe-find-native-sysroot +++ b/scripts/oe-find-native-sysroot | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | # it, e.g: | 9 | # it, e.g: |
| 10 | # | 10 | # |
| 11 | # SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot` | 11 | # SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot` |
| 12 | # . $SYSROOT_SETUP_SCRIPT | 12 | # . $SYSROOT_SETUP_SCRIPT <recipe> |
| 13 | # | 13 | # |
| 14 | # This script will terminate execution of your calling program unless | 14 | # This script will terminate execution of your calling program unless |
| 15 | # you set a variable $SKIP_STRICT_SYSROOT_CHECK to a non-empty string | 15 | # you set a variable $SKIP_STRICT_SYSROOT_CHECK to a non-empty string |
| @@ -30,8 +30,8 @@ | |||
| 30 | # with this program; if not, write to the Free Software Foundation, Inc., | 30 | # with this program; if not, write to the Free Software Foundation, Inc., |
| 31 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 31 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 32 | 32 | ||
| 33 | if [ "$1" = '--help' -o "$1" = '-h' ] ; then | 33 | if [ "$1" = '--help' -o "$1" = '-h' -o $# -ne 1 ] ; then |
| 34 | echo 'Usage: oe-find-native-sysroot [-h|--help]' | 34 | echo 'Usage: oe-find-native-sysroot <recipe> [-h|--help]' |
| 35 | echo '' | 35 | echo '' |
| 36 | echo 'OpenEmbedded find-native-sysroot - helper script to set' | 36 | echo 'OpenEmbedded find-native-sysroot - helper script to set' |
| 37 | echo 'environment variables OECORE_NATIVE_SYSROOT and PSEUDO' | 37 | echo 'environment variables OECORE_NATIVE_SYSROOT and PSEUDO' |
| @@ -39,11 +39,31 @@ if [ "$1" = '--help' -o "$1" = '-h' ] ; then | |||
| 39 | echo 'executable binary' | 39 | echo 'executable binary' |
| 40 | echo '' | 40 | echo '' |
| 41 | echo 'options:' | 41 | echo 'options:' |
| 42 | echo ' recipe its STAGING_DIR_NATIVE is used as native sysroot' | ||
| 42 | echo ' -h, --help show this help message and exit' | 43 | echo ' -h, --help show this help message and exit' |
| 43 | echo '' | 44 | echo '' |
| 44 | exit 2 | 45 | exit 2 |
| 45 | fi | 46 | fi |
| 46 | 47 | ||
| 48 | # Global vars | ||
| 49 | BITBAKE_E="" | ||
| 50 | OECORE_NATIVE_SYSROOT="" | ||
| 51 | |||
| 52 | set_oe_native_sysroot(){ | ||
| 53 | echo "Running bitbake -e $1" | ||
| 54 | BITBAKE_E="`bitbake -e $1`" | ||
| 55 | OECORE_NATIVE_SYSROOT=`echo "$BITBAKE_E" | grep ^STAGING_DIR_NATIVE | cut -d '"' -f2` | ||
| 56 | |||
| 57 | if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then | ||
| 58 | # This indicates that there was an error running bitbake -e that | ||
| 59 | # the user needs to be informed of | ||
| 60 | echo "There was an error running bitbake to determine STAGING_DIR_NATIVE" | ||
| 61 | echo "Here is the output from bitbake -e $1" | ||
| 62 | echo $BITBAKE_E | ||
| 63 | exit 1 | ||
| 64 | fi | ||
| 65 | } | ||
| 66 | |||
| 47 | if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then | 67 | if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then |
| 48 | BITBAKE=`which bitbake 2> /dev/null` | 68 | BITBAKE=`which bitbake 2> /dev/null` |
| 49 | if [ "x$BITBAKE" != "x" ]; then | 69 | if [ "x$BITBAKE" != "x" ]; then |
| @@ -54,10 +74,10 @@ if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then | |||
| 54 | exit 1 | 74 | exit 1 |
| 55 | fi | 75 | fi |
| 56 | touch conf/sanity.conf | 76 | touch conf/sanity.conf |
| 57 | OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '"' -f2` | 77 | set_oe_native_sysroot $1 |
| 58 | rm -f conf/sanity.conf | 78 | rm -f conf/sanity.conf |
| 59 | else | 79 | else |
| 60 | OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '"' -f2` | 80 | set_oe_native_sysroot $1 |
| 61 | fi | 81 | fi |
| 62 | else | 82 | else |
| 63 | echo "Error: Unable to locate bitbake command." | 83 | echo "Error: Unable to locate bitbake command." |
| @@ -69,21 +89,11 @@ if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then | |||
| 69 | fi | 89 | fi |
| 70 | fi | 90 | fi |
| 71 | 91 | ||
| 72 | if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then | 92 | if [ ! -e "$OECORE_NATIVE_SYSROOT/" ]; then |
| 73 | # This indicates that there was an error running bitbake -e that | 93 | echo "Error: $OECORE_NATIVE_SYSROOT doesn't exist." |
| 74 | # the user needs to be informed of | ||
| 75 | echo "There was an error running bitbake to determine STAGING_DIR_NATIVE" | ||
| 76 | echo "Here is the output from bitbake -e" | ||
| 77 | bitbake -e | ||
| 78 | exit 1 | ||
| 79 | fi | ||
| 80 | |||
| 81 | # Set up pseudo command | ||
| 82 | if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/pseudo" ]; then | ||
| 83 | echo "Error: Unable to find pseudo binary in $OECORE_NATIVE_SYSROOT/usr/bin/" | ||
| 84 | 94 | ||
| 85 | if [ "x$OECORE_DISTRO_VERSION" = "x" ]; then | 95 | if [ "x$OECORE_DISTRO_VERSION" = "x" ]; then |
| 86 | echo "Have you run 'bitbake meta-ide-support'?" | 96 | echo "Have you run 'bitbake $1 -caddto_recipe_sysroot'?" |
| 87 | else | 97 | else |
| 88 | echo "This shouldn't happen - something is wrong with your toolchain installation" | 98 | echo "This shouldn't happen - something is wrong with your toolchain installation" |
| 89 | fi | 99 | fi |
| @@ -92,4 +102,12 @@ if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/pseudo" ]; then | |||
| 92 | exit 1 | 102 | exit 1 |
| 93 | fi | 103 | fi |
| 94 | fi | 104 | fi |
| 95 | PSEUDO="$OECORE_NATIVE_SYSROOT/usr/bin/pseudo" | 105 | |
| 106 | # Set up pseudo command | ||
| 107 | pseudo="$OECORE_NATIVE_SYSROOT/usr/bin/pseudo" | ||
| 108 | if [ -e "$pseudo" ]; then | ||
| 109 | echo "PSEUDO=$pseudo" | ||
| 110 | PSEUDO="$pseudo" | ||
| 111 | else | ||
| 112 | echo "PSEUDO $pseudo is not found." | ||
| 113 | fi | ||
