Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,739,856 Members 45,463 Now Online
XDA Developers Android and Mobile Development Forum

How to build busybox from sources?

Tip us?
 
stari4ek
Old
#1  
stari4ek's Avatar
Member - OP
Thanks Meter 2
Posts: 61
Join Date: Sep 2009
Location: Minsk
Default How to build busybox from sources?

I'm trying to build busybox from sources.
I use last NDK as toolchain.

I started building it from original sources checked out from official busybox's git. Some small fixes with includes/declarations and stuff. Didn't finish fixing these problems.
And found out that cyanogenmod already has it with fixes I made for my build, but wrapped in __BIONIC__ define.

I decided to build it from cyanogenmod git (http://github.com/cyanogen/android_external_busybox) cause it looks like it already solved all that small build problems.

But I can't invoke make properly.
It has Android.mk, If I invoke usual
Code:
Select Code
make ARCH=arm CROSS_COMPILE="arm-eabi-" CFLAGS="-I/home/astar/android/android-ndk-r4/build/platforms/android-8/arch-arm/usr/include"
it doesn't use Android.mk makefile and fails with those small problems.
But if I invoke it with -f Android.mk It fails with error
Code:
Select Code
$ make ARCH=arm CROSS_COMPILE="arm-eabi-" CFLAGS="-I/home/astar/android/android-ndk-r4/build/platforms/android-8/arch-arm/usr/include" -f Android.mk
cat: /busybox-full.sources: No such file or directory
make: *** CC=cc: No such file or directory.  Stop.
cat: /busybox-full.links: No such file or directory
cat: /busybox-minimal.sources: No such file or directory
make: *** CC=cc: No such file or directory.  Stop.
looking inside Android.mk i think, that it fails with setting LOCAL_PATH. Setting it manually inside Android.mk doesn't help.

Can anyone point me to proper guide/howto?
How do You build busybox?
 
Brut.all
Old
#2  
Recognized Developer
Thanks Meter 332
Posts: 1,467
Join Date: Jul 2009
I have really little knowledge about building parts of Android system, but I think that you can't build it using makefile directly. When you are building Android system, then building process begins with some initialization, macros are defined, etc. and then makefiles of subprojects are called. This is why you get errors - you run makefile of busybox directly, but building process isn't initialized properly.

On the other hand NDK does this initialization when you are building native application, but you don't use NDK properly. NDK apps aren't build using regular make command.
G+ | apktool | Ingress broot mod | Brut Google Maps (dead)

If you like me you can buy me a droidburger!
 
kevin@TeslaCoil
Old
#3  
kevin@TeslaCoil's Avatar
Senior Member
Thanks Meter 4813
Posts: 498
Join Date: May 2010
Location: Chicago
There's three build systems for android:
SDK - Java
NDK - C/C++
android-sources - unixy stuff
You might need the android-sources rather than NDK to build busybox. To do that you'll need to download the sources then source the build/envsetup.sh then run "mm" in the directory that has your Android.mk

I have some instructions here (for dropbear, not busybox, but should be similar):
http://teslacoilsw.com/dropbear
Check the Building section.
 
stari4ek
Old
#4  
stari4ek's Avatar
Member - OP
Thanks Meter 2
Posts: 61
Join Date: Sep 2009
Location: Minsk
Quote:
Originally Posted by kevin@TeslaCoil View Post
I have some instructions here (for dropbear, not busybox, but should be similar):
http://teslacoilsw.com/dropbear
Check the Building section.
Thank you very much. It is the magic I was looking for (crap, I spent 10 hours trying to find out how to do it):
Code:
Select Code
export TOP=/path/to/android-sources
source "$TOP/build/envsetup.sh"
mm
I managed to build AOSP with java 1.6. Check this patch if you're interested in.
I tried to build cm's busybox with AOSP but it fails (I expected that). Currently I'm getting cm sources. Hope that it'll be ok.

Do you know if I have to build whole tree before external utils (=busybox)? Cause when I tried to do it before aosp build it failed with make dependencies.
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes