Welcome to mirror list, hosted at ThFree Co, Russian Federation.

apple-target.m4 « m4 - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3e5844e1faeb3839b01e9ef03863532c7be3a058 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Usage:
# AC_MONO_APPLE_TARGET(target-name, action-if-found, action-if-not-found)
#
# Checks whether `target-name` is defined in "TargetConditionals.h"
#
AC_DEFUN([AC_MONO_APPLE_TARGET], [
	AC_MONO_APPLE_AVAILABLE([$1], [for $1], [$1 == 1], $2, $3)
])


# Usage:
# AC_MONO_APPLE_AVAILABLE(name, message, conditional, action-if-found, action-if-not-found)
#
# Checks for `conditional` using "TargetConditionals.h" and "AvailabilityMacros.h"
#
AC_DEFUN([AC_MONO_APPLE_AVAILABLE], [
	# cache the compilation check
	AC_CACHE_CHECK([$2], [ac_cv_apple_available_[]$1], [
		AC_TRY_COMPILE([
			#include "TargetConditionals.h"
			#include "AvailabilityMacros.h"
		],[
			#if !($3)
			#error failed
			#endif
		], [
			ac_cv_apple_available_[]$1=yes
		], [
			ac_cv_apple_available_[]$1=no
		])
	])
	# keep the actions out of the cache check because they need to be always executed.
	if test x$ac_cv_apple_available_[]$1 = xyes; then
		$1=yes
		[$4]
	else
		$1=no
		[$5]
	fi
])