diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bitbake | 125 |
1 files changed, 0 insertions, 125 deletions
diff --git a/scripts/bitbake b/scripts/bitbake deleted file mode 100755 index dde61c405b..0000000000 --- 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 | |||
7 | export BBFETCH2=True | ||
8 | export 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 | ||
12 | NO_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) | ||
16 | PASSTHROUGH_OPTS="-D -DD -DDD -DDDD -v" | ||
17 | |||
18 | needpseudo="1" | ||
19 | for opt in $@; do | ||
20 | for key in $NO_BUILD_OPTS; do | ||
21 | if [ $opt = $key ] | ||
22 | then | ||
23 | needpseudo="0" | ||
24 | break | ||
25 | fi | ||
26 | done | ||
27 | [ $needpseudo = "0" ] && break | ||
28 | done | ||
29 | |||
30 | if [ ! -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 | ||
36 | elif [ -z "$BUILDDIR" ] ; then | ||
37 | BUILDDIR="`pwd`" | ||
38 | fi | ||
39 | |||
40 | buildpseudo="1" | ||
41 | if [ $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 | ||
64 | fi | ||
65 | |||
66 | |||
67 | if [ $needpseudo = "0" ]; then | ||
68 | buildpseudo="0" | ||
69 | fi | ||
70 | |||
71 | # If pseudo-native is an argument, assume the user wants to build pseudo-native! | ||
72 | if [ $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 | ||
79 | fi | ||
80 | |||
81 | OLDPATH=$PATH | ||
82 | export PATH=`echo $PATH | sed s#[^:]*/scripts:##g` | ||
83 | if [ $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 | ||
114 | fi | ||
115 | BITBAKE=`which bitbake` | ||
116 | export PATH=$OLDPATH | ||
117 | if [ $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 $@ | ||
120 | else | ||
121 | export PSEUDO_BUILD=0 | ||
122 | $BITBAKE $@ | ||
123 | fi | ||
124 | ret=$? | ||
125 | exit $ret | ||