0

我正在尝试为基于 arm 的板交叉编译 lftp-4.3.5。我将配置文件执行为:

"./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 =没有”

我不得不稍微修改一下配置文件。我添加了“i_cv_posix_fallocate_works=yes”因为我遇到了类似的错误

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

我无法得到解决方案,所以我像这样修改它并摆脱了这种阻塞。

现在它要求 readline 库,我下载了 lib 源代码(readline-6.2)并交叉编译它。在运行 make 文件时,make 脚本没有从给定位置获取交叉编译的 libreadline.a 文件(我在运行 configure 时添加了 --libdir 路径)。无论如何,我能够提供这个库来制作脚本,但是当脚本读取这个库时,它抛出了很多错误:

/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

现在: 1.是否有人可以帮助我解决这里的问题?2.或者无论如何我可以跳过这个readline lib的添加?('--with-readline=no' 选项未在配置文件中配置)。

我试图从 4-5 天开始交叉编译,但仍然坚持这一点。任何人都会帮助我。

谢谢,拉胡尔

4

1 回答 1

1

考虑到未定义的引用,例如 tputs( http://linux.die.net/man/3/tputs ),它们似乎是 ncurses 库的一部分( http://www.gnu.org/software/ncurses /)。您需要交叉编译并与 ncurses 链接。

于 2012-06-09T14:43:02.347 回答