aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/android-build31
-rwxr-xr-xexamples/zcip.script4
2 files changed, 33 insertions, 2 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 @@
1#!/bin/sh
2# Build Busybox against Android's bionic
3# Originally by Dan Fandrich
4#
5# Configure with android_defconfig
6# This file has been tested on Android Froyo (the lack of ttyname_r in
7# the must be patched around) and Gingerbread.
8
9# Point this to the Android root directory; it's used in the defconfig CFLAGS
10export A="$HOME/android"
11
12# Android product being built
13P=zoom2
14
15# Toolchain version in use by this version of Android
16GCCVER=4.4.3
17
18export PATH="$A/prebuilt/linux-x86/toolchain/arm-eabi-$GCCVER/bin:$PATH"
19
20# Set the linker flags; compiler flags are in the defconfig file
21if grep "^CONFIG_STATIC=y" .config >/dev/null ; then
22 # Static linking
23 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"
24 LDLIBS="m c gcc"
25else
26 # Dynamic linking
27 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"
28 LDLIBS="dl m c gcc"
29fi
30
31make EXTRA_LDFLAGS="$LDFLAGS" LDLIBS="$LDLIBS" "$@"
diff --git a/examples/zcip.script b/examples/zcip.script
index 988e542a4..e543c304e 100755
--- a/examples/zcip.script
+++ b/examples/zcip.script
@@ -20,9 +20,9 @@ config)
20 exit 1 20 exit 1
21 fi 21 fi
22 # remember $ip for $interface, to use on restart 22 # remember $ip for $interface, to use on restart
23 if [ "x$IP" != x -a -w "$IP.$interface" ] 23 if [ "x$ip" != x -a -w "$ip.$interface" ]
24 then 24 then
25 echo $ip > "$IP.$interface" 25 echo $ip > "$ip.$interface"
26 fi 26 fi
27 exec ip address add dev $interface \ 27 exec ip address add dev $interface \
28 scope link local "$ip/16" broadcast + 28 scope link local "$ip/16" broadcast +