diff options
Diffstat (limited to 'src/luarocks/cfg.lua')
-rw-r--r-- | src/luarocks/cfg.lua | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index 220e7b29..5ec87bf5 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
@@ -74,6 +74,8 @@ elseif system and system:match("^CYGWIN") then | |||
74 | detected.cygwin = true | 74 | detected.cygwin = true |
75 | elseif system and system:match("^Windows") then | 75 | elseif system and system:match("^Windows") then |
76 | detected.windows = true | 76 | detected.windows = true |
77 | elseif system and system:match("^MINGW") then | ||
78 | detected.mingw32 = true | ||
77 | else | 79 | else |
78 | detected.unix = true | 80 | detected.unix = true |
79 | -- Fall back to Unix in unknown systems. | 81 | -- Fall back to Unix in unknown systems. |
@@ -82,7 +84,7 @@ end | |||
82 | -- Path configuration: | 84 | -- Path configuration: |
83 | 85 | ||
84 | local sys_config_file, home_config_file, home_tree | 86 | local sys_config_file, home_config_file, home_tree |
85 | if detected.windows then | 87 | if detected.windows or detected.mingw32 then |
86 | home = os.getenv("APPDATA") or "c:" | 88 | home = os.getenv("APPDATA") or "c:" |
87 | sys_config_file = "c:/luarocks/config.lua" | 89 | sys_config_file = "c:/luarocks/config.lua" |
88 | home_config_file = home.."/luarocks/config.lua" | 90 | home_config_file = home.."/luarocks/config.lua" |
@@ -185,6 +187,39 @@ if detected.windows then | |||
185 | defaults.local_cache = home.."/cache/luarocks" | 187 | defaults.local_cache = home.."/cache/luarocks" |
186 | end | 188 | end |
187 | 189 | ||
190 | if detected.mingw32 then | ||
191 | home_config_file = home_config_file:gsub("\\","/") | ||
192 | defaults.arch = "mingw32-"..proc | ||
193 | defaults.platforms = { "win32", "mingw32" } | ||
194 | defaults.lib_extension = "dll" | ||
195 | defaults.external_lib_extension = "dll" | ||
196 | defaults.obj_extension = "o" | ||
197 | defaults.external_deps_dirs = { "c:/external/" } | ||
198 | defaults.variables.LUA_BINDIR = config.LUA_BINDIR and config.LUA_BINDIR:gsub("\\", "/") or "c:/lua5.1/bin" | ||
199 | defaults.variables.LUA_INCDIR = config.LUA_INCDIR and config.LUA_INCDIR:gsub("\\", "/") or "c:/lua5.1/include" | ||
200 | defaults.variables.LUA_LIBDIR = config.LUA_LIBDIR and config.LUA_LIBDIR:gsub("\\", "/") or "c:/lua5.1/lib" | ||
201 | defaults.cmake_generator = "MinGW Makefiles" | ||
202 | defaults.make = "mingw32-make" -- TODO: Split Windows flavors between mingw and msvc | ||
203 | defaults.makefile = "Makefile.win" | ||
204 | defaults.variables.CC = "gcc" | ||
205 | defaults.variables.RC = "windres" | ||
206 | defaults.variables.WRAPPER = config.LUAROCKS_PREFIX .. "\\2.0\\rclauncher.o" | ||
207 | defaults.variables.LD = "gcc" | ||
208 | defaults.variables.CFLAGS = "-O2" | ||
209 | defaults.variables.LIBFLAG = "-shared --dll --export-all-symbols" | ||
210 | defaults.external_deps_patterns = { | ||
211 | bin = { "?.exe", "?.bat" }, | ||
212 | lib = { "lib?.a", "?.dll", "lib?.dll" }, | ||
213 | include = { "?.h" } | ||
214 | } | ||
215 | defaults.runtime_external_deps_patterns = { | ||
216 | bin = { "?.exe", "?.bat" }, | ||
217 | lib = { "?.dll", "lib?.dll" }, | ||
218 | include = { "?.h" } | ||
219 | } | ||
220 | defaults.local_cache = home.."/cache/luarocks" | ||
221 | end | ||
222 | |||
188 | if detected.unix then | 223 | if detected.unix then |
189 | defaults.lib_extension = "so" | 224 | defaults.lib_extension = "so" |
190 | defaults.external_lib_extension = "so" | 225 | defaults.external_lib_extension = "so" |