mail[Wesnoth-commits] r34182 - /trunk/scons/lua.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by loonycyborg on March 27, 2009 - 13:26:
Author: loonycyborg
Date: Fri Mar 27 13:26:14 2009
New Revision: 34182

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34182&view=rev
Log:
Added support for finding lua without pkg-config.

Modified:
    trunk/scons/lua.py

Modified: trunk/scons/lua.py
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/scons/lua.py?rev=34182&r1=34181&r2=34182&view=diff
==============================================================================
--- trunk/scons/lua.py (original)
+++ trunk/scons/lua.py Fri Mar 27 13:26:14 2009
@@ -1,5 +1,8 @@
 # vi: syntax=python:et:ts=4
 from pkgconfig import run_pkg_config
+from config_check_utils import find_include
+
+from os.path import join
 
 def CheckLua(context, require_version):
     env = context.env
@@ -14,6 +17,13 @@
         found = True
     else:
         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("""
     #include <lualib.h>




Related Messages


Powered by MHonArc, Updated Fri Mar 27 13:40:30 2009