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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • sublime3激活码【在线注册码/序列号/破解码】

    sublime3激活码【在线注册码/序列号/破解码】,https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月19日
    38
  • 如何利用腾讯云服务器搭建个人网站[通俗易懂]

    如何利用腾讯云服务器搭建个人网站[通俗易懂]你是否想要搭建一个网站,却苦苦找不到方法,你是否看到别人搭建的网站,自己羡慕不已,今天,就教大家来搭建一个简单的个人网站。在这里,我采用的是腾讯云服务器搭建的。首先,需要注册腾讯云账号,登录腾讯云,点击控制台进入控制台后,选择域名注册看到的结果如下图所示:开始注册域名:提交订单后,域名就注册成功了。接下来需要购买云主机(云服务器),流程如下用…

    2022年6月29日
    47
  • Python中Permission denied怎么解决

    Python中Permission denied怎么解决运行代码时,出现诸如这样的文件的权限有可能出问题,不过更多是路径本身有问题。

    2025年8月18日
    3
  • 计算机网络-划分子网 四大类必会题型

    计算机网络-划分子网 四大类必会题型必记知识点A类:0~126,默认子网掩码:255.0.0.0B类:128~191,默认子网掩码:255.255.0.0C类:192~223,默认子网掩码:255.255.255.0子网地址:网络号(照抄)+子网号(照抄)+主机号(全为0)广播地址:网络号(照抄)+子网号(照抄)+主机号(全为1)子网掩码:网络号(全为1)+子网号(全为1)+主机号(全为0)IP地址总数:根据主机号的位数得出可分配IP地址总数:主机数(IP地址总数-2)(减去全0和全1的

    2022年6月27日
    30
  • 符号_王者荣耀2019名字特殊符号大全 最好看的特殊符号复制[通俗易懂]

    符号_王者荣耀2019名字特殊符号大全 最好看的特殊符号复制[通俗易懂][海峡网]大家玩王者荣耀的时候都会取一个特别的名字,如果再加上特殊符号的话,会让人更印象深刻,也比较容易交上朋友,那么2019年哪些特殊符号可以用在游戏中,一起来了解一下吧。【王者荣耀特殊符号推荐2019】1、爱心符号:დღ♡❣❤❥❦❧♥2、音符符号:♩♪♫♬♭♮♯3、文化符号:☠☤☥☦☧☨☩☪☫☬☮☭☯☸☽☾♕♚♛✙✚✛✜…

    2022年6月1日
    36
  • 本地mysql文件浏览器_可视化数据库浏览器(SQLite Database Browser)

    本地mysql文件浏览器_可视化数据库浏览器(SQLite Database Browser)SQLiteDatabaseBrowser可以管理所有iphone数据,基于Qt库开发,主要是为非技术用户创建、修改和编辑SQLite数据库的工具,使用向导方式实现。用来处理SQLite3数据库文件的应用程序,它能够打开sqlite3数据库文件(常见的文件扩展名为.db,.db3,.s3db;只要文件是SQLite3数据库文件,其扩展名不规范也不要紧)。SQLiteDatabas…

    2025年10月15日
    1

发表回复

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

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