简体   繁体   中英

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 - eg 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

问题中列出的环境编译得很好。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM