mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-20 16:01:07 +00:00
29 lines
854 B
Python
29 lines
854 B
Python
# vi: syntax=python:et:ts=4
|
|
from pkgconfig import run_pkg_config
|
|
|
|
def CheckLua(context, require_version):
|
|
env = context.env
|
|
|
|
context.Message("Checking for Lua development files version " + require_version + "... ")
|
|
|
|
version = ".".join(require_version.split(".")[0:2])
|
|
|
|
if env.get("luadir"):
|
|
env.Append(LIBPATH = ["$luadir"], CPPPATH = ["$luadir/include"], LIBS = "lua" + version)
|
|
found = True
|
|
else:
|
|
found = run_pkg_config(env, "lua >= " + require_version) or run_pkg_config(env, "lua" + version + " >= " + require_version)
|
|
|
|
result = found and context.TryLink("""
|
|
#include <lualib.h>
|
|
int main() { luaL_newstate(); }
|
|
""", ".c")
|
|
if result:
|
|
context.Result("yes")
|
|
return True
|
|
else:
|
|
context.Result("no")
|
|
return False
|
|
|
|
config_checks = { "CheckLua" : CheckLua }
|