diff options
author | Fabio Mascarenhas <mascarenhas@lambda-2.local> | 2010-01-22 14:57:23 -0200 |
---|---|---|
committer | Fabio Mascarenhas <mascarenhas@lambda-2.local> | 2010-01-22 14:57:23 -0200 |
commit | acb4296d3cdd3b5017c3c39e04ecc12c55e49ed5 (patch) | |
tree | 7d06a5af831c31927d1a13597cf79029976002df /src | |
parent | 47fea74335776d0d05de6225fcb3a8baa33e7f01 (diff) | |
download | luarocks-acb4296d3cdd3b5017c3c39e04ecc12c55e49ed5.tar.gz luarocks-acb4296d3cdd3b5017c3c39e04ecc12c55e49ed5.tar.bz2 luarocks-acb4296d3cdd3b5017c3c39e04ecc12c55e49ed5.zip |
mingw as build system
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/build/builtin.lua | 9 | ||||
-rw-r--r-- | src/luarocks/cfg.lua | 14 |
2 files changed, 11 insertions, 12 deletions
diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua index dacaad0a..b6f42eab 100644 --- a/src/luarocks/build/builtin.lua +++ b/src/luarocks/build/builtin.lua | |||
@@ -86,10 +86,9 @@ function run(rockspec) | |||
86 | compile_library = function(library, objects, libraries, libdirs, name) | 86 | compile_library = function(library, objects, libraries, libdirs, name) |
87 | local extras = { unpack(objects) } | 87 | local extras = { unpack(objects) } |
88 | add_flags(extras, "-L%s", libdirs) | 88 | add_flags(extras, "-L%s", libdirs) |
89 | add_flags(extras, "-l%s", libraries) | 89 | add_flags(extras, "%s.lib", libraries) |
90 | extras[#extras+1] = "-L" .. variables.LUA_LIBDIR | 90 | extras[#extras+1] = dir.path(variables.LUA_LIBDIR, "lua5.1.lib") |
91 | extras[#extras+1] = "-llua51" | 91 | extras[#extras+1] = "-l" .. (variables.MSVCRT or "msvcr80") |
92 | extras[#extras+1] = "-lmsvcrt" | ||
93 | local ok = execute(variables.LD.." "..variables.LIBFLAG, "-o", library, unpack(extras)) | 92 | local ok = execute(variables.LD.." "..variables.LIBFLAG, "-o", library, unpack(extras)) |
94 | return ok | 93 | return ok |
95 | end | 94 | end |
@@ -103,7 +102,7 @@ function run(rockspec) | |||
103 | local ok = execute(variables.RC, "-o", resname, rcname) | 102 | local ok = execute(variables.RC, "-o", resname, rcname) |
104 | if not ok then return ok end | 103 | if not ok then return ok end |
105 | ok = execute(variables.LD, "-o", wrapname, resname, variables.WRAPPER, | 104 | ok = execute(variables.LD, "-o", wrapname, resname, variables.WRAPPER, |
106 | "-L"..variables.LUA_LIBDIR, "-llua51", "-lmsvcrt", "-luser32") | 105 | dir.path(variables.LUA_LIBDIR, "lua5.1.lib"), "-l" .. (variables.MSVCRT or "msvcr80"), "-luser32") |
107 | return ok, wrapname | 106 | return ok, wrapname |
108 | end | 107 | end |
109 | elseif is_platform("win32") then | 108 | elseif is_platform("win32") then |
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index 5ec87bf5..ae07f905 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
@@ -176,12 +176,12 @@ if detected.windows then | |||
176 | defaults.variables.LIBFLAG = "/dll" | 176 | defaults.variables.LIBFLAG = "/dll" |
177 | defaults.external_deps_patterns = { | 177 | defaults.external_deps_patterns = { |
178 | bin = { "?.exe", "?.bat" }, | 178 | bin = { "?.exe", "?.bat" }, |
179 | lib = { "?.lib", "?.dll" }, | 179 | lib = { "?.lib", "?.dll", "lib?.dll" }, |
180 | include = { "?.h" } | 180 | include = { "?.h" } |
181 | } | 181 | } |
182 | defaults.runtime_external_deps_patterns = { | 182 | defaults.runtime_external_deps_patterns = { |
183 | bin = { "?.exe", "?.bat" }, | 183 | bin = { "?.exe", "?.bat" }, |
184 | lib = { "?.dll" }, | 184 | lib = { "?.dll", "lib?.dll" }, |
185 | include = { "?.h" } | 185 | include = { "?.h" } |
186 | } | 186 | } |
187 | defaults.local_cache = home.."/cache/luarocks" | 187 | defaults.local_cache = home.."/cache/luarocks" |
@@ -189,7 +189,7 @@ end | |||
189 | 189 | ||
190 | if detected.mingw32 then | 190 | if detected.mingw32 then |
191 | home_config_file = home_config_file:gsub("\\","/") | 191 | home_config_file = home_config_file:gsub("\\","/") |
192 | defaults.arch = "mingw32-"..proc | 192 | defaults.arch = "win32-"..proc |
193 | defaults.platforms = { "win32", "mingw32" } | 193 | defaults.platforms = { "win32", "mingw32" } |
194 | defaults.lib_extension = "dll" | 194 | defaults.lib_extension = "dll" |
195 | defaults.external_lib_extension = "dll" | 195 | defaults.external_lib_extension = "dll" |
@@ -201,15 +201,15 @@ if detected.mingw32 then | |||
201 | defaults.cmake_generator = "MinGW Makefiles" | 201 | defaults.cmake_generator = "MinGW Makefiles" |
202 | defaults.make = "mingw32-make" -- TODO: Split Windows flavors between mingw and msvc | 202 | defaults.make = "mingw32-make" -- TODO: Split Windows flavors between mingw and msvc |
203 | defaults.makefile = "Makefile.win" | 203 | defaults.makefile = "Makefile.win" |
204 | defaults.variables.CC = "gcc" | 204 | defaults.variables.CC = "mingw32-gcc" |
205 | defaults.variables.RC = "windres" | 205 | defaults.variables.RC = "windres" |
206 | defaults.variables.WRAPPER = config.LUAROCKS_PREFIX .. "\\2.0\\rclauncher.o" | 206 | defaults.variables.WRAPPER = config.LUAROCKS_PREFIX .. "\\2.0\\rclauncher.o" |
207 | defaults.variables.LD = "gcc" | 207 | defaults.variables.LD = "mingw32-gcc" |
208 | defaults.variables.CFLAGS = "-O2" | 208 | defaults.variables.CFLAGS = "-O2" |
209 | defaults.variables.LIBFLAG = "-shared --dll --export-all-symbols" | 209 | defaults.variables.LIBFLAG = "-shared" |
210 | defaults.external_deps_patterns = { | 210 | defaults.external_deps_patterns = { |
211 | bin = { "?.exe", "?.bat" }, | 211 | bin = { "?.exe", "?.bat" }, |
212 | lib = { "lib?.a", "?.dll", "lib?.dll" }, | 212 | lib = { "?.lib", "?.dll", "lib?.dll" }, |
213 | include = { "?.h" } | 213 | include = { "?.h" } |
214 | } | 214 | } |
215 | defaults.runtime_external_deps_patterns = { | 215 | defaults.runtime_external_deps_patterns = { |