[转]编译QNX平台的源码文件-google protobuf与libevent

锋影

email:[email protected]

如果你认为本系列文章对你有所帮助,请大家有钱的捧个钱场,点击此处赞助,赞助额0.1元起步,多少随意

 

1.在终端中运行QNX sdp安装目录下的环境变量文件

source  qnxsdp-env.sh

 


2.在protobuf目录下,运行configure 配置编译器为qnx编译器,目标为arm。如果qnx运行在x86或x86_64,可把ntoarmv7-gcc  ntoarmv7-g++

中的armv7替换为x86或x86_64,编译器路径根据sdp安装路径找到。

./configure --prefix=/home/zoutianming/google/qnx/protobuf-c++/arm --host=arm --build=i686-pc-linux CC=/home/zoutianming/qnx700/host/linux/x86_64/usr/bin/ntoarmv7-gcc CXX=/home/zoutianming/qnx700/host/linux/x86_64/usr/bin/ntoarmv7-g++ --with-protoc=protoc --disable-shared

3.依次执行make与make install命令

 

 


 


编译libevent

1.在终端中运行QNX sdp安装目录下的环境变量文件

source  qnxsdp-env.sh

2.在libevent目录下,运行configure 

配置编译器为qnx编译器,目标为arm。如果qnx运行在x86或x86_64,可把ntoarmv7-gcc  ntoarmv7-g++

中的armv7替换为x86或x86_64,编译器路径根据sdp安装路径找到。

qnx运行在pc时,--host 设置为i686-pc-qnx ,运行在arm时设置为arm-qnx  

--build设定编译平台

--prefix 指定最终include文件和库文件的安装路径

CC设定编译器  

--enable-shared=no --enable-static=yes 只编译静态文件

./configure --prefix=/home/zoutianming/opensource/temp --host=i686-pc-qnx --build=i686-pc-linux CC=/home/zoutianming/qnx700/host/linux/x86_64/usr/bin/ntoarmv7-gcc  --enable-shared=no --enable-static=yes

3.依次执行make 与make install命令

在make时,可能会报SA_RESTART undefined 错误,原因时QNX中没有此信号类型,可将其更改为如下:

#ifdef SA_RESTART //to fix the problem that QNX don't have SA_RESTART 

sa.sa_flags |= SA_RESTART;

 #endif

即无该信号时,该代码不参与编译。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章