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


相关推荐

  • 数据结构基础温故-1.线性表(下)

    数据结构基础温故-1.线性表(下)

    2021年6月20日
    101
  • 【电赛】2017年电赛A题——三相逆变电源EG8030测试

    【电赛】2017年电赛A题——三相逆变电源EG8030测试目录:一、相关介绍1.创建窗口【Tk】2.创建标签【Label】3.创建按钮【Button】二、简易滚动抽奖界面代码三、界面展示注:本文仅用于学习交流分享,[若有不妥之处,请指正,感谢]关键词:【电赛】【三项逆变电源】【EG8030】用到的工具有:AltiumDesigner16.0实现的功能有:①实现三相SPWM②实现三相交流电一、相关介绍SPWM:脉冲宽度按正…

    2022年5月5日
    117
  • 新手学堂之有刷/无刷动力电调与马达知识[通俗易懂]

    新手学堂之有刷/无刷动力电调与马达知识[通俗易懂]新手学堂之有刷-无刷动力知识FunRCStudio原创资料,只发RCFANS,如需转载务必注明出处。模型车需要行驶,就跟真车一样,需要一套动力单元,也有分电动和油动,至于混合动力这个估计就不需要奢望了,对于车模这么小的空间来说是不现实的,而且模型车也不需要考虑燃油经济性的问题。本文则重点介绍电动模型的动力单元。电动模型的动力,主要是指2个元件:第一就是带动

    2022年5月25日
    908
  • Win10 Ubuntu16.04/Ubuntu18.04双系统完美安装「建议收藏」

    Win10 Ubuntu16.04/Ubuntu18.04双系统完美安装「建议收藏」按照网上博客的安装教程安装的Win10+Ubuntu16.04双系统安装了好几遍都不成功?启动Ubuntu左上一直有个光标在闪?如果你的电脑也是双硬盘(装Windows系统的固态硬盘+机械硬盘),在安装Win10+Ubuntu16.04双系统前一定要提前了解如下这些安装要点。首先非常非常感谢博客作者们分享的Win10+Ubuntu16.04双系统安装教程,其中一些博客对笔者双系统的安装非…

    2022年7月24日
    9
  • SpringBoot自动装配原理「建议收藏」

    SpringBoot自动装配原理「建议收藏」SpringBoot项目无需各种配置文件,一个main方法,就能把项目启动起来。那么我们看看SpringBoot是如何进行自动配置和启动的。SpringBoot通过main方法启动SpringApplication类的静态方法run()来启动项目。根据注释的意思,run方法从一个使用了默认配置的指定资源启动一个SpringApplication并返回ApplicationContext对象,这个默认配置如何指定呢?这个默认配置来源于@SpringBootApplication注解,这个注解是个复

    2022年8月20日
    5
  • 查看端口是否占用 linux_打开vnc端口

    查看端口是否占用 linux_打开vnc端口准备使用python写一个端口探测的Linux如何查看端口1、lsof-i:端口号用于查看某一端口的占用情况,比如查看8000端口使用情况,lsof-i:8000#lsof-i:8000COMMANDPIDUSERFDTYPEDEVICESIZE/OFFNODENAMElwfs22065root6uIPv443950530…

    2022年7月27日
    20

发表回复

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

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