tce-load -wi compiletc readline-dev wget https://www.lua.org/ftp/lua-5.4.7.tar.gz wget https://www.linuxfromscratch.org/patches/blfs/svn/lua-5.4.7-shared_library-1.patch tar -xvf lua-5.4.7.tar.gz cd lua-5.4.7 cat > lua.pc << "EOF" V=5.4 R=5.4.7 prefix=/usr INSTALL_BIN=${prefix}/bin INSTALL_INC=${prefix}/include INSTALL_LIB=${prefix}/lib INSTALL_MAN=${prefix}/share/man/man1 INSTALL_LMOD=${prefix}/share/lua/${V} INSTALL_CMOD=${prefix}/lib/lua/${V} exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: Lua Description: An Extensible Extension Language Version: ${R} Requires: Libs: -L${libdir} -llua -lm -ldl Cflags: -I${includedir} EOF patch -Np1 -i ../lua-5.4.7-shared_library-1.patch edit Makefile: INSTALL_TOP= /tmp/destlua-lib/usr/local INSTALL_INC= $(INSTALL_TOP)/include/lua5.4 edit src/Makefile CC= gcc -flto -mtune=generic -Os -pipe -std=gnu99 $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline -lncursesw" [in linux-readline target] make linux-readline TO_LIB="liblua.so liblua.so.5.4 liblua.so.5.4.7" mkdir /tmp/destlua-lib make TO_LIB="liblua.so liblua.so.5.4 liblua.so.5.4.7" INSTALL_DATA="cp -d" install install -m644 -D lua.pc /tmp/destlua-lib/usr/local/lib/pkgconfig/lua.pc