summaryrefslogtreecommitdiff
path: root/xmake/scripts
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
parent80f92040764d0e4d6c89c5f8d82f4a8dc1b54902 (diff)
add prober to all platforms
Diffstat (limited to 'xmake/scripts')
-rw-r--r--xmake/scripts/base/config.lua7
-rw-r--r--xmake/scripts/base/main.lua2
-rw-r--r--xmake/scripts/platform/android/_android.lua10
-rw-r--r--xmake/scripts/platform/android/_prober.lua57
-rw-r--r--xmake/scripts/platform/iphoneos/_iphoneos.lua (renamed from xmake/scripts/platform/ios/_ios.lua)31
-rw-r--r--xmake/scripts/platform/iphoneos/_prober.lua143
-rw-r--r--xmake/scripts/platform/iphonesimulator/_iphonesimulator.lua93
-rw-r--r--xmake/scripts/platform/iphonesimulator/_prober.lua (renamed from xmake/scripts/platform/ios/_prober.lua)26
-rw-r--r--xmake/scripts/platform/linux/_linux.lua10
-rw-r--r--xmake/scripts/platform/linux/_prober.lua57
-rw-r--r--xmake/scripts/platform/macosx/_macosx.lua1
-rw-r--r--xmake/scripts/platform/macosx/_prober.lua26
-rw-r--r--xmake/scripts/platform/windows/_prober.lua57
-rw-r--r--xmake/scripts/platform/windows/_windows.lua10
14 files changed, 501 insertions, 29 deletions
diff --git a/xmake/scripts/base/config.lua b/xmake/scripts/base/config.lua
index e6b4dbfdd..bf201db4b 100644
--- a/xmake/scripts/base/config.lua
+++ b/xmake/scripts/base/config.lua
@@ -291,11 +291,16 @@ function config.loadxconf()
-- save configs
config._CONFIGS = newenv._CONFIGS
- -- clear configs if the host environment has been changed
+ -- clear configs if the host has been changed
local target = config._target()
if target and target.host ~= xmake._HOST then
config._CONFIGS = {}
end
+
+ -- clear configs if the plat has been changed
+ if target and target.plat and options.plat and target.plat ~= options.plat then
+ config._CONFIGS = {}
+ end
end
-- the target name
diff --git a/xmake/scripts/base/main.lua b/xmake/scripts/base/main.lua
index 7d448fc57..7418a625a 100644
--- a/xmake/scripts/base/main.lua
+++ b/xmake/scripts/base/main.lua
@@ -155,7 +155,7 @@ local menu =
end
return descriptions
end }
- , {'a', "arch", "kv", xmake._ARCH, "Compile for the given architecture."
+ , {'a', "arch", "kv", "auto", "Compile for the given architecture."
, function ()
local descriptions = {}
local plats = platform.plats()
diff --git a/xmake/scripts/platform/android/_android.lua b/xmake/scripts/platform/android/_android.lua
index 9de364e77..a7e8806df 100644
--- a/xmake/scripts/platform/android/_android.lua
+++ b/xmake/scripts/platform/android/_android.lua
@@ -23,11 +23,17 @@
-- define module: _android
local _android = _android or {}
+-- load modules
+local config = require("base/config")
+
-- init host
-_android._HOST = xmake._HOST
+_android._HOST = xmake._HOST
-- init architectures
-_android._ARCHS = {"armv5te", "armv6", "armv7-a"}
+_android._ARCHS = {"armv5te", "armv6", "armv7-a"}
+
+-- init prober
+_android._PROBER = require("platform/android/_prober")
-- make configure
function _android.make(configs)
diff --git a/xmake/scripts/platform/android/_prober.lua b/xmake/scripts/platform/android/_prober.lua
new file mode 100644
index 000000000..a1f68de8a
--- /dev/null
+++ b/xmake/scripts/platform/android/_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 = "armv7-a"
+
+ -- 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
diff --git a/xmake/scripts/platform/ios/_ios.lua b/xmake/scripts/platform/iphoneos/_iphoneos.lua
index eee1f6587..5d7d679e8 100644
--- a/xmake/scripts/platform/ios/_ios.lua
+++ b/xmake/scripts/platform/iphoneos/_iphoneos.lua
@@ -17,26 +17,26 @@
-- Copyright (C) 2009 - 2015, ruki All rights reserved.
--
-- @author ruki
--- @file _ios.lua
+-- @file _iphoneos.lua
--
--- define module: _ios
-local _ios = _ios or {}
+-- define module: _iphoneos
+local _iphoneos = _iphoneos or {}
-- load modules
-local config = require("base/config")
+local config = require("base/config")
-- init host
-_ios._HOST = "macosx"
+_iphoneos._HOST = "macosx"
-- init architectures
-_ios._ARCHS = {"armv7", "armv7s", "arm64"}
+_iphoneos._ARCHS = {"armv7", "armv7s", "arm64"}
-- init prober
-_ios._PROBER = require("platform/ios/_prober")
+_iphoneos._PROBER = require("platform/iphoneos/_prober")
-- make configure
-function _ios.make(configs)
+function _iphoneos.make(configs)
-- init the file name formats
configs.formats = {}
@@ -50,10 +50,10 @@ function _ios.make(configs)
end
-- get the option menu for action: xmake config or global
-function _ios.menu(action)
+function _iphoneos.menu(action)
-- init config option menu
- _ios._MENU_CONFIG = _ios._MENU_CONFIG or
+ _iphoneos._MENU_CONFIG = _iphoneos._MENU_CONFIG or
{ {}
, {nil, "mm", "kv", nil, "The Objc Compiler" }
, {nil, "mx", "kv", nil, "The Objc/c++ Compiler" }
@@ -71,10 +71,9 @@ function _ios.menu(action)
, }
-- init global option menu
- _ios._MENU_GLOBAL = _ios._MENU_GLOBAL or
+ _iphoneos._MENU_GLOBAL = _iphoneos._MENU_GLOBAL or
{ {}
, {nil, "xcode_dir", "kv", "auto", "The Xcode Application Directory" }
- , {nil, "xcode_sdkver", "kv", "auto", "The SDK Version for Xcode" }
, {}
, {nil, "mobileprovision","kv", "auto", "The Provisioning Profile File" }
, {nil, "codesign", "kv", "auto", "The Code Signing Indentity" }
@@ -83,12 +82,12 @@ function _ios.menu(action)
-- get the option menu
if action == "config" then
- return _ios._MENU_CONFIG
+ return _iphoneos._MENU_CONFIG
elseif action == "global" then
- return _ios._MENU_GLOBAL
+ return _iphoneos._MENU_GLOBAL
end
end
--- return module: _ios
-return _ios
+-- return module: _iphoneos
+return _iphoneos
diff --git a/xmake/scripts/platform/iphoneos/_prober.lua b/xmake/scripts/platform/iphoneos/_prober.lua
new file mode 100644
index 000000000..52b0e5df4
--- /dev/null
+++ b/xmake/scripts/platform/iphoneos/_prober.lua
@@ -0,0 +1,143 @@
+--!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 = "armv7"
+
+ -- ok
+ return true
+end
+
+-- probe the xcode application directory
+function _prober._probe_xcode(configs)
+
+ -- get the xcode directory
+ local xcode_dir = configs.xcode_dir
+
+ -- ok?
+ if xcode_dir and xcode_dir ~= "auto" then return true end
+
+ -- clear it first
+ xcode_dir = nil
+
+ -- attempt to get the default directory
+ if not xcode_dir then
+ if os.isdir("/Applications/Xcode.app") then
+ xcode_dir = "/Applications/Xcode.app"
+ end
+ end
+
+ -- attempt to match the other directories
+ if not xcode_dir then
+ local dirs = os.match("/Applications/Xcode*.app", true)
+ if dirs and table.getn(dirs) ~= 0 then
+ xcode_dir = dirs[1]
+ end
+ end
+
+ -- probe ok? update it
+ if xcode_dir then
+ configs.xcode_dir = xcode_dir
+ else
+ -- failed
+ utils.error("The Xcode directory is unknown now, please config it first!")
+ utils.error(" - xmake config --xcode_dir=xxx")
+ utils.error("or - xmake global --xcode_dir=xxx")
+ return false
+ end
+
+ -- ok
+ return true
+end
+
+-- probe the xcode sdk version
+function _prober._probe_xcode_sdkver(configs)
+
+ -- get the xcode sdk version
+ local xcode_sdkver = configs.xcode_sdkver
+
+ -- ok?
+ if xcode_sdkver and xcode_sdkver ~= "auto" then return true end
+
+ -- clear it first
+ xcode_sdkver = nil
+
+ -- attempt to match the directory
+ if not xcode_sdkver then
+ local dirs = os.match(configs.xcode_dir .. "/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk", true)
+ if dirs then
+ for _, dir in ipairs(dirs) do
+ xcode_sdkver = string.match(dir, "%d+%.%d+")
+ if xcode_sdkver then break end
+ end
+ end
+ end
+
+ -- probe ok? update it
+ if xcode_sdkver then
+ configs.xcode_sdkver = xcode_sdkver
+ else
+ -- failed
+ utils.error("The Xcode SDK version is unknown now, please config it first!")
+ utils.error(" - xmake config --xcode_sdkver=xxx")
+ utils.error("or - xmake global --xcode_sdkver=xxx")
+ return false
+ end
+
+ -- 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
+
+ -- probe the xcode application directory
+ if not _prober._probe_xcode(configs) then return end
+
+ -- probe the xcode sdk version
+ if not _prober._probe_xcode_sdkver(configs) then return end
+
+end
+
+-- return module: _prober
+return _prober
diff --git a/xmake/scripts/platform/iphonesimulator/_iphonesimulator.lua b/xmake/scripts/platform/iphonesimulator/_iphonesimulator.lua
new file mode 100644
index 000000000..5df326fd0
--- /dev/null
+++ b/xmake/scripts/platform/iphonesimulator/_iphonesimulator.lua
@@ -0,0 +1,93 @@
+--!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 _iphonesimulator.lua
+--
+
+-- define module: _iphonesimulator
+local _iphonesimulator = _iphonesimulator or {}
+
+-- load modules
+local config = require("base/config")
+
+-- init host
+_iphonesimulator._HOST = "macosx"
+
+-- init architectures
+_iphonesimulator._ARCHS = {"x86", "x64"}
+
+-- init prober
+_iphonesimulator._PROBER = require("platform/iphonesimulator/_prober")
+
+-- make configure
+function _iphonesimulator.make(configs)
+
+ -- init the file name formats
+ configs.formats = {}
+ configs.formats.static = {"lib", ".a"}
+ configs.formats.object = {"", ".o"}
+ configs.formats.shared = {"", ".dylib"}
+
+ -- init xcode sdk directory
+ configs.xcode_sdkdir = config.get("xcode_dir") .. "/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" .. config.get("xcode_sdkver") .. ".sdk"
+
+end
+
+-- get the option menu for action: xmake config or global
+function _iphonesimulator.menu(action)
+
+ -- init config option menu
+ _iphonesimulator._MENU_CONFIG = _iphonesimulator._MENU_CONFIG or
+ { {}
+ , {nil, "mm", "kv", nil, "The Objc Compiler" }
+ , {nil, "mx", "kv", nil, "The Objc/c++ Compiler" }
+ , {nil, "mxx", "kv", nil, "The Objc++ Compiler" }
+ , {nil, "mflags", "kv", nil, "The Objc Compiler Flags" }
+ , {nil, "mxflags", "kv", nil, "The Objc/c++ Compiler Flags" }
+ , {nil, "mxxflags", "kv", nil, "The Objc++ Compiler Flags" }
+ , {}
+ , {nil, "xcode_dir", "kv", "auto", "The Xcode Application Directory" }
+ , {nil, "xcode_sdkver", "kv", "auto", "The SDK Version for Xcode" }
+ , {}
+ , {nil, "mobileprovision","kv", "auto", "The Provisioning Profile File" }
+ , {nil, "codesign", "kv", "auto", "The Code Signing Indentity" }
+ , {nil, "entitlements", "kv", "auto", "The Code Signing Entitlements" }
+ , }
+
+ -- init global option menu
+ _iphonesimulator._MENU_GLOBAL = _iphonesimulator._MENU_GLOBAL or
+ { {}
+ , {nil, "xcode_dir", "kv", "auto", "The Xcode Application Directory" }
+ , {}
+ , {nil, "mobileprovision","kv", "auto", "The Provisioning Profile File" }
+ , {nil, "codesign", "kv", "auto", "The Code Signing Indentity" }
+ , {nil, "entitlements", "kv", "auto", "The Code Signing Entitlements" }
+ , }
+
+ -- get the option menu
+ if action == "config" then
+ return _iphonesimulator._MENU_CONFIG
+ elseif action == "global" then
+ return _iphonesimulator._MENU_GLOBAL
+ end
+end
+
+
+-- return module: _iphonesimulator
+return _iphonesimulator
diff --git a/xmake/scripts/platform/ios/_prober.lua b/xmake/scripts/platform/iphonesimulator/_prober.lua
index 2209c14b9..c11d78a03 100644
--- a/xmake/scripts/platform/ios/_prober.lua
+++ b/xmake/scripts/platform/iphonesimulator/_prober.lua
@@ -29,6 +29,22 @@ 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 = "x86"
+
+ -- ok
+ return true
+end
+
-- probe the xcode application directory
function _prober._probe_xcode(configs)
@@ -86,8 +102,11 @@ function _prober._probe_xcode_sdkver(configs)
-- attempt to match the directory
if not xcode_sdkver then
local dirs = os.match(configs.xcode_dir .. "/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk", true)
- if dirs and table.getn(dirs) ~= 0 then
- xcode_sdkver = string.match(dirs[1], "%d+%.%d+")
+ if dirs then
+ for _, dir in ipairs(dirs) do
+ xcode_sdkver = string.match(dir, "%d+%.%d+")
+ if xcode_sdkver then break end
+ end
end
end
@@ -109,6 +128,9 @@ 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
+
-- probe the xcode application directory
if not _prober._probe_xcode(configs) then return end
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
diff --git a/xmake/scripts/platform/macosx/_macosx.lua b/xmake/scripts/platform/macosx/_macosx.lua
index e19e5d5ea..67110058f 100644
--- a/xmake/scripts/platform/macosx/_macosx.lua
+++ b/xmake/scripts/platform/macosx/_macosx.lua
@@ -69,7 +69,6 @@ function _macosx.menu(action)
_macosx._MENU_GLOBAL = _macosx._MENU_GLOBAL or
{ {}
, {nil, "xcode_dir", "kv", "auto", "The Xcode Application Directory" }
- , {nil, "xcode_sdkver", "kv", "auto", "The SDK Version for Xcode" }
, }
-- get the option menu
diff --git a/xmake/scripts/platform/macosx/_prober.lua b/xmake/scripts/platform/macosx/_prober.lua
index 8b12894de..4cb2ef1e3 100644
--- a/xmake/scripts/platform/macosx/_prober.lua
+++ b/xmake/scripts/platform/macosx/_prober.lua
@@ -29,6 +29,22 @@ 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 xcode application directory
function _prober._probe_xcode(configs)
@@ -86,8 +102,11 @@ function _prober._probe_xcode_sdkver(configs)
-- attempt to match the directory
if not xcode_sdkver then
local dirs = os.match(configs.xcode_dir .. "/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX*.sdk", true)
- if dirs and table.getn(dirs) ~= 0 then
- xcode_sdkver = string.match(dirs[1], "%d+%.%d+")
+ if dirs then
+ for _, dir in ipairs(dirs) do
+ xcode_sdkver = string.match(dir, "%d+%.%d+")
+ if xcode_sdkver then break end
+ end
end
end
@@ -109,6 +128,9 @@ 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
+
-- probe the xcode application directory
if not _prober._probe_xcode(configs) then return end
diff --git a/xmake/scripts/platform/windows/_prober.lua b/xmake/scripts/platform/windows/_prober.lua
new file mode 100644
index 000000000..cbfcc3710
--- /dev/null
+++ b/xmake/scripts/platform/windows/_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
diff --git a/xmake/scripts/platform/windows/_windows.lua b/xmake/scripts/platform/windows/_windows.lua
index bda11aa07..394846872 100644
--- a/xmake/scripts/platform/windows/_windows.lua
+++ b/xmake/scripts/platform/windows/_windows.lua
@@ -23,11 +23,17 @@
-- define module: _windows
local _windows = _windows or {}
+-- load modules
+local config = require("base/config")
+
-- init host
-_windows._HOST = "windows"
+_windows._HOST = "windows"
-- init architectures
-_windows._ARCHS = {"x86", "x64"}
+_windows._ARCHS = {"x86", "x64"}
+
+-- init prober
+_windows._PROBER = require("platform/windows/_prober")
-- make configure
function _windows.make(configs)