0
votes

I am trying to cross compile lftp-4.3.5 for my arm based board. I executed the configure file as:

"./configure --host=arm-montavista-linux CXX=arm-montavista-linux-gnueabi-g++ CC=arm-montavista-linux-gnueabi-gcc --with-openssl=/abcd/xxx/yyy/ssl with_included_readline=no"

I had to modify the configure file a bit. I added "i_cv_posix_fallocate_works=yes" coz I was getting errors like

checking for pty.h... yes
checking for library containing openpty... -lutil
checking for _getpty... configure: error: in `/home/xxxx/yyyy/lftp-4.3.5':
checking whether posix_fallocate() works... no
configure: error: cannot run test program while cross compiling
See `config.log' for more details

I could not get the solution for this so I modified it like this and got rid of this blockage.

Now it was asking for readline library, I downloaded the lib source code (readline-6.2) and cross compiled it. while running make file, make script was not taking the cross-compiled libreadline.a file from given location (I added --libdir path while running configure). Anyhow I was able to provide this lib to make script, but when scrip read this lib, it threw many errors as:

/bin/sh ../libtool --silent --tag=CXX   --mode=link arm-montavista-linux-gnueabi-g++  -O2 -Wall -Wwrite-strings -Woverloaded-virtual -fno-exceptions -fno-rtti -fno-implement-inlines  -s -o lftp lftp.o complete.o lftp_rl.o attach.o liblftp-jobs.la -lreadline -lutil -ldl 
/home/dev/montavista/tools/arm-gnueabi/bin/../lib/gcc/arm-montavista-linux-gnueabi/4.4.1/../../../../arm-montavista-linux-gnueabi/bin/ld: warning: library search path "/usr/local/lib/lftp/4.3.7" is unsafe for cross-compilation
/usr/local/lib/lftp/4.3.7/libreadline.a(display.o): In function `cr':
/home/dev/workspace/readline-6.2/display.c:2465: undefined reference to `tputs'
/usr/local/lib/lftp/4.3.7/libreadline.a(display.o): In function `_rl_clear_screen':
/home/dev/workspace/readline-6.2/display.c:2345: undefined reference to `tputs'
/usr/local/lib/lftp/4.3.7/libreadline.a(display.o): In function `_rl_clear_to_eol':
/home/dev/workspace/readline-6.2/display.c:2322: undefined reference to `tputs'
/usr/local/lib/lftp/4.3.7/libreadline.a(display.o): In function `_rl_move_vert':
/home/dev/workspace/readline-6.2/display.c:2053: undefined reference to `tputs'
/home/dev/workspace/readline-6.2/display.c:2061: undefined reference to `tputs'
/usr/local/lib/lftp/4.3.7/libreadline.a(display.o):/home/dev/workspace/readline-6.2/display.c:1981: more undefined references to `tputs' follow
/usr/local/lib/lftp/4.3.7/libreadline.a(display.o): In function `insert_some_chars':
/home/dev/workspace/readline-6.2/display.c:2369: undefined reference to `tgoto'
/home/dev/workspace/readline-6.2/display.c:2370: undefined reference to `tputs'
/home/dev/workspace/readline-6.2/display.c:2379: undefined reference to `tputs'
/home/dev/workspace/readline-6.2/display.c:2386: undefined reference to `tputs'
/home/dev/workspace/readline-6.2/display.c:2395: undefined reference to `tputs'
/usr/local/lib/lftp/4.3.7/libreadline.a(display.o): In function `delete_chars':
/home/dev/workspace/readline-6.2/display.c:2412: undefined reference to `tgoto'
/home/dev/workspace/readline-6.2/display.c:2413: undefined reference to `tputs'
/home/dev/workspace/readline-6.2/display.c:2419: undefined reference to `tputs'
/usr/local/lib/lftp/4.3.7/libreadline.a(display.o): In function `rl_redisplay':
/home/dev/workspace/readline-6.2/display.c:1083: undefined reference to `tputs'
/usr/local/lib/lftp/4.3.7/libreadline.a(terminal.o): In function `_rl_set_cursor':
/home/dev/workspace/readline-6.2/terminal.c:728: undefined reference to `tputs'
/usr/local/lib/lftp/4.3.7/libreadline.a(terminal.o): In function `_rl_control_keypad':
/home/dev/workspace/readline-6.2/terminal.c:701: undefined reference to `tputs'
/usr/local/lib/lftp/4.3.7/libreadline.a(terminal.o):/home/dev/workspace/readline-6.2/terminal.c:703: more undefined references to `tputs' follow
/usr/local/lib/lftp/4.3.7/libreadline.a(terminal.o): In function `_rl_get_screen_size':
/home/dev/workspace/readline-6.2/terminal.c:269: undefined reference to `tgetnum'
/home/dev/workspace/readline-6.2/terminal.c:285: undefined reference to `tgetnum'
/usr/local/lib/lftp/4.3.7/libreadline.a(terminal.o): In function `_rl_init_terminal_io':
/home/dev/workspace/readline-6.2/terminal.c:452: undefined reference to `tgetent'
/usr/local/lib/lftp/4.3.7/libreadline.a(terminal.o): In function `get_term_capabilities':
/home/dev/workspace/readline-6.2/terminal.c:415: undefined reference to `tgetstr'
/usr/local/lib/lftp/4.3.7/libreadline.a(terminal.o): In function `_rl_init_terminal_io':
/home/dev/workspace/readline-6.2/terminal.c:516: undefined reference to `tgetflag'
/home/dev/workspace/readline-6.2/terminal.c:516: undefined reference to `tgetflag'
/home/dev/workspace/readline-6.2/terminal.c:531: undefined reference to `tgetflag'
/home/dev/workspace/readline-6.2/terminal.c:546: undefined reference to `PC'
/home/dev/workspace/readline-6.2/terminal.c:546: undefined reference to `BC'
/home/dev/workspace/readline-6.2/terminal.c:546: undefined reference to `UP'
collect2: ld returned 1 exit status
make[1]: *** [lftp] Error 1
make[1]: Leaving directory `/home/dev/workspace/sslftp/lftp-4.3.7/src'
make: *** [all-recursive] Error 1

Now: 1. If anybody could help me figuring out the issue here? 2. or by any mean I could skip the addition of this readline lib? ('--with-readline=no' option not configured in config file).

I am trying to cross-compilation since 4-5 days and yet hanging with this. Anybody would help me pls.

Thanks, Rahul

1

1 Answers

1
votes

Considering the undefined references such as tputs(http://linux.die.net/man/3/tputs), it seems that they are a part of the ncurses library(http://www.gnu.org/software/ncurses/). You would need to cross compile and link with ncurses.