summaryrefslogtreecommitdiff
path: root/m4/efl_lua.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/efl_lua.m4')
-rw-r--r--m4/efl_lua.m426
1 files changed, 26 insertions, 0 deletions
diff --git a/m4/efl_lua.m4 b/m4/efl_lua.m4
new file mode 100644
index 0000000..61eccf1
--- /dev/null
+++ b/m4/efl_lua.m4
@@ -0,0 +1,26 @@
1dnl EFL_CHECK_LUA_5_1(EFL)
2dnl checks for lua5.1 in pkg-config (multiple names) and -llua directly
3dnl will call EFL_ADD_LIBS() or EFL_DEPEND_PKG() as required.
4dnl this is a strict call and will abort if lua is not found
5AC_DEFUN([EFL_CHECK_LUA_5_1],
6[dnl
7requirement_lua=""
8PKG_CHECK_EXISTS([lua >= 5.1.0], [requirement_lua="lua >= 5.1.0"],
9 [PKG_CHECK_EXISTS([lua5.1 >= 5.1.0], [requirement_lua="lua5.1 >= 5.1.0"],
10 [PKG_CHECK_EXISTS([lua-5.1 >= 5.1.0], [requirement_lua="lua-5.1 >= 5.1.0"],
11 [PKG_CHECK_EXISTS([lua51 >= 5.1.0], [requirement_lua="lua51 >= 5.1.0"])])])])
12
13if test "x${requirement_lua}" = "x"; then
14 AC_MSG_CHECKING([whether lua_newstate() is in liblua])
15 AC_CHECK_LIB([lua], [lua_newstate],
16 [have_lua="yes"
17 EFL_ADD_LIBS([$1], [-llua])],
18 [have_lua="no"])
19 AC_MSG_RESULT([${have_lua}])
20 if test "${have_lua}" = "no"; then
21 AC_MSG_ERROR([Missing lua 5.1 support])
22 fi
23else
24 EFL_DEPEND_PKG([$1], [LUA], [${requirement_lua}])
25fi
26])