Game Development Reference
In-Depth Information
include files (that is, the header files bundled with the toolchain itself). You do not wish to use the
toolchain's headers, but instead use the headers provided by the Android source, as you will be linking
against Android's system libraries as well.
That takes care of the compilation step, but you also need to link against the device system libraries,
which is the purpose of the next script.
An Android Linker Script
Listing 1-3 shows the Android linker helper script, called ald .
Listing 1-3. Linker Helper Script (ald)
#!/bin/bash
#############################################
# Android Linker helper script
# Set these values to match your system
#############################################
HOME=/home/user
JAVA_HOME=/usr/lib/jvm/java-6-sun
# System image location
SYS_ROOT=$HOME/tmp/android/system
# Toolchain location
TOOLCHAIN_ROOT=$HOME/Desktop/android/arm-2008q3
# Android Toolchain libgcc.a
LIBGCC=${SYS_DEV}/prebuilt/darwin-x86/toolchain/arm-eabi-4.2.1/lib/gcc/ «
arm-eabi/4.2.1/libgcc.a
# CodeSourcery libgcc.a
#LIBGCC=${TOOLCHAIN_ROOT}/lib/gcc/arm-none-linux-gnueabi/4.3.2/libgcc.a
# Linker libraries: C runtime, Math, and extra symbols
LIBRARIES="-lc -lm ${LIBGCC}"
# Library locations
LIB_PATHS="-rpath /system/lib \
-rpath ${SYS_ROOT}/lib \
-L${SYS_ROOT}/lib \
-L${JAVA_HOME}/jre/lib/i386 -L."
# Linker flags
LD_FLAGS="--dynamic-linker=/system/bin/linker -nostdlib"
#############################################
# Linker command
#############################################
Search WWH ::




Custom Search