標籤:
1. ncurses 安裝
官網下載:http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz
CSDN 下載:http://download.csdn.net/detail/spch2008/8828779
tar -xf ncurses-5.9.tar.gzcd ncurses-5.9./configuremakesudo make install
2. lua 安裝
官方網下載:http://www.lua.org/download.html
CSDN 下載:http://download.csdn.net/detail/spch2008/8828787
tar -xf lua-5.3.1.tar.gzcd lua-5.3.1make linuxsudo make install
問題一:
error: readline/readline.h: No such file or directory
下載readline
CSDN下載:http://download.csdn.net/detail/spch2008/8828777
cd readline-5.2./configuresudo makesudo make install
問題二:
//usr/local/lib/libreadline.so: undefined reference to `tputs‘//usr/local/lib/libreadline.so: undefined reference to `tgoto‘//usr/local/lib/libreadline.so: undefined reference to `tgetflag‘//usr/local/lib/libreadline.so: undefined reference to `UP‘//usr/local/lib/libreadline.so: undefined reference to `tgetent‘//usr/local/lib/libreadline.so: undefined reference to `tgetnum‘//usr/local/lib/libreadline.so: undefined reference to `PC‘//usr/local/lib/libreadline.so: undefined reference to `tgetstr‘//usr/local/lib/libreadline.so: undefined reference to `BC‘collect2: error: ld returned 1 exit status
添加 -lncurses 參數
/home/spch2008/lua-5.3.1/src/Makefile
linux:110 $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline -lncurses"
3. vim 安裝
官方下載:ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
CSDN下載:http://download.csdn.net/detail/spch2008/8828773
tar -xf vim-7.4.tar.bz2cd vim74./configure --prefix=/usr --with-features=huge --enable-rubyinterp --enable-pythoninterp --enable-luainterp --with-lua-prefix=/usr/local
sudo make
sudo make install
可以將輸出重新導向到log檔案中,查看configure輸出:
cat log | grep lua
[email protected]:~/vim74$ cat log | grep luachecking --enable-luainterp argument... yeschecking --with-lua-prefix argument... /usr/localchecking --with-luajit... nochecking for lua... /usr/local/bin/luachecking if lua.h can be found in /usr/local/include... yeschecking if link with -L/usr/local/lib -llua is sane... yes
問題:
objects/if_lua.o: In function `luaV_list_insert‘:/home/spch2008/vim74/src/if_lua.c:777: undefined reference to `luaL_optlong‘collect2: error: ld returned 1 exit status
修改檔案 /home/spch2008/vim74/src/if_lua.c
//long pos = luaL_optlong(L, 3, 0);
long pos = (long)luaL_optinteger(L, 3, 0);
4. 安裝成功,檢測時間,可能遇到問題
開啟vim,輸入:version, 查看vim編譯時間,如果是本次編譯產生,則說明正確,然後查看是否有+lua。
若編譯時間不正確,則刪除舊vim,拷貝新的vim程式
sudo rm -f /usr/bin/vimsudo rm -f /usr/local/binsudo cp ~/vim74/src/vim /usr/binsudo cp ~/vim74/src/vim /usr/local/bin
vim 重新編譯,支援lua (compile vim with lua)