mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-21 23:51:41 +00:00
Added support for finding lua without pkg-config.
This commit is contained in:
parent
6b35904778
commit
b2829b1a1a
10
scons/lua.py
10
scons/lua.py
@ -1,5 +1,8 @@
|
|||||||
# vi: syntax=python:et:ts=4
|
# vi: syntax=python:et:ts=4
|
||||||
from pkgconfig import run_pkg_config
|
from pkgconfig import run_pkg_config
|
||||||
|
from config_check_utils import find_include
|
||||||
|
|
||||||
|
from os.path import join
|
||||||
|
|
||||||
def CheckLua(context, require_version):
|
def CheckLua(context, require_version):
|
||||||
env = context.env
|
env = context.env
|
||||||
@ -14,6 +17,13 @@ def CheckLua(context, require_version):
|
|||||||
found = True
|
found = True
|
||||||
else:
|
else:
|
||||||
found = run_pkg_config(env, "lua >= " + require_version) or run_pkg_config(env, "lua" + version + " >= " + require_version)
|
found = run_pkg_config(env, "lua >= " + require_version) or run_pkg_config(env, "lua" + version + " >= " + require_version)
|
||||||
|
if not found:
|
||||||
|
try:
|
||||||
|
prefix, include = find_include([env["prefix"]], "lualib.h", "", not env["host"])[0]
|
||||||
|
found = True
|
||||||
|
env.Append(LIBPATH = [join(prefix, "lib")], CPPPATH = [join(prefix, "include")], LIBS = ["lua"])
|
||||||
|
except IndexError:
|
||||||
|
pass
|
||||||
|
|
||||||
result = found and context.TryLink("""
|
result = found and context.TryLink("""
|
||||||
#include <lualib.h>
|
#include <lualib.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user