diff options
Diffstat (limited to 'oe-init-build-env')
-rwxr-xr-x | oe-init-build-env | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/oe-init-build-env b/oe-init-build-env index b7e29188b0..7b922b302a 100755 --- a/oe-init-build-env +++ b/oe-init-build-env | |||
@@ -26,30 +26,32 @@ | |||
26 | # to sourcing this script. | 26 | # to sourcing this script. |
27 | # | 27 | # |
28 | if [ -n "$BASH_SOURCE" ]; then | 28 | if [ -n "$BASH_SOURCE" ]; then |
29 | OEROOT="`dirname $BASH_SOURCE`" | 29 | THIS_SCRIPT=$BASH_SOURCE |
30 | elif [ -n "$ZSH_NAME" ]; then | 30 | elif [ -n "$ZSH_NAME" ]; then |
31 | OEROOT="`dirname $0`" | 31 | THIS_SCRIPT=$0 |
32 | else | 32 | else |
33 | OEROOT="`pwd`" | 33 | THIS_SCRIPT="$(pwd)/oe-init-build-env" |
34 | fi | 34 | fi |
35 | if [ -n "$BBSERVER" ]; then | 35 | if [ -n "$BBSERVER" ]; then |
36 | unset BBSERVER | 36 | unset BBSERVER |
37 | fi | 37 | fi |
38 | THIS_SCRIPT=$OEROOT/oe-init-build-env | ||
39 | 38 | ||
40 | if [ -z "$ZSH_NAME" ] && [ "$0" = "$THIS_SCRIPT" ]; then | 39 | if [ -z "$ZSH_NAME" ] && [ "$0" = "$THIS_SCRIPT" ]; then |
41 | echo "Error: This script needs to be sourced. Please run as '. $THIS_SCRIPT'" | 40 | echo "Error: This script needs to be sourced. Please run as '. $THIS_SCRIPT'" |
42 | exit 1 | 41 | exit 1 |
43 | fi | 42 | fi |
44 | 43 | ||
45 | OEROOT=`readlink -f "$OEROOT"` | 44 | if [ -z "$OEROOT" ]; then |
45 | OEROOT=$(dirname "$THIS_SCRIPT") | ||
46 | OEROOT=$(readlink -f "$OEROOT") | ||
47 | fi | ||
48 | unset THIS_SCRIPT | ||
49 | |||
46 | export OEROOT | 50 | export OEROOT |
47 | . $OEROOT/scripts/oe-buildenv-internal && \ | 51 | . $OEROOT/scripts/oe-buildenv-internal && \ |
48 | TEMPLATECONF="$TEMPLATECONF" $OEROOT/scripts/oe-setup-builddir && \ | 52 | TEMPLATECONF="$TEMPLATECONF" $OEROOT/scripts/oe-setup-builddir && \ |
49 | [ -n "$BUILDDIR" ] && cd "$BUILDDIR" | 53 | [ -n "$BUILDDIR" ] && cd "$BUILDDIR" |
50 | unset OEROOT | 54 | unset OEROOT |
51 | unset BBPATH | ||
52 | unset THIS_SCRIPT | ||
53 | 55 | ||
54 | # Shutdown any bitbake server if the BBSERVER variable is not set | 56 | # Shutdown any bitbake server if the BBSERVER variable is not set |
55 | if [ -z "$BBSERVER" ] && [ -f bitbake.lock ] ; then | 57 | if [ -z "$BBSERVER" ] && [ -f bitbake.lock ] ; then |