6 # - package-ios-<target>
7 # Install target into ../out/<target>
10 # Where <target> is: target32, target32s, target64, sim32, sim64, cross32, cross64
13 PLATFORM_BIN
=$(XCODE_DIR
)/Toolchains
/XcodeDefault.xctoolchain
/usr
/bin
19 # $(1): target (target32/target32s/target64)
20 # $(2): host arch (arm or aarch64)
21 # $(3): host arch for compiler (armv7 or arm64)
26 # ios-$(1)_CONFIGURE_FLAGS
31 # ios-$(1)_BITCODE_MARKER
33 # This handles tvos/watchos as well.
35 define iOSDeviceTemplate
37 _ios-
$(1)_CC
=$$(CCACHE
) $$(PLATFORM_BIN
)/clang
38 _ios-
$(1)_CXX
=$$(CCACHE
) $$(PLATFORM_BIN
)/clang
++
41 ac_cv_c_bigendian
=no \
42 ac_cv_func_fstatat
=no \
43 ac_cv_func_readlinkat
=no \
44 ac_cv_func_getpwuid_r
=no \
45 ac_cv_func_posix_getpwuid_r
=yes \
46 ac_cv_header_curses_h
=no \
47 ac_cv_header_localcharset_h
=no \
48 ac_cv_header_sys_user_h
=no \
49 ac_cv_func_getentropy
=no \
50 ac_cv_func_futimens
=no \
51 ac_cv_func_utimensat
=no \
52 ac_cv_func_shm_open_working_with_mmap
=no \
53 mono_cv_sizeof_sunpath
=104 \
57 $$(ios-
$(1)_SYSROOT
) \
59 -Wl
,-application_extension \
61 $$(ios-
$(1)_BITCODE_MARKER
)
64 $$(ios-
$(1)_SYSROOT
) \
66 -Wl
,-application_extension \
67 $$(ios-
$(1)_BITCODE_MARKER
)
71 $$(ios-
$(1)_SYSROOT
) \
73 -DSMALL_CONFIG
-D_XOPEN_SOURCE
-DHOST_IOS
-DHAVE_LARGE_FILE_SUPPORT
=1 \
76 -Wl
,-no_weak_imports \
78 -framework CoreFoundation \
81 _ios-
$(1)_CONFIGURE_FLAGS
= \
84 --disable-executables \
85 --disable-icall-tables \
89 --disable-visibility-hidden \
91 --enable-icall-export \
92 --enable-maintainer-mode \
93 --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 \
95 --with-lazy-gc-thread-creation
=yes \
98 --without-ikvm-native \
99 --without-sigaltstack \
100 --disable-cooperative-suspend \
101 --disable-hybrid-suspend \
102 --disable-crash-reporting
104 .stamp-ios-
$(1)-toolchain
:
107 $$(eval
$$(call RuntimeTemplate
,ios
,$(1),$(2)-apple-darwin10
))
111 ios_sysroot
= -isysroot
$(XCODE_DIR
)/Platforms
/iPhoneOS.platform
/Developer
/SDKs
/iPhoneOS
$(IOS_VERSION
).sdk
-miphoneos-version-min
=$(IOS_VERSION_MIN
)
112 tvos_sysroot
= -isysroot
$(XCODE_DIR
)/Platforms
/AppleTVOS.platform
/Developer
/SDKs
/AppleTVOS
$(TVOS_VERSION
).sdk
-mtvos-version-min
=$(TVOS_VERSION_MIN
)
113 watchos_sysroot
= -isysroot
$(XCODE_DIR
)/Platforms
/WatchOS.platform
/Developer
/SDKs
/WatchOS
$(WATCHOS_VERSION
).sdk
-mwatchos-version-min
=$(WATCHOS_VERSION_MIN
)
115 # 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))
116 ios-targettv_CONFIGURE_FLAGS
= --enable-dtrace
=no
--enable-llvm-runtime
--with-bitcode
=yes
--with-monotouch-tv
117 ios-targetwatch_CONFIGURE_FLAGS
= --enable-cooperative-suspend
--enable-llvm-runtime
--with-bitcode
=yes
--with-monotouch-watch
119 ios-target32_SYSROOT
= $(ios_sysroot
)
120 ios-target32s_SYSROOT
= $(ios_sysroot
)
121 ios-target64_SYSROOT
= $(ios_sysroot
)
122 ios-targettv_SYSROOT
= $(tvos_sysroot
)
123 ios-targetwatch_SYSROOT
= $(watchos_sysroot
)
125 ios-target32_CPPFLAGS
= -DHOST_IOS
126 ios-target32s_CPPFLAGS
= -DHOST_IOS
127 ios-target64_CPPFLAGS
= -DHOST_IOS
128 ios-targettv_CPPFLAGS
= -DHOST_APPLETVOS
-DTARGET_APPLETVOS
129 ios-targetwatch_CPPFLAGS
= -DHOST_IOS
-DHOST_WATCHOS
131 ios-targettv_CFLAGS
= -fembed-bitcode
-fno-gnu-inline-asm
132 ios-targettv_CXXFLAGS
= -fembed-bitcode
-fno-gnu-inline-asm
133 ios-targetwatch_CFLAGS
= -fembed-bitcode
-fno-gnu-inline-asm
134 ios-targetwatch_CXXFLAGS
= -fembed-bitcode
-fno-gnu-inline-asm
136 ios-targettv_LDFLAGS
= -Wl
,-bitcode_bundle
-framework CoreFoundation
-lobjc
-lc
++
137 ios-targetwatch_LDFLAGS
= -Wl
,-bitcode_bundle
-framework CoreFoundation
-lobjc
-lc
++
139 ios-targettv_AC_VARS
= \
140 ac_cv_func_system
=no \
141 ac_cv_func_pthread_kill
=no \
143 ac_cv_func_sigaction
=no \
145 ac_cv_func_execv
=no \
146 ac_cv_func_execve
=no \
147 ac_cv_func_execvp
=no \
149 ios-targetwatch_AC_VARS
= $(ios-targettv_AC_VARS
)
151 # ios-target32_BITCODE_MARKER=-fembed-bitcode-marker
152 $(eval
$(call iOSDeviceTemplate
,target32
,arm
,armv7
))
153 $(eval
$(call iOSDeviceTemplate
,target32s
,arm
,armv7s
))
154 # ios-target64_BITCODE_MARKER=-fembed-bitcode-marker
155 $(eval
$(call iOSDeviceTemplate
,target64
,aarch64
,arm64
))
156 $(eval
$(call iOSDeviceTemplate
,targettv
,aarch64
,arm64
))
157 $(eval
$(call iOSDeviceTemplate
,targetwatch
,armv7k
,armv7k
))
163 # $(1): target (sim32 or sim64)
164 # $(2): host arch (i386 or x86_64)
174 # This handles tvos/watchos as well.
176 define iOSSimulatorTemplate
178 _ios-
$(1)_CC
=$$(CCACHE
) $$(PLATFORM_BIN
)/clang
179 _ios-
$(1)_CXX
=$$(CCACHE
) $$(PLATFORM_BIN
)/clang
++
182 ac_cv_func_clock_nanosleep
=no \
183 ac_cv_func_fstatat
=no \
184 ac_cv_func_readlinkat
=no \
185 ac_cv_func_system
=no \
186 ac_cv_func_getentropy
=no \
187 ac_cv_func_futimens
=no \
188 ac_cv_func_utimensat
=no \
189 ac_cv_func_shm_open_working_with_mmap
=no \
193 $$(ios-
$(1)_SYSROOT
) \
195 -Wl
,-application_extension
197 _ios-
$(1)_CPPFLAGS
= \
199 $$(ios-
$(1)_SYSROOT
) \
201 -Wl
,-application_extension
203 _ios-
$(1)_CXXFLAGS
= \
204 $$(ios-
$(1)_SYSROOT
) \
206 -Wl
,-application_extension
208 _ios-
$(1)_CONFIGURE_FLAGS
= \
211 --disable-executables \
213 --disable-mcs-build \
215 --disable-visibility-hidden \
216 --enable-maintainer-mode \
217 --enable-minimal
=com
,remoting
,shared_perfcounters \
220 --without-ikvm-native \
221 --disable-cooperative-suspend \
222 --disable-hybrid-suspend \
223 --disable-crash-reporting
225 # _ios-$(1)_CONFIGURE_FLAGS += --enable-extension-module=xamarin
227 .stamp-ios-
$(1)-toolchain
:
230 $$(eval
$$(call RuntimeTemplate
,ios
,$(1),$(2)-apple-darwin10
))
234 ios_sim_sysroot
= -isysroot
$(XCODE_DIR
)/Platforms
/iPhoneSimulator.platform
/Developer
/SDKs
/iPhoneSimulator
$(IOS_VERSION
).sdk
-mios-simulator-version-min
=$(IOS_VERSION_MIN
)
235 tvos_sim_sysroot
= -isysroot
$(XCODE_DIR
)/Platforms
/AppleTVSimulator.platform
/Developer
/SDKs
/AppleTVSimulator
$(TVOS_VERSION
).sdk
-mtvos-simulator-version-min
=$(TVOS_VERSION_MIN
)
236 watchos_sim_sysroot
= -isysroot
$(XCODE_DIR
)/Platforms
/WatchSimulator.platform
/Developer
/SDKs
/WatchSimulator
$(WATCH_VERSION
).sdk
-mwatchos-simulator-version-min
=$(WATCHOS_VERSION_MIN
)
238 ios-sim32_SYSROOT
= $(ios_sim_sysroot
)
239 ios-sim64_SYSROOT
= $(ios_sim_sysroot
)
240 ios-simtv_SYSROOT
= $(tvos_sim_sysroot
)
241 ios-simwatch_SYSROOT
= $(watchos_sim_sysroot
)
243 ios-simwatch_CONFIGURE_FLAGS
= --enable-cooperative-suspend
245 ios-sim32_CPPFLAGS
= -DHOST_IOS
246 ios-sim64_CPPFLAGS
= -DHOST_IOS
247 ios-simtv_CPPFLAGS
= -DHOST_APPLETVOS
-DTARGET_APPLETVOS
248 ios-simwatch_CPPFLAGS
= -DHOST_IOS
-DHOST_WATCHOS
250 ios-simtv_AC_VARS
= \
251 ac_cv_func_pthread_kill
=no \
253 ac_cv_func_sigaction
=no \
255 ac_cv_func_execv
=no \
256 ac_cv_func_execve
=no \
257 ac_cv_func_execvp
=no \
259 ios-simwatch_AC_VARS
= \
260 ac_cv_func_system
=no \
261 ac_cv_func_pthread_kill
=no \
263 ac_cv_func_sigaction
=no \
265 ac_cv_func_execv
=no \
266 ac_cv_func_execve
=no \
267 ac_cv_func_execvp
=no \
270 $(eval
$(call iOSSimulatorTemplate
,sim32
,i386
))
271 $(eval
$(call iOSSimulatorTemplate
,sim64
,x86_64
))
272 $(eval
$(call iOSSimulatorTemplate
,simtv
,x86_64
))
273 $(eval
$(call iOSSimulatorTemplate
,simwatch
,i386
))
277 # $(1): target (cross32 or cross64)
278 # $(2): host arch (i386 or x86_64)
279 # $(3): target arch (arm or aarch64)
280 # $(4): device target (target32, target64, ...)
281 # $(5): llvm (llvm32 or llvm64)
282 # $(6): offsets dumper abi
289 # ios-$(1)_CONFIGURE_FLAGS
290 define iOSCrossTemplate
292 _ios-
$(1)_OFFSETS_DUMPER_ARGS
=--gen-ios
294 _ios-
$(1)_CC
=$$(CCACHE
) $$(PLATFORM_BIN
)/clang
295 _ios-
$(1)_CXX
=$$(CCACHE
) $$(PLATFORM_BIN
)/clang
++
298 ac_cv_func_shm_open_working_with_mmap
=no
301 -isysroot
$$(XCODE_DIR
)/Platforms
/MacOSX.platform
/Developer
/SDKs
/MacOSX
$$(MACOS_VERSION
).sdk
-mmacosx-version-min
=$$(MACOS_VERSION_MIN
) \
304 _ios-
$(1)_CXXFLAGS
= \
305 -isysroot
$$(XCODE_DIR
)/Platforms
/MacOSX.platform
/Developer
/SDKs
/MacOSX
$$(MACOS_VERSION
).sdk
-mmacosx-version-min
=$$(MACOS_VERSION_MIN
) \
309 _ios-
$(1)_CPPFLAGS
= \
315 _ios-
$(1)_CONFIGURE_FLAGS
= \
319 --disable-libraries \
320 --disable-mcs-build \
323 --enable-icall-symbol-map \
324 --enable-minimal
=com
,remoting \
325 --disable-crash-reporting
327 $$(eval
$$(call CrossRuntimeTemplate
,ios
,$(1),$(2)-apple-darwin10
,$(3)-darwin
,$(4),$(5),$(6)))
331 $(eval
$(call iOSCrossTemplate
,cross32
,i386
,arm
,target32
,llvm36-llvm32
,arm-apple-darwin10
))
332 $(eval
$(call iOSCrossTemplate
,cross64
,x86_64
,aarch64
,target64
,llvm-llvm64
,aarch64-apple-darwin10
))
333 ios-crosswatch_CONFIGURE_FLAGS
=--enable-cooperative-suspend
334 $(eval
$(call iOSCrossTemplate
,crosswatch
,i386
,armv7k-unknown
,targetwatch
,llvm36-llvm32
,armv7k-apple-darwin
))
335 # 64->arm32 cross compiler
336 $(eval
$(call iOSCrossTemplate
,cross32-64
,x86_64
,arm
,target32
,llvm-llvm64
,arm-apple-darwin10
))
338 $(eval
$(call BclTemplate
,ios
,monotouch monotouch_runtime monotouch_tv monotouch_tv_runtime monotouch_watch monotouch_watch_runtime monotouch_tools
,monotouch monotouch_tv monotouch_watch
))