-
Notifications
You must be signed in to change notification settings - Fork 52
/
mono.m4
66 lines (58 loc) · 1.66 KB
/
mono.m4
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
AC_DEFUN([SHAMROCK_FIND_MONO_1_0_COMPILER],
[
SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, mcs)
])
AC_DEFUN([SHAMROCK_FIND_MONO_2_0_COMPILER],
[
SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, gmcs)
])
AC_DEFUN([SHAMROCK_FIND_MONO_2_0_COMPILER_OR_HIGHER],
[
if pkg-config --atleast-version=4.0 mono; then
SHAMROCK_FIND_PROGRAM(MCS, mcs)
fi
if pkg-config --atleast-version=2.8 mono; then
SHAMROCK_FIND_PROGRAM(MCS, dmcs)
fi
if test "x$MCS" = "x" ; then
SHAMROCK_FIND_PROGRAM(MCS, gmcs)
fi
if test "x$MCS" = "x" ; then
AC_MSG_ERROR([You need to install 'dmcs' or 'gmcs'])
fi
])
AC_DEFUN([SHAMROCK_FIND_MONO_RUNTIME],
[
SHAMROCK_FIND_PROGRAM_OR_BAIL(MONO, mono)
])
AC_DEFUN([SHAMROCK_CHECK_MONO_MODULE],
[
PKG_CHECK_MODULES(MONO_MODULE, mono >= $1)
])
AC_DEFUN([SHAMROCK_CHECK_MONO_MODULE_NOBAIL],
[
PKG_CHECK_MODULES(MONO_MODULE, mono >= $1,
HAVE_MONO_MODULE=yes, HAVE_MONO_MODULE=no)
AC_SUBST(HAVE_MONO_MODULE)
])
AC_DEFUN([SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES],
[
CLR_VERSIONS="2.0 3.5 4.0 4.5"
for ASM in $(echo "$*" | cut -d, -f2- | sed 's/\,/ /g'); do
AC_MSG_CHECKING([Mono GAC for $ASM.dll])
found=0
for CLR_VER in $CLR_VERSIONS; do
if test \
-e "$($PKG_CONFIG --variable=libdir mono)/mono/$CLR_VER/$ASM.dll" -o \
-e "$($PKG_CONFIG --variable=prefix mono)/lib/mono/$CLR_VER/$ASM.dll"; then
found=1
fi
done
if test "x$found" = "x1"; then
AC_MSG_RESULT([found])
else
AC_MSG_RESULT([not found])
AC_MSG_ERROR([missing required Mono assembly: $ASM.dll])
fi
done
])