2 AM_CONFIG_HEADER(config.h)
3 AM_INIT_AUTOMAKE(mono, 0.7)
16 AC_CHECK_SIZEOF(void *)
18 CFLAGS='-g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations'
20 dnl ***************************
21 dnl *** Checks for glib 1.2 ***
22 dnl ***************************
24 AC_MSG_ERROR([Cannot find GLIB: Is glib-config in path?]))
26 GLIB_CFLAGS=`glib-config --cflags glib`
27 GLIB_LIBS=`glib-config --libs glib`
32 GMODULE_CFLAGS=`glib-config --cflags gmodule`
33 GMODULE_LIBS=`glib-config --libs gmodule`
35 AC_SUBST(GMODULE_CFLAGS)
36 AC_SUBST(GMODULE_LIBS)
38 dnl *****************************
39 dnl *** Checks for libpthread ***
40 dnl *****************************
41 AC_CHECK_LIB(pthread, pthread_create, [
43 AM_CONDITIONAL(THREADS_PTHREAD, true)
44 AC_DEFINE(HAVE_PTHREAD)
46 # Need pthread_mutex_timedlock
48 orig_CPPFLAGS=$CPPFLAGS
49 # This is a gcc-specific error, but we already set gcc-specific
50 # options in CFLAGS :)
51 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
52 AC_MSG_CHECKING(for pthread_mutex_timedlock)
53 AC_TRY_COMPILE([ #include <pthread.h>], [
54 pthread_mutex_t mut=PTHREAD_MUTEX_INITIALIZER;
55 pthread_mutex_timedlock(&mut, NULL);
59 AC_DEFINE(HAVE_PTHREAD_MUTEX_TIMEDLOCK)
63 # glibc requires -D_GNU_SOURCE before it will declare
65 AC_MSG_CHECKING(whether _GNU_SOURCE is needed for pthread_mutex_timedlock)
66 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
67 AC_TRY_COMPILE([ #include <pthread.h>], [
68 pthread_mutex_t mut=PTHREAD_MUTEX_INITIALIZER;
69 pthread_mutex_timedlock(&mut, NULL);
72 pthread_CFLAGS="-D_GNU_SOURCE"
73 AC_DEFINE(HAVE_PTHREAD_MUTEX_TIMEDLOCK)
76 dnl Add other variants here
77 AC_MSG_WARN(Working around pthread_mutex_timedlock)
80 CPPFLAGS=$orig_CPPFLAGS
81 CFLAGS="$CFLAGS $pthread_CFLAGS"
83 AC_MSG_RESULT([Cannot find libpthread])
84 # Check for other thread systems here, set THREAD_LIBS to
85 # whatever is needed, and define
86 # AM_CONDITIONAL(THREADS_foo, true), and add it to the
87 # section in mono/metadata/Makefile.am, AC_DEFINE(HAVE_foo),
88 # add that to acconfig.h, add the section for that in
89 # mono/metadata/threads.h
94 ACCESS_UNALIGNED="yes"
97 #mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; ACCESS_UNALIGNED="no";;
98 i*86-*-*) TARGET=X86; arch_target=x86;;
99 sparc*-*-*) TARGET=SPARC; ACCESS_UNALIGNED="no";;
100 #alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; ACCESS_UNALIGNED="no";;
101 #m68k-*-linux*) TARGET=M68K;;
102 #powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; ACCESS_UNALIGNED="no";;
103 #arm-*-linux-*) TARGET=ARM; ACCESS_UNALIGNED="no";;
106 if test ${TARGET} = unknown; then
107 CFLAGS="$CFLAGS -DNO_PORT"
108 AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
111 if test ${ACCESS_UNALIGNED} = no; then
112 CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
115 AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
116 AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
117 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
118 AM_CONDITIONAL(X86, test x$TARGET = xX86)
119 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
120 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
121 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
122 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
124 AC_SUBST(arch_target)
130 mono/metadata/Makefile
134 mono/arch/x86/Makefile
135 mono/interpreter/Makefile
137 mono/wrapper/Makefile
138 mono/monoburg/Makefile