diff --git a/submodules/build/Makefile b/submodules/build/Makefile index 9e4f01787..d8903c92e 100644 --- a/submodules/build/Makefile +++ b/submodules/build/Makefile @@ -87,19 +87,27 @@ LINPHONE_OPTIONS=enable_gpl_third_parties=$(enable_gpl_third_parties) \ armv7-%: make -f builder-iphone-os.mk $(LINPHONE_OPTIONS) $* +arm64-%: + make -f builder-iphone-os.mk host=aarch64-apple-darwin $(LINPHONE_OPTIONS) $* V=1 VERBOSE=1 + simu-%: make -f builder-iphone-simulator.mk $(LINPHONE_OPTIONS) $* +arm64: + make -f builder-iphone-os.mk host=aarch64-apple-darwin $(LINPHONE_OPTIONS) V=1 VERBOSE=1 -build-% clean-% veryclean-%: - make -f builder-iphone-simulator.mk $(LINPHONE_OPTIONS) $@ \ - && make -f builder-iphone-os.mk $(LINPHONE_OPTIONS) $@ -# sends the target after 'broadcast_' to all sub-architectures (armv7, simulator) +# sends the target after 'broadcast_' to all sub-architectures (armv7, simu, arm64) broadcast_%: @echo "Broadcasting target '$*' to all sub-architectures" make -f builder-iphone-simulator.mk $(LINPHONE_OPTIONS) $* \ - && make -f builder-iphone-os.mk $(LINPHONE_OPTIONS) $* + && make -f builder-iphone-os.mk $(LINPHONE_OPTIONS) $* \ + && make -f builder-iphone-os.mk host=aarch64-apple-darwin $(LINPHONE_OPTIONS) $* + +build-% clean-% veryclean-%: + make -f builder-iphone-simulator.mk $(LINPHONE_OPTIONS) $@ \ + && make -f builder-iphone-os.mk $(LINPHONE_OPTIONS) $@ \ + && make -f builder-iphone-os.mk host=aarch64-apple-darwin $(LINPHONE_OPTIONS) $@ sdk: make -f builder-iphone-os.mk delivery-sdk @@ -115,6 +123,9 @@ clean: broadcast_clean veryclean: broadcast_veryclean +list-packages: + @make -f builder-iphone-os.mk list-packages + zipres: @tar -C ../.. -czf ../../ios_assets.tar.gz Resources iTunesArtwork @@ -129,9 +140,12 @@ help: @echo " * ipa : builds all, creates the SDK, then builds an IPA of the Linphone-iphone application" @echo " * clean : clean all packages for all architectures" @echo " * veryclean : completely clean all packages for all architectures" + @echo " * zipres : creates a tar.gz file with all the resources (images)" @echo "" @echo "=== Advanced usage ===" @echo "" + @echo " * list-packages : lists the packages that you can build" + @echo "" @echo " * build-[package] : builds the package for all architectures" @echo " * clean-[package] : clean the package for all architectures" @echo " * veryclean-[package] : completely clean the package for all architectures" diff --git a/submodules/build/builder-iphone-os.mk b/submodules/build/builder-iphone-os.mk index 118fa60a9..aacc23b42 100644 --- a/submodules/build/builder-iphone-os.mk +++ b/submodules/build/builder-iphone-os.mk @@ -56,9 +56,42 @@ LINPHONE_SRC_DIR=$(BUILDER_SRC_DIR)/linphone LINPHONE_BUILD_DIR=$(BUILDER_BUILD_DIR)/linphone LINPHONE_IPHONE_VERSION=$(shell git describe --always) -all: build-linphone build-msilbc build-msamr build-msx264 build-mssilk build-msbcg729 build-mswebrtc build-msopenh264 +# list of the submodules to build, the order is important +MEDIASTREAMER_PLUGINS := msilbc \ + libilbc \ + msamr \ + mssilk \ + msx264 \ +# mswebrtc \ # we need to update it to be compatible with aarch64 + msopenh264 \ + msbcg729 -# setup the switches that might trigger a linphone reconfiguration +SUBMODULES_LIST := polarssl + +ifeq ($(enable_tunnel),yes) +SUBMODULES_LIST += tunnel +endif + +SUBMODULES_LIST += libantlr \ + cunit \ + belle-sip \ + srtp \ + speex \ + libgsm \ + libvpx \ + libxml2 \ + bzrtp \ + ffmpeg \ + opus + +# build linphone (which depends on submodules) and then the plugins +all: build-linphone $(addprefix build-,$(MEDIASTREAMER_PLUGINS)) + + + +#################################################################### +# setup the switches that might trigger a linphone recompilation +#################################################################### enable_gpl_third_parties?=yes enable_ffmpeg?=yes @@ -101,7 +134,6 @@ endif SWITCHES := $(addprefix $(LINPHONE_BUILD_DIR)/,$(SWITCHES)) mode_switch_check: $(SWITCHES) - #generic rule to force recompilation of linphone if some options require it $(LINPHONE_BUILD_DIR)/enable_% $(LINPHONE_BUILD_DIR)/disable_%: mkdir -p $(LINPHONE_BUILD_DIR) @@ -109,58 +141,49 @@ $(LINPHONE_BUILD_DIR)/enable_% $(LINPHONE_BUILD_DIR)/disable_%: touch $@ cd $(LINPHONE_BUILD_DIR) && rm -f Makefile && rm -f oRTP/Makefile && rm -f mediastreamer2/Makefile -# end of switches parsing +#################################################################### +# Base rules: +#################################################################### -speex_dir=externals/speex -gsm_dir=externals/gsm -MSILBC_SRC_DIR:=$(BUILDER_SRC_DIR)/msilbc -MSILBC_BUILD_DIR:=$(BUILDER_BUILD_DIR)/msilbc - -LIBILBC_SRC_DIR:=$(BUILDER_SRC_DIR)/libilbc-rfc3951 -LIBILBC_BUILD_DIR:=$(BUILDER_BUILD_DIR)/libilbc-rfc3951 - -ifneq (,$(findstring arm,$(host))) - #SPEEX_CONFIGURE_OPTION := --enable-fixed-point --disable-float-api - CFLAGS := $(CFLAGS) -marm - SPEEX_CONFIGURE_OPTION := --disable-float-api --enable-arm5e-asm --enable-fixed-point -endif - -ifneq (,$(findstring armv7,$(host))) - SPEEX_CONFIGURE_OPTION += --enable-armv7neon-asm -endif - -clean-makefile: clean-makefile-linphone clean-makefile-msbcg729 -clean: clean-linphone clean-msbcg729 +clean-makefile: clean-makefile-linphone +clean: clean-linphone init: mkdir -p $(prefix)/include mkdir -p $(prefix)/lib/pkgconfig -veryclean: veryclean-linphone veryclean-msbcg729 +veryclean: veryclean-linphone rm -rf $(BUILDER_BUILD_DIR) -# list of the submodules to build, the order is important -MS_MODULES := msilbc libilbc msamr mssilk msx264 mswebrtc msopenh264 -SUBMODULES_LIST := polarssl +list-packages: + @echo "Submodules:" + @echo "$(addprefix \nbuild-,$(SUBMODULES_LIST))" + @echo "\nPlugins: " + @echo "$(addprefix \nbuild-,$(MEDIASTREAMER_PLUGINS))" -ifeq ($(enable_tunnel),yes) -SUBMODULES_LIST += tunnel -endif +#################################################################### +# Linphone compilation +#################################################################### -SUBMODULES_LIST += libantlr cunit belle-sip srtp speex libgsm libvpx libxml2 bzrtp ffmpeg opus +build-submodules: $(addprefix build-,$(SUBMODULES_LIST)) -.NOTPARALLEL build-linphone: init $(addprefix build-,$(SUBMODULES_LIST)) mode_switch_check $(LINPHONE_BUILD_DIR)/Makefile - cd $(LINPHONE_BUILD_DIR) && export PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig export CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) make newdate && make && make install - mkdir -p $(prefix)/share/linphone/tutorials && cp -f $(LINPHONE_SRC_DIR)/coreapi/help/*.c $(prefix)/share/linphone/tutorials/ +.NOTPARALLEL build-linphone: init build-submodules mode_switch_check $(LINPHONE_BUILD_DIR)/Makefile + cd $(LINPHONE_BUILD_DIR) \ + && PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig \ + CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ + make newdate \ + && make \ + && make install + mkdir -p $(prefix)/share/linphone/tutorials \&& cp -f $(LINPHONE_SRC_DIR)/coreapi/help/*.c $(prefix)/share/linphone/tutorials/ -clean-linphone: $(addprefix clean-,$(SUBMODULES_LIST)) $(addprefix clean-,$(MS_MODULES)) +clean-linphone: $(addprefix clean-,$(SUBMODULES_LIST)) $(addprefix clean-,$(MEDIASTREAMER_PLUGINS)) cd $(LINPHONE_BUILD_DIR) && make clean -veryclean-linphone: $(addprefix veryclean-,$(SUBMODULES_LIST)) $(addprefix veryclean-,$(MS_MODULES)) +veryclean-linphone: $(addprefix veryclean-,$(SUBMODULES_LIST)) $(addprefix veryclean-,$(MEDIASTREAMER_PLUGINS)) #-cd $(LINPHONE_BUILD_DIR) && make distclean -cd $(LINPHONE_SRC_DIR) && rm -f configure -clean-makefile-linphone: $(addprefix clean-makefile-,$(SUBMODULES_LIST)) $(addprefix clean-makefile-,$(MS_MODULES)) +clean-makefile-linphone: $(addprefix clean-makefile-,$(SUBMODULES_LIST)) $(addprefix clean-makefile-,$(MEDIASTREAMER_PLUGINS)) cd $(LINPHONE_BUILD_DIR) && rm -f Makefile && rm -f oRTP/Makefile && rm -f mediastreamer2/Makefile @@ -188,105 +211,12 @@ clean-makefile-liblinphone: clean-liblinphone: cd $(LINPHONE_BUILD_DIR) && make clean -#speex -$(BUILDER_SRC_DIR)/$(speex_dir)/configure: - cd $(BUILDER_SRC_DIR)/$(speex_dir) && ./autogen.sh - -$(BUILDER_BUILD_DIR)/$(speex_dir)/Makefile: $(BUILDER_SRC_DIR)/$(speex_dir)/configure - mkdir -p $(BUILDER_BUILD_DIR)/$(speex_dir) - cd $(BUILDER_BUILD_DIR)/$(speex_dir)/\ - && CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) CFLAGS="$(CFLAGS) -O2" \ - $(BUILDER_SRC_DIR)/$(speex_dir)/configure -prefix=$(prefix) --host=$(host) ${library_mode} --disable-ogg $(SPEEX_CONFIGURE_OPTION) - -build-speex: $(BUILDER_BUILD_DIR)/$(speex_dir)/Makefile - cd $(BUILDER_BUILD_DIR)/$(speex_dir) && make && make install - -clean-speex: - cd $(BUILDER_BUILD_DIR)/$(speex_dir) && make clean - -veryclean-speex: -# -cd $(BUILDER_BUILD_DIR)/$(speex_dir) && make distclean - -rm -f $(BUILDER_SRC_DIR)/$(speex_dir)/configure - -clean-makefile-speex: - cd $(BUILDER_BUILD_DIR)/$(speex_dir) && rm -f Makefile - - -#GSM - -build-libgsm: - cp -rf $(BUILDER_SRC_DIR)/$(gsm_dir) $(BUILDER_BUILD_DIR)/$(gsm_dir) - rm -rf $(BUILDER_BUILD_DIR)/$(gsm_dir)/gsm/.git - rm -f $(prefix)/lib/libgsm.a - rm -rf $(prefix)/include/gsm - cd $(BUILDER_BUILD_DIR)/$(gsm_dir)\ - && mkdir -p $(prefix)/include/gsm \ - && host_alias=$(host) . $(BUILDER_SRC_DIR)/build/$(config_site) \ - && make -j1 CC="$${CC}" INSTALL_ROOT=$(prefix) GSM_INSTALL_INC=$(prefix)/include/gsm install - -clean-libgsm: - cd $(BUILDER_BUILD_DIR)/$(gsm_dir)\ - && make clean - -veryclean-libgsm: - -cd $(BUILDER_BUILD_DIR)/$(gsm_dir) \ - && make uninstall - - - -# msilbc plugin - -$(MSILBC_SRC_DIR)/configure: - cd $(MSILBC_SRC_DIR) && ./autogen.sh - -$(MSILBC_BUILD_DIR)/Makefile: $(MSILBC_SRC_DIR)/configure - mkdir -p $(MSILBC_BUILD_DIR) - cd $(MSILBC_BUILD_DIR) && \ - PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ - $(MSILBC_SRC_DIR)/configure -prefix=$(prefix) --host=$(host) $(library_mode) - -build-msilbc: build-libilbc $(MSILBC_BUILD_DIR)/Makefile - cd $(MSILBC_BUILD_DIR) && make && make install - -clean-msilbc: - cd $(MSILBC_BUILD_DIR) && make clean - -veryclean-msilbc: -# -cd $(MSILBC_BUILD_DIR) && make distclean - -cd $(MSILBC_SRC_DIR) && rm configure - -clean-makefile-msilbc: - cd $(MSILBC_BUILD_DIR) && rm -f Makefile - -# libilbc - -$(LIBILBC_SRC_DIR)/configure: - cd $(LIBILBC_SRC_DIR) && ./autogen.sh - -$(LIBILBC_BUILD_DIR)/Makefile: $(LIBILBC_SRC_DIR)/configure - mkdir -p $(LIBILBC_BUILD_DIR) - cd $(LIBILBC_BUILD_DIR) && \ - PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ - $(LIBILBC_SRC_DIR)/configure -prefix=$(prefix) --host=$(host) $(library_mode) - -build-libilbc: $(LIBILBC_BUILD_DIR)/Makefile - cd $(LIBILBC_BUILD_DIR) && make && make install - -clean-libilbc: - cd $(LIBILBC_BUILD_DIR) && make clean - -veryclean-libilbc: - -cd $(LIBILBC_BUILD_DIR) && make distclean - -clean-makefile-libilbc: - cd $(LIBILBC_BUILD_DIR) && rm -f Makefile - -#openssl -#srtp -#zrtp include builders.d/*.mk -#sdk generation and distribution + +#################################################################### +# sdk generation and distribution +#################################################################### multi-arch: arm_archives=`find $(prefix) -name *.a` ;\ @@ -294,24 +224,20 @@ multi-arch: cp -rf $(prefix)/include $(prefix)/../apple-darwin/. ; \ cp -rf $(prefix)/share $(prefix)/../apple-darwin/. ; \ for archive in $$arm_archives ; do \ - i386_path=`echo $$archive | sed -e "s/armv7/i386/"` ;\ - armv6_path=`echo $$archive | sed -e "s/armv7/armv6/"` ;\ - if test ! -f "$$armv6_path"; then \ - armv6_path= ; \ + i386_path=`echo $$archive | sed -e "s/armv7/i386/"` ;\ + arm64_path=`echo $$archive | sed -e "s/armv7/aarch64/"` ;\ + if test ! -f "$$arm64_path"; then \ + arm64_path= ; \ fi; \ - armv7s_path=`echo $$archive | sed -e "s/armv7/armv7s/"` ;\ - if test ! -f "$$armv7s_path"; then \ - armv7s_path= ; \ - fi; \ - destpath=`echo $$archive | sed -e "s/-debug//"` ;\ - destpath=`echo $$destpath | sed -e "s/armv7-//"` ;\ - if test -f "$$i386_path"; then \ - echo "Mixing $$archive into $$destpath"; \ - mkdir -p `dirname $$destpath` ; \ - lipo -create $$archive $$armv7s_path $$armv6_path $$i386_path -output $$destpath; \ - else \ - echo "WARNING: archive `basename $$archive` exists in arm tree but does not exists in i386 tree."; \ - fi \ + destpath=`echo $$archive | sed -e "s/-debug//"` ;\ + destpath=`echo $$destpath | sed -e "s/armv7-//"` ;\ + if test -f "$$i386_path"; then \ + echo "Mixing $$archive into $$destpath"; \ + mkdir -p `dirname $$destpath` ; \ + lipo -create $$archive $$arm64_path $$i386_path -output $$destpath; \ + else \ + echo "WARNING: archive `basename $$archive` exists in arm tree but does not exists in i386 tree."; \ + fi \ done if ! test -f $(prefix)/../apple-darwin/lib/libtunnel.a ; then \ cp -f $(BUILDER_SRC_DIR)/../submodules/binaries/libdummy.a $(prefix)/../apple-darwin/lib/libtunnel.a ; \ @@ -329,6 +255,7 @@ delivery-sdk: multi-arch -x liblinphone-tutorials/hello-world/hello-world.xcodeproj/*.mode1v3 download-sdk: + @echo "Downloading the latest binary SDK" cd $(BUILDER_SRC_DIR)/../ rm -fr liblinphone-iphone-sdk-latest* wget http://linphone.org/snapshots/ios/liblinphone-iphone-sdk-latest.zip diff --git a/submodules/build/builders.d/gsm.mk b/submodules/build/builders.d/gsm.mk new file mode 100644 index 000000000..c012d9c3b --- /dev/null +++ b/submodules/build/builders.d/gsm.mk @@ -0,0 +1,23 @@ + +#GSM + +gsm_dir?=externals/gsm + + +build-libgsm: + cp -rf $(BUILDER_SRC_DIR)/$(gsm_dir) $(BUILDER_BUILD_DIR)/$(gsm_dir) + rm -rf $(BUILDER_BUILD_DIR)/$(gsm_dir)/gsm/.git + rm -f $(prefix)/lib/libgsm.a + rm -rf $(prefix)/include/gsm + cd $(BUILDER_BUILD_DIR)/$(gsm_dir)\ + && mkdir -p $(prefix)/include/gsm \ + && host_alias=$(host) . $(BUILDER_SRC_DIR)/build/$(config_site) \ + && make -j1 CC="$${CC}" INSTALL_ROOT=$(prefix) GSM_INSTALL_INC=$(prefix)/include/gsm install + +clean-libgsm: + cd $(BUILDER_BUILD_DIR)/$(gsm_dir)\ + && make clean + +veryclean-libgsm: + -cd $(BUILDER_BUILD_DIR)/$(gsm_dir) \ + && make uninstall diff --git a/submodules/build/builders.d/libilbc.mk b/submodules/build/builders.d/libilbc.mk new file mode 100644 index 000000000..2f6b4414a --- /dev/null +++ b/submodules/build/builders.d/libilbc.mk @@ -0,0 +1,27 @@ + +# libilbc + + +LIBILBC_SRC_DIR:=$(BUILDER_SRC_DIR)/libilbc-rfc3951 +LIBILBC_BUILD_DIR:=$(BUILDER_BUILD_DIR)/libilbc-rfc3951 + +$(LIBILBC_SRC_DIR)/configure: + cd $(LIBILBC_SRC_DIR) && ./autogen.sh + +$(LIBILBC_BUILD_DIR)/Makefile: $(LIBILBC_SRC_DIR)/configure + mkdir -p $(LIBILBC_BUILD_DIR) + cd $(LIBILBC_BUILD_DIR) && \ + PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ + $(LIBILBC_SRC_DIR)/configure -prefix=$(prefix) --host=$(host) $(library_mode) + +build-libilbc: $(LIBILBC_BUILD_DIR)/Makefile + cd $(LIBILBC_BUILD_DIR) && make && make install + +clean-libilbc: + cd $(LIBILBC_BUILD_DIR) && make clean + +veryclean-libilbc: + -cd $(LIBILBC_BUILD_DIR) && make distclean + +clean-makefile-libilbc: + cd $(LIBILBC_BUILD_DIR) && rm -f Makefile diff --git a/submodules/build/builders.d/libvpx.mk b/submodules/build/builders.d/libvpx.mk index 1d8c8bf8b..16384d4ee 100644 --- a/submodules/build/builders.d/libvpx.mk +++ b/submodules/build/builders.d/libvpx.mk @@ -19,6 +19,8 @@ else ifneq (,$(findstring armv7s,$(host))) else ifneq (,$(findstring armv7,$(host))) libvpx_configure_options+= --target=armv7-darwin-gcc take_binary = armv7 +else ifneq (,$(findstring aarch64,$(host))) + libvpx_configure_options+= --target=arm64-darwin-gcc else libvpx_configure_options+= --target=x86-darwin10-gcc take_binary = i386 @@ -30,9 +32,7 @@ endif -all_p=armv6-darwin-gcc #neon Cortex-A8 all_p+=armv7-darwin-gcc #neon Cortex-A8 -all_p+=armv7s-darwin-gcc #neon Cortex-A8 ifeq ($(force_non_binary_libvpx),1) take_binary= @@ -45,7 +45,7 @@ $(BUILDER_SRC_DIR)/$(libvpx_dir)/patched.stamp: && touch $@ -$(BUILDER_BUILD_DIR)/$(libvpx_dir)/config.mk: $(BUILDER_SRC_DIR)/$(libvpx_dir)/patched.stamp +$(BUILDER_BUILD_DIR)/$(libvpx_dir)/config.mk: mkdir -p $(BUILDER_BUILD_DIR)/$(libvpx_dir) cd $(BUILDER_BUILD_DIR)/$(libvpx_dir)/ \ && host_alias=${host} . $(BUILDER_SRC_DIR)/build/$(config_site) \ diff --git a/submodules/build/builders.d/libvpx.patch b/submodules/build/builders.d/libvpx.patch deleted file mode 100644 index 2835a1d17..000000000 --- a/submodules/build/builders.d/libvpx.patch +++ /dev/null @@ -1,61 +0,0 @@ -diff --git a/build/make/configure.sh b/build/make/configure.sh -index a65d395..579e0d6 100755 ---- a/build/make/configure.sh -+++ b/build/make/configure.sh -@@ -172,6 +172,7 @@ add_cflags() { - - - add_cflags_only() { -+ log_echo "Adding $@ to CFLAGS" - CFLAGS="${CFLAGS} $@" - } - -@@ -792,7 +793,7 @@ process_common_toolchain() { - arm*) - # on arm, isa versions are supersets - case ${tgt_isa} in -- armv7) -+ armv7*) - soft_enable neon - soft_enable media - soft_enable edsp -@@ -820,7 +821,9 @@ process_common_toolchain() { - arch_int=${arch_int%%te} - check_add_asflags --defsym ARCHITECTURE=${arch_int} - tune_cflags="-mtune=" -- if [ ${tgt_isa} = "armv7" ]; then -+ -+ case ${tgt_isa} in -+ armv7*) - if [ -z "${float_abi}" ]; then - check_cpp <