From da017901fced0b9f05cb824f7e13ba8dc2ca9b51 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 26 Mar 2012 12:27:24 +0200 Subject: [PATCH] make zrtp compilation optional --- README | 17 +++++++++++------ submodules/build/Makefile | 13 ++++++++++--- submodules/build/builder-iphone-os.mk | 10 ++++++++-- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/README b/README index 4f0900f9d..096cfdadb 100644 --- a/README +++ b/README @@ -36,19 +36,24 @@ BUILDING THE SDK * GPL third parties versus non GPL third parties -This sdk can be generated in 2 flavors. Firt 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. + This sdk can be generated in 2 flavors. Firt 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. -To generate the liblinphone multi arch sdk in GPL mode, do: + To generate the liblinphone multi arch sdk in GPL mode, do: $ cd submodules/build $ make all -ALTERNATIVELY, you can force liblinphone to use only non GPL code except for liblinphone, mediastremer2, ortp, exosip, osip. -If you choose this flavor, your final application is still subject to GPL except if you have a commercial license for liblinphone, mediastremer2, ortp, exosip, osip. + ALTERNATIVELY, you can force liblinphone to use only non GPL code except for liblinphone, mediastremer2, ortp, exosip, osip. + If you choose this flavor, your final application is still subject to GPL except if you have a commercial license for liblinphone, mediastremer2, ortp, exosip, osip. -To generate the liblinphone multi arch sdkin non GPL mode, do: + To generate the liblinphone multi arch sdkin non GPL mode, do: $ cd submodules/build $ make all enable_gpl_third_parties=no + + * ZRTP support + + You can enable ZRTP support in GPL mode only, by adding "enable_zrtp=yes" to the make command, for example: + $ make all enable_gpl_third_parties=yes enable_zrtp=yes The resulting sdk is in liblinphone-sdk/ directory. diff --git a/submodules/build/Makefile b/submodules/build/Makefile index 311aaa4fd..aa1fa2c70 100644 --- a/submodules/build/Makefile +++ b/submodules/build/Makefile @@ -20,6 +20,7 @@ # ############################################################################ enable_gpl_third_parties=yes +enable_zrtp=no .NOTPARALLEL all: build warning ifeq ($(enable_gpl_third_parties),yes) @@ -39,12 +40,18 @@ warning: @echo "*****linphone SDK without GPL code ******" @echo "*****************************************************************" @echo "*****************************************************************" + ifeq($(enable_zrtp),yes) + @echo "ZRTP is not available in non-gpl build." + enable_zrtp=no + endif endif +LINPHONE_OPTIONS="enable_gpl_third_parties=$(enable_gpl_third_parties) enable_zrtp=$(enable_zrtp)" + build: - make -f builder-iphone-os.mk all enable_gpl_third_parties=$(enable_gpl_third_parties) \ - && make -f builder-iphone-simulator.mk all enable_gpl_third_parties=$(enable_gpl_third_parties)\ - && make -f builder-iphone-os.mk host=armv7-apple-darwin all enable_gpl_third_parties=$(enable_gpl_third_parties)\ + make -f builder-iphone-os.mk all $(LINPHONE_OPTIONS) \ + && make -f builder-iphone-simulator.mk all $(LINPHONE_OPTIONS) \ + && make -f builder-iphone-os.mk host=armv7-apple-darwin all $(LINPHONE_OPTIONS) \ && make -f builder-iphone-os.mk delivery-sdk ipa: build diff --git a/submodules/build/builder-iphone-os.mk b/submodules/build/builder-iphone-os.mk index e89de143d..20797a9f4 100644 --- a/submodules/build/builder-iphone-os.mk +++ b/submodules/build/builder-iphone-os.mk @@ -38,6 +38,12 @@ linphone_configure_controls= \ --disable-tests \ --with-srtp=$(prefix) +ifeq ($(enable_zrtp),yes) + linphone_configure_controls+= --enable-zrtp +else + linphone_configure_controls+= --disable-zrtp +endif + #path BUILDER_SRC_DIR?=$(shell pwd)/../ BUILDER_BUILD_DIR?=$(shell pwd)/../build-$(host) @@ -60,11 +66,11 @@ $(LINPHONE_BUILD_DIR)/disable_gpl_third_parties: cd $(LINPHONE_BUILD_DIR) && rm -f Makefile && rm -f oRTP/Makefile && rm -f mediastreamer2/Makefile ifeq ($(enable_gpl_third_parties),yes) -linphone_configure_controls+= --enable-ffmpeg --enable-zrtp +linphone_configure_controls+= --enable-ffmpeg detect_gpl_mode_switch: $(LINPHONE_BUILD_DIR)/enable_gpl_third_parties else -linphone_configure_controls+= --disable-ffmpeg --disable-zrtp +linphone_configure_controls+= --disable-ffmpeg detect_gpl_mode_switch: $(LINPHONE_BUILD_DIR)/disable_gpl_third_parties endif