用的是地平线交叉编译工具链
# 在此目录下操作
/usr/local/exosip2/
# 最终效果
root@sony-HP-Notebook:/usr/local/exosip2# ls
exosip2_horizon libexosip2-5.1.2 libexosip2-5.1.2.tar.gz libosip2-5.1.2 libosip2-5.1.2.tar.gz osip2_horizon
由于exosip2依赖osip2,所以先编译osip2
wget http://ftp.twaren.net/Unix/NonGNU//osip/libosip2-5.1.2.tar.gz
tar xvf libosip2-5.1.2.tar.gz
cd libosip2-5.1.2
touch build.sh
#! /bin/bash
ARM_CROSS_TOOL=/home/z/cross_tool/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/bin
SYS_LIB_DIR=$ARM_CROSS_TOOL/../arm-linux-gnueabihf/libc/usr/
export PATH=$PATH:$ARM_CROSS_TOOL
OUT_TARGET=`pwd`/../osip2_arm
mkdir -p $OUT_TARGET
export CC=$ARM_CROSS_TOOL/arm-linux-gnueabihf-gcc
export CXX=$ARM_CROSS_TOOL/arm-linux-gnueabihf-g++
export AR=$ARM_CROSS_TOOL/arm-linux-gnueabihf-ar
export LD=$ARM_CROSS_TOOL/arm-linux-gnueabihf-ld
export RANLIB=$ARM_CROSS_TOOL/arm-linux-gnueabihf-ranlib
./configure \
--host=arm-linux-gnueabihf \
--prefix=$OUT_TARGET
make -j8
make install
echo "the output files are in $OUT_TARGET"
cp -rvf $OUT_TARGET/* $SYS_LIB_DIR
#!/bin/bash
ARM_CROSS_TOOL=/usr/local/horizon/gcc-linaro-6.5.0-2018.12-x86_64_aarch64-linux-gnu/bin
# 设置生成之后拷贝到的目录可以写死/usr/local/horizon/gcc-linaro-6.5.0-2018.12-x86_64_aarch64-linux-gnu/lib/usr/,记得提前创建好目录,否则拷贝不过去,
# 后期作为exosip2的编译依赖
SYS_LIB_DIR=$ARM_CROSS_TOOL/../lib/usr/
export PATH=$PATH:$ARM_CROSS_TOOL
OUT_TARGET=`pwd`/../osip2_horizon
mkdir -p $OUT_TARGET
export CC=$ARM_CROSS_TOOL/aarch64-linux-gnu-gcc
export CXX=$ARM_CROSS_TOOL/aarch64-linux-gnu-g++
export AR=$ARM_CROSS_TOOL/aarch64-linux-gnu-ar
export LD=$ARM_CROSS_TOOL/aarch64-linux-gnu-ld
export RANLIB=$ARM_CROSS_TOOL/aarch64-linux-gnu-ranlib
./configure \
--host=aarch64-linux-gnu \
--prefix=$OUT_TARGET
make -j8
make install
echo "the output files are in $OUT_TARGET"
cp -rvf $OUT_TARGET/* $SYS_LIB_DIR
chmod +x build.sh
./build.sh
# 位置一
root@sony-HP-Notebook:/usr/local/exosip2/osip2_horizon# ls
include lib share
wget http://download.savannah.nongnu.org/releases/exosip/libexosip2-5.1.2.tar.gz
tar xvf libexosip2-5.1.2.tar.gz
注意:编译涉及到libosip2,需要将交叉编译的osip2库放到交叉编译器的libc/usr中,否则会出现osipparser2/osip_message.h: No such file or directory编译错误。libosip2的交叉编译见https://blog.csdn.net/weixin_43479963/article/details/109494578
#! /bin/bash
ARM_CROSS_TOOL=/home/z/cross_tool/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/bin
SYS_LIB_DIR=$ARM_CROSS_TOOL/../libc/usr/
OSIP2_LIB_DIR=/data/project/scm/gb28181/src/libosip2/osip2_arm
export PATH=$PATH:$ARM_CROSS_TOOL
OUT_TARGET=`pwd`/../exosip2_horizon
mkdir -p $OUT_TARGET
export CC=$ARM_CROSS_TOOL/arm-linux-gnueabihf-gcc
export CXX=$ARM_CROSS_TOOL/arm-linux-gnueabihf-g++
export AR=$ARM_CROSS_TOOL/arm-linux-gnueabihf-ar
export LD=$ARM_CROSS_TOOL/arm-linux-gnueabihf-ld
export RANLIB=$ARM_CROSS_TOOL/arm-linux-gnueabihf-ranlib
./configure \
--host=arm-linux-gnueabihf \
--prefix=$OUT_TARGET \
--disable-openssl \
--enable-static \
--enable-shared
make -j8
make install
echo "the output files are in $OUT_TARGET"
切记关闭–disable-openssl
#!/bin/bash
ARM_CROSS_TOOL=/usr/local/horizon/gcc-linaro-6.5.0-2018.12-x86_64_aarch64-linux-gnu/bin
OSIP2_LIB_DIR=/usr/local/exosip2/osip2_horizon
export PATH=$PATH:$ARM_CROSS_TOOL
OUT_TARGET=`pwd`/../exosip2_horizon
mkdir -p $OUT_TARGET
export CC=$ARM_CROSS_TOOL/aarch64-linux-gnu-gcc
export CXX=$ARM_CROSS_TOOL/aarch64-linux-gnu-g++
export AR=$ARM_CROSS_TOOL/aarch64-linux-gnu-ar
export LD=$ARM_CROSS_TOOL/aarch64-linux-gnu-ld
export RANLIB=$ARM_CROSS_TOOL/aarch64-linux-gnu-ranlib
# 指定osip2的依赖
export C_INCLUDE_PATH=/usr/local/exosip2/osip2_horizon/include/
export LD_LIBRARY_PATH=/usr/local/exosip2/osip2_horizon/lib/
./configure \
--host=aarch64-linux-gnu \
--prefix=$OUT_TARGET \
--with-osip=/usr/local/exosip2/osip2_horizon \
--disable-openssl \
--enable-static \
--enable-shared \
OSIP_CFLAGS=-I/usr/local/exosip2/osip2_horizon/lib/include OSIP_LIBS="-L/usr/local/exosip2/osip2_horizon/lib -losip2 -losipparser2"
make -j8
make install
echo "the output files are in $OUT_TARGET"
chmod +x build.sh
./build.sh
# 位置一
root@sony-HP-Notebook:/usr/local/exosip2/exosip2_horizon# ls
include lib bin
openssl-1.1.0f编译
mkdir build
../Configure linux-elf
no-asm #关于汇编模块的编译,部分汇编会报错,因此关掉
--cross-compile-prefix=aarch64-himix100-linux- #编译链前缀
--prefix=/home/lisi/DeepGlint/dgsipserver/thirdlibs/himix100_install/openssl-1.1.0f #安装目录
make && make install
————————————————
版权声明:本文为CSDN博主「剪烛西窗」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/lhf19891003/article/details/110853915