0

我一直在尝试为 arm64 架构构建 Libyuv,然后将其集成到 PJSIP 库中。但是我没有取得任何进展,因为 Pjsip 无法找到libyuv.a框架。

在配置 Pjsip 构建时,我使用以下命令:

ARCH='-arch arm64' ./configure-iphone --with-libyuv=/Users/Mayur/Desktop/pjsip/externals/libyuv/out_ios/Release-iphoneos

这是所在的文件夹libyuv.a

但是,在配置时,会出现此行:

checking for I420Scale in -lyuv... no

关于这里有什么问题的任何建议?

参考 :

  1. 为 iPhone 构建 Pjsip:https ://trac.pjsip.org/repos/wiki/Getting-Started/iPhone

  2. 构建 libyuv:https ://trac.pjsip.org/repos/ticket/1776

更新

这就是我构建的方式libyuv.a

  1. GYP_DEFINES="OS=ios target_arch=arm64 target_subarch=arm64" GYP_CROSSCOMPILE=1 GYP_GENERATOR_FLAGS="output_dir=out_ios" ./gyp_libyuv -f ninja --depth=. libyuv_test.gyp

  2. ninja -j7 -C out_ios/Release-iphoneos libyuv_unittest

这成功地创建了库,但我没有得到连接该库的正确方法!

4

3 回答 3

1

事实证明,如果您使用 PJSIP 的最新版本并libyuv按照问题中的描述安装框架,它就会完美地构建。

只需使用以下命令查看修订版 5128:

svn checkout -r 5128 http://svn.pjsip.org/repos/pjproject/trunk pjproject

它还包含 iOS 中的方向修复!

于 2015-07-28T12:52:16.183 回答
0

从 PJSIP 2.5.5 开始,libyuv 包含在 PJSIP 包中,并且删除了配置脚本参数 --with-libyuv,请查看票证 #1937 了解更多信息。

https://trac.pjsip.org/repos/wiki/Getting-Started/iPhone

于 2018-11-02T19:49:29.183 回答
0

使用以下脚本构建 PJSIP 库。

脚步 :

  1. 复制脚本并制作 .sh 文件。
  2. 将 .sh 文件复制到 PJSIP Lib 文件夹中。
  3. 运行 chmod 777 .sh_filename
  4. 运行脚本(例如 ./pjsip_auto_2.6.sh)

#!/bin/sh

BASE_DIR=$(pwd)

# Create config_site.h file in path
echo "#define PJ_CONFIG_IPHONE 1 
#define PJ_HAS_IPV6 1
#include <pj/config_site_sample.h>" > pjlib/include/pj/config_site.h


# Compile Library and Build For Default iPhone 4 use armv7 architecture
./configure-iphone && make dep && make clean && make


# Build For iPhone 5, use armv7s architecture
ARCH='-arch armv7s' ./configure-iphone && make dep && make clean && make


# Build For iPhone 5s, use arm64 architecture
ARCH='-arch arm64' ./configure-iphone && make dep && make clean && make


# Build For Simulator, use i386 architecture
export DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
ARCH="-arch i386" CFLAGS="-O2 -m32 -mios-simulator-version-min=5.0" LDFLAGS="-O2 -m32 -mios-simulator-version-min=5.0" ./configure-iphone
make dep && make clean && make


# Build For Simulator, use x86_64 architecture
export DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
ARCH="-arch x86_64" CFLAGS="-O2 -m32 -mios-simulator-version-min=5.0" LDFLAGS="-O2 -m32 -mios-simulator-version-min=5.0" ./configure-iphone
make dep && make clean && make


# Create (arm64,armv7,armv7s,i386, x86_64, unified) Folder
if [ ! -d libs/arm64 ];
then
mkdir -p libs/arm64
echo "arm64 Folder created"
else
echo "arm64 Folder exists"
fi

if [ ! -d libs/armv7 ];
then
mkdir -p libs/armv7
echo "armv7 Folder created"
else
echo "armv7 Folder exists"
fi

if [ ! -d libs/armv7s ];
then
mkdir -p libs/armv7s
echo "armv7s Folder created"
else
echo "armv7s Folder exists"
fi

if [ ! -d libs/i386 ];
then
mkdir -p libs/i386
echo "i386 Folder created"
else
echo "i386 Folder exists"
fi

if [ ! -d libs/x86_64 ];
then
mkdir -p libs/x86_64
echo "x86_64 Folder created"
else
echo "x86_64 Folder exists"
fi

if [ ! -d libs/unified ];
then
mkdir -p libs/unified
echo "unified Folder created"
else
echo "unified Folder exists"
fi


