Created
October 4, 2012 20:25
-
-
Save deltheil/3836196 to your computer and use it in GitHub Desktop.
Android NDK basic example: build jsmn C parser w/ the Standalone Toolchain
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Use the tools from the Standalone Toolchain | |
export PATH=/tmp/my-android-toolchain/bin:$PATH | |
export SYSROOT=/tmp/my-android-toolchain/sysroot | |
export CC="arm-linux-androideabi-gcc --sysroot $SYSROOT" | |
export AR=arm-linux-androideabi-ar | |
# 2. Clone the Github mirror | |
git clone git://github.com/noct/jsmn.git; cd jsmn | |
# 3. Build for the ARMv7 ABI | |
# -> this creates libjsmn.a static library | |
make CFLAGS="-march=armv7-a" | |
# 4. Inspect the library architecture specific information | |
arm-linux-androideabi-readelf -A libjsmn.a | |
# File: libjsmn.a(jsmn.o) | |
# Attribute Section: aeabi | |
# File Attributes | |
# Tag_CPU_name: "7-A" | |
# Tag_CPU_arch: v7 | |
# Tag_CPU_arch_profile: Application | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment