Commit ae926e08 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2988 from crimsonwoods/update_androidndk_rake

Update androidndk.rake to add support 64bit architectures.
parents 5830e2a6 1a59721c
...@@ -53,7 +53,20 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter ...@@ -53,7 +53,20 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter
params.fetch(:toolchain_version) do params.fetch(:toolchain_version) do
test = case toolchain test = case toolchain
when :gcc when :gcc
'arm-linux-androideabi-*' case arch
when /armeabi/
'arm-linux-androideabi-*'
when /arm64/
'aarch64-linux-android-*'
when /mips64/
'mips64el-linux-android-*'
when /mips/
'mipsel-linux-android-*'
when /x86_64/
'x86_64-*'
when /x86/
'x86-*'
end
when :clang when :clang
'llvm-*' 'llvm-*'
end end
...@@ -67,9 +80,12 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter ...@@ -67,9 +80,12 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter
when :clang then 'llvm-' when :clang then 'llvm-'
when :gcc when :gcc
case arch case arch
when /arm/ then 'arm-linux-androideabi-' when /armeabi/ then 'arm-linux-androideabi-'
when /x86/ then 'x86-' when /arm64/ then 'aarch64-linux-android-'
when /mips/ then 'mipsel-linux-android-' when /x86_64/ then 'x86_64-'
when /x86/ then 'x86-'
when /mips64/ then 'mips64el-linux-android-'
when /mips/ then 'mipsel-linux-android-'
end end
end end
home_path.join('toolchains', prefix + toolchain_version.to_s, 'prebuilt', host_platform) home_path.join('toolchains', prefix + toolchain_version.to_s, 'prebuilt', host_platform)
...@@ -77,9 +93,12 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter ...@@ -77,9 +93,12 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter
def sysroot def sysroot
path = case arch path = case arch
when /arm/ then 'arch-arm' when /armeabi/ then 'arch-arm'
when /x86/ then 'arch-x86' when /arm64/ then 'arch-arm64'
when /mips/ then 'arch-mips' when /x86_64/ then 'arch-x86_64'
when /x86/ then 'arch-x86'
when /mips64/ then 'arch-mips64'
when /mips/ then 'arch-mips'
end end
home_path.join('platforms', platform, path).to_s home_path.join('platforms', platform, path).to_s
...@@ -90,9 +109,12 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter ...@@ -90,9 +109,12 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter
if toolchain == :gcc if toolchain == :gcc
command = case arch command = case arch
when /arm/ then 'arm-linux-androideabi-' when /armeabi/ then 'arm-linux-androideabi-'
when /x86/ then 'i686-linux-android-' when /arm64/ then 'aarch64-linux-android-'
when /mips/ then 'mipsel-linux-android-' when /x86_64/ then 'x86_64-linux-android-'
when /x86/ then 'i686-linux-android-'
when /mips64/ then 'mips64el-linux-android-'
when /mips/ then 'mipsel-linux-android-'
end + command end + command
end end
...@@ -111,15 +133,21 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter ...@@ -111,15 +133,21 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter
case toolchain case toolchain
when :gcc when :gcc
flags += %W(-ffunction-sections -funwind-tables -fstack-protector) flags += %W(-ffunction-sections -funwind-tables -no-canonical-prefixes)
flags += %W(-D__android__ -mandroid --sysroot="#{sysroot}") flags += %W(-D__android__ -mandroid --sysroot="#{sysroot}")
case arch case arch
when /arm64/
flags += %W(-fpic -fstack-protector-strong)
when 'armeabi-v7a-hard'
flags += %W(-fpic -fstack-protector-strong -march=armv7-a -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -mfpu=vfpv3-d16)
when 'armeabi-v7a' when 'armeabi-v7a'
flags += %W(-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16) flags += %W(-fpic -fstack-protector-strong -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16)
when /arm/ when /arm/
flags += %W(-march=armv5te -mtune=xscale -msoft-float) flags += %W(-fpic -fstack-protector-strong -march=armv5te -mtune=xscale -msoft-float)
when /mips/ when /mips/
flags += %W(-fpic -fno-strict-aliasing -finline-functions -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers) flags += %W(-fpic -fno-strict-aliasing -finline-functions -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers)
when /x86/
flags += %W(-fstack-protector-strong)
end end
when :clang when :clang
end end
...@@ -132,7 +160,18 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter ...@@ -132,7 +160,18 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter
end end
def ldflags def ldflags
%W(-D__android__ -mandroid --sysroot="#{sysroot}") flags = []
case toolchain
when :gcc
flags += %W(-no-canonical-prefixes)
flags += %W(-D__android__ -mandroid --sysroot="#{sysroot}")
case arch
when 'armeabi-v7a-hard'
flags += %W(-march=armv7-a -Wl,--fix-cortex-a8 -Wl,--no-warn-mismatch -lm_hard)
when 'armeabi-v7a'
flags += %W(-march=armv7-a -Wl,--fix-cortex-a8)
end
end
end end
def ar def ar
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment