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