diff options
-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 |