• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 12 13 14 15 16 17 18 19 L"
10
11FIRST_API64_LEVEL=L
12
13# Default ABIs for the target prebuilt binaries.
14PREBUILT_ABIS="armeabi armeabi-v7a x86 mips armeabi-v7a-hard arm64-v8a x86_64 mips64"
15
16# Location of the STLport sources, relative to the NDK root directory
17STLPORT_SUBDIR=sources/cxx-stl/stlport
18
19# Location of the GAbi++ sources, relative to the NDK root directory
20GABIXX_SUBDIR=sources/cxx-stl/gabi++
21
22# Location of the GNU libstdc++ headers and libraries, relative to the NDK
23# root directory.
24GNUSTL_SUBDIR=sources/cxx-stl/gnu-libstdc++
25
26# Location of the LLVM libc++ headers and libraries, relative to the NDK
27# root directory.
28LIBCXX_SUBDIR=sources/cxx-stl/llvm-libc++
29
30# Location of the LLVM libc++abi headers, relative to the NDK # root directory.
31LIBCXXABI_SUBDIR=sources/cxx-stl/llvm-libc++abi/libcxxabi
32
33# Location of the libportable sources, relative to the NDK root directory
34LIBPORTABLE_SUBDIR=sources/android/libportable
35
36# Location of the gccunwind sources, relative to the NDK root directory
37GCCUNWIND_SUBDIR=sources/android/gccunwind
38
39# Location of the compiler-rt sources, relative to the NDK root directory
40COMPILER_RT_SUBDIR=sources/android/compiler-rt
41
42# Location of the support sources for libc++, relative to the NDK root directory
43SUPPORT_SUBDIR=sources/android/support
44
45# The date to use when downloading toolchain sources from AOSP servers
46# Leave it empty for tip of tree.
47TOOLCHAIN_GIT_DATE=now
48
49# The space-separated list of all GCC versions we support in this NDK
50DEFAULT_GCC_VERSION_LIST="4.6 4.8 4.9"
51
52DEFAULT_GCC32_VERSION=4.6
53DEFAULT_GCC64_VERSION=4.9
54DEFAULT_LLVM_GCC32_VERSION=4.8
55DEFAULT_LLVM_GCC64_VERSION=4.9
56
57DEFAULT_BINUTILS_VERSION=2.21
58DEFAULT_GDB_VERSION=7.3.x
59DEFAULT_MPFR_VERSION=3.1.1
60DEFAULT_GMP_VERSION=5.0.5
61DEFAULT_MPC_VERSION=1.0.1
62DEFAULT_CLOOG_VERSION=0.18.0
63DEFAULT_ISL_VERSION=0.11.1
64DEFAULT_PPL_VERSION=1.0
65DEFAULT_PYTHON_VERSION=2.7.5
66DEFAULT_PERL_VERSION=5.16.2
67
68RECENT_BINUTILS_VERSION=2.24
69
70# Default platform to build target binaries against.
71DEFAULT_PLATFORM=android-9
72
73# The list of default CPU architectures we support
74DEFAULT_ARCHS="arm x86 mips arm64 x86_64 mips64"
75
76# Default toolchain names and prefix
77#
78# This is used by get_default_toolchain_name_for_arch and get_default_toolchain_prefix_for_arch
79# defined below
80DEFAULT_ARCH_TOOLCHAIN_NAME_arm=arm-linux-androideabi
81DEFAULT_ARCH_TOOLCHAIN_PREFIX_arm=arm-linux-androideabi
82
83DEFAULT_ARCH_TOOLCHAIN_NAME_arm64=aarch64-linux-android
84DEFAULT_ARCH_TOOLCHAIN_PREFIX_arm64=aarch64-linux-android
85
86DEFAULT_ARCH_TOOLCHAIN_NAME_x86=x86
87DEFAULT_ARCH_TOOLCHAIN_PREFIX_x86=i686-linux-android
88
89DEFAULT_ARCH_TOOLCHAIN_NAME_x86_64=x86_64
90DEFAULT_ARCH_TOOLCHAIN_PREFIX_x86_64=x86_64-linux-android
91
92DEFAULT_ARCH_TOOLCHAIN_NAME_mips=mipsel-linux-android
93DEFAULT_ARCH_TOOLCHAIN_PREFIX_mips=mipsel-linux-android
94
95DEFAULT_ARCH_TOOLCHAIN_NAME_mips64=mips64el-linux-android
96DEFAULT_ARCH_TOOLCHAIN_PREFIX_mips64=mips64el-linux-android
97
98# The space-separated list of all LLVM versions we support in NDK
99DEFAULT_LLVM_VERSION_LIST="3.4 3.3"
100
101# The default LLVM version (first item in the list)
102DEFAULT_LLVM_VERSION=$(echo "$DEFAULT_LLVM_VERSION_LIST" | tr ' ' '\n' | head -n 1)
103
104# The default URL to download the LLVM tar archive
105DEFAULT_LLVM_URL="http://llvm.org/releases"
106
107# The list of default host NDK systems we support
108DEFAULT_SYSTEMS="linux-x86 windows darwin-x86"
109
110# The default issue tracker URL
111DEFAULT_ISSUE_TRACKER_URL="http://source.android.com/source/report-bugs.html"
112
113# Return the default gcc version for a given architecture
114# $1: Architecture name (e.g. 'arm')
115# Out: default arch-specific gcc version
116get_default_gcc_version_for_arch ()
117{
118    case $1 in
119       *64) echo $DEFAULT_GCC64_VERSION ;;
120       *) echo $DEFAULT_GCC32_VERSION ;;
121    esac
122}
123
124# Return default NDK ABI for a given architecture name
125# $1: Architecture name
126# Out: ABI name
127get_default_abi_for_arch ()
128{
129    local RET
130    case $1 in
131        arm)
132            RET="armeabi"
133            ;;
134        arm64)
135            RET="arm64-v8a"
136            ;;
137        x86|x86_64|mips|mips64)
138            RET="$1"
139            ;;
140        *)
141            2> echo "ERROR: Unsupported architecture name: $1, use one of: arm arm64 x86 x86_64 mips mips64"
142            exit 1
143            ;;
144    esac
145    echo "$RET"
146}
147
148
149# Retrieve the list of default ABIs supported by a given architecture
150# $1: Architecture name
151# Out: space-separated list of ABI names
152get_default_abis_for_arch ()
153{
154    local RET
155    case $1 in
156        arm)
157            RET="armeabi armeabi-v7a armeabi-v7a-hard"
158            ;;
159        arm64)
160            RET="arm64-v8a"
161            ;;
162        x86|x86_64|mips|mips64)
163            RET="$1"
164            ;;
165        *)
166            2> echo "ERROR: Unsupported architecture name: $1, use one of: arm arm64 x86 x86_64 mips mips64"
167            exit 1
168            ;;
169    esac
170    echo "$RET"
171}
172
173# Return toolchain name for given architecture and GCC version
174# $1: Architecture name (e.g. 'arm')
175# $2: optional, GCC version (e.g. '4.6')
176# Out: default arch-specific toolchain name (e.g. 'arm-linux-androideabi-$GCC_VERSION')
177# Return empty for unknown arch
178get_toolchain_name_for_arch ()
179{
180    if [ ! -z "$2" ] ; then
181        eval echo \"\${DEFAULT_ARCH_TOOLCHAIN_NAME_$1}-$2\"
182    else
183        eval echo \"\${DEFAULT_ARCH_TOOLCHAIN_NAME_$1}\"
184    fi
185}
186
187# Return the default toolchain name for a given architecture
188# $1: Architecture name (e.g. 'arm')
189# Out: default arch-specific toolchain name (e.g. 'arm-linux-androideabi-$GCCVER')
190# Return empty for unknown arch
191get_default_toolchain_name_for_arch ()
192{
193    local GCCVER=$(get_default_gcc_version_for_arch $1)
194    eval echo \"\${DEFAULT_ARCH_TOOLCHAIN_NAME_$1}-$GCCVER\"
195}
196
197# Return the default toolchain program prefix for a given architecture
198# $1: Architecture name
199# Out: default arch-specific toolchain prefix (e.g. arm-linux-androideabi)
200# Return empty for unknown arch
201get_default_toolchain_prefix_for_arch ()
202{
203    eval echo "\$DEFAULT_ARCH_TOOLCHAIN_PREFIX_$1"
204}
205
206# Get the list of all toolchain names for a given architecture
207# $1: architecture (e.g. 'arm')
208# Out: list of toolchain names for this arch (e.g. arm-linux-androideabi-4.6 arm-linux-androideabi-4.8)
209# Return empty for unknown arch
210get_toolchain_name_list_for_arch ()
211{
212    local PREFIX VERSION RET ADD DEFAULT_GCC_VERSION
213    PREFIX=$(eval echo \"\$DEFAULT_ARCH_TOOLCHAIN_NAME_$1\")
214    if [ -z "$PREFIX" ]; then
215        return 0
216    fi
217    RET=""
218    DEFAULT_GCC_VERSION=$(get_default_gcc_version_for_arch $1)
219    ADD=""
220    for VERSION in $DEFAULT_GCC_VERSION_LIST; do
221        if [ -z "$ADD" -a "$VERSION" = "$DEFAULT_GCC_VERSION" ]; then
222            ADD="yes"
223        fi
224        if [ -z "$ADD" ]; then
225            continue
226        fi
227        RET=$RET" $PREFIX-$VERSION"
228    done
229    RET=${RET## }
230    echo "$RET"
231}
232
233# Return the binutils version to be used by default when
234# building a given version of GCC. This is needed to ensure
235# we use binutils-2.19 when building gcc-4.4.3 for ARM and x86,
236# and later binutils in other cases (mips, or gcc-4.6+).
237#
238# Note that technically, we could use latest binutils for all versions of
239# GCC, however, in NDK r7, we did build GCC 4.4.3 with binutils-2.20.1
240# and this resulted in weird C++ debugging bugs. For NDK r7b and higher,
241# binutils was reverted to 2.19, to ensure at least
242# feature/bug compatibility.
243#
244# $1: toolchain with version numer (e.g. 'arm-linux-androideabi-4.6')
245#
246get_default_binutils_version_for_gcc ()
247{
248    case $1 in
249        mipsel-*-4.4.3|*-4.6) echo "$DEFAULT_BINUTILS_VERSION";;
250        *-4.4.3) echo "2.19";;
251        x86*-4.7) echo "2.23";;  # Use 2.23 to get x32 support in ld.gold
252        *-4.7) echo "2.22";;
253        *) echo "2.24";;
254    esac
255}
256
257# Return the binutils version to be used by default when
258# building a given version of llvm. For llvm-3.4 or later,
259# we use binutils-2.23 to ensure the LLVMgold.so could be
260# built properly. For llvm-3.3, we use binutils-2.21 as default.
261#
262# $1: toolchain with version numer (e.g. 'llvm-3.3')
263#
264get_default_binutils_version_for_llvm ()
265{
266    case $1 in
267        *-3.3|*-3.2) echo "2.21";;
268        *-3.4) echo "2.23";;
269        *) echo "2.23";;
270    esac
271}
272
273# Return the gdb version to be used by default when building a given
274# version of GCC.
275#
276# $1: toolchain with version numer (e.g. 'arm-linux-androideabi-4.6')
277#
278get_default_gdb_version_for_gcc ()
279{
280    case $1 in
281        mips*) echo "7.7";;
282        x86*|aarch64-*|*-4.8|*-4.8l|*-4.9|*-4.9l) echo "7.6";;
283        *) echo "$DEFAULT_GDB_VERSION";;
284    esac
285}
286
287# Return the gdbserver version to be used by default when building a given
288# version of GCC.
289#
290# $1: toolchain with version numer (e.g. 'arm-linux-androideabi-4.6')
291#
292get_default_gdbserver_version_for_gcc ()
293{
294    case $1 in
295        mips*) echo "7.7";;
296        *) echo "7.6";;
297    esac
298}
299