<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
I am using this script to set environment variables, in order to
use the Android Arm toolchain:<br>
<br>
export
TOOLCHAIN_ROOT=/home/user/android-ndk/toolchains/arm-linux-androideabi-4.7<br>
export erl_xcomp_sysroot=${TOOLCHAIN_ROOT}/sysroot<br>
export CROSS_COMPILE=arm-linux-androideabi-<br>
export CC=${TOOLCHAIN_ROOT}/bin/${CROSS_COMPILE}gcc<br>
export CXX=${TOOLCHAIN_ROOT}/bin/${CROSS_COMPILE}g++<br>
export SHLIB_LD=${TOOLCHAIN_ROOT}/bin/${CROSS_COMPILE}gcc<br>
export LD=${TOOLCHAIN_ROOT}/bin/${CROSS_COMPILE}ld<br>
export AR=${TOOLCHAIN_ROOT}/bin/${CROSS_COMPILE}ar<br>
export RANLIB=${TOOLCHAIN_ROOT}/bin/${CROSS_COMPILE}ranlib<br>
export CFLAGS=<br>
export LDFLAGS=""<br>
export ERLANDROID_ROOT=`pwd`<br>
export ERL_TOP=`pwd`/otp_src_R15B03<br>
<br>
And then I configure using:<br>
./configure --prefix=/tmp/arm_erlang
--with-ssl=/home/user/openssl/openssl-android-master
--without-java --disable-hipe --without-termcap
--disable-smp-support --host=arm-linux-androideabi
--build=i686-pc-linux-gnu<br>
<br>
Note that I have compiled openssl for Android. If you do not need
it, you can disable openssl by using --without-ssl<br>
<br>
Then I compile using:<br>
<br>
TARGET=arm-linux-androideabi make noboot -j12<br>
TARGET=arm-linux-androideabi ./otp_build release -a
${ERLANDROID_ROOT}/arm_erlang_R15B03_rel<br>
<br>
That gives me a directory arm_erlang_R15B03_rel with the compiled
Erlang/OTP. This directory contains a script Install, which you
should call with appropriate arguments. I call it like this:<br>
./Install -cross -minimal
/data/data/com.ernovation.erlangforandroid/files/erlang<br>
<br>
Anyway, you are right that the cross compiler finds the Android
NDK's lib/include from erl_xcomp_sysroot.<br>
<br>
On 01/25/2013 07:05 PM, Dongsheng Wang wrote:<br>
</div>
<blockquote
cite="mid:4e641416-f21c-4dcb-addf-9cf38a1e6d4e@googlegroups.com"
type="cite">
<div><br>
</div>
hi, Erik,
<div><br>
</div>
<div>I have been trying to cross compile erlang for Android as
well. I am working on a Mac here. Question about the your
configure script:</div>
<div><br>
</div>
<div><a class="moz-txt-link-freetext" href="http://code.google.com/p/erlang4android/downloads/detail?name=otp_src_R15B03.android.tgz&can=2&q=">http://code.google.com/p/erlang4android/downloads/detail?name=otp_src_R15B03.android.tgz&can=2&q=</a><br>
</div>
<div><br>
</div>
<div>How does the cross compiler find the Android NDK's
lib/include? I am guessing it is using </div>
<div><br>
</div>
<div>
<pre style="font-size: 12px; white-space: pre-wrap; max-width: 80em; padding-left: 0.7em; color: rgb(0, 0, 0);">erl_xcomp_sysroot=${TOOLCHAIN_ROOT}/sysroot</pre>
<pre style="font-size: 12px; white-space: pre-wrap; max-width: 80em; padding-left: 0.7em; color: rgb(0, 0, 0);"><span style="font-family: Arial, Helvetica, sans-serif;">
</span></pre>
<pre style="font-size: 12px; white-space: pre-wrap; max-width: 80em; padding-left: 0.7em; color: rgb(0, 0, 0);"><span style="font-family: Arial, Helvetica, sans-serif;">Some now, but could not figure out how. </span>
</pre>
</div>
<div><br>
</div>
<div>ds<br>
</div>
</blockquote>
*Erik.<br>
</body>
</html>