Configure the Lua runtime environment in Centos

Source: Internet
Author: User

Configure the Lua runtime environment in linux

1. Download package

[Root @ dev ~] # Wgethttp: // www.lua.org/ftp/lua-5.2.0.tar.gz


2. Extract

Export root@devlua?#tarzxflua-5.2.0.tar.gz


3. Modify the Makefile file

[Root @ devlua] # cdlua-5.2.0

[Root@devlua-5.2.0] # vimMakefile


INSTALL_TOP =/usr/local/lua


4. Run and install

[Root@devlua-5.2.0] # makelinux

Make [1]: Enteringdirectory '/usr/local/lua/lua-5.2.0/src'
MakeallSYSCFLAGS = "-DLUA_USE_LINUX" SYSLIBS = "-Wl,-E-ldl-lreadline-lncurses"
Make [2]: Enteringdirectory '/usr/local/lua/lua-5.2.0/src'
Gcc-O2-Wall-DLUA_COMPAT_ALL-DLUA_USE_LINUX-c-olua.olua.c
Gcc-olualua.oliblua.a-lm-Wl,-E-ldl-lreadline-lncurses
Gcc-O2-Wall-DLUA_COMPAT_ALL-DLUA_USE_LINUX-c-oluac.oluac.c
Gcc-oluacluac.oliblua.a-lm-Wl,-E-ldl-lreadline-lncurses
Make [2]: Leavingdirectory '/usr/local/lua/lua-5.2.0/src'
Make [1]: Leavingdirectory '/usr/local/lua/lua-5.2.0/src'

[Root@devlua-5.2.0] # makeinstall

Cdsrc & 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.2/usr/local/lua/lib/lua/5.2
Cdsrc & install-p-m0755lualuac/usr/local/lua/bin
Cdsrc & install-p-m0644lua.hluaconf.hlualib.hlauxlib.hlua.hpp/usr/local/lua/include
Cdsrc & install-p-m0644liblua.a/usr/local/lua/lib
Cddoc & install-p-m0644lua.1luac.1/usr/local/lua/man/man1


5. Verify

[Root@devlua-5.2.0] #/usr/local/lua/bin/lua
Lua5.2.0Copyright (C) 1994-2011Lua.org, PUC-Rio
>
Congratulations! The installation is successful!


Note: if an error occurs in makelinux or makeinstall, run

[Root@devlua-5.2.0] # yuminstall-yreadline-develncurses-devel

Then re-run makelinux and makeinstall

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.