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 18" 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# Location of the LLVM libc++ headers and libraries, relative to the NDK 25# root directory. 26LIBCXX_SUBDIR=sources/cxx-stl/llvm-libc++ 27 28# Location of the libportable sources, relative to the NDK root directory 29LIBPORTABLE_SUBDIR=sources/android/libportable 30 31# Location of the compiler-rt sources, relative to the NDK root directory 32COMPILER_RT_SUBDIR=sources/android/compiler-rt 33 34# The date to use when downloading toolchain sources from AOSP servers 35# Leave it empty for tip of tree. 36TOOLCHAIN_GIT_DATE=now 37 38# The space-separated list of all GCC versions we support in this NDK 39DEFAULT_GCC_VERSION_LIST="4.6 4.7 4.8" 40 41# The default GCC version for this NDK, i.e. the first item in 42# $DEFAULT_GCC_VERSION_LIST 43# 44DEFAULT_GCC_VERSION=$(echo "$DEFAULT_GCC_VERSION_LIST" | tr ' ' '\n' | head -n 1) 45 46DEFAULT_BINUTILS_VERSION=2.21 47DEFAULT_GDB_VERSION=7.3.x 48DEFAULT_MPFR_VERSION=3.1.1 49DEFAULT_GMP_VERSION=5.0.5 50DEFAULT_MPC_VERSION=1.0.1 51DEFAULT_CLOOG_VERSION=0.18.0 52DEFAULT_ISL_VERSION=0.11.1 53DEFAULT_PPL_VERSION=1.0 54DEFAULT_PYTHON_VERSION=2.7.5 55DEFAULT_PERL_VERSION=5.16.2 56 57# Default platform to build target binaries against. 58DEFAULT_PLATFORM=android-9 59 60# The list of default CPU architectures we support 61DEFAULT_ARCHS="arm x86 mips" 62 63# Default toolchain names and prefix 64# 65# This is used by get_default_toolchain_name_for_arch and get_default_toolchain_prefix_for_arch 66# defined below 67DEFAULT_ARCH_TOOLCHAIN_NAME_arm=arm-linux-androideabi 68DEFAULT_ARCH_TOOLCHAIN_PREFIX_arm=arm-linux-androideabi 69 70DEFAULT_ARCH_TOOLCHAIN_NAME_x86=x86 71DEFAULT_ARCH_TOOLCHAIN_PREFIX_x86=i686-linux-android 72 73DEFAULT_ARCH_TOOLCHAIN_NAME_x86_64=x86_64 74DEFAULT_ARCH_TOOLCHAIN_PREFIX_x86_64=x86_64-linux-android 75 76DEFAULT_ARCH_TOOLCHAIN_NAME_mips=mipsel-linux-android 77DEFAULT_ARCH_TOOLCHAIN_PREFIX_mips=mipsel-linux-android 78 79# The space-separated list of all LLVM versions we support in NDK 80DEFAULT_LLVM_VERSION_LIST="3.3 3.2" 81 82# The default LLVM version (first item in the list) 83DEFAULT_LLVM_VERSION=$(echo "$DEFAULT_LLVM_VERSION_LIST" | tr ' ' '\n' | head -n 1) 84 85# The default URL to download the LLVM tar archive 86DEFAULT_LLVM_URL="http://llvm.org/releases" 87 88# The list of default host NDK systems we support 89DEFAULT_SYSTEMS="linux-x86 windows darwin-x86" 90 91# The default issue tracker URL 92DEFAULT_ISSUE_TRACKER_URL="http://source.android.com/source/report-bugs.html" 93 94# Return default NDK ABI for a given architecture name 95# $1: Architecture name 96# Out: ABI name 97get_default_abi_for_arch () 98{ 99 local RET 100 case $1 in 101 arm) 102 RET="armeabi" 103 ;; 104 x86|x86_64|mips) 105 RET="$1" 106 ;; 107 *) 108 2> echo "ERROR: Unsupported architecture name: $1, use one of: arm x86 x86_64 mips" 109 exit 1 110 ;; 111 esac 112 echo "$RET" 113} 114 115 116# Retrieve the list of default ABIs supported by a given architecture 117# $1: Architecture name 118# Out: space-separated list of ABI names 119get_default_abis_for_arch () 120{ 121 local RET 122 case $1 in 123 arm) 124 RET="armeabi armeabi-v7a" 125 ;; 126 x86|x86_64|mips) 127 RET="$1" 128 ;; 129 *) 130 2> echo "ERROR: Unsupported architecture name: $1, use one of: arm x86 x86_64 mips" 131 exit 1 132 ;; 133 esac 134 echo "$RET" 135} 136 137# Return toolchain name for given architecture and GCC version 138# $1: Architecture name (e.g. 'arm') 139# $2: optional, GCC version (e.g. '4.6') 140# Out: default arch-specific toolchain name (e.g. 'arm-linux-androideabi-$GCC_VERSION') 141# Return empty for unknown arch 142get_toolchain_name_for_arch () 143{ 144 if [ ! -z "$2" ] ; then 145 eval echo \"\${DEFAULT_ARCH_TOOLCHAIN_NAME_$1}-$2\" 146 else 147 eval echo \"\${DEFAULT_ARCH_TOOLCHAIN_NAME_$1}\" 148 fi 149} 150 151# Return the default toolchain name for a given architecture 152# $1: Architecture name (e.g. 'arm') 153# Out: default arch-specific toolchain name (e.g. 'arm-linux-androideabi-$DEFAULT_GCC_VERSION') 154# Return empty for unknown arch 155get_default_toolchain_name_for_arch () 156{ 157 eval echo \"\${DEFAULT_ARCH_TOOLCHAIN_NAME_$1}-$DEFAULT_GCC_VERSION\" 158} 159 160# Return the default toolchain program prefix for a given architecture 161# $1: Architecture name 162# Out: default arch-specific toolchain prefix (e.g. arm-linux-androideabi) 163# Return empty for unknown arch 164get_default_toolchain_prefix_for_arch () 165{ 166 eval echo "\$DEFAULT_ARCH_TOOLCHAIN_PREFIX_$1" 167} 168 169# Get the list of all toolchain names for a given architecture 170# $1: architecture (e.g. 'arm') 171# Out: list of toolchain names for this arch (e.g. arm-linux-androideabi-4.6 arm-linux-androideabi-4.7) 172# Return empty for unknown arch 173get_toolchain_name_list_for_arch () 174{ 175 local PREFIX VERSION RET 176 PREFIX=$(eval echo \"\$DEFAULT_ARCH_TOOLCHAIN_NAME_$1\") 177 if [ -z "$PREFIX" ]; then 178 return 0 179 fi 180 RET="" 181 for VERSION in $DEFAULT_GCC_VERSION_LIST; do 182 RET=$RET" $PREFIX-$VERSION" 183 done 184 RET=${RET## } 185 echo "$RET" 186} 187 188# Return the binutils version to be used by default when 189# building a given version of GCC. This is needed to ensure 190# we use binutils-2.19 when building gcc-4.4.3 for ARM and x86, 191# and later binutils in other cases (mips, or gcc-4.6+). 192# 193# Note that technically, we could use latest binutils for all versions of 194# GCC, however, in NDK r7, we did build GCC 4.4.3 with binutils-2.20.1 195# and this resulted in weird C++ debugging bugs. For NDK r7b and higher, 196# binutils was reverted to 2.19, to ensure at least 197# feature/bug compatibility. 198# 199# $1: toolchain with version numer (e.g. 'arm-linux-androideabi-4.6') 200# 201get_default_binutils_version_for_gcc () 202{ 203 case $1 in 204 mipsel-*-4.4.3|*-4.6) echo "$DEFAULT_BINUTILS_VERSION";; 205 *-4.4.3) echo "2.19";; 206 x86*-4.7) echo "2.23";; # Use 2.23 to get x32 support in ld.gold 207 *-4.7) echo "2.22";; 208 *) echo "2.23";; 209 esac 210} 211 212# Return the gdb version to be used by default when building a given 213# version of GCC. 214# 215# $1: toolchain with version numer (e.g. 'arm-linux-androideabi-4.6') 216# 217get_default_gdb_version_for_gcc () 218{ 219 case $1 in 220 aarch64-*) echo "7.6";; 221 *) echo "$DEFAULT_GDB_VERSION";; 222 esac 223} 224