Commit 5d2795c0 authored by Felix Jones's avatar Felix Jones

Fixed mips and mips64: GCC Toolchain now points to GCC.

parent 5fd068eb
...@@ -18,7 +18,8 @@ class MRuby::Toolchain::Android ...@@ -18,7 +18,8 @@ class MRuby::Toolchain::Android
ARCHITECTURES = %w{ ARCHITECTURES = %w{
armeabi armeabi-v7a arm64-v8a armeabi armeabi-v7a arm64-v8a
x86 x86_64 x86 x86_64
} # TODO : Add mips mips64 support mips mips64
}
class AndroidNDKHomeNotFound < StandardError class AndroidNDKHomeNotFound < StandardError
def message def message
...@@ -59,26 +60,6 @@ Set ANDROID_PLATFORM environment variable or set :platform parameter ...@@ -59,26 +60,6 @@ Set ANDROID_PLATFORM environment variable or set :platform parameter
when /mips/ then 'mipsel-linux-android-' when /mips/ then 'mipsel-linux-android-'
end + command end + command
prefix = case arch
when /armeabi/ then 'arm-linux-androideabi-'
when /arm64-v8a/ then 'aarch64-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
test = case arch
when /armeabi/ then 'arm-linux-androideabi-*'
when /arm64-v8a/ then 'aarch64-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
gcc_toolchain_version = Dir[home_path.join('toolchains', test)].map{|t| t.match(/-(\d+\.\d+)$/); $1.to_f }.max
gcc_toolchain_path = home_path.join('toolchains', prefix + gcc_toolchain_version.to_s, 'prebuilt', host_platform)
gcc_toolchain_path.join('bin', command).to_s gcc_toolchain_path.join('bin', command).to_s
end end
end end
...@@ -112,6 +93,32 @@ Set ANDROID_PLATFORM environment variable or set :platform parameter ...@@ -112,6 +93,32 @@ Set ANDROID_PLATFORM environment variable or set :platform parameter
end end
end end
def gcc_toolchain_path
if @gcc_toolchain_path === nil then
prefix = case arch
when /armeabi/ then 'arm-linux-androideabi-'
when /arm64-v8a/ then 'aarch64-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
test = case arch
when /armeabi/ then 'arm-linux-androideabi-*'
when /arm64-v8a/ then 'aarch64-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
gcc_toolchain_version = Dir[home_path.join('toolchains', test)].map{|t| t.match(/-(\d+\.\d+)$/); $1.to_f }.max
@gcc_toolchain_path = home_path.join('toolchains', prefix + gcc_toolchain_version.to_s, 'prebuilt', host_platform)
end
@gcc_toolchain_path
end
def host_platform def host_platform
@host_platform ||= case RUBY_PLATFORM @host_platform ||= case RUBY_PLATFORM
when /cygwin|mswin|mingw|bccwin|wince|emx/i when /cygwin|mswin|mingw|bccwin|wince|emx/i
...@@ -199,7 +206,7 @@ Set ANDROID_PLATFORM environment variable or set :platform parameter ...@@ -199,7 +206,7 @@ Set ANDROID_PLATFORM environment variable or set :platform parameter
flags += %W(-D__android__ --sysroot="#{sysroot}") flags += %W(-D__android__ --sysroot="#{sysroot}")
case toolchain case toolchain
when :clang when :clang
flags += %W(-gcc-toolchain "#{toolchain_path.to_s}") flags += %W(-gcc-toolchain "#{gcc_toolchain_path.to_s}")
case arch case arch
when /armeabi-v7a/ then flags += %W(-target armv7-none-linux-androideabi) when /armeabi-v7a/ then flags += %W(-target armv7-none-linux-androideabi)
when /armeabi/ then flags += %W(-target armv5te-none-linux-androideabi) when /armeabi/ then flags += %W(-target armv5te-none-linux-androideabi)
......
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