3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(mono, 0.16)
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)
23 AC_DEFINE(PTHREAD_POINTER_ID)
28 CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT"
33 CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT"
34 AC_DEFINE(NEED_LINK_UNLINK)
37 AC_MSG_WARN([*** Please add $host to configure.in checks!])
43 AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
45 AC_CHECK_TOOL(CC, gcc, gcc)
50 AC_CHECK_PROG(BISON, bison,yes,no)
51 if test "x$BISON" = "xno";
53 AC_MSG_ERROR([You need to install bison])
56 dnl may require a specific autoconf version
57 dnl AC_PROG_CC_FOR_BUILD
58 dnl CC_FOR_BUILD not automatically detected
61 if test "x$cross_compiling" = "xyes"; then
65 AC_SUBST(CC_FOR_BUILD)
67 AC_SUBST(BUILD_EXEEXT)
74 AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h)
76 # for mono/metadata/debug-symfile.c
77 AC_CHECK_HEADERS(elf.h)
80 AC_CHECK_HEADERS(wchar.h)
82 # not 64 bit clean in cross-compile
83 AC_CHECK_SIZEOF(void *, 4)
85 CFLAGS='-g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings'
87 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
88 if test "x$PKG_CONFIG" = "xno"; then
89 AC_MSG_ERROR([You need to install pkg-config])
92 dnl for use on the build system
93 dnl pkg-config is stupid
94 BUILD_GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
95 BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
96 AC_SUBST(BUILD_GLIB_CFLAGS)
97 AC_SUBST(BUILD_GLIB_LIBS)
100 AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir],
101 if test x$with_crosspkgdir = "x"; then
102 if test -s $PKG_CONFIG_PATH; then
103 PKG_PATH=$PKG_CONFIG_PATH
106 PKG_PATH=$with_crosspkgdir
107 PKG_CONFIG_PATH=$PKG_PATH
108 export PKG_CONFIG_PATH
112 ## Versions of dependencies
113 GLIB_REQUIRED_VERSION=1.3.11
115 PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION)
117 GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
118 GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
119 GMODULE_CFLAGS=`$PKG_CONFIG --cflags gmodule-2.0`
120 GMODULE_LIBS=`$PKG_CONFIG --libs gmodule-2.0`
122 AC_SUBST(GLIB_CFLAGS)
124 AC_SUBST(GMODULE_CFLAGS)
125 AC_SUBST(GMODULE_LIBS)
127 AC_CHECK_HEADERS(gc.h gc/gc.h)
128 AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
130 AC_ARG_WITH(gc, [ --with-gc=boehm,none],[gc=$with_gc])
134 if test "x$found_boehm" != "xyes"; then
135 AC_MSG_ERROR("GC requested but libgc not found!")
138 AC_DEFINE(HAVE_BOEHM_GC)
139 AC_SUBST(HAVE_BOEHM_GC)
140 LIBS="$LIBS -lgc $libdl"
143 AC_MSG_WARN("Compiling mono without GC.")
146 # If libgc was found, use it. Otherwise just warn.
147 if test "x$found_boehm" != "xyes"; then
148 AC_MSG_WARN("Compiling mono without GC.")
150 AC_DEFINE(HAVE_BOEHM_GC)
151 AC_SUBST(HAVE_BOEHM_GC)
152 LIBS="$LIBS -lgc $libdl"
158 if test x$platform_win32 = xno; then
159 dnl ******************************************************************
160 dnl *** Check for large file support ***
161 dnl *** (If we were using autoconf 2.50 we'd use AC_SYS_LARGEFILE) ***
162 dnl ******************************************************************
164 # Check that off_t can represent 2**63 - 1 correctly, working around
165 # potential compiler bugs. Defines LARGE_FILE_SUPPORT, adds $1 to
166 # CPPFLAGS and sets $large_offt to yes if the test succeeds
168 AC_DEFUN(LARGE_FILES, [
169 large_CPPFLAGS=$CPPFLAGS
170 CPPFLAGS="$CPPFLAGS $1"
172 #include <sys/types.h>
174 #define BIG_OFF_T (((off_t)1<<62)-1+((off_t)1<<62))
177 int big_off_t=((BIG_OFF_T%2147483629==721) &&
178 (BIG_OFF_T%2147483647==1));
187 AC_DEFINE(HAVE_LARGE_FILE_SUPPORT)
188 large_CPPFLAGS="$large_CPPFLAGS $1"
193 CPPFLAGS=$large_CPPFLAGS
196 AC_MSG_CHECKING(if off_t is 64 bits wide)
198 if test $large_offt = no; then
199 AC_MSG_CHECKING(if _FILE_OFFSET_BITS=64 gives 64 bit off_t)
200 LARGE_FILES("-D_FILE_OFFSET_BITS=64")
202 if test $large_offt = no; then
203 AC_MSG_WARN([No 64 bit file size support available])
206 dnl *****************************
207 dnl *** Checks for libsocket ***
208 dnl *****************************
209 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
211 dnl *******************************
212 dnl *** Checks for MSG_NOSIGNAL ***
213 dnl *******************************
214 AC_MSG_CHECKING(for MSG_NOSIGNAL)
215 AC_TRY_COMPILE([#include <sys/socket.h>], [
216 int f = MSG_NOSIGNAL;
220 AC_DEFINE(HAVE_MSG_NOSIGNAL)
222 # We'll have to use signals
226 dnl *****************************
227 dnl *** Checks for SOL_IP ***
228 dnl *****************************
229 AC_MSG_CHECKING(for SOL_IP)
230 AC_TRY_COMPILE([#include <netdb.h>], [
235 AC_DEFINE(HAVE_SOL_IP)
237 # We'll have to use getprotobyname
241 dnl *****************************
242 dnl *** Checks for SOL_TCP ***
243 dnl *****************************
244 AC_MSG_CHECKING(for SOL_TCP)
245 AC_TRY_COMPILE([#include <netdb.h>], [
250 AC_DEFINE(HAVE_SOL_TCP)
252 # We'll have to use getprotobyname
256 dnl *****************************
257 dnl *** Checks for IP_PKTINFO ***
258 dnl *****************************
259 AC_MSG_CHECKING(for IP_PKTINFO)
260 AC_TRY_COMPILE([#include <netdb.h>], [
261 int level = IP_PKTINFO;
265 AC_DEFINE(HAVE_IP_PKTINFO)
270 dnl *********************************
271 dnl *** Check for struct ip_mreqn ***
272 dnl *********************************
273 AC_MSG_CHECKING(for struct ip_mreqn)
274 AC_TRY_COMPILE([#include <netinet/in.h>], [
275 struct ip_mreqn mreq;
276 mreq.imr_address.s_addr = 0;
280 AC_DEFINE(HAVE_STRUCT_IP_MREQN)
282 # We'll just have to use struct ip_mreq
286 dnl *****************************
287 dnl *** Checks for libnsl ***
288 dnl *****************************
289 AC_CHECK_LIB(nsl, gethostbyaddr, LIBS="$LIBS -lnsl")
291 AC_CHECK_FUNCS(inet_pton inet_aton)
293 dnl ***********************************************
294 dnl *** Checks for size of sockaddr_un.sun_path ***
295 dnl ***********************************************
296 # AC_CHECK_SIZEOF can't cope with struct members :-(
297 AC_MSG_CHECKING(size of sockaddr_un.sun_path)
298 AC_CACHE_VAL(cv_mono_sizeof_sunpath,
300 #include <sys/types.h>
305 struct sockaddr_un sock_un;
306 FILE *f=fopen("conftestval", "w");
308 fprintf(f, "%d\n", sizeof(sock_un.sun_path));
311 ], cv_mono_sizeof_sunpath=`cat conftestval`,
312 cv_mono_sizeof_sunpath=0,
313 cv_mono_sizeof_sunpath=0)])dnl
314 AC_MSG_RESULT($cv_mono_sizeof_sunpath)
315 AC_DEFINE_UNQUOTED(MONO_SIZEOF_SUNPATH, $cv_mono_sizeof_sunpath)
317 dnl *****************************
318 dnl *** Checks for libxnet ***
319 dnl *****************************
322 AC_MSG_CHECKING(for Solaris XPG4 support)
323 if test -f /usr/lib/libxnet.so; then
324 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
325 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
326 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
333 if test "$GCC" = "yes"; then
334 CFLAGS="$CFLAGS -Wno-char-subscripts"
339 dnl *****************************
340 dnl *** Checks for libpthread ***
341 dnl *****************************
342 AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
343 AC_CHECK_FUNCS(pthread_mutex_timedlock)
344 AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
345 AC_TRY_COMPILE([ #include <pthread.h>], [
346 pthread_mutexattr_t attr;
347 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
352 AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
353 AC_DEFINE(USE_MONO_MUTEX)
356 dnl ********************************
357 dnl *** Checks for semaphore lib ***
358 dnl ********************************
359 AC_CHECK_LIB(rt, sem_init, LIBS="$LIBS -lrt")
361 dnl ********************************
362 dnl *** Checks for timezone stuff **
363 dnl ********************************
364 AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
369 ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
370 if test $ac_cv_var_timezone = yes; then
371 AC_DEFINE(HAVE_TIMEZONE)
373 AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
379 ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
380 if test $ac_cv_struct_tm_gmtoff = yes; then
381 AC_DEFINE(HAVE_TM_GMTOFF)
383 AC_ERROR(unable to find a way to determine timezone)
387 AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
388 AC_CHECK_LIB(psapi, main, LIBS="$LIBS -lpsapi", AC_ERROR(bad mingw install?))
391 dnl ****************************
392 dnl *** Look for /dev/random ***
393 dnl ****************************
395 AC_MSG_CHECKING([if usage of random device is requested])
396 AC_ARG_ENABLE(dev-random,
397 [ --disable-dev-random disable the use of the random device],
398 try_dev_random=$enableval, try_dev_random=yes)
399 AC_MSG_RESULT($try_dev_random)
403 NAME_DEV_RANDOM="/dev/srandom"
406 dnl Win32 does not have /dev/random, they have their own method...
408 *-*-mingw*|*-*-cygwin*)
409 ac_cv_have_dev_random = no
412 dnl Everywhere else, it's /dev/random
415 NAME_DEV_RANDOM="/dev/random"
419 AC_DEFINE_UNQUOTED(NAME_DEV_RANDOM, "$NAME_DEV_RANDOM")
421 dnl Now check if the device actually exists
423 if test "x$try_dev_random" = "xyes"; then
424 AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
425 [if test -r "$NAME_DEV_RANDOM" ; then
426 ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
427 if test "x$ac_cv_have_dev_random" = "xyes"; then
428 AC_DEFINE(HAVE_CRYPT_RNG)
431 AC_MSG_CHECKING(for random device)
432 ac_cv_have_dev_random=no
433 AC_MSG_RESULT(has been disabled)
436 if test "x$platform_win32" = "xyes"; then
437 AC_DEFINE(HAVE_CRYPT_RNG)
440 if test "x$ac_cv_have_dev_random" = "xno" \
441 && test "x$platform_win32" = "xno"; then
444 *** A system-provided entropy source was not found on this system.
445 *** Because of this, the System.Security.Cryptography random number generator
446 *** will throw a NotImplemented exception.
448 *** If you are seeing this message, and you know your system DOES have an
449 *** entropy collection in place, please contact <crichton@gimp.org> and
450 *** provide information about the system and how to access the random device.
452 *** For those systems who lack a random device, EGD support is forthcoming.
456 AC_MSG_CHECKING([if inter-process shared handles are requested])
457 AC_ARG_ENABLE(shared-handles, [ --disable-shared-handles disable inter-process shared handles], try_shared_handles=$enableval, try_shared_handles=yes)
458 AC_MSG_RESULT($try_shared_handles)
459 if test "x$try_shared_handles" != "xyes"; then
460 AC_DEFINE(DISABLE_SHARED_HANDLES)
461 AC_SUBST(DISABLE_SHARED_HANDLES)
465 ACCESS_UNALIGNED="yes"
468 #mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; ACCESS_UNALIGNED="no";;
469 i*86-*-*) TARGET=X86; arch_target=x86;;
470 sparc*-*-*) TARGET=SPARC; arch_target=sparc; ACCESS_UNALIGNED="no";;
471 #alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; ACCESS_UNALIGNED="no";;
472 #m68k-*-linux*) TARGET=M68K;;
473 macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | powerpc-*-sysv*) TARGET=POWERPC; arch_target=ppc;;
474 arm-*-linux-* | armv4l-*-linux-*) TARGET=ARM; arch_target=arm; ACCESS_UNALIGNED="no";;
477 if test ${TARGET} = unknown; then
478 CPPFLAGS="$CPPFLAGS -DNO_PORT"
479 AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
482 if test ${ACCESS_UNALIGNED} = no; then
483 CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
486 AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
487 AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
488 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
489 AM_CONDITIONAL(X86, test x$TARGET = xX86)
490 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
491 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
492 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
493 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
498 AC_SUBST(arch_target)
507 mono/metadata/Makefile
512 mono/os/win32/Makefile
513 mono/os/unix/Makefile
514 mono/arch/x86/Makefile
515 mono/arch/ppc/Makefile
516 mono/arch/sparc/Makefile
517 mono/arch/arm/Makefile
518 mono/interpreter/Makefile
520 mono/benchmark/Makefile
521 mono/monoburg/Makefile
522 mono/monograph/Makefile
524 mono/io-layer/Makefile
525 mono/handles/Makefile