From 9a1839cc5ce11e35eacd6263ed000513e3f1beec Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Tue, 7 Oct 2014 17:00:59 +0200 Subject: [PATCH] =?UTF-8?q?Enable=20CCACHE=20compilation:=20export=20LINPH?= =?UTF-8?q?ONE=5FCCACHE=3Dccache=20and=20go.=20It=E2=80=99s=20not=20perfec?= =?UTF-8?q?t=20at=20all,=20and=20there=E2=80=99s=20about=201/3=20of=20the?= =?UTF-8?q?=20SDK=20that=20will=20trigger=20=C2=AB=C2=A0unsupported=C2=A0c?= =?UTF-8?q?ompiler=20option=20=C2=BB,=20but=20that=E2=80=99s=20a=20start.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- submodules/build/builders.d/libvpx.mk | 6 ++++++ submodules/build/builders.d/msamr.mk | 9 ++++++++- submodules/build/builders.d/msbcg729.mk | 7 ++++++- submodules/build/builders.d/mssilk.mk | 7 ++++++- submodules/build/builders.d/msx264.mk | 8 +++++++- submodules/build/builders.d/zrtp.mk | 8 +++++++- submodules/build/iphone-config.site | 13 ++++++++++--- 7 files changed, 50 insertions(+), 8 deletions(-) diff --git a/submodules/build/builders.d/libvpx.mk b/submodules/build/builders.d/libvpx.mk index 2d72bfa51..1d8c8bf8b 100644 --- a/submodules/build/builders.d/libvpx.mk +++ b/submodules/build/builders.d/libvpx.mk @@ -24,6 +24,12 @@ else take_binary = i386 endif +ifeq ($(LINPHONE_CCACHE),ccache) + libvpx_configure_options+= --enable-ccache +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 diff --git a/submodules/build/builders.d/msamr.mk b/submodules/build/builders.d/msamr.mk index ed38e4997..d5dbf097a 100644 --- a/submodules/build/builders.d/msamr.mk +++ b/submodules/build/builders.d/msamr.mk @@ -20,6 +20,13 @@ # ############################################################################ msamr_dir?=msamr + +configure-options= +ifeq ($(LINPHONE_CCACHE), ccache) + configure-options+= --disable-strict +endif + + $(BUILDER_SRC_DIR)/$(msamr_dir)/configure: cd $(BUILDER_SRC_DIR)/$(msamr_dir) && ./autogen.sh @@ -27,7 +34,7 @@ $(BUILDER_BUILD_DIR)/$(msamr_dir)/Makefile: $(BUILDER_SRC_DIR)/$(msamr_dir)/conf mkdir -p $(BUILDER_BUILD_DIR)/$(msamr_dir) cd $(BUILDER_BUILD_DIR)/$(msamr_dir)/ \ && PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ - $(BUILDER_SRC_DIR)/$(msamr_dir)/configure -prefix=$(prefix) --host=$(host) ${library_mode} + $(BUILDER_SRC_DIR)/$(msamr_dir)/configure -prefix=$(prefix) --host=$(host) ${library_mode} ${configure-options} build-msamr: build-opencore-amr $(BUILDER_BUILD_DIR)/$(msamr_dir)/Makefile cd $(BUILDER_BUILD_DIR)/$(msamr_dir) && PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) make && make install diff --git a/submodules/build/builders.d/msbcg729.mk b/submodules/build/builders.d/msbcg729.mk index 98b1f3bbb..d90d88ec3 100644 --- a/submodules/build/builders.d/msbcg729.mk +++ b/submodules/build/builders.d/msbcg729.mk @@ -22,6 +22,11 @@ msbcg729_dir?=bcg729 enable_bcg729?=yes +configure-options= +ifeq ($(LINPHONE_CCACHE), ccache) + configure-options+= --disable-strict +endif + $(BUILDER_SRC_DIR)/$(msbcg729_dir)/configure: @echo -e "\033[01;32m Running autogen for msbcg729 in $(BUILDER_SRC_DIR)/$(msbcg729_dir) \033[0m" cd $(BUILDER_SRC_DIR)/$(msbcg729_dir) && ./autogen.sh @@ -32,7 +37,7 @@ $(BUILDER_BUILD_DIR)/$(msbcg729_dir)/Makefile: $(BUILDER_SRC_DIR)/$(msbcg729_dir cd $(BUILDER_BUILD_DIR)/$(msbcg729_dir)/ \ && PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ $(BUILDER_SRC_DIR)/$(msbcg729_dir)/configure -prefix=$(prefix) --host=$(host) ${library_mode} \ - --enable-static + --enable-static ${configure-options} ifeq ($(enable_bcg729),yes) diff --git a/submodules/build/builders.d/mssilk.mk b/submodules/build/builders.d/mssilk.mk index 4a41986c6..cff9b9b1f 100644 --- a/submodules/build/builders.d/mssilk.mk +++ b/submodules/build/builders.d/mssilk.mk @@ -22,6 +22,11 @@ mssilk_dir?=mssilk enable_silk?=yes +configure-options= +ifeq ($(LINPHONE_CCACHE), ccache) + configure-options+= --disable-strict +endif + $(BUILDER_SRC_DIR)/$(mssilk_dir)/configure: echo -e "\033[01;32m Running autogen for mssilk in $(BUILDER_SRC_DIR)/$(mssilk_dir) \033[0m" cd $(BUILDER_SRC_DIR)/$(mssilk_dir) && ./autogen.sh @@ -32,7 +37,7 @@ $(BUILDER_BUILD_DIR)/$(mssilk_dir)/Makefile: $(BUILDER_SRC_DIR)/$(mssilk_dir)/co cd $(BUILDER_BUILD_DIR)/$(mssilk_dir)/ \ && PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ $(BUILDER_SRC_DIR)/$(mssilk_dir)/configure -prefix=$(prefix) --host=$(host) ${library_mode} \ - --enable-static + --enable-static ${configure-options} ifeq ($(enable_silk),yes) diff --git a/submodules/build/builders.d/msx264.mk b/submodules/build/builders.d/msx264.mk index 06c3a4ba3..ce0b727c0 100644 --- a/submodules/build/builders.d/msx264.mk +++ b/submodules/build/builders.d/msx264.mk @@ -20,6 +20,12 @@ # ############################################################################ msx264_dir?=msx264 + +configure-options= +ifeq ($(LINPHONE_CCACHE), ccache) + configure-options+= --disable-strict +endif + $(BUILDER_SRC_DIR)/$(msx264_dir)/configure: cd $(BUILDER_SRC_DIR)/$(msx264_dir) && ./autogen.sh @@ -27,7 +33,7 @@ $(BUILDER_BUILD_DIR)/$(msx264_dir)/Makefile: $(BUILDER_SRC_DIR)/$(msx264_dir)/co mkdir -p $(BUILDER_BUILD_DIR)/$(msx264_dir) cd $(BUILDER_BUILD_DIR)/$(msx264_dir)/ \ && PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ - $(BUILDER_SRC_DIR)/$(msx264_dir)/configure -prefix=$(prefix) --host=$(host) ${library_mode} + $(BUILDER_SRC_DIR)/$(msx264_dir)/configure -prefix=$(prefix) --host=$(host) ${library_mode} ${configure-options} build-msx264: build-x264 $(BUILDER_BUILD_DIR)/$(msx264_dir)/Makefile cd $(BUILDER_BUILD_DIR)/$(msx264_dir) && PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) make && make install diff --git a/submodules/build/builders.d/zrtp.mk b/submodules/build/builders.d/zrtp.mk index 4d5395937..db08fc9a4 100644 --- a/submodules/build/builders.d/zrtp.mk +++ b/submodules/build/builders.d/zrtp.mk @@ -22,6 +22,11 @@ bzrtp_dir?=bzrtp enable_zrtp?=yes +configure-options= +ifeq ($(LINPHONE_CCACHE), ccache) + configure-options+= --disable-strict +endif + $(BUILDER_SRC_DIR)/$(bzrtp_dir)/configure: @echo -e "\033[01;32m Running autogen for bzrtp in $(BUILDER_SRC_DIR)/$(bzrtp_dir) \033[0m" cd $(BUILDER_SRC_DIR)/$(bzrtp_dir) && ./autogen.sh @@ -30,9 +35,10 @@ $(BUILDER_BUILD_DIR)/$(bzrtp_dir)/Makefile: $(BUILDER_SRC_DIR)/$(bzrtp_dir)/conf @echo -e "\033[01;32m Running configure in $(BUILDER_BUILD_DIR)/$(bzrtp_dir) \033[0m" mkdir -p $(BUILDER_BUILD_DIR)/$(bzrtp_dir) cd $(BUILDER_BUILD_DIR)/$(bzrtp_dir)/ \ + && host_alias=${host} . $(BUILDER_SRC_DIR)/build/$(config_site) \ && PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ $(BUILDER_SRC_DIR)/$(bzrtp_dir)/configure -prefix=$(prefix) --host=$(host) ${library_mode} \ - --enable-static + --enable-static ${configure-options} ifeq ($(enable_zrtp),yes) diff --git a/submodules/build/iphone-config.site b/submodules/build/iphone-config.site index c62de78fe..970fe51c8 100644 --- a/submodules/build/iphone-config.site +++ b/submodules/build/iphone-config.site @@ -51,9 +51,16 @@ COMMON_FLAGS="$COMMON_FLAGS -Dsha256=polarssl_sha256" # silence clang unused operators. This is temporary, we should find a way to compile 3rd party with correct flags :( COMMON_FLAGS="-Qunused-arguments -Wno-unknown-warning-option -Wno-unused-command-line-argument-hard-error-in-future $COMMON_FLAGS" -CC="xcrun clang -std=c99 $COMMON_FLAGS" -OBJC="xcrun clang -std=c99 $COMMON_FLAGS" -CXX="xcrun clang++ $COMMON_FLAGS" +# you can use ccache to speed up build, in which case just define LINPHONE_CCACHE to 'ccache' + +if test "$LINPHONE_CCACHE" = "ccache" ; then + # ccache doesn't like some options + COMMON_FLAGS="$COMMON_FLAGS -Wno-variadic-macros -Wno-pointer-arith -Wno-return-type -Wno-tautological-compare -Wno-unused-function -Wno-error" +fi + +CC="xcrun $LINPHONE_CCACHE clang -std=c99 $COMMON_FLAGS" +OBJC="xcrun $LINPHONE_CCACHE clang -std=c99 $COMMON_FLAGS" +CXX="xcrun $LINPHONE_CCACHE clang++ $COMMON_FLAGS" LD="xcrun ld -arch ${ARCH}" AR="xcrun ar" RANLIB="xcrun ranlib"