pjsip编译

pjsip编译pjsip 编译主要是找到编译器路径 Xcode5 开始所有版本 系统的 gcc 整合到 xcrun 中了 需要用参数来区分在 pjlib include pj 目录下增加 con

pjsip编译主要是找到编译器路径,Xcode5开始所有版本,系统的gcc整合到xcrun中了,需要用参数来区分

————————————————————————————————————–

在pjlib/include/pj/目录下增加config_site.h文件,内容如下:

#ifdef __LP_IOS #define PJ_CONFIG_IPHONE 1 #include <pj/config_site_sample.h> #define PJMEDIA_HAS_SRTP 0 #elif defined(__LP_ANDROID) #define PJ_CONFIG_ANDROID 1 #include <pj/config_site_sample.h> #define PJMEDIA_HAS_SRTP 0 #undef PJMEDIA_AUDIO_DEV_HAS_OPENSL #define PJMEDIA_AUDIO_DEV_HAS_OPENSL 0 #endif


注:__LP_IOS、__LP_ANDROID是我编译时自己添加的,用来区分不同平台。

应用工程配置宏定义:PJ_AUTOCONF=1

————————————————-iPhone编译————————————————————-

export CC="xcrun -sdk iphoneos clang" export DEVPATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer" export IPHONESDK="iPhoneOS8.2.sdk" export ARCH="-arch arm64" ./configure-iphone --disable-resample --disable-sdl --disable-ffmpeg --disable-v4l2 --disable-speex-aec --disable-speex-codec --disable-l16-codec --disable-g722-codec --disable-g7221-codec --disable-gsm-codec --disable-ssl --disable-floating-point --disable-small-filter --disable-large-filter --disable-opencore-amr --disable-silk --disable-ilbc-codec --disable-sound --disable-oss make install-iphoneos

—————————————————-iPhone模拟器编译———————————————————-

export DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer export IPHONESDK="iPhoneSimulator8.2.sdk" export ARCH="-arch i386" export CFLAGS="-O2 -m32 -mios-simulator-version-min=5.0" export LDFLAGS="-O2 -m32 -mios-simulator-version-min=5.0" ./configure-iphone --disable-resample --disable-sdl --disable-ffmpeg --disable-v4l2 --disable-speex-aec --disable-speex-codec --disable-l16-codec --disable-g722-codec --disable-g7221-codec --disable-gsm-codec --disable-ssl --disable-floating-point --disable-small-filter --disable-large-filter --disable-opencore-amr --disable-silk --disable-ilbc-codec --disable-sound --disable-oss make install-iphonesimulator

把相应的NDK路径改为自己的安装路径即可
——————————————————Android编译——————————————————–

export ANDROID_NDK_ROOT=~/Develop/Software/android-ndk-r9d ./configure-android --disable-resample --disable-sdl --disable-ffmpeg --disable-v4l2 --disable-speex-aec --disable-speex-codec --disable-l16-codec --disable-g722-codec --disable-g7221-codec --disable-gsm-codec --disable-ssl --disable-floating-point --disable-small-filter --disable-large-filter --disable-opencore-amr --disable-silk --disable-ilbc-codec --disable-sound

一键编译脚本:

1.iPhone

