3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(mono, 0.15)
7 # Thread configuration inspired by sleepycat's db
8 AC_MSG_CHECKING([host platform characteristics])
10 *-*-mingw*|*-*-cygwin*)
12 AC_DEFINE(PLATFORM_WIN32)
15 CPPFLAGS="$CPPFLAGS -DGC_WIN32_THREADS"
20 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
21 LDFLAGS="$LDFLAGS -pthread"
22 AC_DEFINE(NEED_LINK_UNLINK)
27 CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT"
32 CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT"
33 AC_DEFINE(NEED_LINK_UNLINK)
36 AC_MSG_WARN([*** Please add $host to configure.in checks!])
42 AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
44 AC_CHECK_TOOL(CC, gcc, gcc)
49 AC_CHECK_PROG(BISON, bison,yes,no)
50 if test "x$BISON" = "xno";
52 AC_MSG_ERROR([You need to install bison])
55 dnl may require a specific autoconf version
56 dnl AC_PROG_CC_FOR_BUILD
57 dnl CC_FOR_BUILD not automatically detected
60 if test "x$cross_compiling" = "xyes"; then
64 AC_SUBST(CC_FOR_BUILD)
66 AC_SUBST(BUILD_EXEEXT)
73 AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h)
75 # for mono/metadata/debug-symfile.c
76 AC_CHECK_HEADERS(elf.h)
79 AC_CHECK_HEADERS(wchar.h)
81 # not 64 bit clean in cross-compile
82 AC_CHECK_SIZEOF(void *, 4)
84 CFLAGS='-g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings'
86 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
87 if test "x$PKG_CONFIG" = "xno"; then
88 AC_MSG_ERROR([You need to install pkg-config])
91 dnl for use on the build system
92 dnl pkg-config is stupid
93 BUILD_GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
94 BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
95 AC_SUBST(BUILD_GLIB_CFLAGS)
96 AC_SUBST(BUILD_GLIB_LIBS)
99 AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir],
100 if test x$with_crosspkgdir = "x"; then
101 if test -s $PKG_CONFIG_PATH; then
102 PKG_PATH=$PKG_CONFIG_PATH
105 PKG_PATH=$with_crosspkgdir
106 PKG_CONFIG_PATH=$PKG_PATH
107 export PKG_CONFIG_PATH
111 ## Versions of dependencies
112 GLIB_REQUIRED_VERSION=1.3.11
114 PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION)
116 GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
117 GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
118 GMODULE_CFLAGS=`$PKG_CONFIG --cflags gmodule-2.0`
119 GMODULE_LIBS=`$PKG_CONFIG --libs gmodule-2.0`
121 AC_SUBST(GLIB_CFLAGS)
123 AC_SUBST(GMODULE_CFLAGS)
124 AC_SUBST(GMODULE_LIBS)
126 AC_CHECK_HEADERS(gc.h gc/gc.h)
127 AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
129 AC_ARG_WITH(gc, [ --with-gc=boehm,none],[gc=$with_gc])
133 if test "x$found_boehm" != "xyes"; then
134 AC_MSG_ERROR("GC requested but libgc not found!")
137 AC_DEFINE(HAVE_BOEHM_GC)
138 AC_SUBST(HAVE_BOEHM_GC)
139 LIBS="$LIBS -lgc $libdl"
142 AC_MSG_WARN("Compiling mono without GC.")
145 # If libgc was found, use it. Otherwise just warn.
146 if test "x$found_boehm" != "xyes"; then
147 AC_MSG_WARN("Compiling mono without GC.")
149 AC_DEFINE(HAVE_BOEHM_GC)
150 AC_SUBST(HAVE_BOEHM_GC)
151 LIBS="$LIBS -lgc $libdl"
157 if test x$platform_win32 = xno; then
158 dnl ******************************************************************
159 dnl *** Check for large file support ***
160 dnl *** (If we were using autoconf 2.50 we'd use AC_SYS_LARGEFILE) ***
161 dnl ******************************************************************
163 # Check that off_t can represent 2**63 - 1 correctly, working around
164 # potential compiler bugs. Defines LARGE_FILE_SUPPORT, adds $1 to
165 # CPPFLAGS and sets $large_offt to yes if the test succeeds
167 AC_DEFUN(LARGE_FILES, [
168 large_CPPFLAGS=$CPPFLAGS
169 CPPFLAGS="$CPPFLAGS $1"
171 #include <sys/types.h>
173 #define BIG_OFF_T (((off_t)1<<62)-1+((off_t)1<<62))
176 int big_off_t=((BIG_OFF_T%2147483629==721) &&
177 (BIG_OFF_T%2147483647==1));
186 AC_DEFINE(HAVE_LARGE_FILE_SUPPORT)
187 large_CPPFLAGS="$large_CPPFLAGS $1"
192 CPPFLAGS=$large_CPPFLAGS
195 AC_MSG_CHECKING(if off_t is 64 bits wide)
197 if test $large_offt = no; then
198 AC_MSG_CHECKING(if _FILE_OFFSET_BITS=64 gives 64 bit off_t)
199 LARGE_FILES("-D_FILE_OFFSET_BITS=64")
201 if test $large_offt = no; then
202 AC_MSG_WARN([No 64 bit file size support available])
205 dnl *****************************
206 dnl *** Checks for libsocket ***
207 dnl *****************************
208 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
210 dnl *******************************
211 dnl *** Checks for MSG_NOSIGNAL ***
212 dnl *******************************
213 AC_MSG_CHECKING(for MSG_NOSIGNAL)
214 AC_TRY_COMPILE([#include <sys/socket.h>], [
215 int f = MSG_NOSIGNAL;
219 AC_DEFINE(HAVE_MSG_NOSIGNAL)
221 # We'll have to use signals
225 dnl *****************************
226 dnl *** Checks for SOL_IP ***
227 dnl *****************************
228 AC_MSG_CHECKING(for SOL_IP)
229 AC_TRY_COMPILE([#include <netdb.h>], [
234 AC_DEFINE(HAVE_SOL_IP)
236 # We'll have to use getprotobyname
240 dnl *****************************
241 dnl *** Checks for SOL_TCP ***
242 dnl *****************************
243 AC_MSG_CHECKING(for SOL_TCP)
244 AC_TRY_COMPILE([#include <netdb.h>], [
249 AC_DEFINE(HAVE_SOL_TCP)
251 # We'll have to use getprotobyname
255 dnl *****************************
256 dnl *** Checks for IP_PKTINFO ***
257 dnl *****************************
258 AC_MSG_CHECKING(for IP_PKTINFO)
259 AC_TRY_COMPILE([#include <netdb.h>], [
260 int level = IP_PKTINFO;
264 AC_DEFINE(HAVE_IP_PKTINFO)
269 dnl *********************************
270 dnl *** Check for struct ip_mreqn ***
271 dnl *********************************
272 AC_MSG_CHECKING(for struct ip_mreqn)
273 AC_TRY_COMPILE([#include <netinet/in.h>], [
274 struct ip_mreqn mreq;
275 mreq.imr_address.s_addr = 0;
279 AC_DEFINE(HAVE_STRUCT_IP_MREQN)
281 # We'll just have to use struct ip_mreq
285 dnl *****************************
286 dnl *** Checks for libnsl ***
287 dnl *****************************
288 AC_CHECK_LIB(nsl, gethostbyaddr, LIBS="$LIBS -lnsl")
290 AC_CHECK_FUNCS(inet_pton inet_aton)
292 dnl ***********************************************
293 dnl *** Checks for size of sockaddr_un.sun_path ***
294 dnl ***********************************************
295 # AC_CHECK_SIZEOF can't cope with struct members :-(
296 AC_MSG_CHECKING(size of sockaddr_un.sun_path)
297 AC_CACHE_VAL(cv_mono_sizeof_sunpath,
299 #include <sys/types.h>
304 struct sockaddr_un sock_un;
305 FILE *f=fopen("conftestval", "w");
307 fprintf(f, "%d\n", sizeof(sock_un.sun_path));
310 ], cv_mono_sizeof_sunpath=`cat conftestval`,
311 cv_mono_sizeof_sunpath=0,
312 cv_mono_sizeof_sunpath=0)])dnl
313 AC_MSG_RESULT($cv_mono_sizeof_sunpath)
314 AC_DEFINE_UNQUOTED(MONO_SIZEOF_SUNPATH, $cv_mono_sizeof_sunpath)
316 dnl *****************************
317 dnl *** Checks for libxnet ***
318 dnl *****************************
321 AC_MSG_CHECKING(for Solaris XPG4 support)
322 if test -f /usr/lib/libxnet.so; then
323 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
324 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
325 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
332 if test "$GCC" = "yes"; then
333 CFLAGS="$CFLAGS -Wno-char-subscripts"
338 dnl *****************************
339 dnl *** Checks for libpthread ***
340 dnl *****************************
341 AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
342 AC_CHECK_FUNCS(pthread_mutex_timedlock)
343 AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
344 AC_TRY_COMPILE([ #include <pthread.h>], [
345 pthread_mutexattr_t attr;
346 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
351 AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
352 AC_DEFINE(USE_MONO_MUTEX)
355 dnl ********************************
356 dnl *** Checks for semaphore lib ***
357 dnl ********************************
358 AC_CHECK_LIB(rt, sem_init, LIBS="$LIBS -lrt")
360 dnl ********************************
361 dnl *** Checks for timezone stuff **
362 dnl ********************************
363 AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
368 ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
369 if test $ac_cv_var_timezone = yes; then
370 AC_DEFINE(HAVE_TIMEZONE)
372 AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
378 ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
379 if test $ac_cv_struct_tm_gmtoff = yes; then
380 AC_DEFINE(HAVE_TM_GMTOFF)
382 AC_ERROR(unable to find a way to determine timezone)
386 AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
389 dnl ****************************
390 dnl *** Look for /dev/random ***
391 dnl ****************************
393 AC_MSG_CHECKING([if usage of random device is requested])
394 AC_ARG_ENABLE(dev-random,
395 [ --disable-dev-random disable the use of the random device],
396 try_dev_random=$enableval, try_dev_random=yes)
397 AC_MSG_RESULT($try_dev_random)
401 NAME_DEV_RANDOM="/dev/srandom"
404 dnl Win32 does not have /dev/random, they have their own method...
406 *-*-mingw*|*-*-cygwin*)
407 ac_cv_have_dev_random = no
410 dnl Everywhere else, it's /dev/random
413 NAME_DEV_RANDOM="/dev/random"
417 AC_DEFINE_UNQUOTED(NAME_DEV_RANDOM, "$NAME_DEV_RANDOM")
419 dnl Now check if the device actually exists
421 if test "x$try_dev_random" = "xyes"; then
422 AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
423 [if test -r "$NAME_DEV_RANDOM" ; then
424 ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
425 if test "x$ac_cv_have_dev_random" = "xyes"; then
426 AC_DEFINE(HAVE_CRYPT_RNG)
429 AC_MSG_CHECKING(for random device)
430 ac_cv_have_dev_random=no
431 AC_MSG_RESULT(has been disabled)
434 if test "x$platform_win32" = "xyes"; then
435 AC_DEFINE(HAVE_CRYPT_RNG)
438 if test "x$ac_cv_have_dev_random" = "xno" \
439 && test "x$platform_win32" = "xno"; then
442 *** A system-provided entropy source was not found on this system.
443 *** Because of this, the System.Security.Cryptography random number generator
444 *** will throw a NotImplemented exception.
446 *** If you are seeing this message, and you know your system DOES have an
447 *** entropy collection in place, please contact <crichton@gimp.org> and
448 *** provide information about the system and how to access the random device.
450 *** For those systems who lack a random device, EGD support is forthcoming.
454 AC_MSG_CHECKING([if inter-process shared handles are requested])
455 AC_ARG_ENABLE(shared-handles, [ --disable-shared-handles disable inter-process shared handles], try_shared_handles=$enableval, try_shared_handles=yes)
456 AC_MSG_RESULT($try_shared_handles)
457 if test "x$try_shared_handles" != "xyes"; then
458 AC_DEFINE(DISABLE_SHARED_HANDLES)
459 AC_SUBST(DISABLE_SHARED_HANDLES)
463 ACCESS_UNALIGNED="yes"
466 #mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; ACCESS_UNALIGNED="no";;
467 i*86-*-*) TARGET=X86; arch_target=x86;;
468 sparc*-*-*) TARGET=SPARC; arch_target=sparc; ACCESS_UNALIGNED="no";;
469 #alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; ACCESS_UNALIGNED="no";;
470 #m68k-*-linux*) TARGET=M68K;;
471 macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | powerpc-*-sysv*) TARGET=POWERPC; arch_target=ppc;;
472 arm-*-linux-* | armv4l-*-linux-*) TARGET=ARM; arch_target=arm; ACCESS_UNALIGNED="no";;
475 if test ${TARGET} = unknown; then
476 CPPFLAGS="$CPPFLAGS -DNO_PORT"
477 AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
480 if test ${ACCESS_UNALIGNED} = no; then
481 CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
484 AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
485 AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
486 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
487 AM_CONDITIONAL(X86, test x$TARGET = xX86)
488 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
489 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
490 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
491 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
496 AC_SUBST(arch_target)
505 mono/metadata/Makefile
510 mono/os/win32/Makefile
511 mono/os/unix/Makefile
512 mono/arch/x86/Makefile
513 mono/arch/ppc/Makefile
514 mono/arch/sparc/Makefile
515 mono/arch/arm/Makefile
516 mono/interpreter/Makefile
518 mono/benchmark/Makefile
519 mono/monoburg/Makefile
520 mono/monograph/Makefile
522 mono/io-layer/Makefile
523 mono/handles/Makefile