Comment 7 for bug 715126

Revision history for this message
Miika Komu (miika-iki) wrote :

New up-to-date instructions for Ubuntu *oneiric*. Did not double check the instructions, I hope they are ok from my history. I don't know if there's some unncessary parts in the instructions.

Please note that there's absolutely no reason install android stuff to "/" - everything should be in your home directory. Also, no need to have root privileges for compilation.

# gcc -6 requires a new Ubuntu
mkomu@bling:~/projects/hipl-bzr/arm$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.10
Release: 11.10
Codename: oneiric

# let's install it, no need to compile in Oneiric
sudo aptitude install gcc-4.6-arm-linux-gnueabi

# Download and SDK and NDK. Set Android root to make paths shorter later.
cd ~
wget http://dl.google.com/android/android-sdk_r16-linux.tgz
tar xvzf android-sdk_r16-linux.tgz
cd android-sdk-linux
wget http://dl.google.com/android/ndk/android-ndk-r7-linux-x86.tar.bz2
tar xvjf android-ndk-r7-linux-x86.tar.bz2
export ANDROID_ROOT=~/android-sdk-linux/android-ndk-r7
source ~/.bashrc

# Download, compile, modify and install OpenSSL to the NDK directory.
cd ~
wget http://www.openssl.org/source/openssl-1.0.0g.tar.gz
tar xvzf openssl-1.0.0g.tar.gz
cd openssl-1.0.0g
./config no-asm shared --prefix=$ANDROID_ROOT/platforms/android-3/arch-arm/usr
edit Makefile:
  CC= arm-linux-gnueabi-gcc-4.6
  CFLAG= -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DOPENSSL_N -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -fPIC
  DEPFLAG= -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_R C5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_STORE
  PEX_LIBS=
  EX_LIBS= -ldl
  EXE_EXT=
  ARFLAGS=
  AR= arm-linux-gnueabi-ar $(ARFLAGS) r
  RANLIB= arm-linux-gnueabi-ranlib
  NM= arm-linux-gnueabi-nm
  PERL= /usr/bin/perl
  TAR= tar
  TARFLAGS= --no-recursion
  MAKEDEPPROG= gcc
  LIBDIR=lib
make install

# Download and cross-compile HIPL.
cd ~
bzr co lp:hipl trunk
cd trunk
edit configure.ac and comment out all AM_CFLAGS
autoreconf --install
./configure --disable-gcc-warn --disable-firewall -host=arm-linux CC=arm-linux-gnueabi-gcc-4.6 CPPFLAGS="-I$ANDROID_ROOT/platforms/android-3/arch-arm/usr/include" CFLAGS="-nostdlib" LDFLAGS="-Wl,-rpath-link=$ANDROID_ROOT/platforms/android-3/arch-arm/usr/lib,-L$ANDROID_ROOT/platforms/android-3/arch-arm/usr/lib" LIBS="-lc"
make
make all-am
make[1]: Entering directory `/home/mkomu/projects/hipl-bzr/arm'
  CC lib/core/builder.lo
In file included from lib/core/debug.h:34:0,
                 from lib/core/crypto.h:43,
                 from lib/core/builder.c:100:
lib/core/protodefs.h:917:5: error: unknown type name 'in_port_t'
lib/core/protodefs.h:929:5: error: unknown type name 'in_port_t'
lib/core/protodefs.h:1027:5: error: unknown type name 'in_port_t'
lib/core/protodefs.h:1036:5: error: unknown type name 'in_port_t'
lib/core/protodefs.h:1043:5: error: unknown type name 'in_port_t'
lib/core/protodefs.h:1054:5: error: unknown type name 'in_port_t'
lib/core/protodefs.h:1055:5: error: unknown type name 'in_port_t'
...
(it appears in_port_t definition is missing from android (?), so it may have to be declared redudantly in some header file)