Guest User

android configure sh

a guest
Feb 24th, 2015
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.09 KB | None | 0 0
  1. #!/bin/sh                                                                        
  2.  
  3. if [ "x$1" = "x" ]; then
  4.     echo "Usage: $0 prefix"
  5.     exit 1;
  6. fi
  7.  
  8. if [ ! -d $1 ]; then
  9.    echo "$1 is not a directory"
  10.    exit 1;
  11. fi
  12.  
  13. # This is just an empty directory where I want the built objects to be installed  
  14. export PREFIX=$1
  15.  
  16. export CROSS_COMPILE=arm-linux-androideabi
  17. # I chose the gcc-4.7 toolchain - works fine for me!                              
  18. export ANDROID_PREFIX=${ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
  19.  
  20. # Apparently android-8 works fine, there are other versions, look them up        
  21. export SYSROOT=${ANDROID_NDK_ROOT}/platforms/android-21/arch-arm
  22.  
  23. export CROSS_PATH=${ANDROID_PREFIX}/bin/${CROSS_COMPILE}
  24.  
  25. # Non-exhaustive lists of compiler + binutils                                    
  26. # Depending on what you compile, you might need more binutils than that          
  27. export CPP=${CROSS_PATH}-cpp
  28. export AR=${CROSS_PATH}-ar
  29. export AS=${CROSS_PATH}-as
  30. export NM=${CROSS_PATH}-nm
  31. export CC=${CROSS_PATH}-gcc
  32. export CXX=${CROSS_PATH}-g++
  33. export LD=${CROSS_PATH}-ld
  34. export RANLIB=${CROSS_PATH}-ranlib
  35.  
  36. # Don't mix up .pc files from your host and build target                          
  37. export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
  38.  
  39. # You can clone the full Android sources to get bionic if you want.. I didn't    
  40. # want to so I just got linker.h from here: http://gitorious.org/0xdroid/bionic  
  41. # Note that this was only required to build boehm-gc with dynamic linking support.                                                                                
  42. export CFLAGS="${CFLAGS} --sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${ANDROID_PREFIX}/include -I${DEV_PREFIX}/android/bionic"
  43. export CPPFLAGS="${CFLAGS}"
  44. export LDFLAGS="${LDFLAGS} -L${SYSROOT}/usr/lib -L${ANDROID_PREFIX}/lib"
  45.  
  46. echo "./configure --host=${CROSS_COMPILE} --with-sysroot=${SYSROOT} --prefix=${PREFIX}" # \"$@\""                                                                
  47. ./configure --host=${CROSS_COMPILE} --with-sysroot=${SYSROOT} --prefix=${PREFIX} # "$@"
Advertisement
Add Comment
Please, Sign In to add comment