Harnessing Open Source Library WebRTC
Fourth chapter-Compiling Mac&ios edition
Author: Adam Acknowledgements: Lao Zhang
Date: 2015-4-6
Version: 1.0.0
Welcome reprint, has the question feedback q:2780113541, as far as possible consummates series of tutorials. Update Address: Https://github.com/wpc320/webrtc_doc.git
Depot_tools proxy settings Reference old Zhang "the best wall in history download WEBRTC code Description _20150401"
0, the official source of SVN since 2015-3-24 has moved to Google git
Some tutorials that use SVN addresses are no longer available or need to be improved
1, the deployment of HTTP (s) to SOCK5 agent, specific reference to the first chapter
Shadowsocks: Proxy Address 127.0.0.1:1080
Privoxy: Proxy Address 127.0.0.1:8118
2, compiling environment preparation
MacOS X 10.9.5 host or virtual machine one, install Xcode6
I work area for $home, to ensure that the remaining space of more than 10G
3, download tool preparation
Cd$home
Gitconfig--global Http.proxy http://127.0.0.1:8118
Gitconfig--global Https.proxy https://127.0.0.1:8118
Gitclone Https://chromium.googlesource.com/chromium/tools/depot_tools.git
4, set the Download tool path to environment variables
Echo ' Export path= $HOME/depot_tools/: $PATH ' >> ~/.bash_profile
Source~/.bash_profile
5, download tool agent settings and download WEBRTC
Vi$home/depot_tools/http_proxy.boto, the contents are as follows:
[Boto]
proxy= 127.0.0.1
proxy_port= 8118
Setting environment variables, such as new open terminals, needs to be reset
exporthttp_proxy=http://127.0.0.1:8118
exporthttps_proxy=https://127.0.0.1:8118
Gitconfig--global Http.proxy http://127.0.0.1:8118
Gitconfig--global Https.proxy https://127.0.0.1:8118
Exportpath= $HOME/depot_tools/: $PATH
exportno_auth_boto_config= $HOME/depot_tools/http_proxy.boto
Mkdir$home/webrtc_ios
Cd$home/webrtc_ios
Exportgyp_defines= "Os=ios"
First download input download command:
Fetchwebrtc_ios
Wait for several G download complete, it is best not to complain.
The error indicates that there is a problem with the network or the top proxy settings, troubleshooting and then executing the following command:
Download code:
Gitpull or Gitfetch
To download a dependency build compilation file:
Gclientsync
6, compile WebRTC
With the iOS platform example, set the environment variables:
Exportgyp_crosscompile=1
exportgyp_defines= "Os=ios target_arch=arm arm_version=7"
Exportgyp_generator_flags= "Output_dir=out_ios"
Exportgyp_generators=ninja
Perform:
Cd$home/webrtc_ios/src
Webrtc/build/gyp_webrtc
Wait for project file generation complete ...
Compile:
Ninja-c Out_ios/debug-iphoneos
Other platform compilation reference: Http://www.webrtc.org/native-code/ios
---------------------------Advanced-----------------------------------
1. Code and Dependency updates
Cd$home/webrtc_ios
exportgyp_defines= "$GYP _defines Os=ios"
Sync Download Source:
Gitpull or Gitfetch
Synchronize download dependencies and generate compiled files based on gyp_generators settings:
Gclientsync
Only synchronous download dependencies do not generate compilation files:
Gclientsync--nohooks
Build the compiled file only based on gyp_generators settings:
Gclientrunhooks
2, if the Python library error, replace the new version of Python
_BSDDB, that's because the Mac has a problem with the Python library.
Manually update python, I'm using a 2.7.9 pkg,10.6+ system that can be installed.
Https://www.python.org/ftp/python/2.7.9/python-2.7.9-macosx10.6.pkg
Install well and then perform
sudo rm/usr/bin/pydoc
sudo rm/usr/bin/python
sudo rm/usr/bin/pythonw
sudo rm/usr/bin/python-config
This old Python connector is removed
New open terminal input python, display 2.7.9 that is ok,ctrl+d exit.
3. Compile with Xcode
The new WEBRTC is compiled using Xcode Ninja under OS X.
New Open terminal, enter:
Cd$home/webrtc_ios/src
Export gyp_generator_flags= "Xcode_project_version=3.2xcode_ninja_target_pattern=all_ios Xcode_ninja_executable_ Target_pattern=apprtcdemo|libjingle_peerconnection_unittest|libjingle_peerconnection_objc_testoutput_dir=out_ iOS
Exportgyp_generators= "Ninja,xcode-ninja"
Webrtc/build/gyp_webrtc
You can then find all.ninja.xcodeproj in the SRC directory to open the compilation.
In addition, there are two other projects under SRC, one is as an index sources_for_ Indexing.xcodeproj, one is all.ninja.xcworkspace,xcode open there are warning and error, later again, there are know how to solve the friend can tell me.
For more equipment please refer to:
Http://www.webrtc.org/native-code/ios