README: update README.md and add --list-features option

parent 52a0d874
[![Build Status](https://travis-ci.org/BelledonneCommunications/linphone-iphone.svg?branch=master)](https://travis-ci.org/BelledonneCommunications/linphone-iphone)
# BUILDING THE SDK
# Building the SDK
Linphone for iPhone depends on liblinphone SDK. This SDK is generated from makefiles and shell scripts.
* GPL third parties versus non GPL third parties
To generate the liblinphone multi-arch SDK in GPL mode, simply invoke:
This SDK can be generated in 2 flavors. First is with GPL third parties, it means liblinphone includes GPL third parties like FFMPEG or X264.
If you choose this flavor, your final application must comply with GPL in any case. This is the default mode.
./prepare.py [options] && make
Note: We are not compiling for the 32 bits i386 simulator by default because since iPhone 6 / iOS 8 simulators run in 64 bits. If you want to activate it, you should call prepare.py "i386" architecture.
**The resulting SDK is located in `liblinphone-sdk/` root directory.**
To generate the liblinphone multi arch SDK in GPL mode, do:
## Licensing: GPL third parties versus non GPL third parties
./prepare.py && make
This SDK can be generated in 2 flavors.
ALTERNATIVELY, you can force liblinphone to use only non GPL code except for liblinphone, mediastreamer2, oRTP, belle-sip.
If you choose this flavor, your final application is still subject to GPL except if you have a commercial license for liblinphone, mediastreamer2, oRTP, belle-sip.
* When choosing using GPL third parties, it means liblinphone includes GPL third parties like FFmpeg or X264. If you choose this flavor, your final application must comply with GPL in any case. This is the default mode.
* When choosing NOT using GPL third parties, Linphone will only use non GPL code except for `liblinphone`, `mediastreamer2`, `oRTP` and `belle-sip`.
If you choose this flavor, your final application is still subject to GPL except if you have a commercial license for liblinphone, mediastreamer2, oRTP, belle-sip.
To generate the liblinphone multi arch SDK in non GPL mode, do:
./prepare.py -DENABLE_GPL_THIRD_PARTIES=NO && make
./prepare.py -DENABLE_GPL_THIRD_PARTIES=NO [other options] && make
## Customizing features
You can choose to enable / disable features such as custom audio / video codecs, media encryption, etc. To get a list of all features, the simplest way is to invoke `prepare.py` with `--list-features`:
./prepare.py --list-features
You can for instance enable X264 by using:
./prepare.py -DENABLE_X264=ON [other options]
## Built architectures
4 architectures currently exists on iOS:
- 64 bits ARM64 for iPhone 5s, iPad Air, iPad mini 2, iPhone 6, iPhone 6 Plus, iPad Air 2, iPad mini 3.
- 32 bits ARMv7 for older devices.
- 64 bits x86_64 for simulator for all ARM64 devices.
- 32 bits i386 for simulator for all ARMv7 older devices.
Note: We are not compiling for the 32 bits i386 simulator by default because xCode default device (iPhone 6) runs in 64 bits. If you want to enable it, you should invoke `prepare.py` with `i386` argument: `./prepare.py i386 [other options]`.
* In case you upgrade your IOS SDK, you may force rebuilding everything, by doing
## Upgrading your iOS SDK
./prepare.py -c && ./prepare.py && make
Simply re-invoking `make` should update your SDK. If compilation fails, you may need to rebuilding everything by invoking:
**The resulting sdk is in `liblinphone-sdk/` root directory.**
./prepare.py -c && ./prepare.py [options] && make
# BUILDING THE APPLICATION
# Building the application
After the SDK is built, just open the Linphone Xcode project with Xcode, and press `Run`.
* Note regarding third party components subject to license:
## Note regarding third party components subject to license
The liblinphone-sdk is compiled with third parties code that are subject to patent license, specially: AMR, SILK G729 and H264 codecs.
Linphone controls the embedding of these codecs thanks to the preprocessor macros HAVE_SILK, HAVE_AMR, HAVE_G729 HAVE_OPENH264 positioned in Xcode project.
Before embedding these 4 codecs in the final application, make sure to have the right to do so.
# TESTING THE APPLICATION
# Testing the application
We are using the KIF framework to test the UI of Linphone. It is used as a submodule (instead of CocoaPods) for ease.
Simply press `Command + U` and the default simulator / device will launch and try to pass all the tests.
# LIMITATIONS, KNOWN BUGS
# Limitations and known bugs
* Video capture does not work in simulator (not implemented by simulator?).
* Video capture will not work in simulator (not implemented in simulator).
# DEBUGING THE SDK
# Debugging the SDK
Sometime it can be useful to step into liblinphone SDK functions. To allow Xcode to enable breakpoint within liblinphone, SDK must be built with debug symbols.
To add debug symbol to liblinphone SDK, use:
Sometime it can be useful to step into liblinphone SDK functions. To allow XCode to enable breakpoint within liblinphone, SDK must be built with debug symbols by using option `--debug`:
./prepare.py -d && make
./prepare.py --debug [other options] && make
# DEBUGING MEDIASTREAMER2
## Debugging mediastreamer2
For iOS specific media development like audio video capture/playback it may be interesting to use `mediastream` test tool.
The project `submodule/liblinphone.xcodeproj` can be used for this purpose.
# Quick UI reference for Linphone iOS:
# Quick UI reference
- The app is contained in a window, which resides in the MainStoryboard file.
- The delegate is set to LinphoneAppDelegate in main.m, in the UIApplicationMain() by passing its class
......@@ -86,7 +106,7 @@ MainStoryboard
#--> tabBar
When the app is started, the phoneMainView gets asked to transition to the Dialer view or the Wizard view.
When the application is started, the phoneMainView gets asked to transition to the Dialer view or the Wizard view.
PhoneMainView exposes the -changeCurrentView: method, which will setup its
Any Linphone view is actually presented in the UICompositeViewController, with or without a stateBar and tabBar.
......
......@@ -26,6 +26,7 @@ import argparse
import os
import re
import shutil
import tempfile
import sys
from distutils.spawn import find_executable
from subprocess import Popen, PIPE
......@@ -467,6 +468,8 @@ def main(argv=None):
'-G' '--generator', help="CMake build system generator (default: Unix Makefiles).", default='Unix Makefiles', choices=['Unix Makefiles', 'Ninja'])
argparser.add_argument(
'-L', '--list-cmake-variables', help="List non-advanced CMake cache variables.", action='store_true', dest='list_cmake_variables')
argparser.add_argument(
'-lf', '--list-features', help="List optional features and their default values.", action='store_true', dest='list_features')
argparser.add_argument(
'-t', '--tunnel', help="Enable Tunnel.", action='store_true')
argparser.add_argument('platform', nargs='*', action=PlatformListAction, default=[
......@@ -474,13 +477,11 @@ def main(argv=None):
args, additional_args = argparser.parse_known_args()
if args.debug_verbose:
additional_args += ["-DENABLE_DEBUG_LOGS=YES"]
if check_tools() != 0:
return 1
install_git_hook()
if args.debug_verbose:
additional_args += ["-DENABLE_DEBUG_LOGS=YES"]
additional_args += ["-G", args.G__generator]
if args.G__generator == 'Ninja':
......@@ -491,13 +492,26 @@ def main(argv=None):
generator = '$(MAKE) -C'
if args.tunnel:
additional_args += ["-DENABLE_TUNNEL=YES"]
if not os.path.isdir("submodules/tunnel"):
print("Tunnel enabled but not found, trying to clone it...")
if check_is_installed("git", "it", True):
Popen("git clone gitosis@git.linphone.org:tunnel.git submodules/tunnel".split(" ")).wait()
else:
return 1
additional_args += ["-DENABLE_TUNNEL=YES"]
if args.list_features:
tmpdir = tempfile.mkdtemp(prefix="linphone-iphone")
tmptarget = IOSarm64Target()
option_regex = re.compile("ENABLE_(.*):(.*)=(.*)")
for line in Popen(tmptarget.cmake_command("Debug", False, True, additional_args),
cwd=tmpdir, shell=False, stdout=PIPE).stdout.readlines():
match = option_regex.match(line)
if match is not None:
print("ENABLE_{} (is currently {})".format(match.groups()[0], match.groups()[2]))
shutil.rmtree(tmpdir)
return 0
selected_platforms = []
for platform in args.platform:
......@@ -528,6 +542,7 @@ def main(argv=None):
if os.path.isfile('Makefile'):
os.remove('Makefile')
elif selected_platforms:
install_git_hook()
generate_makefile(selected_platforms, generator)
return 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment