8 # - package-ios-<target>
9 # Install target into ../out/<target>
10 # - clean-ios-<target>
12 # Where <target> is: target32, target32s, target64, sim32, sim64, cross32, cross64
15 PLATFORM_BIN
=$(XCODE_DIR
)/Toolchains
/XcodeDefault.xctoolchain
/usr
/bin
17 ios_CPPFLAGS
=-DMONOTOUCH
=1
21 COMMON_LDFLAGS
=-Wl
,-no_weak_imports
23 BITCODE_CFLAGS
=-fexceptions
24 BITCODE_LDFLAGS
=-framework CoreFoundation
-lobjc
-lc
++
25 BITCODE_CONFIGURE_FLAGS
=--enable-llvm-runtime
--with-bitcode
=yes
31 # $(1): target (target32/target32s/target64)
32 # $(2): arch (armv7 or arm64)
33 # $(3): arch (arm or aarch64)
38 # ios-$(1)_CONFIGURE_FLAGS
43 # ios-$(1)_BITCODE_MARKER
45 # This handles tvos/watchos as well.
47 define iOSDeviceTemplate
49 _ios-
$(1)_CC
=$$(CCACHE
) $$(PLATFORM_BIN
)/clang
50 _ios-
$(1)_CXX
=$$(CCACHE
) $$(PLATFORM_BIN
)/clang
++
53 ac_cv_c_bigendian
=no \
54 ac_cv_func_finite
=no \
55 ac_cv_func_getpwuid_r
=no \
56 ac_cv_func_posix_getpwuid_r
=yes \
57 ac_cv_header_curses_h
=no \
58 ac_cv_header_localcharset_h
=no \
59 ac_cv_header_sys_user_h
=no \
60 ac_cv_func_getentropy
=no \
61 ac_cv_func_futimens
=no \
62 ac_cv_func_utimensat
=no \
63 ac_cv_func_shm_open_working_with_mmap
=no \
64 mono_cv_sizeof_sunpath
=104 \
69 $$(ios-
$(1)_SYSROOT
) \
71 -Wl
,-application_extension \
73 $$(ios-
$(1)_BITCODE_MARKER
) \
77 $$(ios-
$(1)_SYSROOT
) \
79 -Wl
,-application_extension \
80 $$(ios-
$(1)_CXXFLAGS
) \
81 $$(ios-
$(1)_BITCODE_MARKER
)
85 $$(ios-
$(1)_SYSROOT
) \
87 -DSMALL_CONFIG
-DDISABLE_POLICY_EVIDENCE
=1 -D_XOPEN_SOURCE
-DHOST_IOS
-DHAVE_LARGE_FILE_SUPPORT
=1 \
92 -Wl
,-no_weak_imports \
94 -framework CoreFoundation \
98 _ios-
$(1)_CONFIGURE_FLAGS
= \
99 --build
=i386-apple-darwin10 \
100 --host
=$(3)-apple-darwin10 \
101 --cache-file
=$(TOP
)/sdks
/builds
/ios-
$(1)-$$(CONFIGURATION
).config.cache \
102 --prefix=$(TOP
)/sdks
/out
/ios-
$(1)-$$(CONFIGURATION
) \
105 --disable-executables \
106 --disable-icall-tables \
108 --disable-mcs-build \
110 --disable-support-build \
111 --disable-visibility-hidden \
113 --enable-icall-export \
114 --enable-maintainer-mode \
115 --enable-minimal
=ssa
,com
,interpreter
,jit
,reflection_emit_save
,reflection_emit
,portability
,assembly_remapping
,attach
,verifier
,full_messages
,appdomains
,security
,sgen_remset
,sgen_marksweep_par
,sgen_marksweep_fixed
,sgen_marksweep_fixed_par
,sgen_copying
,logging
,remoting
,shared_perfcounters \
117 --with-lazy-gc-thread-creation
=yes \
120 --without-ikvm-native \
121 --without-sigaltstack \
122 --disable-cooperative-suspend \
123 --disable-hybrid-suspend \
124 $$(ios-
$(1)_CONFIGURE_FLAGS
)
126 .stamp-ios-
$(1)-toolchain
:
129 $$(eval
$$(call RuntimeTemplate
,ios-
$(1)))
133 ios_sysroot
= -isysroot
$(XCODE_DIR
)/Platforms
/iPhoneOS.platform
/Developer
/SDKs
/iPhoneOS
$(IOS_VERSION
).sdk
-miphoneos-version-min
=$(IOS_VERSION_MIN
)
134 tvos_sysroot
= -isysroot
$(XCODE_DIR
)/Platforms
/AppleTVOS.platform
/Developer
/SDKs
/AppleTVOS
$(TVOS_VERSION
).sdk
-mtvos-version-min
=$(TVOS_VERSION_MIN
)
135 watchos_sysroot
= -isysroot
$(XCODE_DIR
)/Platforms
/WatchOS.platform
/Developer
/SDKs
/WatchOS
$(WATCH_VERSION
).sdk
-mwatchos-version-min
=$(WATCHOS_VERSION_MIN
)
137 # explicitly disable dtrace, since it requires inline assembly, which is disabled on AppleTV (and mono's configure.ac doesn't know that (yet at least))
138 ios-targettv_CONFIGURE_FLAGS
= --enable-dtrace
=no
$(BITCODE_CONFIGURE_FLAGS
) --with-monotouch-tv
139 ios-targetwatch_CONFIGURE_FLAGS
= --enable-cooperative-suspend
$(BITCODE_CONFIGURE_FLAGS
) --with-monotouch-watch
141 ios-target32_SYSROOT
= $(ios_sysroot
)
142 ios-target32s_SYSROOT
= $(ios_sysroot
)
143 ios-target64_SYSROOT
= $(ios_sysroot
)
144 ios-targettv_SYSROOT
= $(tvos_sysroot
)
145 ios-targetwatch_SYSROOT
= $(watchos_sysroot
)
147 ios-target32_CPPFLAGS
= -DHOST_IOS
148 ios-target32s_CPPFLAGS
= -DHOST_IOS
149 ios-target64_CPPFLAGS
= -DHOST_IOS
150 ios-targettv_CPPFLAGS
= -DHOST_APPLETVOS
-DTARGET_APPLETVOS
151 ios-targetwatch_CPPFLAGS
= -DHOST_IOS
-DHOST_WATCHOS
153 ios-targettv_CFLAGS
= -fembed-bitcode
-fno-gnu-inline-asm
154 ios-targettv_CXXFLAGS
= -fembed-bitcode
-fno-gnu-inline-asm
155 ios-targetwatch_CFLAGS
= -fembed-bitcode
-fno-gnu-inline-asm
156 ios-targetwatch_CXXFLAGS
= -fembed-bitcode
-fno-gnu-inline-asm
158 ios-targettv_LDFLAGS
= -Wl
,-bitcode_bundle
$(BITCODE_LDFLAGS
)
159 ios-targetwatch_LDFLAGS
= -Wl
,-bitcode_bundle
$(BITCODE_LDFLAGS
)
161 ios-targettv_AC_VARS
= \
162 ac_cv_func_system
=no \
163 ac_cv_func_pthread_kill
=no \
165 ac_cv_func_sigaction
=no \
167 ac_cv_func_execv
=no \
168 ac_cv_func_execve
=no \
169 ac_cv_func_execvp
=no \
171 ios-targetwatch_AC_VARS
= $(ios-targettv_AC_VARS
)
173 # ios-target32_BITCODE_MARKER=-fembed-bitcode-marker
174 $(eval
$(call iOSDeviceTemplate
,target32
,armv7
,arm
))
175 $(eval
$(call iOSDeviceTemplate
,target32s
,armv7s
,arm
))
176 # ios-target64_BITCODE_MARKER=-fembed-bitcode-marker
177 $(eval
$(call iOSDeviceTemplate
,target64
,arm64
,aarch64
))
178 $(eval
$(call iOSDeviceTemplate
,targettv
,arm64
,aarch64
))
179 $(eval
$(call iOSDeviceTemplate
,targetwatch
,armv7k
,armv7k
))
185 # $(1): target (sim32 or sim64)
186 # $(2): arch (i386 or x86_64)
196 # This handles tvos/watchos as well.
198 define iOSSimulatorTemplate
200 _ios-
$(1)_CC
=$$(CCACHE
) $$(PLATFORM_BIN
)/clang
201 _ios-
$(1)_CXX
=$$(CCACHE
) $$(PLATFORM_BIN
)/clang
++
204 ac_cv_func_clock_nanosleep
=no \
205 ac_cv_func_fstatat
=no \
206 ac_cv_func_readlinkat
=no \
207 ac_cv_func_system
=no \
208 ac_cv_func_getentropy
=no \
209 ac_cv_func_futimens
=no \
210 ac_cv_func_utimensat
=no \
211 ac_cv_func_shm_open_working_with_mmap
=no \
216 $$(ios-
$(1)_SYSROOT
) \
218 -Wl
,-application_extension \
221 _ios-
$(1)_CPPFLAGS
= \
223 $$(ios-
$(1)_SYSROOT
) \
225 -Wl
,-application_extension \
226 $$(ios-
$(1)_CPPFLAGS
)
228 _ios-
$(1)_CXXFLAGS
= \
229 $$(ios-
$(1)_SYSROOT
) \
231 -Wl
,-application_extension\
232 $$(ios-
$(1)_CXXFLAGS
)
238 _ios-
$(1)_CONFIGURE_FLAGS
= \
239 --host
=$(2)-apple-darwin10 \
240 --cache-file
=$$(TOP
)/sdks
/builds
/ios-
$(1)-$$(CONFIGURATION
).config.cache \
241 --prefix=$$(TOP
)/sdks
/out
/ios-
$(1)-$$(CONFIGURATION
) \
244 --disable-executables \
246 --disable-mcs-build \
248 --disable-visibility-hidden \
249 --enable-maintainer-mode \
250 --enable-minimal
=com
,remoting
,shared_perfcounters \
253 --without-ikvm-native \
254 --disable-cooperative-suspend \
255 --disable-hybrid-suspend \
256 $$(ios-
$(1)_CONFIGURE_FLAGS
)
258 # _ios-$(1)_CONFIGURE_FLAGS += --enable-extension-module=xamarin
260 .stamp-ios-
$(1)-toolchain
:
263 $$(eval
$$(call RuntimeTemplate
,ios-
$(1)))
267 ios_sim_sysroot
= -isysroot
$(XCODE_DIR
)/Platforms
/iPhoneSimulator.platform
/Developer
/SDKs
/iPhoneSimulator
$(IOS_VERSION
).sdk
-mios-simulator-version-min
=$(IOS_VERSION_MIN
)
268 tvos_sim_sysroot
= -isysroot
$(XCODE_DIR
)/Platforms
/AppleTVSimulator.platform
/Developer
/SDKs
/AppleTVSimulator
$(TVOS_VERSION
).sdk
-mtvos-simulator-version-min
=$(TVOS_VERSION_MIN
)
269 watchos_sim_sysroot
= -isysroot
$(XCODE_DIR
)/Platforms
/WatchSimulator.platform
/Developer
/SDKs
/WatchSimulator
$(WATCH_VERSION
).sdk
-mwatchos-simulator-version-min
=$(WATCHOS_VERSION_MIN
)
271 ios-sim32_SYSROOT
= $(ios_sim_sysroot
)
272 ios-sim64_SYSROOT
= $(ios_sim_sysroot
)
273 ios-simtv_SYSROOT
= $(tvos_sim_sysroot
)
274 ios-simwatch_SYSROOT
= $(watchos_sim_sysroot
)
276 ios-simwatch_CONFIGURE_FLAGS
= --enable-cooperative-suspend
278 ios-sim32_CPPFLAGS
= -DHOST_IOS
279 ios-sim64_CPPFLAGS
= -DHOST_IOS
280 ios-simtv_CPPFLAGS
= -DHOST_APPLETVOS
-DTARGET_APPLETVOS
281 ios-simwatch_CPPFLAGS
= -DHOST_IOS
-DHOST_WATCHOS
283 ios-simtv_AC_VARS
= \
284 ac_cv_func_pthread_kill
=no \
286 ac_cv_func_sigaction
=no \
288 ac_cv_func_execv
=no \
289 ac_cv_func_execve
=no \
290 ac_cv_func_execvp
=no \
292 ios-simwatch_AC_VARS
= \
293 ac_cv_func_system
=no \
294 ac_cv_func_pthread_kill
=no \
296 ac_cv_func_sigaction
=no \
298 ac_cv_func_execv
=no \
299 ac_cv_func_execve
=no \
300 ac_cv_func_execvp
=no \
303 $(eval
$(call iOSSimulatorTemplate
,sim32
,i386
))
304 $(eval
$(call iOSSimulatorTemplate
,sim64
,x86_64
))
305 $(eval
$(call iOSSimulatorTemplate
,simtv
,x86_64
))
306 $(eval
$(call iOSSimulatorTemplate
,simwatch
,i386
))
310 # $(1): target (cross32 or cross64)
311 # $(2): arch (arm or aarch64)
312 # $(3): llvm (llvm32 or llvm64)
313 # $(4): configure target arch
314 # $(5): offsets tool --abi argument
321 # ios-$(1)_CONFIGURE_FLAGS
322 define iOSCrossTemplate
324 _ios-
$(1)_OFFSET_TOOL_ABI
=$(5)
326 _ios-
$(1)_CC
=$$(CCACHE
) $$(PLATFORM_BIN
)/clang
327 _ios-
$(1)_CXX
=$$(CCACHE
) $$(PLATFORM_BIN
)/clang
++
330 ac_cv_func_shm_open_working_with_mmap
=no \
334 -isysroot
$$(XCODE_DIR
)/Platforms
/MacOSX.platform
/Developer
/SDKs
/MacOSX
$$(MACOS_VERSION
).sdk
-mmacosx-version-min
=$$(MACOS_VERSION_MIN
) \
338 _ios-
$(1)_CXXFLAGS
= \
339 -isysroot
$$(XCODE_DIR
)/Platforms
/MacOSX.platform
/Developer
/SDKs
/MacOSX
$$(MACOS_VERSION
).sdk
-mmacosx-version-min
=$$(MACOS_VERSION_MIN
) \
342 $$(ios-
$(1)_CXXFLAGS
)
344 _ios-
$(1)_CPPFLAGS
= \
346 $$(ios-
$(1)_CPPFLAGS
)
353 _ios-
$(1)_CONFIGURE_FLAGS
= \
354 $$(ios-
$(1)_CONFIGURE_FLAGS
) \
356 --cache-file
=$$(TOP
)/sdks
/builds
/ios-
$(1)-$$(CONFIGURATION
).config.cache \
357 --prefix=$$(TOP
)/sdks
/out
/ios-
$(1)-$$(CONFIGURATION
) \
361 --disable-libraries \
362 --disable-mcs-build \
365 --enable-icall-symbol-map \
366 --enable-minimal
=com
,remoting \
367 --with-cross-offsets
=$(4).h \
368 --with-llvm
=$$(TOP
)/sdks
/out
/ios-
$(3)
370 .stamp-ios-
$(1)-toolchain
:
373 .stamp-ios-
$(1)-$$(CONFIGURATION
)-configure
: |
$(if
$(IGNORE_PACKAGE_LLVM
),package-llvm-
$(3),download-llvm-
$(3))
375 $$(TOP
)/sdks
/builds
/ios-
$(1)-$$(CONFIGURATION
)/$(4).h
: .stamp-ios-
$(1)-$$(CONFIGURATION
)-configure
$$(TOP
)/tools
/offsets-tool
/MonoAotOffsetsDumper.exe
376 cd
$$(TOP
)/sdks
/builds
/ios-
$(1)-$$(CONFIGURATION
) && \
377 MONO_PATH
=$(TOP
)/tools
/offsets-tool
/CppSharp
/osx_64 \
378 mono
--debug
$$(TOP
)/tools
/offsets-tool
/MonoAotOffsetsDumper.exe \
379 --gen-ios
--abi
$$(_ios-
$(1)_OFFSET_TOOL_ABI
) --outfile
$$@
--mono
$$(TOP
) --targetdir
$$(TOP
)/sdks
/builds
/ios-
$(1)-$$(CONFIGURATION
)
381 build-ios-
$(1): $$(TOP
)/sdks
/builds
/ios-
$(1)-$$(CONFIGURATION
)/$(4).h
383 $$(eval
$$(call RuntimeTemplate
,ios-
$(1)))
387 ios-cross32_CONFIGURE_FLAGS
=--build
=i386-apple-darwin10
388 ios-crosswatch_CONFIGURE_FLAGS
=--build
=i386-apple-darwin10
--enable-cooperative-suspend
389 $(eval
$(call iOSCrossTemplate
,cross32
,arm
,llvm36-32
,arm-darwin
,arm-apple-darwin10
))
390 $(eval
$(call iOSCrossTemplate
,cross64
,aarch64
,llvm64
,aarch64-darwin
,aarch64-apple-darwin10
))
391 $(eval
$(call iOSCrossTemplate
,crosswatch
,armv7k
,llvm36-32
,armv7k-unknown-darwin
,armv7k-apple-darwin
))