Permalink
Browse files

Android: Allow to build with x86_64 toolchain (r8e)

  • Loading branch information...
1 parent f40c878 commit 10f8d9b2a40a017c00d6c593b21c49b0fa9a009c @lexis-t lexis-t committed Mar 22, 2013
Showing with 23 additions and 14 deletions.
  1. +23 −14 platform/android/build/androidcommon.rb
@@ -38,11 +38,13 @@
if RUBY_PLATFORM =~ /(win|w)32$/
$bat_ext = ".bat"
$exe_ext = ".exe"
- $ndkhost = "windows"
+ $ndkhostvariants = []
+ $ndkhostvariants << 'windows-x86_64' if `wmic OS get OSArchitecture`.split[1] == '64-bit'
+ $ndkhostvariants << 'windows'
else
$bat_ext = ""
$exe_ext = ""
- $ndkhost = `uname -s`.downcase!.chomp! + "-x86"
+ $ndkhostvariants = [`uname -s`.downcase!.chomp! + "-" + `uname -m`.chomp!, `uname -s`.downcase!.chomp! + '-x86']
end
def num_cpus
@@ -69,28 +71,35 @@ def get_objects(sources, objdir)
sources.map { |src| File.join(objdir, File.basename(src) + ".o") }
end
-def setup_ndk(ndkpath,apilevel)
- puts "setup_ndk(#{ndkpath}, #{apilevel})" if USE_TRACES
-
+def detect_toolchain(ndkpath)
$ndktools = nil
$ndkabi = "unknown"
$ndkgccver = "unknown"
- ["arm-linux-androideabi-4.4.3", "arm-eabi-4.4.0", "arm-eabi-4.2.1"].each do |abi|
+ ["arm-linux-androideabi-4.6", "arm-linux-androideabi-4.4.3", "arm-eabi-4.4.0", "arm-eabi-4.2.1"].each do |abi|
variants = []
- variants << File.join(ndkpath, "toolchains", abi, "prebuilt", $ndkhost)
- variants << File.join(ndkpath, "build/prebuilt", $ndkhost, abi)
- variants.each do |variant|
- next unless File.directory? variant
- $ndktools = variant
- $ndkabi = abi.gsub(/^(.*)-([^-]*)$/, '\1')
- $ndkgccver = abi.gsub(/^(.*)-([^-]*)$/, '\2')
- break
+ $ndkhostvariants.each do |ndkhost|
+ variants << File.join(ndkpath,'build','prebuilt',ndkhost,abi)
+ variants << File.join(ndkpath,'toolchains',abi,'prebuilt',ndkhost)
+ variants.each do |variant|
+ puts "Check toolchain path: #{variant}" if USE_TRACES
+ next unless File.directory? variant
+ $ndktools = variant
+ $ndkabi = abi.gsub(/^(.*)-([^-]*)$/, '\1')
+ $ndkgccver = abi.gsub(/^(.*)-([^-]*)$/, '\2')
+ return
+ end
end
break unless $ndktools.nil?
end
if $ndktools.nil?
raise "Can't detect NDK toolchain path (corrupted NDK installation?)"
end
+end
+
+def setup_ndk(ndkpath,apilevel)
+ puts "setup_ndk(#{ndkpath}, #{apilevel})" if USE_TRACES
+
+ detect_toolchain ndkpath
variants = []
variants << "platforms"

0 comments on commit 10f8d9b

Please sign in to comment.