summaryrefslogtreecommitdiff
path: root/scripts/bitbake
blob: 2576871e8793a033f6304d98bd23aaa29d0c7094 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
NO_BUILD_OPTS="--version -h --help -p --parse-only -s --show-versions -e --environment"
no_build="0"
for opt in $@; do
for key in $NO_BUILD_OPTS; do
    if [ $opt == $key ]
    then
        no_build="1"
        break
    fi
done
[ $no_build == "1" ] && break
done

OLDPATH=$PATH
export PATH=`echo $PATH | sed s#[^:]*/scripts:##`
if [ ! -e "$BUILDDIR/pseudodone" -a $no_build == "0" ]; then
    echo "Pseudo has not been built, building this first before the main build"
    bitbake pseudo-native -c populate_sysroot
    ret=$?
    if [ "$ret" != "0" ]; then
        exit 1
    fi
    PSEUDOBINDIR=`bitbake -e | grep STAGING_BINDIR_NATIVE=\" | cut -d '=' -f2 | cut -d '"' -f2`
    ret=$?
    if [ "$ret" != "0" ]; then
        exit 1
    fi
    echo $PSEUDOBINDIR > $BUILDDIR/pseudodone
    # This needs to exist in case pseudo has to log somewhere
    mkdir -p $PSEUDOBINDIR/../../var/pseudo
fi
BITBAKE=`which bitbake`
export PATH=$OLDPATH
if [ $no_build == "0" ]
then
    PSEUDOBINDIR=`cat $BUILDDIR/pseudodone`
    PSEUDO_BINDIR=$PSEUDOBINDIR PSEUDO_LIBDIR=$PSEUDOBINDIR/../lib/pseudo/lib PSEUDO_PREFIX=$PSEUDOBINDIR/../../ PSEUDO_DISABLED=1 $PSEUDOBINDIR/pseudo $BITBAKE $@
else
    $BITBAKE $@
fi
ret=$?
exit $ret