Comment 1 for bug 715126

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

This is what we have managed so far to complete with a student with a bit older version of HIPL:

1 Download arm-linux tools-chain:
download from http://www.handhelds.org/download/projects/toolchain/arm-linux-gcc-3.4.1.tar.bz2
unzip tar to / directory.
export PATH=$PATH:/usr/local/arm/3.4.1/bin

2 build openssl:
download openssl source code from http://www.openssl.org/source/
./config no-asm shared
Change the Makefile
replace the section started from line 62 with the following:

CC= arm-linux-gcc
CFLAG= -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DOPENSSL_N -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
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-ar $(ARFLAGS) r
RANLIB= arm-linux-ranlib
NM= arm-linux-nm
PERL= /usr/bin/perl
TAR= tar
TARFLAGS= --no-recursion
MAKEDEPPROG= gcc
LIBDIR=lib

and then make it!
make install

3 download Android SDK and NDK
http://developer.android.com/sdk/index.html
http://developer.android.com/sdk/ndk/index.html
unzip ndk into sdk directory.
export ANDROID_ROOT=XXX/android-sdk-linux_86/android-ndk-r3
export PATH=$PATH:XXX/android-sdk-linux_86/android-ndk-r3/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin

copy openssl headers from openssl-1.0.0a/include/openssl directory to $ANDROID_ROOT/build/platforms/android-3/arch-arm/usr/include/ directory
copy libcrypto.so and libcrypto.a libraries to $ANDROID_ROOT/build/platforms/android-3/arch-arm/usr/lib/ directory

4 build HIPL
product configure by run command
autoreconf --install

method 1: use arm-eabi-gcc provided by NDK:
./configure -host=arm-eabi CC=arm-eabi-gcc CPPFLAGS=”-I$ANDROID_ROOT/build/platforms/android-3/arch-arm/usr/include/” CFLAGS=”-nostdlib” LDFLAGS=”-Wl,-rpath-link=$ANDROID_ROOT/build/platforms/android-3/arch-arm/usr/lib/ -L$ANDROID_ROOT/build/platforms/android-3/arch-arm/usr/lib/” LIBS=”-lc “
method 2 (WORKS): use arm-linux-gcc which is a general crosscompile tool:
./configure --disable-gcc-warn --disable-firewall -host=arm-linux CC=arm-linux-gcc CPPFLAGS="-I$OPENSSL/include/" CFLAGS="-nostdlib" LDFLAGS="-Wl,-rpath-link=$ANDROID_ROOT/build/platforms/android-3/arch-arm/usr/lib,-L$ANDROID_ROOT/build/platforms/android-3/arch-arm/usr/lib/" LIBS="-lc"

If you get this far, there are some compilation issues for you to solve:

In file included from ./lib/modularization/lmod.h:37,
                 from lib/core/state.h:37,
                 from lib/core/builder.h:43,
                 from lib/core/builder.c:98:
./lib/core/linkedlist.h:64: warning: declaration of 'index' shadows a global declaration
/home/mkomu/usr/local/arm/3.4.1/bin/../lib/gcc/arm-linux/3.4.1/../../../../arm-linux/sys-include/string.h:267: warning: shadowed declaration is here
./lib/core/linkedlist.h:67: warning: declaration of 'index' shadows a global declaration
/home/mkomu/usr/local/arm/3.4.1/bin/../lib/gcc/arm-linux/3.4.1/../../../../arm-linux/sys-include/string.h:267: warning: shadowed declaration is here
./lib/core/linkedlist.h:70: warning: declaration of 'index' shadows a global declaration
/home/mkomu/usr/local/arm/3.4.1/bin/../lib/gcc/arm-linux/3.4.1/../../../../arm-linux/sys-include/string.h:267: warning: shadowed declaration is here
In file included from lib/core/builder.c:98:
lib/core/builder.h:191: warning: declaration of 'index' shadows a global declaration
/home/mkomu/usr/local/arm/3.4.1/bin/../lib/gcc/arm-linux/3.4.1/../../../../arm-linux/sys-include/string.h:267: warning: shadowed declaration is here
make[1]: *** [lib/core/builder.lo] Error 1

Feel free to suggest any smarter way to do this. I have offered this topic to a new student, but I am still waiting a confirmation from him if he will pick up the topic.