基于ARM的板交叉编译lftp-4.3.5封装

时间:2012-06-09 10:05:49

标签: cross-compiling embedded-linux lftp

我正在尝试为我的基于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 = no“

我不得不稍微修改配置文件。我添加了“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路径)。无论如何我能够提供这个lib来制作脚本,但是当脚本读取这个lib时,它会抛出许多错误:

/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

现在: 如果有人能帮我解决这个问题吗? 2.或者通过任何方式我可以跳过添加这个readline lib? ('--with-readline = no'选项未在配置文件中配置。)

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

谢谢, 拉胡

1 个答案:

答案 0 :(得分:1)

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