libuv移植全记录

下载源码

通过GitHub下载源码
https://github.com/libuv/libuv

编译安装源码

$ sh autogen.sh
$ ./configure --prefix=/opt/armlib_mipsel/libuv --host=mipsel-openwrt-linux CC=mipsel-openwrt-linux-gcc
$ make
$ make check//该步骤可以省略,只是校验一下,直接安装,由于运行平台不同check会报错
$ make install

全过程问题记录

$ sh autogen.sh
autogen.sh: 1: autogen.sh: automake: not found
autogen.sh: 33: test: Illegal number: 
autogen.sh: 34: test: Illegal number: 
+ libtoolize --copy
autogen.sh: 43: autogen.sh: libtoolize: not found

问题:缺少工具,通过apt安装

$ apt install automake
$ apt install libtool
$ make check
make  test/run-tests
make[1]: Entering directory '/opt/armsrc/libuv'
make[1]: 'test/run-tests' is up to date.
make[1]: Leaving directory '/opt/armsrc/libuv'
make  check-TESTS
make[1]: Entering directory '/opt/armsrc/libuv'
./test/run-tests: line 117: /opt/armsrc/libuv/test/.libs/lt-run-tests: cannot execute binary file: Exec format error
./test/run-tests: line 117: /opt/armsrc/libuv/test/.libs/lt-run-tests: Success
FAIL: test/run-tests
======================================================
1 of 1 test failed
Please report to https://github.com/libuv/libuv/issues
======================================================
Makefile:4481: recipe for target 'check-TESTS' failed
make[1]: *** [check-TESTS] Error 1
make[1]: Leaving directory '/opt/armsrc/libuv'
Makefile:4737: recipe for target 'check-am' failed
make: *** [check-am] Error 2

问题:由于交叉编译产生的test/run-tests测试程序无法运行,可以忽略该错误,直接编译安装即可。

扩展说明

configure的–prefix 作用:
设置安装目录。如果不配置该选项,安装后可执行文件默认放在/usr/local/bin,库文件默认放在/usr/local/lib,配置文件默认放在/usr/local/etc,其它的资源文件放在/usr/local/share。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值