# Copy From pjlib folder to Libs

cp pjlib/lib/*-arm64-apple-darwin_ios.a libs/arm64/
cp pjlib/lib/*-armv7-apple-darwin_ios.a libs/armv7/
cp pjlib/lib/*-armv7s-apple-darwin_ios.a libs/armv7s/
cp pjlib/lib/*-i386-apple-darwin_ios.a libs/i386/
cp pjlib/lib/*-x86_64-apple-darwin_ios.a libs/x86_64/

# Copy From pjlib-util folder to Libs

cp pjlib-util/lib/*-arm64-apple-darwin_ios.a libs/arm64/
cp pjlib-util/lib/*-armv7-apple-darwin_ios.a libs/armv7/
cp pjlib-util/lib/*-armv7s-apple-darwin_ios.a libs/armv7s/
cp pjlib-util/lib/*-i386-apple-darwin_ios.a libs/i386/
cp pjlib-util/lib/*-x86_64-apple-darwin_ios.a libs/x86_64/

# Copy From pjmedia folder to Libs

cp pjmedia/lib/*-arm64-apple-darwin_ios.a libs/arm64/
cp pjmedia/lib/*-armv7-apple-darwin_ios.a libs/armv7/
cp pjmedia/lib/*-armv7s-apple-darwin_ios.a libs/armv7s/
cp pjmedia/lib/*-i386-apple-darwin_ios.a libs/i386/
cp pjmedia/lib/*-x86_64-apple-darwin_ios.a libs/x86_64/

# Copy From pjnath folder to Libs

cp pjnath/lib/*-arm64-apple-darwin_ios.a libs/arm64/
cp pjnath/lib/*-armv7-apple-darwin_ios.a libs/armv7/
cp pjnath/lib/*-armv7s-apple-darwin_ios.a libs/armv7s/
cp pjnath/lib/*-i386-apple-darwin_ios.a libs/i386/
cp pjnath/lib/*-x86_64-apple-darwin_ios.a libs/x86_64/

# Copy From pjsip folder to Libs

cp pjsip/lib/*-arm64-apple-darwin_ios.a libs/arm64/
cp pjsip/lib/*-armv7-apple-darwin_ios.a libs/armv7/
cp pjsip/lib/*-armv7s-apple-darwin_ios.a libs/armv7s/
cp pjsip/lib/*-i386-apple-darwin_ios.a libs/i386/
cp pjsip/lib/*-x86_64-apple-darwin_ios.a libs/x86_64/

# Copy From third_party folder to Libs

cp third_party/lib/*-arm64-apple-darwin_ios.a libs/arm64/
cp third_party/lib/*-armv7-apple-darwin_ios.a libs/armv7/
cp third_party/lib/*-armv7s-apple-darwin_ios.a libs/armv7s/
cp third_party/lib/*-i386-apple-darwin_ios.a libs/i386/
cp third_party/lib/*-x86_64-apple-darwin_ios.a libs/x86_64/


# Rename file name From Created folder

cd $BASE_DIR/libs/arm64/
rename 's/\-arm64\-apple\-darwin_ios//g' *.a

cd $BASE_DIR/libs/armv7/
rename 's/\-armv7\-apple\-darwin_ios//g' *.a

cd $BASE_DIR/libs/armv7s/
rename 's/\-armv7s\-apple\-darwin_ios//g' *.a

cd $BASE_DIR/libs/i386/
rename 's/\-i386\-apple\-darwin_ios//g' *.a

cd $BASE_DIR/libs/x86_64/
rename 's/\-x86_64\-apple\-darwin_ios//g' *.a


cd $BASE_DIR/libs/

# Combine Libs to united folder

export LIB_NAME="libg7221codec.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libgsmcodec.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libilbccodec.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libpj.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libpjlib-util.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libpjmedia-audiodev.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libpjmedia-codec.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libpjmedia-videodev.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libpjmedia.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libpjnath.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libpjsdp.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libpjsip-simple.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libpjsip-ua.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libpjsip.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libpjsua.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libpjsua2.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libresample.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libspeex.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libsrtp.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libyuv.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME

export LIB_NAME="libwebrtc.a"
lipo -arch armv7 armv7/$LIB_NAME -arch armv7s armv7s/$LIB_NAME -arch arm64 arm64/$LIB_NAME -arch i386 i386/$LIB_NAME -arch x86_64 x86_64/$LIB_NAME -create -output unified/$LIB_NAME



echo 'Congratulation you have built PJSIP Library successfully'

于 2017-08-09T09:10:47.147 回答