From e47e8a25120be53fd55d808210344aaea32c0a25 Mon Sep 17 00:00:00 2001 From: Robert Rowe Date: Mon, 8 Jul 2013 21:16:16 -0700 Subject: Fix the androideabi toolchain not matching host The included method of determining the host platform in the androideabi would not match to windows if RUBY_PLATFORM returned mingw, wince, or emx. As an added pre-caution, using a case statement with regexp matching will better determine the host platform since it won't be case sensitive and for windows is set to match more specifially than just "win". --- tasks/toolchains/androideabi.rake | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tasks/toolchains/androideabi.rake b/tasks/toolchains/androideabi.rake index a69fd1a9d..51897667e 100644 --- a/tasks/toolchains/androideabi.rake +++ b/tasks/toolchains/androideabi.rake @@ -41,20 +41,21 @@ MRuby::Toolchain.new(:androideabi) do |conf| end if ANDROID_STANDALONE_TOOLCHAIN == nil then - if RUBY_PLATFORM.include?('darwin') then + case RUBY_PLATFORM + when /cygwin|mswin|mingw|bccwin|wince|emx/i + HOST_PLATFORM = 'windows' + when /darwin/i HOST_PLATFORM = 'darwin-x86' - elsif RUBY_PLATFORM.include?('linux') then + when /linux/i HOST_PLATFORM = 'linux-x86' - elsif RUBY_PLATFORM.include?('win') then - HOST_PLATFORM = 'windows' else - # Unknown host platform. + # Unknown host platform end ANDROID_TARGET_PLATFORM = ENV['ANDROID_TARGET_PLATFORM'] || DEFAULT_ANDROID_TARGET_PLATFORM path_to_toolchain = ANDROID_NDK_HOME + '/toolchains/' - path_to_sysroot = ANDROID_NDK_HOME + '/platforms/' + ANDROID_TARGET_PLATFORM + path_to_sysroot = ANDROID_NDK_HOME + '/platforms/' + ANDROID_TARGET_PLATFORM if ANDROID_TOOLCHAIN.downcase == 'gcc' then case ANDROID_TARGET_ARCH.downcase when 'arch-arm', 'arm' then -- cgit v1.2.3