Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building SDL for ARM using Android standalone toolchain

How can I build libsdl using the Android NDK's standalone toolchain? I can't use the standard ndk-build as I have to integrate with an existing build system.

I know I probably have to put the path and name of the cross-compiler in my PATH and CC environment variables, respectively, but I assume there is a bunch of other things that need to be done - e.g. SSE and 3DNow probably need to be disabled (the target architecture is ARM) etc.

This is what I have so far:

$ HOSTCONF=arm-eabi-linux
$ TOOLCHAIN=$HOME/android/toolchain
$ export ARCH=armv7-a
$ export SYSROOT=$TOOLCHAIN/sysroot
$ export PATH=$PATH:$TOOLCHAIN/bin:$SYSROOT/usr/local/bin
$ export CROSS_COMPILE=arm-linux-androideabi
$ export CC=${CROSS_COMPILE}-gcc
$ export CXX=${CROSS_COMPILE}-g++
$ export CFLAGS="-DANDROID -mandroid -fomit-frame-pointer --sysroot $SYSROOT -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb"
$ export CXXFLAGS=$CFLAGS
$ ./configure --host=$HOSTCONF --build=i686-pc-linux-gnu  --with-sysroot=$SYSROOT --prefix=$SYSROOT/usr/local --disable-joystick
$ make
$ make install
like image 354
Anders Feder Avatar asked Jan 23 '12 14:01

Anders Feder


1 Answers

The environment listed in the question compiles fine.

like image 172
Anders Feder Avatar answered Nov 20 '22 05:11

Anders Feder