diff options
Diffstat (limited to 'src/luarocks/cfg.lua')
-rw-r--r-- | src/luarocks/cfg.lua | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index 9628a291..8527ba52 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
@@ -11,8 +11,8 @@ | |||
11 | -- (~/.luarocks/config.lua on Unix or %APPDATA%/luarocks/config.lua on | 11 | -- (~/.luarocks/config.lua on Unix or %APPDATA%/luarocks/config.lua on |
12 | -- Windows). | 12 | -- Windows). |
13 | 13 | ||
14 | local rawset, next, table, pairs, require, io, os, setmetatable, pcall, ipairs, package, type, assert = | 14 | local rawset, next, table, pairs, require, io, os, setmetatable, pcall, ipairs, package, type, assert, _VERSION = |
15 | rawset, next, table, pairs, require, io, os, setmetatable, pcall, ipairs, package, type, assert | 15 | rawset, next, table, pairs, require, io, os, setmetatable, pcall, ipairs, package, type, assert, _VERSION |
16 | 16 | ||
17 | module("luarocks.cfg") | 17 | module("luarocks.cfg") |
18 | 18 | ||
@@ -25,6 +25,7 @@ end | |||
25 | 25 | ||
26 | _M.site_config = site_config | 26 | _M.site_config = site_config |
27 | 27 | ||
28 | lua_version = _VERSION:sub(5) | ||
28 | program_version = "2.0.8" | 29 | program_version = "2.0.8" |
29 | user_agent = "LuaRocks/"..program_version | 30 | user_agent = "LuaRocks/"..program_version |
30 | 31 | ||
@@ -150,8 +151,8 @@ local defaults = { | |||
150 | use_extensions = false, | 151 | use_extensions = false, |
151 | accept_unknown_fields = false, | 152 | accept_unknown_fields = false, |
152 | 153 | ||
153 | lua_modules_path = "/share/lua/5.1/", | 154 | lua_modules_path = "/share/lua/"..lua_version, |
154 | lib_modules_path = "/lib/lua/5.1/", | 155 | lib_modules_path = "/lib/lua/"..lua_version, |
155 | 156 | ||
156 | arch = "unknown", | 157 | arch = "unknown", |
157 | lib_extension = "unknown", | 158 | lib_extension = "unknown", |
@@ -230,9 +231,9 @@ if detected.windows then | |||
230 | defaults.external_lib_extension = "dll" | 231 | defaults.external_lib_extension = "dll" |
231 | defaults.obj_extension = "obj" | 232 | defaults.obj_extension = "obj" |
232 | defaults.external_deps_dirs = { "c:/external/" } | 233 | defaults.external_deps_dirs = { "c:/external/" } |
233 | defaults.variables.LUA_BINDIR = site_config.LUA_BINDIR and site_config.LUA_BINDIR:gsub("\\", "/") or "c:/lua5.1/bin" | 234 | defaults.variables.LUA_BINDIR = site_config.LUA_BINDIR and site_config.LUA_BINDIR:gsub("\\", "/") or "c:/lua"..lua_version.."/bin" |
234 | defaults.variables.LUA_INCDIR = site_config.LUA_INCDIR and site_config.LUA_INCDIR:gsub("\\", "/") or "c:/lua5.1/include" | 235 | defaults.variables.LUA_INCDIR = site_config.LUA_INCDIR and site_config.LUA_INCDIR:gsub("\\", "/") or "c:/lua"..lua_version.."/include" |
235 | defaults.variables.LUA_LIBDIR = site_config.LUA_LIBDIR and site_config.LUA_LIBDIR:gsub("\\", "/") or "c:/lua5.1/lib" | 236 | defaults.variables.LUA_LIBDIR = site_config.LUA_LIBDIR and site_config.LUA_LIBDIR:gsub("\\", "/") or "c:/lua"..lua_version.."/lib" |
236 | defaults.cmake_generator = "MinGW Makefiles" | 237 | defaults.cmake_generator = "MinGW Makefiles" |
237 | defaults.makefile = "Makefile.win" | 238 | defaults.makefile = "Makefile.win" |
238 | defaults.variables.MAKE = "nmake" -- TODO: Split Windows flavors between mingw and msvc | 239 | defaults.variables.MAKE = "nmake" -- TODO: Split Windows flavors between mingw and msvc |
@@ -241,10 +242,10 @@ if detected.windows then | |||
241 | defaults.variables.WRAPPER = site_config.LUAROCKS_PREFIX .. "\\2.0\\rclauncher.obj" | 242 | defaults.variables.WRAPPER = site_config.LUAROCKS_PREFIX .. "\\2.0\\rclauncher.obj" |
242 | defaults.variables.LD = "link" | 243 | defaults.variables.LD = "link" |
243 | defaults.variables.MT = "mt" | 244 | defaults.variables.MT = "mt" |
244 | defaults.variables.LUALIB = "lua5.1.lib" | 245 | defaults.variables.LUALIB = "lua"..lua_version..".lib" |
245 | defaults.variables.CFLAGS = "/MD /O2" | 246 | defaults.variables.CFLAGS = "/MD /O2" |
246 | defaults.variables.LIBFLAG = "/dll" | 247 | defaults.variables.LIBFLAG = "/dll" |
247 | defaults.variables.LUALIB = "lua5.1.lib" | 248 | defaults.variables.LUALIB = "lua"..lua_version..".lib" |
248 | defaults.external_deps_patterns = { | 249 | defaults.external_deps_patterns = { |
249 | bin = { "?.exe", "?.bat" }, | 250 | bin = { "?.exe", "?.bat" }, |
250 | lib = { "?.lib", "?.dll", "lib?.dll" }, | 251 | lib = { "?.lib", "?.dll", "lib?.dll" }, |
@@ -268,9 +269,9 @@ if detected.mingw32 then | |||
268 | defaults.external_lib_extension = "dll" | 269 | defaults.external_lib_extension = "dll" |
269 | defaults.obj_extension = "o" | 270 | defaults.obj_extension = "o" |
270 | defaults.external_deps_dirs = { "c:/external/" } | 271 | defaults.external_deps_dirs = { "c:/external/" } |
271 | defaults.variables.LUA_BINDIR = site_config.LUA_BINDIR and site_config.LUA_BINDIR:gsub("\\", "/") or "c:/lua5.1/bin" | 272 | defaults.variables.LUA_BINDIR = site_config.LUA_BINDIR and site_config.LUA_BINDIR:gsub("\\", "/") or "c:/lua"..lua_version.."/bin" |
272 | defaults.variables.LUA_INCDIR = site_config.LUA_INCDIR and site_config.LUA_INCDIR:gsub("\\", "/") or "c:/lua5.1/include" | 273 | defaults.variables.LUA_INCDIR = site_config.LUA_INCDIR and site_config.LUA_INCDIR:gsub("\\", "/") or "c:/lua"..lua_version.."/include" |
273 | defaults.variables.LUA_LIBDIR = site_config.LUA_LIBDIR and site_config.LUA_LIBDIR:gsub("\\", "/") or "c:/lua5.1/lib" | 274 | defaults.variables.LUA_LIBDIR = site_config.LUA_LIBDIR and site_config.LUA_LIBDIR:gsub("\\", "/") or "c:/lua"..lua_version.."/lib" |
274 | defaults.cmake_generator = "MinGW Makefiles" | 275 | defaults.cmake_generator = "MinGW Makefiles" |
275 | defaults.make = "mingw32-make" -- TODO: Split Windows flavors between mingw and msvc | 276 | defaults.make = "mingw32-make" -- TODO: Split Windows flavors between mingw and msvc |
276 | defaults.makefile = "Makefile.win" | 277 | defaults.makefile = "Makefile.win" |