aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2012-09-19 20:45:46 -0300
committerHisham Muhammad <hisham@gobolinux.org>2012-09-19 20:45:46 -0300
commitd0ef504fb22131a4717e31f7f22416f60f8efaf4 (patch)
tree8dafd6362a2916e2817adfe83520542d9fbab51c
parentd0998183ca95077b81fa7c31a48cb74b282fd858 (diff)
downloadluarocks-d0ef504fb22131a4717e31f7f22416f60f8efaf4.tar.gz
luarocks-d0ef504fb22131a4717e31f7f22416f60f8efaf4.tar.bz2
luarocks-d0ef504fb22131a4717e31f7f22416f60f8efaf4.zip
Cleanup mingw32 code
-rw-r--r--src/luarocks/cfg.lua30
1 files changed, 4 insertions, 26 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua
index c904a7ba..a8475bfe 100644
--- a/src/luarocks/cfg.lua
+++ b/src/luarocks/cfg.lua
@@ -89,6 +89,7 @@ elseif system and system:match("^CYGWIN") then
89elseif system and system:match("^Windows") then 89elseif system and system:match("^Windows") then
90 detected.windows = true 90 detected.windows = true
91elseif system and system:match("^MINGW") then 91elseif system and system:match("^MINGW") then
92 detected.windows = true
92 detected.mingw32 = true 93 detected.mingw32 = true
93else 94else
94 detected.unix = true 95 detected.unix = true
@@ -99,7 +100,7 @@ end
99 100
100local sys_config_file, home_config_file 101local sys_config_file, home_config_file
101local sys_config_ok, home_config_ok = false, false 102local sys_config_ok, home_config_ok = false, false
102if detected.windows or detected.mingw32 then 103if detected.windows then
103 home = os.getenv("APPDATA") or "c:" 104 home = os.getenv("APPDATA") or "c:"
104 sys_config_file = site_config.LUAROCKS_SYSCONFIG or "c:/luarocks/config.lua" 105 sys_config_file = site_config.LUAROCKS_SYSCONFIG or "c:/luarocks/config.lua"
105 home_config_file = home.."/luarocks/config.lua" 106 home_config_file = home.."/luarocks/config.lua"
@@ -253,7 +254,7 @@ if detected.windows then
253 defaults.variables.LUA_LIBDIR = site_config.LUA_LIBDIR and site_config.LUA_LIBDIR:gsub("\\", "/") or "c:/lua"..lua_version.."/lib" 254 defaults.variables.LUA_LIBDIR = site_config.LUA_LIBDIR and site_config.LUA_LIBDIR:gsub("\\", "/") or "c:/lua"..lua_version.."/lib"
254 defaults.cmake_generator = "MinGW Makefiles" 255 defaults.cmake_generator = "MinGW Makefiles"
255 defaults.makefile = "Makefile.win" 256 defaults.makefile = "Makefile.win"
256 defaults.variables.MAKE = "nmake" -- TODO: Split Windows flavors between mingw and msvc 257 defaults.variables.MAKE = "nmake"
257 defaults.variables.CC = "cl" 258 defaults.variables.CC = "cl"
258 defaults.variables.RC = "rc" 259 defaults.variables.RC = "rc"
259 defaults.variables.WRAPPER = site_config.LUAROCKS_PREFIX .. "\\2.0\\rclauncher.obj" 260 defaults.variables.WRAPPER = site_config.LUAROCKS_PREFIX .. "\\2.0\\rclauncher.obj"
@@ -279,39 +280,16 @@ if detected.windows then
279end 280end
280 281
281if detected.mingw32 then 282if detected.mingw32 then
282 home_config_file = home_config_file:gsub("\\","/")
283 defaults.fs_use_modules = false
284 defaults.arch = "win32-"..proc
285 defaults.platforms = { "win32", "mingw32" } 283 defaults.platforms = { "win32", "mingw32" }
286 defaults.lib_extension = "dll"
287 defaults.external_lib_extension = "dll"
288 defaults.obj_extension = "o" 284 defaults.obj_extension = "o"
289 defaults.external_deps_dirs = { "c:/external/" }
290 defaults.variables.LUA_BINDIR = site_config.LUA_BINDIR and site_config.LUA_BINDIR:gsub("\\", "/") or "c:/lua"..lua_version.."/bin"
291 defaults.variables.LUA_INCDIR = site_config.LUA_INCDIR and site_config.LUA_INCDIR:gsub("\\", "/") or "c:/lua"..lua_version.."/include"
292 defaults.variables.LUA_LIBDIR = site_config.LUA_LIBDIR and site_config.LUA_LIBDIR:gsub("\\", "/") or "c:/lua"..lua_version.."/lib"
293 defaults.cmake_generator = "MinGW Makefiles" 285 defaults.cmake_generator = "MinGW Makefiles"
294 defaults.make = "mingw32-make" -- TODO: Split Windows flavors between mingw and msvc 286 defaults.variables.MAKE = "mingw32-make"
295 defaults.makefile = "Makefile.win"
296 defaults.variables.CC = "mingw32-gcc" 287 defaults.variables.CC = "mingw32-gcc"
297 defaults.variables.RC = "windres" 288 defaults.variables.RC = "windres"
298 defaults.variables.WRAPPER = site_config.LUAROCKS_PREFIX .. "\\2.0\\rclauncher.o" 289 defaults.variables.WRAPPER = site_config.LUAROCKS_PREFIX .. "\\2.0\\rclauncher.o"
299 defaults.variables.LD = "mingw32-gcc" 290 defaults.variables.LD = "mingw32-gcc"
300 defaults.variables.CFLAGS = "-O2" 291 defaults.variables.CFLAGS = "-O2"
301 defaults.variables.LIBFLAG = "-shared" 292 defaults.variables.LIBFLAG = "-shared"
302 defaults.external_deps_patterns = {
303 bin = { "?.exe", "?.bat" },
304 lib = { "?.lib", "?.dll", "lib?.dll" },
305 include = { "?.h" }
306 }
307 defaults.runtime_external_deps_patterns = {
308 bin = { "?.exe", "?.bat" },
309 lib = { "?.dll", "lib?.dll" },
310 include = { "?.h" }
311 }
312 defaults.export_lua_path = "SET LUA_PATH=%s"
313 defaults.export_lua_cpath = "SET LUA_CPATH=%s"
314 defaults.local_cache = home.."/cache/luarocks"
315end 293end
316 294
317if detected.unix then 295if detected.unix then