diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2017-04-17 09:29:31 -0300 |
---|---|---|
committer | Peter Melnichenko <mpeterval@gmail.com> | 2017-09-12 20:29:33 +0300 |
commit | b9cc2c906c89a022a0b79515b27d6cce61517f2b (patch) | |
tree | 7acc3373b215a3d0d7490ced139725659c5b9255 /src | |
parent | 186ed708d40945d88e223e0125b706f6d3514385 (diff) | |
download | luarocks-b9cc2c906c89a022a0b79515b27d6cce61517f2b.tar.gz luarocks-b9cc2c906c89a022a0b79515b27d6cce61517f2b.tar.bz2 luarocks-b9cc2c906c89a022a0b79515b27d6cce61517f2b.zip |
Add sanity check for lua.h
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/build/builtin.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua index c36aa96f..ccefaa3b 100644 --- a/src/luarocks/build/builtin.lua +++ b/src/luarocks/build/builtin.lua | |||
@@ -53,6 +53,7 @@ function builtin.run(rockspec) | |||
53 | 53 | ||
54 | local build = rockspec.build | 54 | local build = rockspec.build |
55 | local variables = rockspec.variables | 55 | local variables = rockspec.variables |
56 | local checked_lua_h = false | ||
56 | 57 | ||
57 | local function add_flags(extras, flag, flags) | 58 | local function add_flags(extras, flag, flags) |
58 | if flags then | 59 | if flags then |
@@ -218,6 +219,14 @@ function builtin.run(rockspec) | |||
218 | end | 219 | end |
219 | end | 220 | end |
220 | if type(info) == "table" then | 221 | if type(info) == "table" then |
222 | if not checked_lua_h then | ||
223 | local lua_incdir, lua_h = variables.LUA_INCDIR, "lua.h" | ||
224 | if not fs.exists(dir.path(lua_incdir, lua_h)) then | ||
225 | return nil, "Lua header file "..lua_h.." not found (looked in "..lua_incdir.."). \n" .. | ||
226 | "You need to install the Lua development package for your system." | ||
227 | end | ||
228 | checked_lua_h = true | ||
229 | end | ||
221 | local objects = {} | 230 | local objects = {} |
222 | local sources = info.sources | 231 | local sources = info.sources |
223 | if info[1] then sources = info end | 232 | if info[1] then sources = info end |