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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
AC_INIT(README)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono, 0.7)
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
AC_PROG_CC
AM_PROG_CC_STDC
AC_PROG_INSTALL
# Set STDC_HEADERS
AC_HEADER_STDC
AM_PROG_LIBTOOL
AC_CHECK_SIZEOF(void *)
CFLAGS='-g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations'
dnl ***************************
dnl *** Checks for glib 1.2 ***
dnl ***************************
AM_PATH_GLIB(1.2.0,,
AC_MSG_ERROR([Cannot find GLIB: Is glib-config in path?]))
GLIB_CFLAGS=`glib-config --cflags glib`
GLIB_LIBS=`glib-config --libs glib`
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
GMODULE_CFLAGS=`glib-config --cflags gmodule`
GMODULE_LIBS=`glib-config --libs gmodule`
AC_SUBST(GMODULE_CFLAGS)
AC_SUBST(GMODULE_LIBS)
dnl *****************************
dnl *** Checks for libpthread ***
dnl *****************************
AC_CHECK_LIB(pthread, pthread_create, [
THREAD_LIBS=-lpthread
AM_CONDITIONAL(THREADS_PTHREAD, true)
AC_DEFINE(HAVE_PTHREAD)
# Need pthread_mutex_timedlock
pthread_CFLAGS=""
orig_CPPFLAGS=$CPPFLAGS
# This is a gcc-specific error, but we already set gcc-specific
# options in CFLAGS :)
CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
AC_MSG_CHECKING(for pthread_mutex_timedlock)
AC_TRY_COMPILE([ #include <pthread.h>], [
pthread_mutex_t mut=PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_timedlock(&mut, NULL);
], [
# Works!
AC_MSG_RESULT(ok)
AC_DEFINE(HAVE_PTHREAD_MUTEX_TIMEDLOCK)
], [
AC_MSG_RESULT(no)
# glibc requires -D_GNU_SOURCE before it will declare
# this function
AC_MSG_CHECKING(whether _GNU_SOURCE is needed for pthread_mutex_timedlock)
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
AC_TRY_COMPILE([ #include <pthread.h>], [
pthread_mutex_t mut=PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_timedlock(&mut, NULL);
], [
AC_MSG_RESULT(ok)
pthread_CFLAGS="-D_GNU_SOURCE"
AC_DEFINE(HAVE_PTHREAD_MUTEX_TIMEDLOCK)
], [
AC_MSG_RESULT(no)
dnl Add other variants here
AC_MSG_WARN(Working around pthread_mutex_timedlock)
])
])
CPPFLAGS=$orig_CPPFLAGS
CFLAGS="$CFLAGS $pthread_CFLAGS"
], [
AC_MSG_RESULT([Cannot find libpthread])
# Check for other thread systems here, set THREAD_LIBS to
# whatever is needed, and define
# AM_CONDITIONAL(THREADS_foo, true), and add it to the
# section in mono/metadata/Makefile.am, AC_DEFINE(HAVE_foo),
# add that to acconfig.h, add the section for that in
# mono/metadata/threads.h
])
AC_SUBST(THREAD_LIBS)
TARGET="unknown"
ACCESS_UNALIGNED="yes"
case "$host" in
#mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; ACCESS_UNALIGNED="no";;
i*86-*-*) TARGET=X86; arch_target=x86;;
sparc*-*-*) TARGET=SPARC; ACCESS_UNALIGNED="no";;
#alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; ACCESS_UNALIGNED="no";;
#m68k-*-linux*) TARGET=M68K;;
#powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; ACCESS_UNALIGNED="no";;
#arm-*-linux-*) TARGET=ARM; ACCESS_UNALIGNED="no";;
esac
if test ${TARGET} = unknown; then
CFLAGS="$CFLAGS -DNO_PORT"
AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
fi
if test ${ACCESS_UNALIGNED} = no; then
CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
fi
AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
AM_CONDITIONAL(X86, test x$TARGET = xX86)
AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
AM_CONDITIONAL(ARM, test x$TARGET = xARM)
AC_SUBST(arch_target)
AC_SUBST(CFLAGS)
AC_OUTPUT([
Makefile
mono/Makefile
mono/metadata/Makefile
mono/dis/Makefile
mono/cil/Makefile
mono/arch/Makefile
mono/arch/x86/Makefile
mono/interpreter/Makefile
mono/tests/Makefile
mono/wrapper/Makefile
mono/monoburg/Makefile
mono/jit/Makefile
runtime/Makefile
doc/Makefile
])
|