LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   error when compile lua 5.3.3 (https://www.linuxquestions.org/questions/slackware-14/error-when-compile-lua-5-3-3-a-4175596517/)

sithun 12-31-2016 05:51 AM

error when compile lua 5.3.3
 
i try to compile lua 5.3.3 using slackbuild with changed version and have this error:


Code:

ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o
ranlib liblua.a
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lua.o lua.c
gcc -std=gnu99 -o lua  lua.o liblua.a -lm -Wl,-E -ldl -lreadline
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tputs'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgoto'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgetflag'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `UP'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgetent'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgetnum'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `PC'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgetstr'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `BC'
collect2: error: ld returned 1 exit status
Makefile:63: recipe for target 'lua' failed
make[2]: *** [lua] Error 1
make[2]: Leaving directory '/usr/src/lua-5.3.3/src'
Makefile:110: recipe for target 'linux' failed
make[1]: *** [linux] Error 2
make[1]: Leaving directory '/usr/src/lua-5.3.3/src'
Makefile:55: recipe for target 'linux' failed
make: *** [linux] Error 2


how to fix it?

hazel 12-31-2016 06:04 AM

libreadline is failing to find certain functions from other libraries. tgoto and several others come from termcap. tputs is from ncurses. You should have both of these but maybe not in the right place.

gengisdave 12-31-2016 09:54 AM

Just pass "-ncurses" in LDFLAGS. For completeness, this is the core of my slackbuild:

Code:

sed -i "s|/usr/local|/usr|" src/luaconf.h
sed -i "s|lib/lua|lib64/lua|" src/luaconf.h
sed -i "s|/usr/local|/usr|" etc/lua.pc
sed -i "s|prefix}/lib|prefix}/lib64|g" etc/lua.pc

make linux CFLAGS="$SLKCFLAGS \$(MYCFLAGS)" LDFLAGS="-lncurses" INSTALL_TOP=/usr INSTALL_LIB=/usr/lib64 INSTALL_LMOD=/usr/share/lua/5.3 INSTALL_CMOD=/usr/lib64/lua/5.3 || exit 1
make linux install CFLAGS="$SLKCFLAGS \$(MYCFLAGS)" LDFLAGS="-lncurses" INSTALL_TOP=$PKG/usr INSTALL_LIB=$PKG/usr/lib64 INSTALL_LMOD=$PKG/usr/share/lua/5.3 INSTALL_CMOD=$PKG/usr/lib64/lua/5.3 || exit 1

mkdir -p shared
cd shared
  ar -x $PKG/usr/lib64/liblua.a
  gcc -ldl -lreadline -lhistory -lncurses -lm -shared *.o -o liblua.so.$VERSION
  cp -a liblua.so.$VERSION $PKG/usr/lib64
  ( cd $PKG/usr/lib64
    ln -s liblua.so.$VERSION liblua.so.5.1
    ln -s liblua.so.$VERSION liblua.so.5
    ln -s liblua.so.$VERSION liblua.so
  )
cd ..


sithun 12-31-2016 10:19 AM

Quote:

Originally Posted by gengisdave (Post 5648574)
Just pass "-ncurses" in LDFLAGS. For completeness, this is the core of my slackbuild:

Code:

sed -i "s|/usr/local|/usr|" src/luaconf.h
sed -i "s|lib/lua|lib64/lua|" src/luaconf.h
sed -i "s|/usr/local|/usr|" etc/lua.pc
sed -i "s|prefix}/lib|prefix}/lib64|g" etc/lua.pc

make linux CFLAGS="$SLKCFLAGS \$(MYCFLAGS)" LDFLAGS="-lncurses" INSTALL_TOP=/usr INSTALL_LIB=/usr/lib64 INSTALL_LMOD=/usr/share/lua/5.3 INSTALL_CMOD=/usr/lib64/lua/5.3 || exit 1
make linux install CFLAGS="$SLKCFLAGS \$(MYCFLAGS)" LDFLAGS="-lncurses" INSTALL_TOP=$PKG/usr INSTALL_LIB=$PKG/usr/lib64 INSTALL_LMOD=$PKG/usr/share/lua/5.3 INSTALL_CMOD=$PKG/usr/lib64/lua/5.3 || exit 1

mkdir -p shared
cd shared
  ar -x $PKG/usr/lib64/liblua.a
  gcc -ldl -lreadline -lhistory -lncurses -lm -shared *.o -o liblua.so.$VERSION
  cp -a liblua.so.$VERSION $PKG/usr/lib64
  ( cd $PKG/usr/lib64
    ln -s liblua.so.$VERSION liblua.so.5.1
    ln -s liblua.so.$VERSION liblua.so.5
    ln -s liblua.so.$VERSION liblua.so
  )
cd ..


thanks a lot. it helped


All times are GMT -5. The time now is 02:57 AM.