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)
上一篇 2025年10月26日 上午9:01
下一篇 2025年10月26日 上午9:22


相关推荐

  • c语言fsync函数,c – 如何在一个流上做fsync?

    c语言fsync函数,c – 如何在一个流上做fsync?不幸的是,查看标准没有提供basic_filebuf或任何basic_[io]?fstream类模板,以允许您提取底层的操作系统文件描述符(以fileno()为CstdioI/O的方式).也没有一个open()方法或构造函数将这样的文件描述符作为参数(这将允许您使用不同的机制打开文件并记录文件句柄).有basic_ostream::flush(),但是我怀疑这实际上并不调用fsyn…

    2022年5月23日
    42
  • python用pyinstaller编译成exe_pycharm编译成exe

    python用pyinstaller编译成exe_pycharm编译成exe在pycharm中使用pyinstaller生成exe文件:解决通常在cmd中用pyinstaller打包的exe文件太大的问题1、在pycharm中创建虚拟环境:2、在虚拟环境中添加打包程序所需要的库:添加国内镜像库链接,基本可以正常安装所有需要的库;添加pyinstaller工具:提示:一定要按照上面的配置进行,否则会出错在需要打包的程序中右键选中externalTools—>pyinstaller等待程序打包完成,在打包程序目录下的dist文件夹中就有生成的exe文件

    2022年8月27日
    8
  • oracle建表语句以及约束

    oracle建表语句以及约束创建表基本语法 约束实体完整性主键约束唯一性约束域完整性 check 约束引用完整性 ForeignKEY 约束非空 NOTNULL 约束 顾名思义 所约束的列不能为 NULL 值 否则就会报错创建列级约束创建表级约束主键 唯一性约束 Check 约束 ForeignKEY 例

    2025年11月3日
    4
  • 一文览尽ToF深度相机技术

    一文览尽ToF深度相机技术点击上方“3D视觉工坊”,选择“星标”干货第一时间送达摘要:现行专业级或消费级的3D相机所采用的三角法(Triangulation)和飞时法(Time-of-Flight,ToF),现因…

    2022年5月25日
    50
  • 手机不显示允许usb调试_安卓手机怎么开启usb调试模式

    手机不显示允许usb调试_安卓手机怎么开启usb调试模式问题真机调试,连接USB后,通常会显示如下认证。未认证的设备显示如下有些机器在某些情况下,可能没有弹出认证窗口,可以通过下面的方式尝试解决。解决在开发者选项中撤销USB调试授权执行adbreconnect重新插拔USB调试线重新你的手机尝试关闭,开启一次USB调试尝试关闭开发者模式,重新打开开发者模式…

    2025年11月3日
    3
  • java出现中文乱码_Java开发中中文乱码总结

    java出现中文乱码_Java开发中中文乱码总结1.jsp页面内容显示乱码这种乱码原因很简单,一般的工具或解码程序对中文字符解析时采用默认的解码方式:我们只需修改其编码方式即可,如下:字符集:UTF-8>GBK>GB23122.jsp与Servlet间跳转出现中文乱码2.1:method=”Post”jsp中form表单的ation=”XxxServlet”,method=”Post”时,提交表单后往往发现中文的属性值在Se…

    2022年7月8日
    19

发表回复

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

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