summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xoe-init-build-env6
-rwxr-xr-xscripts/oe-buildenv-internal13
2 files changed, 14 insertions, 5 deletions
diff --git a/oe-init-build-env b/oe-init-build-env
index 77332a7d63..cc30a3b191 100755
--- a/oe-init-build-env
+++ b/oe-init-build-env
@@ -35,10 +35,10 @@ else
35 fi 35 fi
36 OEROOT=`readlink -f "$OEROOT"` 36 OEROOT=`readlink -f "$OEROOT"`
37 export OEROOT 37 export OEROOT
38 . $OEROOT/scripts/oe-buildenv-internal 38 . $OEROOT/scripts/oe-buildenv-internal && \
39 $OEROOT/scripts/oe-setup-builddir 39 $OEROOT/scripts/oe-setup-builddir && \
40 [ -n "$BUILDDIR" ] && cd $BUILDDIR
40 unset OEROOT 41 unset OEROOT
41 unset BBPATH 42 unset BBPATH
42 [ -n "$BUILDDIR" ] && cd $BUILDDIR
43fi 43fi
44 44
diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
index c13fc40f8b..117b0c593e 100755
--- a/scripts/oe-buildenv-internal
+++ b/scripts/oe-buildenv-internal
@@ -21,7 +21,7 @@
21# It is assumed OEROOT is already defined when this is called 21# It is assumed OEROOT is already defined when this is called
22if [ -z "$OEROOT" ]; then 22if [ -z "$OEROOT" ]; then
23 echo >&2 "Error: OEROOT is not defined!" 23 echo >&2 "Error: OEROOT is not defined!"
24 return 24 return 1
25fi 25fi
26 26
27if [ "x$BDIR" = "x" ]; then 27if [ "x$BDIR" = "x" ]; then
@@ -29,6 +29,15 @@ if [ "x$BDIR" = "x" ]; then
29 BDIR="build" 29 BDIR="build"
30 else 30 else
31 BDIR=`readlink -f "$1"` 31 BDIR=`readlink -f "$1"`
32 if [ -z "$BDIR" ]; then
33 if expr "$1" : '.*/$' >/dev/null; then
34 echo >&2 "Error: please remove any trailing / in the argument."
35 else
36 PARENTDIR=`dirname "$1"`
37 echo >&2 "Error: the directory $PARENTDIR doesn't exist?"
38 fi
39 return 1
40 fi
32 fi 41 fi
33fi 42fi
34if expr "$BDIR" : '/.*' > /dev/null ; then 43if expr "$BDIR" : '/.*' > /dev/null ; then
@@ -45,7 +54,7 @@ BUILDDIR=`readlink -f "$BUILDDIR"`
45 54
46if ! (test -d "$BITBAKEDIR"); then 55if ! (test -d "$BITBAKEDIR"); then
47 echo >&2 "Error: The bitbake directory ($BITBAKEDIR) does not exist! Please ensure a copy of bitbake exists at this location" 56 echo >&2 "Error: The bitbake directory ($BITBAKEDIR) does not exist! Please ensure a copy of bitbake exists at this location"
48 return 57 return 1
49fi 58fi
50 59
51PATH="${OEROOT}/scripts:$BITBAKEDIR/bin/:$PATH" 60PATH="${OEROOT}/scripts:$BITBAKEDIR/bin/:$PATH"