1. R12d 插件源码结构与R11之间的差异

R12d源码结构与R11有差异较大,去掉了IPC方式,增加了AccessorySDK、Transport目录, 并且AccessorySDK目录下也有个makefile。之前有的目录内容也完全不一样了,支持无线CarPlay方式,要求使用mDNSResponder-567版本的Bonjour。    环境配置及R11源码编译的方式请参考博主以前的博文:

CarPlay for Android: Bonjour 及 插件源码移植问题分析 :http://blog.csdn.net/romantic_energy/article/details/46680355

2. R12d 插件源码移植到Linux

把插件源码拷贝到Linux环境下,插件根目录下有源码目录和Examples,把源码目录修改为CarPlay_Plugin,

把Bonjour源码拷贝到插件目录下,去掉版本号,改名为mDNSResponder。修改完成后,插件根目录下有3个目录:

CarPlay_Plugin、Examples、mDNSResponder.

首先编译mDNSResponder:shell进入mDNSResponder\mDNSPosix目录下,执行make,环境搭建好了的话,此步骤没有问题。

然后编译插件源码:shell进入CarPlay_Plugin\PlatformPOSIX目录下,执行make,报以下错误:

cc1: warnings being treated as errors

In file included from ***/CarPlay_Plugin/PlatformPOSIX/../build/Release-unknown/CoreUtils/CFCompat.h:8,

from ***/CarPlay_Plugin/PlatformPOSIX/../Sources/AirPlaySettings.h:9,

from ***/CarPlay_Plugin/PlatformPOSIX/../Sources/AirPlaySettings.c:5:

***/CarPlay_Plugin/PlatformPOSIX/../build/Release-unknown/CoreUtils/CommonServices.h:1638: error: "__SIZEOF_INT128__" is not defined

make: *** [***/CarPlay_Plugin/PlatformPOSIX/../build/Release-unknown/obj/AirPlaySettings.so.o] Error 1

cc1: warnings being treated as errors意为将编译警告视为错误,因为无法去掉所有警告,将makefile中的

COMMON_WARNINGS            += -Werror

行注释掉, 即:

#COMMON_WARNINGS            += -Werror

修改后执行make,报以下错误:

