tce-load -i compiletc readline-dev cd lua-5.1.5 cat > /usr/lib/pkgconfig/lua.pc << "EOF" V=5.1 R=5.1.5 prefix=/usr/local INSTALL_BIN=${prefix}/bin INSTALL_INC=${prefix}/include/lua5.1 INSTALL_LIB=${prefix}/lib INSTALL_MAN=${prefix}/man/man1 INSTALL_LMOD=${prefix}/share/lua/${V} INSTALL_CMOD=${prefix}/lib/lua/${V} exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include/lua5.1 Name: Lua Description: An Extensible Extension Language Version: ${R} Requires: Libs: -L${libdir} -llua -lm Cflags: -I${includedir} EOF patch -Np1 -i ../lua-5.1.5-shared_library-2.patch sed -i '/#define LUA_ROOT/s:/usr/local/:/usr/:' src/luaconf.h edit Makefile INSTALL_INC= $(INSTALL_TOP)/include/lua5.1 edit src/Makefile CC= gcc -flto -fuse-linker-plugin -mtune=generic -Os -pipe -std=gnu99 $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncursesw" find . -name Makefile -type f -exec sed -i 's/-O2//g' {} \; make linux sudo make TO_LIB="liblua.so liblua.so.1 liblua.so.5.1.5" INSTALL_DATA="cp -d" install sudo install -m644 -D lua.pc /usr/local/lib/pkgconfig/lua.pc