diff options
-rw-r--r-- | meta-oe/recipes-devtools/lua/lua/0001-Allow-building-lua-without-readline-on-Linux.patch | 59 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/lua/lua_5.3.5.bb | 9 |
2 files changed, 65 insertions, 3 deletions
diff --git a/meta-oe/recipes-devtools/lua/lua/0001-Allow-building-lua-without-readline-on-Linux.patch b/meta-oe/recipes-devtools/lua/lua/0001-Allow-building-lua-without-readline-on-Linux.patch new file mode 100644 index 0000000000..e767900864 --- /dev/null +++ b/meta-oe/recipes-devtools/lua/lua/0001-Allow-building-lua-without-readline-on-Linux.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | From 601ef636fc4dfb2af3e7fda88d8ea1c1d92affe4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | ||
3 | Date: Wed, 2 Oct 2019 17:54:15 +0200 | ||
4 | Subject: [PATCH] Allow building lua without readline on Linux | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | ||
8 | --- | ||
9 | Makefile | 2 +- | ||
10 | src/Makefile | 3 +++ | ||
11 | src/luaconf.h | 5 +++++ | ||
12 | 3 files changed, 9 insertions(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/Makefile b/Makefile | ||
15 | index 119110d..9f6df45 100644 | ||
16 | --- a/Makefile | ||
17 | +++ b/Makefile | ||
18 | @@ -36,7 +36,7 @@ RM= rm -f | ||
19 | # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= | ||
20 | |||
21 | # Convenience platforms targets. | ||
22 | -PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris | ||
23 | +PLATS= aix bsd c89 freebsd generic linux linux-no-readline macosx mingw posix solaris | ||
24 | |||
25 | # What to install. | ||
26 | TO_BIN= lua luac | ||
27 | diff --git a/src/Makefile b/src/Makefile | ||
28 | index 64c78f7..5c0428a 100644 | ||
29 | --- a/src/Makefile | ||
30 | +++ b/src/Makefile | ||
31 | @@ -109,6 +109,9 @@ generic: $(ALL) | ||
32 | linux: | ||
33 | $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline" | ||
34 | |||
35 | +linux-no-readline: | ||
36 | + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX_NO_READLINE" SYSLIBS="-Wl,-E -ldl" | ||
37 | + | ||
38 | macosx: | ||
39 | $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" | ||
40 | |||
41 | diff --git a/src/luaconf.h b/src/luaconf.h | ||
42 | index 9eeeea6..d71ca25 100644 | ||
43 | --- a/src/luaconf.h | ||
44 | +++ b/src/luaconf.h | ||
45 | @@ -64,6 +64,11 @@ | ||
46 | #define LUA_USE_READLINE /* needs some extra libraries */ | ||
47 | #endif | ||
48 | |||
49 | +#if defined(LUA_USE_LINUX_NO_READLINE) | ||
50 | +#define LUA_USE_POSIX | ||
51 | +#define LUA_USE_DLOPEN /* needs an extra library: -ldl */ | ||
52 | +#endif | ||
53 | + | ||
54 | |||
55 | #if defined(LUA_USE_MACOSX) | ||
56 | #define LUA_USE_POSIX | ||
57 | -- | ||
58 | 2.17.1 | ||
59 | |||
diff --git a/meta-oe/recipes-devtools/lua/lua_5.3.5.bb b/meta-oe/recipes-devtools/lua/lua_5.3.5.bb index 265e2519e0..ae41e627f0 100644 --- a/meta-oe/recipes-devtools/lua/lua_5.3.5.bb +++ b/meta-oe/recipes-devtools/lua/lua_5.3.5.bb | |||
@@ -4,9 +4,9 @@ LICENSE = "MIT" | |||
4 | LIC_FILES_CHKSUM = "file://doc/readme.html;beginline=318;endline=352;md5=60aa5cfdbd40086501778d9b6ebf29ee" | 4 | LIC_FILES_CHKSUM = "file://doc/readme.html;beginline=318;endline=352;md5=60aa5cfdbd40086501778d9b6ebf29ee" |
5 | HOMEPAGE = "http://www.lua.org/" | 5 | HOMEPAGE = "http://www.lua.org/" |
6 | 6 | ||
7 | DEPENDS = "readline" | ||
8 | SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz;name=tarballsrc \ | 7 | SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz;name=tarballsrc \ |
9 | file://lua.pc.in \ | 8 | file://lua.pc.in \ |
9 | file://0001-Allow-building-lua-without-readline-on-Linux.patch \ | ||
10 | " | 10 | " |
11 | 11 | ||
12 | # if no test suite matches PV release of Lua exactly, download the suite for the closest Lua release. | 12 | # if no test suite matches PV release of Lua exactly, download the suite for the closest Lua release. |
@@ -24,18 +24,21 @@ SRC_URI[tarballtest.sha256sum] = "b80771238271c72565e5a1183292ef31bd7166414cd0d4 | |||
24 | 24 | ||
25 | inherit pkgconfig binconfig ptest | 25 | inherit pkgconfig binconfig ptest |
26 | 26 | ||
27 | PACKAGECONFIG ??= "readline" | ||
28 | PACKAGECONFIG[readline] = ",,readline" | ||
29 | |||
27 | UCLIBC_PATCHES += "file://uclibc-pthread.patch" | 30 | UCLIBC_PATCHES += "file://uclibc-pthread.patch" |
28 | SRC_URI_append_libc-uclibc = "${UCLIBC_PATCHES}" | 31 | SRC_URI_append_libc-uclibc = "${UCLIBC_PATCHES}" |
29 | 32 | ||
30 | TARGET_CC_ARCH += " -fPIC ${LDFLAGS}" | 33 | TARGET_CC_ARCH += " -fPIC ${LDFLAGS}" |
31 | EXTRA_OEMAKE = "'CC=${CC} -fPIC' 'MYCFLAGS=${CFLAGS} -DLUA_USE_LINUX -fPIC' MYLDFLAGS='${LDFLAGS}'" | 34 | EXTRA_OEMAKE = "'CC=${CC} -fPIC' 'MYCFLAGS=${CFLAGS} -fPIC' MYLDFLAGS='${LDFLAGS}'" |
32 | 35 | ||
33 | do_configure_prepend() { | 36 | do_configure_prepend() { |
34 | sed -i -e s:/usr/local:${prefix}:g src/luaconf.h | 37 | sed -i -e s:/usr/local:${prefix}:g src/luaconf.h |
35 | } | 38 | } |
36 | 39 | ||
37 | do_compile () { | 40 | do_compile () { |
38 | oe_runmake linux | 41 | oe_runmake ${@bb.utils.contains('PACKAGECONFIG', 'readline', 'linux', 'linux-no-readline', d)} |
39 | } | 42 | } |
40 | 43 | ||
41 | do_install () { | 44 | do_install () { |