Linking (unknown-Release) \033[0;35mlibAirPlay.so\033[0m

/usr/bin/ld: ***/CarPlay_Plugin/PlatformPOSIX/../build/Release-unknown/obj/AirPlayNTPClient.o: relocation R_X86_64_32 against `gLogCategory_AirPlayNTPClientCore' can not be used when making a shared object; recompile with -fPIC

***/CarPlay_Plugin/PlatformPOSIX/../build/Release-unknown/obj/AirPlayNTPClient.o: could not read symbols: Bad value

collect2: ld returned 1 exit status

make: *** [***/CarPlay_Plugin/PlatformPOSIX/../build/Release-unknown/libAirPlay.so] Error 1

按编译器提升:recompile with -fPIC

即增加一行:

COMMONFLAGS        += -fPIC

后make clean, 然后继续make编译,会得到以下错误:

Compiling (unknown-Release-shared) \033[0;35mAudioUtilsStub.c\033[0m

In file included from ***/CarPlay_Plugin/PlatformPOSIX/../build/Release-unknown/CoreUtils/CFUtils.h:10,

from ***/CarPlay_Plugin/PlatformPOSIX/../build/Release-unknown/CoreUtils/AudioUtils.h:12,

from ***/CarPlay_Plugin/PlatformPOSIX/../Support/AudioUtilsStub.c:5:

***/CarPlay_Plugin/PlatformPOSIX/../build/Release-unknown/CoreUtils/CommonServices.h:1638: warning: "__SIZEOF_INT128__" is not defined

***/CarPlay_Plugin/PlatformPOSIX/../Support/AudioUtilsStub.c:673: error: expected identifier or '(' before '{' token

make: *** [***/CarPlay_Plugin/PlatformPOSIX/../build/Release-unknown/obj/AudioUtilsStub.so.o] Error 1

Compiling (unknown-Release-shared)意为为未知系统编译,说明我们make的时候带的参数不够,查看makefile后发现,应该使用make os=linux.

查看/CarPlay_Plugin/PlatformPOSIX/../Support/AudioUtilsStub.c 673行,发现此行多了一个";"号,即:

APSAudioSessionAudioFormat    APSAudioSessionGetSupportedFormats( AudioStreamType inStreamType, CFStringRef inAudioType );

{

...

}

去掉";"号即可;

make clean 后执行 make os=linux, 提升以下错误:

Making (linux-Release) \033[0;35mlibCoreUtils.so\033[0m

make[1]: Entering directory `***/CarPlay_Plugin/AccessorySDK/PlatformPOSIX'

Compiling (linux--Release-shared) \033[0;35mAsyncConnection.c\033[0m

***/CarPlay_Plugin/AccessorySDK/PlatformPOSIX/../Support/AsyncConnection.c:36: fatal error: dns_sd.h: No such file or directory

compilation terminated.

make[1]: *** [***/CarPlay_Plugin/PlatformPOSIX/../build/Release-linux/obj/AsyncConnection.so.o] Error 1

make[1]: Leaving directory `***/CarPlay_Plugin/AccessorySDK/PlatformPOSIX'

make: *** [***/CarPlay_Plugin/PlatformPOSIX/../build/Release-linux/libCoreUtils.so] Error 2

阅读makefile后发现没有指定Bonjour的路径,于是在makefile中增加include 目录:

INCLUDES                += -I$(SRCROOT)/../mDNSResponder/mDNSShared

重新make后还是报相同的错误,久寻未果,后发现报错的makefile是/CarPlay_Plugin/AccessorySDK/PlatformPOSIX中的makefile,

应该是此makefile中的目录不对,遂及把/CarPlay_Plugin/AccessorySDK/PlatformPOSIX中的makefile中的

MDNSROOT        = $(SRCROOT)/../mDNSResponder

改为:

MDNSROOT        = $(SRCROOT)/../../mDNSResponder

后此处编译通过。但是还是有其他错误:

cc1: warnings being treated as errors

***/CarPlay_Plugin/AccessorySDK/PlatformPOSIX/../Support/CFLite.c: In function 'CFLRetain':

***/CarPlay_Plugin/AccessorySDK/PlatformPOSIX/../Support/CFLite.c:400: error: implicit declaration of function 'atomic_add_and_fetch_32'

***/CarPlay_Plugin/AccessorySDK/PlatformPOSIX/../Support/CFLite.c: In function 'CFLRuntimeRegisterClass':

***/CarPlay_Plugin/AccessorySDK/PlatformPOSIX/../Support/CFLite.c:3359: error: implicit declaration of function 'atomic_bool_compare_and_swap_32'

***/CarPlay_Plugin/AccessorySDK/PlatformPOSIX/../Support/CFLite.c:3370: error: implicit declaration of function 'atomic_read_write_barrier'

make[1]: *** [***/CarPlay_Plugin/PlatformPOSIX/../build/Release-linux/obj/CFLite.so.o] Error 1

make[1]: Leaving directory `***/CarPlay_Plugin/AccessorySDK/PlatformPOSIX'

make: *** [***/CarPlay_Plugin/PlatformPOSIX/../build/Release-linux/libCoreUtils.so] Error 2

在/CarPlay_Plugin/AccessorySDK/PlatformPOSIX中的makefile中增加

COMMONFLAGS            += -DAtomicUtils_HAS_SYNC_BUILTINS=1

COMMONFLAGS        += -fPIC

后解决。

继续编译后,报以下错误: Compiling (linux--Release-shared) \033[0;35mChaCha20Poly1305.c\033[0m ***/CarPlay_Plugin/AccessorySDK/PlatformPOSIX/../Support/ChaCha20Poly1305.c: In function '_chacha20_xor': ***/CarPlay_Plugin/AccessorySDK/PlatformPOSIX/../Support/ChaCha20Poly1305.c:584: error: subscripted value is neither array nor pointer ***/CarPlay_Plugin/AccessorySDK/PlatformPOSIX/../Support/ChaCha20Poly1305.c:585: error: subscripted value is neither array nor pointer make[1]: *** [***/CarPlay_Plugin/PlatformPOSIX/../build/Release-linux/obj/ChaCha20Poly1305.so.o] Error 1 make[1]: Leaving directory `***/CarPlay_Plugin/AccessorySDK/PlatformPOSIX' make: *** [***/CarPlay_Plugin/PlatformPOSIX/../build/Release-linux/libCoreUtils.so] Error 2 经过阅读代码和查阅网络资料后发现应该是cpu支持SIMD优化,但是编译器不支持,这里描述可能不准确,属于编译优化的问题,不够清楚, 但是修改ChaCha20Poly1305.c中的代码: #if( TARGET_HAS_NEON || ( TARGET_HAS_SSE >= SSE_VERSION( 2, 0 ) ) )     #define CHACHA20_SIMD        1 #else     #define CHACHA20_SIMD        0 #endif 为: //#if( TARGET_HAS_NEON || ( TARGET_HAS_SSE >= SSE_VERSION( 2, 0 ) ) ) //    #define CHACHA20_SIMD        1 //#else     #define CHACHA20_SIMD        0 //#endif 即不使用CHACHA20_SIMD优化后,编译通过。 至此,所有的编译目标都已经被成功编译出,分别是以下文件: airplayutil  libAirPlay.so  libAirPlaySupport.so  libAudioStream.so  libCoreUtils.so  libScreenStream.so

Linux系统carplay模块,CarPlay for Android: R12d 插件源码移植到Linux相关推荐

  1. linux系统 网站木马后门Webshell查杀工具源码

    后门这东西好让人头疼,第一文件太多了,不容易找,第二,难找,需要特征匹配啊.搞了一个python版查杀php webshell后门工具,大家可以增加后门的特征码,然后甩到后台给他查杀就可以了.适合Li ...

  2. Linux 学习数据专题【管理、编程、源码分析】——Linux相关图书选购指南

    编辑推荐--Linux专题  http://www.china-pub.com/main/linux/linux_fengrui.htm Linux相关图书选购指南 本期特约作者 冯锐 (会员名:ph ...

  3. tcpip四层源码分析(Linux)

    tcp/ip四层源码分析(Linux)之socket.c 文章目录 tcp/ip四层源码分析(Linux)之socket.c 1.socket层 2.INET socket层 socket结构体解释 ...

  4. NUC980开发板Linux系统EC20模块 移植 串口 PPP拨号

    NUC980开发板Linux系统EC20模块 移植 串口 PPP拨号 1. EC20模块连接 2. Linux内核配置 3. 交叉编译PPP 4. 拨号脚本 5. 进行拨号 1. EC20模块连接 在 ...

  5. 手机连接Linux系统 JuiceSSH - SSH Client(Android免费的SSH客户端)

    手机连接Linux系统 JuiceSSH - SSH Client(Android免费的SSH客户端) 最近迷上Linux远程连接,以前经常尝试各种方式连接Linux服务器,发现手机上解决方案,Jui ...

  6. 基于Android公交查询系统的设计与实现(论文+程序设计源码+数据库文件)

    [摘 要]随着互联网的技术的不断更新发展,人们生活节奏也在不断的加快,对于网络的依赖也越来越紧密,尤其是在等公交,经常会错过班次,但又不知道,下次班次几点发车,这样会导致乘客花掉大把时间在等待,如果可 ...

  7. Linux android studio 安卓源码导入及调试

    1.AndroidStudio导入源码和调试 需要注意以下,JDK的配置,android studio下JDK一般使用对应于SDK版本的默认JDK版本,例如android studio5.0源码--- ...

  8. android编译.a文件,Android 7.1源码编译导入AS完整教程

    本教程仅针对Android 7.1系统,为便于虚拟机备份和出现问题时的还原,本教程分为3步:初始化编译环境.源码同步.编译源码导入Android Studio. 编译源码:Android7.1.2_r ...

  9. 从谷歌官网下载android 6.0源码、编译并刷入nexus 6p手机

    版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/fuchaosz/article/details/52473660 1 前言 经过一周的奋战,终于从谷 ...

  10. Android视频直播源码开发直播平台、点播播放器哪家强?

    Android视频直播源码开发直播平台.点播播放器哪家强? 最近在项目中要加入视频直播和点播功能,那么问题来了,我需要一个播放器来播放视频流,那该如何选择呢?除了原生的VideoView(VideoV ...

最新文章

  1. Ubuntu常用翻译工具——星际译王StarDict
  2. linux后台运行命令,nohup
  3. PHP 高级编程(3/5) - 使用SPL(标准PHP库)实现观察者模式
  4. Linux下tar.xz结尾的文件的解压方法
  5. Android学习问题:关于AlertDialog中自定义布局带有的EditText无法弹出键盘
  6. Java Web之会话管理二:Session
  7. 安装win10 无网络_微软已修复Win10“无网络连接”问题 已在Dev频道测试
  8. 【MySQL】MySQL 报错 Could not retrieve transation read-only status server Unknown system tx_read_only
  9. oracle mysql增量迁移_深入浅出XTTS:Oracle数据库迁移升级利器
  10. Linux中Docker的yum源与镜像加速器
  11. 单片机C语言,从小白到菜鸟进阶教程(超详细代码解读)
  12. 产品流程图的制作方法详解
  13. 快速利用第三方平台SDK,实现点对点语音通话
  14. Android计分器课程设计,课程设计题八:篮球比赛计分器
  15. 国科大学习资料--形式语言与自动机理论(姚刚)-2020期末考试题
  16. html form提交heard,德普前妻Amber Heard戛纳合辑
  17. Python培训得多少钱
  18. java打印输出万年历_用Java编程输出万年历的功能实现
  19. Proteus仿真p时出现Cannot open‘***\LISA5476.SDF’的错误
  20. 硬盘、U盘、软盘之比较

热门文章

  1. 想学编程做程序员,是学前端好还是学后台好?
  2. 加权平均值不等式的证明
  3. 2362:数字游戏(小k和小p的传奇)
  4. Kotlin笔记 :60秒倒计时
  5. ERP: ERP系统的作用
  6. 北京/苏州内推 | 微软亚洲互联网工程院招聘NLP算法工程师(可实习)
  7. 个人邮箱怎么申请?个人外贸邮箱推荐
  8. 2022年智能马桶行业发展趋势
  9. route和bridge是什么意思_桥接模式与路由模式区别
  10. 【串口服务器】的桥接模式