1.主机操作系统为ubuntu 18.04。交叉编译需要用到的软件包为
zlib-1.2.8.tar.bz2
上面文件可通过此下载链接下载
nginx.v1.6.2.tar.bz2
上面文件可通过此下载链接下载
2.交叉编译nginx
1)将zlib nginx包解压

tar -xvf zlib-1.2.8.tar.bz2
tar -xvf nginx.v1.6.2.tar.bz2

2)配置configure

cd nginx/nginx-1.6.2
mkdir nginx
vi b.sh
CC_PATH=/opt/hisi-linux/x86-arm/aarch64-himix100-linux/bin/aarch64-himix100-linux-gcc#交叉编译工具路径
CPP_PATH=/opt/hisi-linux/x86-arm/aarch64-himix100-linux/bin/aarch64-himix100-linux-g++#交叉编译工具路径
HOME_NGINX=/xxxx/xxxx/xxxx/xxx/ #解压出来的路径可用pwd代替
#./configure --prefix=/opt/project/hi3559a/lib_add/nginx \
./configure --prefix=./nginx \
--add-module=$HOME_NGINX/nginx/arut-nginx-rtmp-module-7a35372 \
--with-zlib=$HOME_NGINX/zlib-1.2.8 \
--without-pcre --without-http_rewrite_module \
--with-http_ssl_module \
--with-openssl=$HOME_NGINX/nginx/openssl-1.0.2 \
--with-cc=$CC_PATH  \
--with-cpp=$CPP_PATH

3)交叉编译

./b.sh
make ;make install

3.遇到的坑
1)error: 'NGX_SYS_NERR’错误

src/os/unix/ngx_errno.c: In function 'ngx_strerror':
src/os/unix/ngx_errno.c:37:31: error: 'NGX_SYS_NERR' undeclared (first use in this function)msg = ((ngx_uint_t) err < NGX_SYS_NERR) ? &ngx_sys_errlist[err]:^~~~~~~~~~~~
src/os/unix/ngx_errno.c:37:31: note: each undeclared identifier is reported only once for each function it appears in
src/os/unix/ngx_errno.c: In function 'ngx_strerror_init':
src/os/unix/ngx_errno.c:58:11: error: 'NGX_SYS_NERR' undeclared (first use in this function)len = NGX_SYS_NERR * sizeof(ngx_str_t);^~~~~~~~~~~~
objs/Makefile:680: recipe for target 'objs/src/os/unix/ngx_errno.o' failed
make[1]: *** [objs/src/os/unix/ngx_errno.o] Error 1
make[1]: Leaving directory '/opt/project/hi3559a/lib_src/nginx/nginx-1.6.2'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2

出错的原因仍然是因为交叉编译程序无法本地运行,导致NGX_SYS_NERR宏没有赋值。解决办法,手动编辑 objs/ngx_auto_config.h,加上

vi objs/ngx_auto_config.h
#ifndef NGX_SYS_NERR
#define NGX_SYS_NERR  132
#endif

2)ngx_shm_free错误

objs/src/core/ngx_cycle.o: In function `ngx_init_cycle':
/opt/project/hi3559a/lib_src/nginx/nginx-1.6.2/src/core/ngx_cycle.c:457: undefined reference to `ngx_shm_free'
/opt/project/hi3559a/lib_src/nginx/nginx-1.6.2/src/core/ngx_cycle.c:462: undefined reference to `ngx_shm_alloc'
/opt/project/hi3559a/lib_src/nginx/nginx-1.6.2/src/core/ngx_cycle.c:648: undefined reference to `ngx_shm_free'
objs/src/event/ngx_event.o: In function `ngx_event_module_init':
/opt/project/hi3559a/lib_src/nginx/nginx-1.6.2/src/event/ngx_event.c:525: undefined reference to `ngx_shm_alloc'
collect2: error: ld returned 1 exit status
objs/Makefile:256: recipe for target 'objs/nginx' failed
make[1]: *** [objs/nginx] Error 1
make[1]: Leaving directory '/opt/project/hi3559a/lib_src/nginx/nginx-1.6.2'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2

解决办法

vi objs/ngx_auto_config.h
#ifndef NGX_HAVE_SYSVSHM
#define NGX_HAVE_SYSVSHM 1
#endif

4.移植到hi3559a
将当前目录下的nginx目录下所有移植到海思3559a上
修改nginx/conf/nginx.conf

vi nginx.conf
#user  nobody;
worker_processes  1;#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {worker_connections  1024;
}

修改如下

user  root;
worker_processes  1;#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {worker_connections  1024;
}

运行

./nginx -c /opt/project/hi3559a/lib_add/nginx/conf/nginx.conf -p /opt/project/hi3559a/lib_add/nginx/

结束