#!/bin/bash # Choose your pjproject version and your currently-installed iOS SDK version: # VERSION="2.2.1" SDKVERSION="9.0" # # # # Don't change anything under this line! # # No need to change this since xcode build will only compile in the # necessary bits from the libraries we create ARCHS="armv7 armv7s arm64 i386 x86_64" DEVELOPER=`xcode-select -print-path` if [ ! -e "${DEVELOPER}" ]; then echo "please install xcode!!!" exit 1; fi REPOROOT=$(pwd) # Where we'll end up storing things in the end BUILDDIR="${REPOROOT}/build" mkdir -p $BUILDDIR # where we will keep our sources and build from. #SRCDIR="${BUILDDIR}/src" #mkdir -p $SRCDIR # where we will store intermediary builds INTERDIR="${BUILDDIR}/built" mkdir -p $INTERDIR #cd $SRCDIR # Exit the script if an error happens #set -e #if [ ! -e "./pjproject-${VERSION}.tar.bz2" ]; then # echo "Downloading pjproject-${VERSION}.tar.bz2" # curl -LO http://pjproject.org/releases/pjproject-${VERSION}.tar.bz2 #else # echo "Using pjproject-${VERSION}.tar.bz2" #fi #if [ ! -e "./pjproject" ]; then # tar zxf pjproject-${VERSION}.tar.bz2 -C ./ # mv pjproject-${VERSION} pjproject #else # echo "Using existing pjproject dir" #fi #cd "./pjproject" # build and install for iARCH in ${ARCHS} do make clean >/dev/null && make distclean >/dev/null rm build.mak if [ "${iARCH}" = "i386" ] || [ "${iARCH}" = "x86_64" ]; then PLATFORM="iPhoneSimulator" export CFLAGS="-O2 -m32 -mios-simulator-version-min=${SDKVERSION}" export LDFLAGS="-O2 -m32 -mios-simulator-version-min=${SDKVERSION}" else PLATFORM="iPhoneOS" #export CFLAGS="-miphoneos-version-min=${SDKVERSION}" fi mkdir -p "${INTERDIR}/ios-${iARCH}" export CC="xcrun -sdk iphoneos clang" export DEVPATH="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer" export ARCH="-arch ${iARCH}" export IPHONESDK="${PLATFORM}${SDKVERSION}.sdk" ./configure-iphone --prefix="${INTERDIR}/ios-${iARCH}" --disable-resample --disable-sdl --disable-ffmpeg --disable-v4l2 --disable-speex-aec --disable-speex-codec --disable-l16-codec --disable-g722-codec --disable-g7221-codec --disable-gsm-codec --disable-ssl --disable-floating-point --disable-small-filter --disable-large-filter --disable-opencore-amr --disable-silk --disable-sound --disable-oss --disable-ilbc-codec make dep && make && make install && make clean >/dev/null done build iphoneos mkdir -p "${INTERDIR}/ios-iphoneos/lib" cd "${INTERDIR}/ios-armv7/lib" for file in *.a do cd ${INTERDIR} xcrun -sdk iphoneos lipo -output ios-iphoneos/lib/$file -create -arch armv7 ios-armv7/lib/$file -arch armv7s ios-armv7s/lib/$file -arch arm64 ios-arm64/lib/$file echo "ios-iphoneos $file created." done cp -r ${INTERDIR}/ios-armv7/include ${INTERDIR}/ios-iphoneos/ echo "iphoneos Done." build iphonesimulator mkdir -p "${INTERDIR}/ios-iphonesimulator/lib" cd "${INTERDIR}/ios-i386/lib" for file in *.a do cd ${INTERDIR} xcrun -sdk iphoneos lipo -output ios-iphonesimulator/lib/$file -create -arch i386 ios-i386/lib/$file -arch x86_64 ios-x86_64/lib/$file echo "ios-iphonesimulator $file created." done #cp -r ${INTERDIR}/ios-i386/lib ${INTERDIR}/ios-iphonesimulator/ cp -r ${INTERDIR}/ios-i386/include ${INTERDIR}/ios-iphonesimulator/ echo "iphonesimulator Done."

2.Android

