summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bitbake125
1 files changed, 0 insertions, 125 deletions
diff --git a/scripts/bitbake b/scripts/bitbake
deleted file mode 100755
index dde61c4..0000000
--- a/scripts/bitbake
+++ /dev/null
@@ -1,125 +0,0 @@
1#!/bin/sh
2
3# This is the bitbake wrapper script that ensures everything is set up
4# correctly in the environment, builds pseudo separately if it hasn't
5# already been built, and then runs bitbake within pseudo.
6
7export BBFETCH2=True
8export BB_ENV_EXTRAWHITE="PSEUDO_BUILD PSEUDO_DISABLED $BB_ENV_EXTRAWHITE"
9
10# For certain operations (i.e. that won't be actually running any tasks)
11# we don't need pseudo
12NO_BUILD_OPTS="--version -h --help -p --parse-only -s --show-versions -e --environment -g --graphviz"
13
14# Some options are useful to pass through to the initial pseudo build if
15# that needs to be run (for debugging)
16PASSTHROUGH_OPTS="-D -DD -DDD -DDDD -v"
17
18needpseudo="1"
19for opt in $@; do
20for key in $NO_BUILD_OPTS; do
21 if [ $opt = $key ]
22 then
23 needpseudo="0"
24 break
25 fi
26done
27[ $needpseudo = "0" ] && break
28done
29
30if [ ! -e conf/bblayers.conf ] ; then
31 BDPRINT=""
32 [ -n "$BUILDDIR" ] && BDPRINT=": $BUILDDIR"
33 echo "Unable to find conf/bblayers.conf"
34 echo "BitBake must be run from within your build directory$BDPRINT"
35 exit 1
36elif [ -z "$BUILDDIR" ] ; then
37 BUILDDIR="`pwd`"
38fi
39
40buildpseudo="1"
41if [ $needpseudo = "1" ]; then
42 if [ -e "$BUILDDIR/pseudodone" ]; then
43 PSEUDOBINDIR=`cat $BUILDDIR/pseudodone`
44 else
45 PSEUDOBINDIR=`bitbake -e | grep STAGING_BINDIR_NATIVE=\" | cut -d '=' -f2 | cut -d '"' -f2`
46 fi
47 if [ -e "$PSEUDOBINDIR/pseudo" ]; then
48 buildpseudo="0"
49 fi
50
51 # Verify that the pseudo recipes are older then the pseudodone file
52 PSEUDO_RECIPE="`dirname $0`/../meta/recipes-devtools/pseudo"
53 if [ $buildpseudo -eq 0 ] && [ ! -d "$PSEUDO_RECIPE" ]; then
54 echo "Unable to verify if pseudo-native is up to date..." >&2
55 elif [ $buildpseudo -eq 0 ]; then
56 PSEUDO_NEWER=`find $PSEUDO_RECIPE -type f -newer $BUILDDIR/pseudodone`
57 if [ -n "$PSEUDO_NEWER" ]; then
58 buildpseudo="2"
59 fi
60 fi
61 if [ $buildpseudo = "0" -a ! -e "$BUILDDIR/pseudodone" ] ; then
62 echo $PSEUDOBINDIR > $BUILDDIR/pseudodone
63 fi
64fi
65
66
67if [ $needpseudo = "0" ]; then
68 buildpseudo="0"
69fi
70
71# If pseudo-native is an argument, assume the user wants to build pseudo-native!
72if [ $needpseudo != "0" -a $buildpseudo -eq 0 ]; then
73 for opt in $@; do
74 if [ "$opt" = "pseudo-native" ]; then
75 buildpseudo="3"
76 break
77 fi
78 done
79fi
80
81OLDPATH=$PATH
82export PATH=`echo $PATH | sed s#[^:]*/scripts:##g`
83if [ $buildpseudo -gt 0 ]; then
84 [ $buildpseudo -eq 1 ] && echo "Pseudo is not present but is required, building this first before the main build"
85 [ $buildpseudo -eq 2 ] && echo "Pseudo may be out of date, rebuilding pseudo before the main build"
86 [ $buildpseudo -eq 3 ] && echo "Building pseudo-native before main build"
87 export PSEUDO_BUILD=1
88
89 # Pass through debug options
90 additionalopts=""
91 for opt in $@; do
92 for key in $PASSTHROUGH_OPTS; do
93 if [ $opt = $key ]
94 then
95 additionalopts="$additionalopts $opt"
96 break
97 fi
98 done
99 done
100
101 bitbake pseudo-native $additionalopts -c populate_sysroot
102 ret=$?
103 if [ "$ret" != "0" ]; then
104 exit 1
105 fi
106 PSEUDOBINDIR=`bitbake -e | grep STAGING_BINDIR_NATIVE=\" | cut -d '=' -f2 | cut -d '"' -f2`
107 ret=$?
108 if [ "$ret" != "0" ]; then
109 exit 1
110 fi
111 echo $PSEUDOBINDIR > $BUILDDIR/pseudodone
112 # This needs to exist in case pseudo has to log somewhere
113 mkdir -p $PSEUDOBINDIR/../../var/pseudo
114fi
115BITBAKE=`which bitbake`
116export PATH=$OLDPATH
117if [ $needpseudo = "1" ]; then
118 export PSEUDO_BUILD=2
119 PSEUDO_BINDIR=$PSEUDOBINDIR PSEUDO_LIBDIR=$PSEUDOBINDIR/../lib/pseudo/lib PSEUDO_PREFIX=$PSEUDOBINDIR/../../ PSEUDO_DISABLED=1 $PSEUDOBINDIR/pseudo $BITBAKE $@
120else
121 export PSEUDO_BUILD=0
122 $BITBAKE $@
123fi
124ret=$?
125exit $ret