aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDaniel Fandrich <dan@coneharvesters.com>2011-07-19 08:10:05 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-07-19 08:10:05 +0200
commit0a428607a05a5a823873a5f013be10ddd26601cc (patch)
tree288b6d253e60b71538d52b00c8d8027b319799b4 /examples
parentf2f9bc59327256baf2cf66bf634560c163c22852 (diff)
downloadbusybox-0a428607a05a5a823873a5f013be10ddd26601cc.tar.gz
add defconfig files for Android, Cygwin and FreeBSD
Also added an example script to show how to compile BusyBox against Android's bionic. Signed-off-by: Daniel Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/android-build31
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/android-build b/examples/android-build
new file mode 100755
index 000000000..f5fe49bda
--- /dev/null
+++ b/examples/android-build
@@ -0,0 +1,31 @@
+#!/bin/sh
+# Build Busybox against Android's bionic
+# Originally by Dan Fandrich
+#
+# Configure with android_defconfig
+# This file has been tested on Android Froyo (the lack of ttyname_r in
+# the must be patched around) and Gingerbread.
+
+# Point this to the Android root directory; it's used in the defconfig CFLAGS
+export A="$HOME/android"
+
+# Android product being built
+P=zoom2
+
+# Toolchain version in use by this version of Android
+GCCVER=4.4.3
+
+export PATH="$A/prebuilt/linux-x86/toolchain/arm-eabi-$GCCVER/bin:$PATH"
+
+# Set the linker flags; compiler flags are in the defconfig file
+if grep "^CONFIG_STATIC=y" .config >/dev/null ; then
+ # Static linking
+ LDFLAGS="-static -Xlinker -z -Xlinker muldefs -nostdlib $A/out/target/product/$P/obj/lib/crtbegin_static.o $A/out/target/product/$P/obj/lib/crtend_android.o -L$A/out/target/product/$P/obj/lib -L$A/out/target/product/$P/obj/STATIC_LIBRARIES/libm_intermediates -L$A/out/target/product/$P/obj/STATIC_LIBRARIES/libc_intermediates"
+ LDLIBS="m c gcc"
+else
+ # Dynamic linking
+ LDFLAGS="-Xlinker -z -Xlinker muldefs -nostdlib -Bdynamic -Xlinker -T$A/build/core/armelf.x -Xlinker -dynamic-linker -Xlinker /system/bin/linker -Xlinker -z -Xlinker nocopyreloc -Xlinker --no-undefined $A/out/target/product/$P/obj/lib/crtbegin_dynamic.o $A/out/target/product/$P/obj/lib/crtend_android.o -L$A/out/target/product/$P/obj/lib"
+ LDLIBS="dl m c gcc"
+fi
+
+make EXTRA_LDFLAGS="$LDFLAGS" LDLIBS="$LDLIBS" "$@"