summaryrefslogtreecommitdiff
path: root/xmake/scripts/platform/linux
diff options
context:
space:
mode:
authorruki <[email protected]>2015-05-27 09:32:01 +0800
committerruki <[email protected]>2015-05-27 09:32:01 +0800
commit3aab30fc254ae7e9bd138aff2bb263af0d447017 (patch)
treebd9e4c95b0e0be22655238f9d51102ac0f48822f /xmake/scripts/platform/linux
parent80f92040764d0e4d6c89c5f8d82f4a8dc1b54902 (diff)
add prober to all platforms
Diffstat (limited to 'xmake/scripts/platform/linux')
-rw-r--r--xmake/scripts/platform/linux/_linux.lua10
-rw-r--r--xmake/scripts/platform/linux/_prober.lua57
2 files changed, 65 insertions, 2 deletions
diff --git a/xmake/scripts/platform/linux/_linux.lua b/xmake/scripts/platform/linux/_linux.lua
index 4b70986c4..b933d563b 100644
--- a/xmake/scripts/platform/linux/_linux.lua
+++ b/xmake/scripts/platform/linux/_linux.lua
@@ -23,11 +23,17 @@
-- define module: _linux
local _linux = _linux or {}
+-- load modules
+local config = require("base/config")
+
-- init host
-_linux._HOST = "linux"
+_linux._HOST = "linux"
-- init architectures
-_linux._ARCHS = {"x86", "x64"}
+_linux._ARCHS = {"x86", "x64"}
+
+-- init prober
+_linux._PROBER = require("platform/linux/_prober")
-- make configure
function _linux.make(configs)
diff --git a/xmake/scripts/platform/linux/_prober.lua b/xmake/scripts/platform/linux/_prober.lua
new file mode 100644
index 000000000..cbfcc3710
--- /dev/null
+++ b/xmake/scripts/platform/linux/_prober.lua
@@ -0,0 +1,57 @@
+--!The Automatic Cross-platform Build Tool
+--
+-- XMake is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU Lesser General Public License as published by
+-- the Free Software Foundation; either version 2.1 of the License, or
+-- (at your option) any later version.
+--
+-- XMake is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public License
+-- along with XMake;
+-- If not, see <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a>
+--
+-- Copyright (C) 2009 - 2015, ruki All rights reserved.
+--
+-- @author ruki
+-- @file _prober.lua
+--
+
+-- load modules
+local os = require("base/os")
+local path = require("base/path")
+local utils = require("base/utils")
+local string = require("base/string")
+
+-- define module: _prober
+local _prober = _prober or {}
+
+-- probe the architecture
+function _prober._probe_arch(configs)
+
+ -- get the architecture
+ local arch = configs.arch
+
+ -- ok?
+ if arch and arch ~= "auto" then return true end
+
+ -- init the default architecture
+ configs.arch = xmake._ARCH
+
+ -- ok
+ return true
+end
+
+-- probe the configure and update the values with "auto"
+function _prober.done(configs)
+
+ -- probe the architecture
+ if not _prober._probe_arch(configs) then return end
+
+end
+
+-- return module: _prober
+return _prober