From d48d7c2e11ea35d005a52b52af1d63a2243c3946 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 19 May 2016 14:33:35 +0200 Subject: [PATCH] [configure] Add option to disable device-related parts of the build. (#67) And use it when building on jenkins. --- Make.config | 1 + builds/Makefile | 18 ++++++++++++++++++ configure | 7 +++++++ jenkins.sh | 2 +- runtime/Makefile | 25 ++++++++++++++++++++++++- 5 files changed, 51 insertions(+), 2 deletions(-) diff --git a/Make.config b/Make.config index 24b34b1ca415..1b4221e0fe36 100644 --- a/Make.config +++ b/Make.config @@ -81,6 +81,7 @@ INCLUDE_IOS=1 INCLUDE_MAC=1 INCLUDE_WATCH=1 INCLUDE_TVOS=1 +INCLUDE_DEVICE=1 -include $(TOP)/Make.config.local -include $(TOP)/configure.inc diff --git a/builds/Makefile b/builds/Makefile index 257cc7d0c5bd..8ff2e85a65d5 100644 --- a/builds/Makefile +++ b/builds/Makefile @@ -1344,10 +1344,12 @@ ARM_ARCH_CONFIGURE_FLAGS=--host=arm-apple-darwin10 --disable-boehm ARM64_ARCH_CONFIGURE_FLAGS=--host=aarch64-apple-darwin10 --disable-boehm ifdef INCLUDE_IOS +ifdef INCLUDE_DEVICE ifndef DEVICE_RUNTIMES DEVICE_RUNTIMES="armv7 armv7s arm64 " endif endif +endif # Note the spaces in findstring arguments, this is needed to distinguish between armv7 and armv7s for example ifneq ($(findstring armv7 , $(DEVICE_RUNTIMES) ),) @@ -1362,6 +1364,7 @@ ifneq ($(findstring arm64 , $(DEVICE_RUNTIMES) ),) $(eval $(call PlatformBuildTemplate,arm64,target64,,$(ARM64_ARCH_CONFIGURE_FLAGS),,7.0)) endif +ifdef INCLUDE_DEVICE iphoneos:: setup-iphoneos build-iphoneos install-iphoneos device:: iphoneos clean-device: clean-iphoneos @@ -1370,6 +1373,7 @@ clean-device: clean-iphoneos ifdef INCLUDE_IOS install-local:: install-iphoneos endif +endif IPHONEOS_TARGETS = \ $(IOS_DESTDIR)$(IPHONEOS_PREFIX)/lib/libmonosgen-2.0.a \ @@ -1499,6 +1503,7 @@ WATCHOS_ENVIRONMENT = \ DEVELOPER_DIR=$(XCODE_DEVELOPER_ROOT) \ ifdef INCLUDE_WATCH +ifdef INCLUDE_DEVICE setup:: setup-targetwatch build:: build-targetwatch clean-local:: clean-targetwatch @@ -1509,6 +1514,7 @@ watchos:: targetwatch .PHONY: targetwatch endif +endif setup-targetwatch: .stamp-configure-targetwatch @@ -1675,6 +1681,7 @@ TVOS_ENVIRONMENT = \ DEVELOPER_DIR=$(XCODE_DEVELOPER_ROOT) \ ifdef INCLUDE_TVOS +ifdef INCLUDE_DEVICE setup:: setup-targettv build:: build-targettv clean-local:: clean-targettv @@ -1685,6 +1692,7 @@ tvos:: targettv .PHONY: targettv endif +endif setup-targettv: .stamp-configure-targettv @@ -1762,6 +1770,7 @@ install-tvos: $(TVOS_TARGETS) # # we need to compile the cross build against llvm so we need to configure/build that first # +ifdef INCLUDE_DEVICE cross:: build-llvm cross64:: build-llvm64 @@ -1770,6 +1779,7 @@ clean-local:: clean-llvm clean-llvm64 setup-llvm: .stamp-configure-llvm setup-llvm64: .stamp-configure-llvm64 +endif LLVM_BASE_CONFIGURE_FLAGS=--enable-libcpp --enable-optimized --enable-assertions=no --disable-jit --disable-docs --disable-doxygen LLVM_CXXFLAGS=$(CCACHE_CXXFLAGS) @@ -1900,6 +1910,7 @@ CROSS_CONFIGURE_ENVIRONMENT = \ CXX="$(MAC_CXX)" \ ifdef INCLUDE_IOS +ifdef INCLUDE_DEVICE cross:: build-cross install-cross .PHONY: setup-cross build-cross install-cross @@ -1909,6 +1920,7 @@ build:: build-cross install-local:: install-cross clean-local:: clean-cross endif +endif setup-cross: .stamp-configure-cross @@ -1961,11 +1973,13 @@ CROSS64_CONFIGURE_ENVIRONMENT = \ cross64:: build-cross64 install-cross64 ifdef INCLUDE_IOS +ifdef INCLUDE_DEVICE setup:: setup-cross64 build:: build-cross64 install-local:: install-cross64 clean-local:: clean-cross64 endif +endif setup-cross64: .stamp-configure-cross64 @@ -2024,6 +2038,7 @@ WATCH_CONFIGURE_ENVIRONMENT = \ CXX="$(MAC_CXX)" \ ifdef INCLUDE_WATCH +ifdef INCLUDE_DEVICE cross:: build-cross-watch install-cross-watch .PHONY: setup-cross-watch build-cross-watch install-cross-watch @@ -2033,6 +2048,7 @@ build:: build-cross-watch install-local:: install-cross-watch clean-local:: clean-cross-watch endif +endif .PHONY: cross-watch cross-watch: build-cross-watch install-cross-watch @@ -2087,6 +2103,7 @@ TV_CROSS_CONFIGURE_ENVIRONMENT = \ ifdef INCLUDE_TVOS +ifdef INCLUDE_DEVICE cross:: build-crosstv install-crosstv .PHONY: setup-crosstv build-crosstv install-crosstv @@ -2096,6 +2113,7 @@ build:: build-crosstv install-local:: install-crosstv clean-local:: clean-crosstv endif +endif setup-crosstv: .stamp-configure-crosstv diff --git a/configure b/configure index 5b3db48b9077..2a51ff7abe01 100755 --- a/configure +++ b/configure @@ -14,6 +14,9 @@ Usage: configure [options] The main reasons for disabling either part is to have faster builds and disable the non-relevant tests. + --disable-ios-device Disables all device-related parts from the iOS build. + This can be used to speed up the build. + --disable-strip: If executables should be stripped or not. Disable to make it easier to debug executables using lldb. @@ -41,6 +44,10 @@ while test x$1 != x; do echo "Mac Build disabled (partially)" shift ;; + --disable-ios-device) + echo "INCLUDE_DEVICE=" >> $CONFIGURED_FILE + shift + ;; --disable-ios) echo "INCLUDE_IOS=" >> $CONFIGURED_FILE echo "INCLUDE_WATCH=" >> $CONFIGURED_FILE diff --git a/jenkins.sh b/jenkins.sh index 78c1444dbf84..4115fcd5fd50 100755 --- a/jenkins.sh +++ b/jenkins.sh @@ -1,4 +1,4 @@ #!/bin/bash -e -./configure +./configure --disable-ios-device time make world diff --git a/runtime/Makefile b/runtime/Makefile index ddd34c8f563c..8e2c04170a6e 100644 --- a/runtime/Makefile +++ b/runtime/Makefile @@ -101,27 +101,38 @@ RUNTIME_$(2)_TARGETS_DIRS += \ RUNTIME_$(2)_TARGETS += \ $$(foreach file,$$($(2)_LIBRARIES),$(IOS_DESTDIR)$$(XAMARIN_$(4)SIMULATOR_SDK)/usr/lib/$$(file)) \ - $$(foreach file,$$($(2)_LIBRARIES),$(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/lib/$$(file)) \ $(foreach file,$(SHIPPED_HEADERS),$(IOS_DESTDIR)$$(XAMARIN_$(4)SIMULATOR_SDK)/usr/include/$(file)) \ + +ifdef INCLUDE_DEVICE +RUNTIME_$(2)_TARGETS += \ + $$(foreach file,$$($(2)_LIBRARIES),$(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/lib/$$(file)) \ $(foreach file,$(SHIPPED_HEADERS),$(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/include/$(file)) \ +endif + $(IOS_DESTDIR)$$(XAMARIN_$(4)SIMULATOR_SDK)/usr/lib/%.a: .libs/$(1)/%.a | $(IOS_DESTDIR)$$(XAMARIN_$(4)SIMULATOR_SDK)/usr/lib $(Q) install -m 0644 $$< $$@ +ifdef INCLUDE_DEVICE $(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/lib/%.a: .libs/$(1)/%.a | $(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/lib $(Q) install -m 0644 $$< $$@ +endif $(IOS_DESTDIR)$$(XAMARIN_$(4)SIMULATOR_SDK)/usr/lib/%.dylib: .libs/$(1)/%.dylib | $(IOS_DESTDIR)$$(XAMARIN_$(4)SIMULATOR_SDK)/usr/lib $(Q) install -m 0644 $$< $$@ +ifdef INCLUDE_DEVICE $(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/lib/%.dylib: .libs/$(1)/%.dylib | $(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/lib $(Q) install -m 0644 $$< $$@ +endif $(IOS_DESTDIR)$$(XAMARIN_$(4)SIMULATOR_SDK)/usr/include/%.h: %.h | $(IOS_DESTDIR)$$(XAMARIN_$(4)SIMULATOR_SDK)/usr/include/xamarin $(Q) install -m 0644 $$< $$@ +ifdef INCLUDE_DEVICE $(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/include/%.h: %.h | $(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/include/xamarin $(Q) install -m 0644 $$< $$@ +endif $$(RUNTIME_$(2)_TARGETS_DIRS): $(Q) mkdir -p $$@ @@ -138,15 +149,27 @@ endef # 4: simulator variable name used in some places # 5: device variable name used in some places ifdef INCLUDE_IOS +ifdef INCLUDE_DEVICE $(eval $(call PlatformTemplate,ios,IOS,armv7 armv7s arm64 x86 x86_64,IOS,IPHONE)) +else +$(eval $(call PlatformTemplate,ios,IOS, x86 x86_64,IOS,IPHONE)) +endif endif ifdef INCLUDE_WATCH +ifdef INCLUDE_DEVICE $(eval $(call PlatformTemplate,watchos,WATCHOS,armv7k x86,WATCH,WATCH)) +else +$(eval $(call PlatformTemplate,watchos,WATCHOS, x86,WATCH,WATCH)) +endif endif ifdef INCLUDE_TVOS +ifdef INCLUDE_DEVICE $(eval $(call PlatformTemplate,tvos,TVOS,arm64 x86_64,TV,TV)) +else +$(eval $(call PlatformTemplate,tvos,TVOS, x86_64,TV,TV)) +endif endif #