make linux
cd src && make linux
make[1]: Entering directory `/root/lua/lua-5.3.2/src'
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
make[2]: Entering directory `/root/lua/lua-5.3.2/src'
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX -c -o lua.o lua.c
lua.c:80:31: fatal error: readline/readline.h: No such file or directory
#include <readline/readline.h>
^
compilation terminated.
make[2]: *** [lua.o] Error 1
make[2]: Leaving directory `/root/lua/lua-5.3.2/src'
make[1]: *** [linux] Error 2
make[1]: Leaving directory `/root/lua/lua-5.3.2/src'
make: *** [linux] Error 2
解决方法:
缺少libreadline-dev依赖包
centos: yum install readline-devel
debian: apt-get install libreadline-dev.
http://www.vcerror.com/?p=1786
# make linux
cd src && make linux
make[1]: Entering directory `/home/lua/lua-5.3.2/src'
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
make[2]: Entering directory `/home/lua/lua-5.3.2/src'
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX -c -o lua.o lua.c
gcc -std=gnu99 -o lua lua.o liblua.a -lm -Wl,-E -ldl -lreadline
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX -c -o luac.o luac.c
gcc -std=gnu99 -o luac luac.o liblua.a -lm -Wl,-E -ldl -lreadline
make[2]: Leaving directory `/home/lua/lua-5.3.2/src'
make[1]: Leaving directory `/home/lua/lua-5.3.2/src'