From b9cc2c906c89a022a0b79515b27d6cce61517f2b Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 17 Apr 2017 09:29:31 -0300 Subject: Add sanity check for lua.h --- src/luarocks/build/builtin.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') 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) local build = rockspec.build local variables = rockspec.variables + local checked_lua_h = false local function add_flags(extras, flag, flags) if flags then @@ -218,6 +219,14 @@ function builtin.run(rockspec) end end if type(info) == "table" then + if not checked_lua_h then + local lua_incdir, lua_h = variables.LUA_INCDIR, "lua.h" + if not fs.exists(dir.path(lua_incdir, lua_h)) then + return nil, "Lua header file "..lua_h.." not found (looked in "..lua_incdir.."). \n" .. + "You need to install the Lua development package for your system." + end + checked_lua_h = true + end local objects = {} local sources = info.sources if info[1] then sources = info end -- cgit v1.2.3-55-g6feb