end0tknr's kipple - web写経開発

太宰府天満宮の狛犬って、妙にカワイイ

lua 言語を sourc から install

依存libraryである readline や ncurse を installした上で、 http://www.lua.org/download.html を参照し、進めましたが、 「make linux test」でエラー(以下)。

$ https://www.lua.org/ftp/lua-5.3.5.tar.gz
$ tar -xvf lua-5.3.5.tar.gz
$ cd lua-5.3.5
$ make linux test
   :
gcc -std=gnu99 -o lua   lua.o liblua.a -lm -Wl,-E -ldl -lreadline 
//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
make[2]: *** [lua] Error 1
make[2]: Leaving directory `/home/end0tknr/tmp/lua-5.3.5/src'
make[1]: *** [linux] Error 2
make[1]: Leaving directory `/home/end0tknr/tmp/lua-5.3.5/src'
make: *** [linux] Error 2
$

Lua を一般ユーザでソースコードからインストールする - はちゅにっきInstall Lua From Source によれば、 MYCFLAGS , MYLDFLAGS , MYLIBS を 指定すれば良いらしく、結果、解消。

$ make linux MYCFLAGS="-I/usr/local/include" \
       MYLDFLAGS="-L/usr/local/lib" \
       MYLIBS="-lncursesw"
$ sudo make install INSTALL_TOP=/usr/local/lua