环境:ubuntu 14.04
目标:arm板
交叉编译器:arm-poky-linux-gnueabi-gcc 5.3.0
版本:libwebsockets-3.1.0,下载地址:https://github.com/warmcat/libwebsockets/releases
# 解压后
cd libwebsockets-3.1.0/
# 新建文件夹
mkdir build
cd build
# 设置编译器,我这里时候直接加载脚本设置
source /opt/fsl-imx-fb/qt5/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
# 配置生成MakeFile
cmake ../ \
-DCMAKE_INSTALL_PREFIX=/home/用户名/arm/libwebsockets \
-DCMAKE_SYSTEM_NAME=Linux \
-DLWS_OPENSSL_INCLUDE_DIRS=/opt/fsl-imx-fb/qt5/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/ \
-DLWS_OPENSSL_LIBRARIES="-L/opt/fsl-imx-fb/qt5/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib -lssl -lcrypto"
# 编译并安装
make
make install
参考:
网友评论