Warning: The original page of this article http://www.centoscn.com/yunwei/Lua/2013/0817/1284.html
On the basis of a slight modification, if there is infringement, please notify the deletion, thank you!
Get root permission before you take the official action!
1. Download the package
[Email protected] ~]# wget http://www.lua.org/ftp/lua-5.3.1.tar.gz
2. Unzip
[Email protected] lua]# tar zxf lua-5.3.1.tar.gz
3. Modify the Makefile file
[[Email protected]]# CD lua-5.3.1
[Email protected] lua-5.3.1]# vim Makefile
install_top=/usr/local/lua
4. Run the installation
[[email protected] lua-5.3.1]# make Linux
MAKE[1]: Entering directory '/USR/LOCAL/LUA/LUA-5.3.1/SRC '
Make all syscflags= "-dlua_use_linux" syslibs= "-wl,-e-ldl-lreadline-lncurses"
MAKE[2]: Entering directory '/USR/LOCAL/LUA/LUA-5.3.1/SRC '
GCC-O2-WALL-DLUA_COMPAT_ALL-DLUA_USE_LINUX-C-O lua.o lua.c
Gcc-o Lua LUA.O liblua.a-lm-wl,-e-ldl-lreadline-lncurses
GCC-O2-WALL-DLUA_COMPAT_ALL-DLUA_USE_LINUX-C-O luac.o luac.c
Gcc-o Luac LUAC.O liblua.a-lm-wl,-e-ldl-lreadline-lncurses
MAKE[2]: Leaving directory '/USR/LOCAL/LUA/LUA-5.3.1/SRC '
MAKE[1]: Leaving directory '/USR/LOCAL/LUA/LUA-5.3.1/SRC '
[[email protected] lua-5.3.1]# make install
CD src && mkdir-p/usr/local/lua/bin/usr/local/lua/include/usr/local/lua/lib/usr/local/lua/man/man1/usr/ local/lua/share/lua/5.3/usr/local/lua/lib/lua/5.3
CD src && install-p-M 0755 Lua Luac/usr/local/lua/bin
CD src && install-p-M 0644 lua.h luaconf.h lualib.h lauxlib.h lua.hpp/usr/local/lua/include
CD src && install-p-M 0644 liblua.a/usr/local/lua/lib
CD Doc && install-p-m 0644 lua.1 Luac.1/usr/local/lua/man/man1
5. Verify
[Email protected] lua-5.3.1]#/usr/local/lua/bin/lua
Lua 5.3.1 Copyright (C) 1994-2015 lua.org, Puc-rio
>
Congratulations, the installation was successful!
Note: If you encounter make Linux or make install error, first run
[email protected] lua-5.3.1]# Yum install-y readline-devel ncurses-devel
Then make Linux and make install again
Configuring the LUA Runtime environment under CentOS