diff options
Diffstat (limited to 'recipes-extended/diod/files/0001-build-Find-lua-with-pkg-config.patch')
-rw-r--r-- | recipes-extended/diod/files/0001-build-Find-lua-with-pkg-config.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/recipes-extended/diod/files/0001-build-Find-lua-with-pkg-config.patch b/recipes-extended/diod/files/0001-build-Find-lua-with-pkg-config.patch new file mode 100644 index 00000000..9f61792a --- /dev/null +++ b/recipes-extended/diod/files/0001-build-Find-lua-with-pkg-config.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 8124eec4e59222f1c3f3dc4d7e6706e13c33755c Mon Sep 17 00:00:00 2001 | ||
2 | From: Ola x Nilsson <olani@axis.com> | ||
3 | Date: Wed, 6 Mar 2024 18:40:16 +0100 | ||
4 | Subject: [PATCH] build: Find lua with pkg-config | ||
5 | |||
6 | ax_lua.m4 does not support cross compilation. | ||
7 | |||
8 | Upstream-Status: Inappropriate (Embedded specific) | ||
9 | |||
10 | --- | ||
11 | configure.ac | 26 +++++++++++++++++++++++++- | ||
12 | 1 file changed, 25 insertions(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/configure.ac b/configure.ac | ||
15 | index e8fcdb2..f3ebdc5 100644 | ||
16 | --- a/configure.ac | ||
17 | +++ b/configure.ac | ||
18 | @@ -121,7 +121,31 @@ AC_ARG_ENABLE([config], | ||
19 | [AS_HELP_STRING([--disable-config], [disable lua config file support])]) | ||
20 | |||
21 | AS_IF([test "x$enable_config" != "xno"], [ | ||
22 | - AX_PROG_LUA([5.1],[5.5]) | ||
23 | + dnl Use pkg_config to check for lua settings. This is not standard | ||
24 | + dnl as lua typically does not distribute a pc file. The | ||
25 | + dnl OpenEmbedded recipe adds one that can be used. Reuse/replicate | ||
26 | + dnl as much of AX_PROG_LUA as possible so AX_LUA_HEADERS and | ||
27 | + dnl AX_LUA_LIBS are still usable. | ||
28 | + PKG_CHECK_EXISTS([lua], [ | ||
29 | + AS_IF([ | ||
30 | + $PKG_CONFIG --atleast-version=5.1 lua && $PKG_CONFIG --max-version=5.5 lua | ||
31 | + ],[ | ||
32 | + AC_ARG_VAR([LUA], [The LUA interpreter, e.g. /usr/bin/lua5.1]) | ||
33 | + dnl should really check that the file exists ... | ||
34 | + AC_SUBST([LUA], [${bindir}/lua]) | ||
35 | + AC_CACHE_CHECK([for $LUA version], [ax_cv_lua_version], [ | ||
36 | + ax_cv_lua_version=[`$PKG_CONFIG --modversion lua | $SED 's/^\([0-9]\+\.[0-9]\+\).*/\1/'`] | ||
37 | + ]) | ||
38 | + AS_IF([test "x$ax_cv_lua_version" = 'x'], | ||
39 | + [AC_MSG_ERROR([invalid Lua version number])]) | ||
40 | + AC_SUBST([LUA_VERSION], [$ax_cv_lua_version]) | ||
41 | + AC_SUBST([LUA_SHORT_VERSION], [`echo "$LUA_VERSION" | $SED 's|\.||'`]) | ||
42 | + ],[ | ||
43 | + AC_MSG_ERROR([Incorrect lua version]) | ||
44 | + ]) | ||
45 | + ],[ | ||
46 | + AX_PROG_LUA([5.1],[5.5]) | ||
47 | + ]) | ||
48 | AX_LUA_HEADERS([],[ | ||
49 | AC_MSG_ERROR([Install lua headers or configure with --disable-config]) | ||
50 | ]) | ||