1、安装基本库: yum install libtermcap-devel ncurses-devel libevent-devel readline-devel
2、下载源码
wget http://www.lua.org/ftp/lua-5.1.4.tar.gz
tar -xzvf lua-5.1.4.tar.gz
3、编译
cd lua-5.1.4
make linux
make install
会把头文件放在/usr/local/include文件夹中,将liblua.a放在/usr/local/lib文件夹中
makefile文件注意
$(TARGET): $(OBJ) ../comm/libcomm.a ../lua/liblua.a
@$(CXX) $(CXX_FLAG) -Bstatic -lpthread $^ -o $(TARGET) $(INC) $(LIB)
@echo Build... $(TARGET)