#!/bin/bash # Choose your pjproject version and your currently-installed Android SDK version: # VERSION="2.2.1" SDKVERSION=android-19 # # # # Don't change anything under this line! # # No need to change this since ndk build will only compile in the # necessary bits from the libraries we create ABIS="armeabi armeabi-v7a arm64-v8a x86" NDKPATH=`which ndk-build` DEVELOPER=`dirname ${NDKPATH}` echo "NDK-PATH: $DEVELOPER" if [ "$DEVELOPER" == "" ]; then echo "ERROR: not found ndk-build" exit 1; fi REPOROOT=$(pwd) # Where we'll end up storing things in the end BUILDDIR="${REPOROOT}/build" mkdir -p $BUILDDIR # where we will keep our sources and build from. #SRCDIR="${BUILDDIR}/src" #mkdir -p $SRCDIR # where we will store intermediary builds INTERDIR="${BUILDDIR}/built" mkdir -p $INTERDIR # build and install for iABI in ${ABIS} do make clean >/dev/null && make distclean >/dev/null rm build.mak export ANDROID_NDK_ROOT=${DEVELOPER} APP_PLATFORM=${SDKVERSION} TARGET_ABI=${iABI} ./configure-android --prefix="${INTERDIR}/android-${iABI}" --disable-resample --disable-sdl --disable-ffmpeg --disable-v4l2 --disable-speex-aec --disable-speex-codec --disable-l16-codec --disable-g722-codec --disable-g7221-codec --disable-gsm-codec --disable-ssl --disable-floating-point --disable-small-filter --disable-large-filter --disable-opencore-amr --disable-silk --disable-ilbc-codec --disable-sound make dep && make && make install && make clean >/dev/null done echo "android Done."









版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/232205.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 安装svn 汉化包 也不能设置中文[通俗易懂]

    (以下为亲测!)汉化包地址:https://osdn.net/projects/tortoisesvn/storage进入地址之后:选择对应版本–>>LanguagePacks–>>选择中文包问题:已经安装svn汉化包,但是不能设置为中文.解决:确保汉化包版本对应svn版本. 如果汉化包版本已经对应svn版本,则把Language文件夹里面东西全部删除,然后再次安装汉化包….

    2022年4月8日
    78
  • 服务器文件句柄数_Linux文件句柄机制

    服务器文件句柄数_Linux文件句柄机制设置文件句柄在配置我们的RedHatLinux服务器时,确保文件句柄的最大数量足够大是非常关键的。文件句柄设置表示您在Linux系统中可以打开的文件数量。使用以下命令来确定整个系统中文件句柄的最大数量:#cat/proc/sys/fs/file-max32768Oracle建议将整个系统的文件句柄值至少设置为65536。通过直接更改/proc文件系统,您可以不必重新启动机…

    2022年10月18日
    2
  • 1.插槽slot基本使用「建议收藏」

    1.插槽slot基本使用「建议收藏」<body><divid="app"><cpn></cpn><cpn><bstyle="c

    2022年8月1日
    5
  • 软件测试缺陷报告单怎么填,缺陷报告(缺陷报告怎么写)[通俗易懂]

    软件测试缺陷报告单怎么填,缺陷报告(缺陷报告怎么写)[通俗易懂]报告软件测试错误的目的是为了保证修复错误的人员可以重复报告的错误,从而有利于分析错误产生的原因,定位错误,然后修正之。因此,报告软件测试错误的基本要求。。1.首先要做一个“标题党”(此标题党非彼标题党)。标题一定要清晰简洁易理解,。[Product][Version]_[Feature]_[Title],这样描述会很清晰,也方便查找3.缺陷的标题一。。测试报告是对BUG的统计,计划的实施,后…

    2025年11月26日
    4
  • 从零开始开发物联网项目(1)——mqtt服务器搭建[通俗易懂]

    从零开始开发物联网项目(1)——mqtt服务器搭建[通俗易懂]去年开发了一个物联网的项目,入了很多坑,花了很多时间,不过最后终于做出了一个初代版本,也算完成了项目。为了避免自己遗忘,也为了让有兴趣学习物联网的同学少入点坑,我整理了一下,写成一个系列教程。通过这个教程,你可以从一个小白成长为可以自己开发物联网项目的菜鸟。项目主要要完成的功能也很简单,就是将传感器的数据通过互联网发送给服务器,然后服务器将数据保存在数据库里;或者通过web端的页面反向控制物联…

    2022年5月9日
    63
  • 百度编辑器Ueditor 增加图片水印功能的解决方案

    百度编辑器Ueditor 增加图片水印功能的解决方案

    2022年3月3日
    47

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号