1# Default values used by several dev-scripts. 2# 3 4# Current list of platform levels we support 5# 6# Note: levels 6 and 7 are omitted since they have the same native 7# APIs as level 5. Same for levels 10, 11 and 12 8# 9API_LEVELS="3 4 5 8 9 14" 10 11# Default ABIs for the target prebuilt binaries. 12PREBUILT_ABIS="armeabi armeabi-v7a x86 mips" 13 14# Location of the STLport sources, relative to the NDK root directory 15STLPORT_SUBDIR=sources/cxx-stl/stlport 16 17# Location of the GAbi++ sources, relative to the NDK root directory 18GABIXX_SUBDIR=sources/cxx-stl/gabi++ 19 20# Location of the GNU libstdc++ headers and libraries, relative to the NDK 21# root directory. 22GNUSTL_SUBDIR=sources/cxx-stl/gnu-libstdc++ 23 24# The date to use when downloading toolchain sources from AOSP servers 25# Leave it empty for tip of tree. 26TOOLCHAIN_GIT_DATE=now 27 28# The space-separated list of all GCC versions we support in this NDK 29DEFAULT_GCC_VERSION_LIST="4.6 4.4.3" 30 31# The default GCC version for this NDK, i.e. the first item in 32# $DEFAULT_GCC_VERSION_LIST 33# 34DEFAULT_GCC_VERSION=$(echo "$DEFAULT_GCC_VERSION_LIST" | tr ' ' '\n' | head -n 1) 35 36DEFAULT_BINUTILS_VERSION=2.21 37DEFAULT_GDB_VERSION=7.3.x 38DEFAULT_MPFR_VERSION=2.4.1 39DEFAULT_GMP_VERSION=5.0.5 40DEFAULT_MPC_VERSION=0.8.1 41 42# Default platform to build target binaries against. 43DEFAULT_PLATFORM=android-9 44 45# The list of default CPU architectures we support 46DEFAULT_ARCHS="arm x86 mips" 47 48# Default toolchain names and prefix 49# 50# This is used by get_default_toolchain_name_for_arch and get_default_toolchain_prefix_for_arch 51# defined below 52DEFAULT_ARCH_TOOLCHAIN_NAME_arm=arm-linux-androideabi 53DEFAULT_ARCH_TOOLCHAIN_PREFIX_arm=arm-linux-androideabi 54 55DEFAULT_ARCH_TOOLCHAIN_NAME_x86=x86 56DEFAULT_ARCH_TOOLCHAIN_PREFIX_x86=i686-linux-android 57 58DEFAULT_ARCH_TOOLCHAIN_NAME_mips=mipsel-linux-android 59DEFAULT_ARCH_TOOLCHAIN_PREFIX_mips=mipsel-linux-android 60 61# The space-separated list of all LLVM versions we support in NDK 62DEFAULT_LLVM_VERSION_LIST="3.1" 63 64# The default URL to download the LLVM tar archive 65DEFAULT_LLVM_URL="http://llvm.org/releases" 66 67# The list of default host NDK systems we support 68DEFAULT_SYSTEMS="linux-x86 windows darwin-x86" 69 70# Return default NDK ABI for a given architecture name 71# $1: Architecture name 72# Out: ABI name 73get_default_abi_for_arch () 74{ 75 local RET 76 case $1 in 77 arm) 78 RET="armeabi" 79 ;; 80 x86) 81 RET="x86" 82 ;; 83 mips) 84 RET="mips" 85 ;; 86 *) 87 2> echo "ERROR: Unsupported architecture name: $1, use one of: arm x86 mips" 88 exit 1 89 ;; 90 esac 91 echo "$RET" 92} 93 94 95# Retrieve the list of default ABIs supported by a given architecture 96# $1: Architecture name 97# Out: space-separated list of ABI names 98get_default_abis_for_arch () 99{ 100 local RET 101 case $1 in 102 arm) 103 RET="armeabi armeabi-v7a" 104 ;; 105 x86) 106 RET="x86" 107 ;; 108 mips) 109 RET="mips" 110 ;; 111 *) 112 2> echo "ERROR: Unsupported architecture name: $1, use one of: arm x86 mips" 113 exit 1 114 ;; 115 esac 116 echo "$RET" 117} 118 119# Return toolchain name for given architecture and GCC version 120# $1: Architecture name (e.g. 'arm') 121# $2: optional, GCC version (e.g. '4.6') 122# Out: default arch-specific toolchain name (e.g. 'arm-linux-androideabi-$GCC_VERSION') 123# Return empty for unknown arch 124get_toolchain_name_for_arch () 125{ 126 if [ ! -z "$2" ] ; then 127 eval echo \"\${DEFAULT_ARCH_TOOLCHAIN_NAME_$1}-$2\" 128 else 129 eval echo \"\${DEFAULT_ARCH_TOOLCHAIN_NAME_$1}\" 130 fi 131} 132 133# Return the default toolchain name for a given architecture 134# $1: Architecture name (e.g. 'arm') 135# Out: default arch-specific toolchain name (e.g. 'arm-linux-androideabi-$DEFAULT_GCC_VERSION') 136# Return empty for unknown arch 137get_default_toolchain_name_for_arch () 138{ 139 eval echo \"\${DEFAULT_ARCH_TOOLCHAIN_NAME_$1}-$DEFAULT_GCC_VERSION\" 140} 141 142# Return the default toolchain program prefix for a given architecture 143# $1: Architecture name 144# Out: default arch-specific toolchain prefix (e.g. arm-linux-androideabi) 145# Return empty for unknown arch 146get_default_toolchain_prefix_for_arch () 147{ 148 eval echo "\$DEFAULT_ARCH_TOOLCHAIN_PREFIX_$1" 149} 150 151# Get the list of all toolchain names for a given architecture 152# $1: architecture (e.g. 'arm') 153# Out: list of toolchain names for this arch (e.g. arm-linux-androideabi-4.6 arm-linux-androideabi-4.4.3) 154# Return empty for unknown arch 155get_toolchain_name_list_for_arch () 156{ 157 local PREFIX VERSION RET 158 PREFIX=$(eval echo \"\$DEFAULT_ARCH_TOOLCHAIN_NAME_$1\") 159 if [ -z "$PREFIX" ]; then 160 return 0 161 fi 162 RET="" 163 for VERSION in $DEFAULT_GCC_VERSION_LIST; do 164 RET=$RET" $PREFIX-$VERSION" 165 done 166 RET=${RET## } 167 echo "$RET" 168} 169 170# Return the binutils version to be used by default when 171# building a given version of GCC. This is needed to ensure 172# we use binutils-2.19 when building gcc-4.4.3 for ARM and x86, 173# and binutils-2.21 in other cases (mips, or gcc-4.6). 174# 175# Note that technically, we could use 2.21 for all versions of 176# GCC, however, in NDK r7, we did build GCC 4.4.3 with binutils-2.20.1 177# and this resulted in weird C++ debugging bugs. For NDK r7b and higher, 178# binutils was reverted to 2.19, to ensure at least 179# feature/bug compatibility. 180# 181# $1: toolchain with version numer (e.g. 'arm-linux-androideabi-4.6') 182# 183get_default_binutils_version_for_gcc () 184{ 185 case $1 in 186 arm-*-4.4.3|x86-4.4.3|x86-*-4.4.3) echo "2.19";; 187 *) echo "$DEFAULT_BINUTILS_VERSION";; 188 esac 189} 190