diff options
| author | ruki <[email protected]> | 2015-06-12 12:30:56 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-06-12 12:30:56 +0800 |
| commit | 99b9eb72c8db9854311fc0b5a79e07f8cae85242 (patch) | |
| tree | 837868dffc057d9a987ac4dc0592d98b015563c2 /xmake/scripts/platform/android | |
| parent | 1678ef146c122b8a38a4485262f43b816230aa0f (diff) | |
modify platform and probe toolchains
Diffstat (limited to 'xmake/scripts/platform/android')
| -rw-r--r-- | xmake/scripts/platform/android/android.lua | 2 | ||||
| -rw-r--r-- | xmake/scripts/platform/android/prober.lua | 40 |
2 files changed, 32 insertions, 10 deletions
diff --git a/xmake/scripts/platform/android/android.lua b/xmake/scripts/platform/android/android.lua index 629f07886..4774b79b5 100644 --- a/xmake/scripts/platform/android/android.lua +++ b/xmake/scripts/platform/android/android.lua @@ -43,7 +43,7 @@ function android.make(configs) -- init the toolchains configs.tools = {} - configs.tools.make = "make" + configs.tools.make = config.get("make") configs.tools.ccache = config.get("__ccache") configs.tools.cc = config.get("cc") configs.tools.cxx = config.get("cxx") diff --git a/xmake/scripts/platform/android/prober.lua b/xmake/scripts/platform/android/prober.lua index 37cd18877..45f4c23ea 100644 --- a/xmake/scripts/platform/android/prober.lua +++ b/xmake/scripts/platform/android/prober.lua @@ -55,11 +55,11 @@ end function prober._probe_ndk_sdkver(configs) -- ok? - local ndk_sdkver = config.get("ndk_sdkver") + local ndk_sdkver = configs.get("ndk_sdkver") if ndk_sdkver then return true end -- get the ndk - local ndk = config.get("ndk") + local ndk = configs.get("ndk") if ndk then -- match all sdk directories @@ -95,6 +95,26 @@ function prober._probe_ndk_sdkver(configs) return true end +-- probe the make +function prober._probe_make(configs) + + -- ok? + local make = configs.get("make") + if make then return true end + + -- probe the make path + make = tools.probe("make", {"/usr/bin", "/usr/local/bin", "/opt/bin", "/opt/local/bin"}) + + -- probe ok? update it + if make then configs.set("make", make) end + + -- trace + utils.verbose("checking for the make ... %s", utils.ifelse(make, make, "no")) + + -- ok + return true +end + -- probe the ccache function prober._probe_ccache(configs) @@ -133,23 +153,23 @@ function prober._probe_toolpath(configs, kind, cross, name, description) assert(kind) -- get the cross - cross = config.get("cross") or cross + cross = configs.get("cross") or cross -- attempt to get it from the given cross toolchains local toolpath = nil - local toolchains = config.get("toolchains") + local toolchains = configs.get("toolchains") if toolchains then - toolpath = tools.probe(cross .. (config.get(kind) or name), toolchains) + toolpath = tools.probe(cross .. (configs.get(kind) or name), toolchains) end -- attempt to get it directly from the configure if not toolpath then - toolpath = config.get(kind) + toolpath = configs.get(kind) end -- attempt to get it from the ndk if not toolpath then - local ndk = config.get("ndk") + local ndk = configs.get("ndk") if ndk then -- match all toolchains @@ -174,7 +194,7 @@ function prober._probe_toolpath(configs, kind, cross, name, description) return true end --- probe the compiler +-- probe the toolchains function prober._probe_toolchains(configs) -- done @@ -192,6 +212,7 @@ function prober.config() -- call all probe functions utils.call( { prober._probe_arch + , prober._probe_make , prober._probe_ccache , prober._probe_ndk_sdkver , prober._probe_toolchains} @@ -204,7 +225,8 @@ end function prober.global() -- call all probe functions - utils.call( { prober._probe_ccache + utils.call( { prober._probe_make + , prober._probe_ccache , prober._probe_ndk_sdkver} , nil , global) |