海思hi3559a nginx 移植相关推荐

  1. 海思Hi3559A平台移植 opencv4.0.0

    原文:https://blog.csdn.net/xclshwd/article/details/85257117 海思Hi3559A平台移植 opencv4.0.0 2018年12月26日 09:5 ...

  2. 海思Hi3559a音视频同时播放的例子

    原文链接:海思Hi3559a音视频同时播放的例子 在mpp/sample下新建av目录 (1)编写Makefile,如下: Hisilicon Hi35xx sample Makefile inclu ...

  3. python交叉编译_交叉编译Python3.6.2,使用海思arm-hisiv200-linux-gcc,移植到arm开发板上...

    最近在学习Python,感觉使用Python可以快速的写出程序,比之前使用的C语言快多了,能省出很多时间.多学一点知识有更多的选择.本职工作是嵌入式开发,学习了Python后想移植到开发板上,尝试嵌入 ...

  4. mysql移植海思_live555 交叉编译移植到海思开发板

    1.首先到它的主页下载一个源码包: http://www.live555.com/liveMedia/public/ 我下载的是latest的,具体什么版本还真不清楚 2.放到linux目录下解压: ...

  5. HI3515海思开发板移植3G模块笔记

    硬件平台: 海思Hi3515 Linux 3G模块: 1.移动模块:ZTE M305(TD-SCDMA) 2.联通模块:HUAWEI EM770W(WCDMA) 3.电信模块:HUAWEI EM660 ...

  6. 海思3519上移植Qt5.5.1

    1. 源码下载 网址:http://download.qt.io/archive/qt/5.5/5.5.1/single/ 源码包: qt-everywhere-opensource-src-5.5. ...

  7. 海思Hi3516A上移植OpenCV

    最近新换了工作,工作中一项任务是将OpenCV移植到Hi3516A平台上.这项工作涉及到很多步骤,中间可以说经历了千难万险,克服了种种艰难困苦,最终成功了!现将过程详细写出,一方面作为此段工作的总结和 ...

  8. 如何在海思 Hi3519AV100上移植YOLOV3 (3)

    隔了好久来填坑,这次写一下怎么在板卡中部署模型. 打个小广告: 海思hi3519av100开发板链接: https://item.taobao.com/item.htm?spm=a230r.1.14. ...

  9. 海思3559平台移植二维码解码库zbar

    1. 下载并解压 zbar 源码包: http://zbar.sourceforge.net/download.html zbar-0.10.tar.bz2 解压缩: tar -xvjf zbar-0 ...

  10. 海思HI3559A SDK文档说明

    添加链接描述1. OS部分 目录: ReleaseDoc\zh\01.software\board\OSDRV 主要文档: Hi3559A╱C V100 U-boot 移植应用开发指南.pdf Hi3 ...

最新文章

  1. MQCache 秒开缓存快速入门指南 - 旁路(使用镜像交换机)
  2. 前端如何让倒计时更准确
  3. [leetcode] 68.二叉树的最近公共祖先
  4. (转)用Java获得当前性能信息
  5. 【360开源】Wayne:企业级可视化多集群Kubernetes一站式管理平台
  6. [实战]Router configuration for TP ROOM
  7. git 怎么拉取线上代码到本地进行合并_android studio如何使用git提交、拉取、合并代码的操作...
  8. 资产组合管理中有哪些基础概念?
  9. 高斯金字塔 matlab,图像拼接中 高斯金字塔的建立 matlab程序详细解释 现金奖励...
  10. 通过一个月时间字段分组
  11. FPGA--串口通信基础知识
  12. 运维工程师常见软件故障_软件故障分类| 软件工程师
  13. android压缩gif大小,使用手机制作GIF动图,免费无水印、大小可调,安卓、iphone都可以...
  14. 普元云计算-AI杂谈:从洗衣机到老鼠屁股
  15. Springboot 阿里云OSS修改下载文件名称
  16. 常见笔记本CPU型号参数和性能对比一览表
  17. ucos 和uclinux的区别及各自的特点
  18. 团队管理24--团建活动
  19. YDOOK:PyDraw 所见即所得 Python GUI 绘制框架 编程源自 JY Lin
  20. HyperLedger Cello学习笔记

热门文章

  1. win7安装python3.7失败_win7安装python3.7出现setup failed,成功解决
  2. 电路串联和并联图解_如何识别串联电路和并联电路
  3. 物联网轻松上云实践 之 HaaS样板间
  4. idea 右键修复lint格式问题
  5. YYLabel使用笔记
  6. jenkins+donet core持续集成环境搭建
  7. VS2013创建Windows服务 || VS2015+Windows服务简易教程
  8. 计算机设计漫画图片,漫画人物设计电脑版
  9. 【matlab】 matlab中如何取整
  10. ROS Navigation-----发布Odometry信息