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