Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated source build to build from NDK

new script to download/untar NDK
udpated agcc/env from aaron
adjustments to build scripts as needed

Change-Id: I60183aa99bf20c0d24b706ee6fda318f2da23d8f
Reviewed-on: http://review.couchbase.org/9621
Reviewed-by: Marty Schoch <marty.schoch@gmail.com>
Reviewed-by: Dale Harvey <daleharvey@arandomurl.com>
Tested-by: Dale Harvey <daleharvey@arandomurl.com>
  • Loading branch information...
commit 843d427d586426e11d7299b97d1b9ac95a9f8f98 1 parent 71164ad
@mschoch mschoch authored Dale Harvey committed
View
3  .gitignore
@@ -1,4 +1,5 @@
build/deps/android/
+build/deps/android-ndk/android-ndk-r6b/
build/deps/geocouch/
build/deps/couchdb/
build/deps/curl-7.20.0.tar.bz2
@@ -8,4 +9,4 @@ build/deps/mozilla-current/mozilla-central-bb9089ae2322/
build/deps/ndk/android-ndk-r4c/
build/deps/otp/
build/deps/otp_rel/
-out/
+out/
View
2  build.all
@@ -2,7 +2,7 @@
# Builds all components but does not finalize the release
#
-for i in android curl resetmz nspr js otp couch
+for i in ndk resetmz nspr js erlang couch geocouch
do
echo "Now building $i"
./build.$i >& build.log.$i
View
4 build.couch
@@ -18,9 +18,6 @@ cd $COUCH_HOME
# Fixes for Android by matt.adams@radicaldynamic.com
./bootstrap
-ANDROID_SDK=$ANDROID_SDK_ROOT
-ANDROID_NDK=$COUCH_ANDROID_HOME/build/deps/ndk/android-ndk-r4c
-
ERL_LIBS=$ERL_HOME/lib \
ERL=$ERL_HOME/bootstrap/bin/erl \
ERLC=$ERL_HOME/bootstrap/bin/erlc \
@@ -29,7 +26,6 @@ CC=agcc \
./configure \
--host=arm-eabi \
--prefix=/data/data/%app_name%/couchdb \
---with-android=$ANDROID_SDK \
--with-erlang=$COUCH_ANDROID_HOME/build/deps/otp_rel/usr/include \
--with-js-include=$COUCH_ANDROID_HOME/build/deps/mozilla-current/mozilla-central/js/src/dist/include \
--with-js-lib="$COUCH_ANDROID_HOME/build/deps/mozilla-current/mozilla-central/js/src"
View
2  build.erlang
@@ -5,7 +5,7 @@ source scripts/env
cd $ERL_HOME
-SKIP=("appmon" "asn1" "common_test" "cosEvent" "cosEventDomain" "cosFileTransfer" "cosNotification" "cosProperty" "cosTime" "cosTransactions" "wx" "debugger" "ssh" "test_server" "toolbar" "odbc" "orber" "reltool" "observer" "dialyzer" "docbuilder" "edoc" "et" "gs" "hipe" "runtime_tools" "percept" "pman" "inviso" "tv" "typer" "webtool" "jinterface" "megaco" "mnesia")
+SKIP=("appmon" "asn1" "common_test" "cosEvent" "cosEventDomain" "cosFileTransfer" "cosNotification" "cosProperty" "cosTime" "cosTransactions" "wx" "debugger" "ssh" "test_server" "toolbar" "odbc" "orber" "reltool" "observer" "dialyzer" "docbuilder" "edoc" "et" "gs" "hipe" "runtime_tools" "percept" "pman" "inviso" "tv" "typer" "webtool" "jinterface" "megaco" "mnesia" "erl_interface" "diameter" "pcre")
for item in ${SKIP[*]}
do
View
16 build.ndk
@@ -0,0 +1,16 @@
+#!/bin/bash -x
+#
+
+source scripts/env
+
+cd $COUCH_ANDROID_HOME/build/deps/android-ndk
+
+NDK=android-ndk-r6b-linux-x86
+
+[[ -f $NDK.tar.bz2 ]] || wget http://dl.google.com/android/ndk/$NDK.tar.bz2
+
+tar -jxf $NDK.tar.bz2
+
+TARSTATUS=$?
+
+exit $TARSTATUS
View
BIN  build/deps/android-ndk/android-ndk-r6b-linux-x86.tar.bz2
Binary file not shown
View
45 scripts/agcc
@@ -32,37 +32,17 @@ use strict;
# Dance around to find the actual android toolchain path (it's very
# deep, so links on $PATH are going to be common.
-my $GCC = `which arm-eabi-gcc`;
+my $GCC = `which arm-linux-androideabi-gcc`;
$GCC = qx(cd `dirname $GCC`; /bin/pwd);
chomp $GCC;
-die "bad arm-eabi-gcc path" if $GCC !~ /(.*)\/prebuilt\//;
+die "bad arm-linux-androideabi-gcc path" if $GCC !~ /(.*)\/toolchains\//;
my $DROID = $1;
-
-my $ALIB = "$DROID/out/target/product/generic/obj/lib";
-my $TOOLCHAIN = "$DROID/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0";
-
-print STDERR "ALIB ........ $ALIB\n";
-print STDERR "TOOLCHAIN ... $TOOLCHAIN\n";
+my $PLATFORM="android-8";
+my $ALIB = "$DROID/platforms/$PLATFORM/arch-arm/usr/lib";
+my $TOOLCHAIN = "$DROID/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1";
my @include_paths = (
- "-I$DROID/system/core/include",
- "-I$DROID/hardware/libhardware/include",
- "-I$DROID/hardware/ril/include",
- "-I$DROID/dalvik/libnativehelper/include",
- "-I$DROID/frameworks/base/include",
- "-I$DROID/external/skia/include",
- "-I$DROID/out/target/product/generic/obj/include",
- "-I$DROID/bionic/libc/arch-arm/include",
- "-I$DROID/bionic/libc/include",
- "-I$DROID/bionic/libstdc++/include",
- "-I$DROID/bionic/libc/kernel/common",
- "-I$DROID/bionic/libc/kernel/arch-arm",
- "-I$DROID/bionic/libm/include",
- "-I$DROID/bionic/libm/include/arch/arm",
- "-I$DROID/bionic/libthread_db/include",
- "-I$DROID/bionic/libm/arm",
- "-I$DROID/bionic/libm",
- "-I$DROID/out/target/product/generic/obj/SHARED_LIBRARIES/libm_intermediates");
+ "-I$DROID/platforms/$PLATFORM/arch-arm/usr/include");
my @preprocess_args = (
"-D__ARM_ARCH_5__",
@@ -72,7 +52,6 @@ my @preprocess_args = (
"-DANDROID",
"-DSK_RELEASE",
"-DNDEBUG",
- "-include", "$DROID/system/core/include/arch/linux-arm/AndroidConfig.h",
"-UDEBUG");
my @warn_args = (
@@ -108,7 +87,7 @@ my @optimize_args = (
my @link_args = (
"-Bdynamic",
- "-Wl,-T,$DROID/build/core/armelf.x",
+ "-Wl,-T,$GCC/../arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.x",
"-Wl,-dynamic-linker,/system/bin/linker",
"-Wl,--gc-sections",
"-Wl,-z,nocopyreloc",
@@ -118,14 +97,14 @@ my @link_args = (
"-nostdlib",
"$ALIB/crtend_android.o",
"$ALIB/crtbegin_dynamic.o",
- "$TOOLCHAIN/lib/gcc/arm-eabi/4.4.0/interwork/libgcc.a",
+ "$GCC/../lib/gcc/arm-linux-androideabi/4.4.3/armv7-a/libgcc.a",
"-lc",
"-lm");
-
+
# Also need: -Wl,-soname,libXXXX.so
my @shared_args = (
"-nostdlib",
- "-Wl,-T,$DROID/build/core/armelf.xsc",
+ "-Wl,-T,$GCC/../arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xsc",
"-Wl,--gc-sections",
"-Wl,-shared,-Bsymbolic",
"-L$ALIB",
@@ -133,7 +112,7 @@ my @shared_args = (
"-lc",
"-lm",
"-Wl,--no-undefined",
- "$TOOLCHAIN/lib/gcc/arm-eabi/4.4.0/interwork/libgcc.a",
+ "$GCC/../lib/gcc/arm-linux-androideabi/4.4.3/armv7-a/libgcc.a",
"-Wl,--whole-archive"); # .a, .o input files go *after* here
# Now implement a quick parser for a gcc-like command line
@@ -178,7 +157,7 @@ if($mode eq "-shared") { $need_shlink = 1; }
if($have_src and $mode ne "-E") { $need_cpp = $need_compile = 1; }
# Assemble the command:
-my @cmd = ("arm-eabi-gcc");
+my @cmd = ("arm-linux-androideabi-gcc");
if($mode ne "DEFAULT") { @cmd = (@cmd, $mode); }
if(defined $out) { @cmd = (@cmd, "-o", $out); }
if($need_cpp) { @cmd = (@cmd, @include_paths, @preprocess_args); }
View
5 scripts/env
@@ -1,7 +1,7 @@
# Important paths for Android binaries
export COUCH_ANDROID_HOME=$(pwd)
-export ANDROID_SDK_ROOT=$HOME/lib/android
+export ANDROID_SDK_ROOT=$COUCH_ANDROID_HOME/build/deps/android-ndk/android-ndk-r6b
export ANDROID_TARGET=froyo
export ERL_HOME=$COUCH_ANDROID_HOME/../erlang
@@ -11,7 +11,8 @@ export GEOCOUCH_HOME=$COUCH_ANDROID_HOME/../geocouch
paths="
$(pwd)/scripts
$ANDROID_SDK_ROOT/other/apk
-$ANDROID_SDK_ROOT/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/
+$ANDROID_SDK_ROOT/toolchains/arm-eabi-4.4.0/bin/
+$ANDROID_SDK_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
"
for i in $paths
Please sign in to comment.
Something went wrong with that request. Please try again.