3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(mono,0.96)
17 if test -d $srcdir/libgc ; then
24 # These are the flags that need to be stored in the mono.pc file for
25 # compiling code that will embed Mono
29 AC_SUBST(libmono_cflags)
30 AC_SUBST(libmono_ldflags)
32 dnl if linker handles the version script
35 # Set to yes if Unix sockets cannot be created in an anonymous namespace
38 # Thread configuration inspired by sleepycat's db
39 AC_MSG_CHECKING([host platform characteristics])
42 *-*-mingw*|*-*-cygwin*)
44 AC_DEFINE(PLATFORM_WIN32,1,[Platform is Win32])
47 # So libgc configure gets -mno-cygwin
49 # latest libgc already defines GC_WIN32_THREADS
50 # CPPFLAGS="$CPPFLAGS -DGC_WIN32_THREADS -DWIN32_THREADS"
51 CPPFLAGS="$CPPFLAGS -DWIN32_THREADS"
62 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
63 libmono_cflags="-D_REENTRANT"
64 LDFLAGS="$LDFLAGS -pthread"
65 libmono_ldflags="-pthread"
70 *-*-*freebsd*|*-*-*openbsd*)
72 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS"
73 libmono_cflags="-D_THREAD_SAFE"
74 LDFLAGS="$LDFLAGS -pthread"
75 libmono_ldflags="-pthread"
77 AC_DEFINE(PTHREAD_POINTER_ID)
79 libgc_threads=pthreads
83 CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT"
84 libmono_cflags="-D_REENTRANT"
85 libmono_ldflags="-lpthread"
87 libgc_threads=pthreads
91 CPPFLAGS="$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT"
92 CFLAGS="$CFLAGS +ESdbgasm"
94 libmono_cflags="-D_REENTRANT"
95 libmono_ldflags="-lpthread"
96 libgc_threads=pthreads
101 CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT"
103 libmono_cflags="-D_REENTRANT"
104 libgc_threads=pthreads
108 CPPFLAGS="$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS"
109 libmono_cflags="-D_THREAD_SAFE"
110 LDFLAGS="$LDFLAGS -pthread"
111 libmono_ldflags="-pthread"
113 AC_DEFINE(PTHREAD_POINTER_ID)
114 AC_DEFINE(USE_MACH_SEMA)
115 no_version_script=yes
117 libgc_threads=pthreads
120 AC_MSG_WARN([*** Please add $host to configure.in checks!])
127 if test x$need_link_unlink = xyes; then
128 AC_DEFINE(NEED_LINK_UNLINK, 1, [Define if Unix sockets cannot be created in an anonymous namespace])
131 AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
133 AC_CHECK_TOOL(CC, gcc, gcc)
137 dnl We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
139 # Set ASFLAGS if not already set.
140 : ${CCASFLAGS='$(CFLAGS)'}
144 AC_CHECK_PROG(BISON, bison,yes,no)
145 if test "x$BISON" = "xno";
147 AC_MSG_ERROR([You need to install bison])
150 dnl may require a specific autoconf version
151 dnl AC_PROG_CC_FOR_BUILD
152 dnl CC_FOR_BUILD not automatically detected
155 if test "x$cross_compiling" = "xyes"; then
159 AC_SUBST(CC_FOR_BUILD)
161 AC_SUBST(BUILD_EXEEXT)
168 # Test whenever ld supports -version-script
171 if test "x$lt_cv_prog_gnu_ld" = "xno"; then
172 no_version_script=yes
175 AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
177 AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h sys/un.h)
179 # for mono/mini/tramp-x86.c
180 AC_CHECK_HEADERS(valgrind/memcheck.h)
182 # for mono/metadata/debug-symfile.c
183 AC_CHECK_HEADERS(elf.h)
186 AC_CHECK_HEADERS(wchar.h)
188 # not 64 bit clean in cross-compile
189 AC_CHECK_SIZEOF(void *, 4)
192 if test x"$GCC" = xyes; then
193 WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings'
194 # The runtime code does not respect ANSI C strict aliasing rules
195 CFLAGS="$CFLAGS -fno-strict-aliasing"
197 # The Sun Forte compiler complains about inline functions that access static variables
198 # so disable all inlining.
201 CFLAGS="$CFLAGS -Dinline="
205 CFLAGS="$CFLAGS -g $WARN"
207 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
208 if test "x$PKG_CONFIG" = "xno"; then
209 AC_MSG_ERROR([You need to install pkg-config])
212 dnl for use on the build system
213 dnl pkg-config is stupid
214 BUILD_GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
215 BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
216 AC_SUBST(BUILD_GLIB_CFLAGS)
217 AC_SUBST(BUILD_GLIB_LIBS)
220 AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir],
221 if test x$with_crosspkgdir = "x"; then
222 if test -s $PKG_CONFIG_PATH; then
223 PKG_PATH=$PKG_CONFIG_PATH
226 PKG_PATH=$with_crosspkgdir
227 PKG_CONFIG_PATH=$PKG_PATH
228 export PKG_CONFIG_PATH
232 ## Versions of dependencies
233 GLIB_REQUIRED_VERSION=1.3.11
235 PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION)
237 GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
238 GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
239 GMODULE_CFLAGS=`$PKG_CONFIG --cflags gmodule-2.0`
240 GMODULE_LIBS=`$PKG_CONFIG --libs gmodule-2.0`
242 AC_SUBST(GLIB_CFLAGS)
244 AC_SUBST(GMODULE_CFLAGS)
245 AC_SUBST(GMODULE_LIBS)
247 AC_ARG_WITH(gc, [ --with-gc=boehm,included,none],[gc=$with_gc],[gc=$gc_default])
249 # Enable support for NPTL only features like fast thread-local storage
250 # We can't reliably detect nptl at compile & run time
251 # so this option will stay until nptl becomes more widespread
252 AC_ARG_WITH(nptl, [ --with-nptl=yes,no enable/disable support for NPTL],[],[with_nptl=yes])
254 # Enable support for using sigaltstack for SIGSEGV and stack overflow handling
255 # This does not work on some platforms (bug #55253)
256 AC_ARG_WITH(sigaltstack, [ --with-sigaltstack=yes,no enable/disable support for sigaltstack],[],[with_sigaltstack=yes])
258 # assembly bundle support, see metadata/make-bundle.pl for more info
259 AC_ARG_WITH(bundle, [ --with-bundle=bundle_template],[
260 BUNDLE_FILE=$with_bundle
261 AC_SUBST(BUNDLE_FILE)
262 AC_DEFINE(WITH_BUNDLE)
264 AM_CONDITIONAL(WITH_BUNDLE, test x$with_bundle != xno)
271 AC_CHECK_HEADERS(gc.h gc/gc.h, gc_headers=yes)
272 AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
274 if test "x$found_boehm" != "xyes"; then
275 AC_MSG_ERROR("GC requested but libgc not found! Install libgc or run configure with --with-gc=none.")
277 if test "x$gc_headers" != "xyes"; then
278 AC_MSG_ERROR("GC requested but header files not found! You may need to install them by hand.")
281 AC_DEFINE(HAVE_BOEHM_GC)
282 AC_SUBST(HAVE_BOEHM_GC)
283 LIBGC_LIBS="-lgc $libdl"
285 # AC_CHECK_FUNCS does not work for some reason...
286 AC_CHECK_LIB(gc, GC_gcj_malloc, found_gcj_malloc="yes",,$libdl)
287 if test "x$found_gcj_malloc" = "xyes"; then
288 AC_DEFINE(HAVE_GC_GCJ_MALLOC)
290 AC_CHECK_LIB(gc, GC_enable, found_gc_enable="yes",,$libdl)
291 if test "x$found_gc_enable" = "xyes"; then
292 AC_DEFINE(HAVE_GC_ENABLE)
297 AC_CONFIG_SUBDIRS(libgc)
304 LIBGC_CFLAGS='-I$(top_srcdir)/libgc/include'
305 LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
307 AC_DEFINE(HAVE_BOEHM_GC)
308 AC_SUBST(HAVE_BOEHM_GC)
311 AC_DEFINE(USE_INCLUDED_LIBGC)
313 # The included libgc contains GCJ support
314 AC_DEFINE(HAVE_GC_GCJ_MALLOC)
315 AC_DEFINE(HAVE_GC_ENABLE)
319 AC_MSG_WARN("Compiling mono without GC.")
322 AC_MSG_ERROR([Invalid argument to --with-gc.])
327 # tell libgc/configure about what we want
328 ac_configure_args="$ac_configure_args --disable-embed-check --with-libgc-threads=$libgc_threads"
330 AM_CONDITIONAL(INCLUDED_LIBGC, test x$use_included_gc = xyes)
331 AC_SUBST(LIBGC_CFLAGS)
336 dnl End of libgc checks
339 if test x$platform_win32 = xno; then
341 dnl ******************************************************************
342 dnl *** Checks for the IKVM JNI interface library ***
343 dnl ******************************************************************
344 AC_ARG_WITH(ikvm-jni, [ --with-ikvm-jni=yes,no build the IKVM JNI interface library],[with_ikvm_jni=$withval],[with_ikvm_jni=yes])
345 AC_ARG_WITH(jdk, [ --with-jdk=DIRECTORY Use JDK from DIRECTORY],[with_jdk_dir=$withval],[with_jdk_dir=])
348 if test x$with_ikvm_jni = xyes; then
349 AC_MSG_CHECKING([JDK headers])
351 if test x$with_jdk_dir = x; then
352 # Try JAVA_HOME variable
353 if test x$JAVA_HOME != x; then
354 with_jdk_dir=$JAVA_HOME
359 if test -d $with_jdk_dir/include; then
360 jdk_headers_found=yes
362 if test -d $with_jdk_dir/include/linux; then
365 if test -d $with_jdk_dir/include/solaris; then
368 if test -f $with_jdk_dir/include/jni_md.h; then
369 # GNU Classpath sources
380 if test x$jdk_headers_found = xyes; then
381 AC_MSG_RESULT($with_jdk_dir/include $with_jdk_dir/include/$jdk_platform)
383 AC_MSG_RESULT(not found)
386 if test x$jdk_headers_found = xyes; then
387 ikvm_jni_dir=ikvm-jni
388 IKVM_JNI_CFLAGS="-I$with_jdk_dir/include -I$with_jdk_dir/include/$jdk_platform"
392 AC_SUBST(ikvm_jni_dir)
393 AC_SUBST(IKVM_JNI_CFLAGS)
395 AC_CHECK_FUNCS(getgrgid_r)
396 AC_CHECK_FUNCS(getgrnam_r)
397 AC_CHECK_FUNCS(getpwnam_r)
398 AC_CHECK_FUNCS(getpwuid_r)
399 AC_CHECK_FUNCS(getresuid)
400 AC_CHECK_FUNCS(setresuid)
402 dnl ******************************************************************
403 dnl *** Check for large file support ***
404 dnl *** (If we were using autoconf 2.50 we'd use AC_SYS_LARGEFILE) ***
405 dnl ******************************************************************
407 # Check that off_t can represent 2**63 - 1 correctly, working around
408 # potential compiler bugs. Defines LARGE_FILE_SUPPORT, adds $1 to
409 # CPPFLAGS and sets $large_offt to yes if the test succeeds
411 AC_DEFUN(LARGE_FILES, [
412 large_CPPFLAGS=$CPPFLAGS
413 CPPFLAGS="$CPPFLAGS $1"
415 #include <sys/types.h>
417 #define BIG_OFF_T (((off_t)1<<62)-1+((off_t)1<<62))
420 int big_off_t=((BIG_OFF_T%2147483629==721) &&
421 (BIG_OFF_T%2147483647==1));
430 AC_DEFINE(HAVE_LARGE_FILE_SUPPORT)
431 large_CPPFLAGS="$large_CPPFLAGS $1"
436 CPPFLAGS=$large_CPPFLAGS
439 AC_MSG_CHECKING(if off_t is 64 bits wide)
441 if test $large_offt = no; then
442 AC_MSG_CHECKING(if _FILE_OFFSET_BITS=64 gives 64 bit off_t)
443 LARGE_FILES("-D_FILE_OFFSET_BITS=64")
445 if test $large_offt = no; then
446 AC_MSG_WARN([No 64 bit file size support available])
449 dnl *****************************
450 dnl *** Checks for libsocket ***
451 dnl *****************************
452 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
454 dnl *******************************
455 dnl *** Checks for MSG_NOSIGNAL ***
456 dnl *******************************
457 AC_MSG_CHECKING(for MSG_NOSIGNAL)
458 AC_TRY_COMPILE([#include <sys/socket.h>], [
459 int f = MSG_NOSIGNAL;
463 AC_DEFINE(HAVE_MSG_NOSIGNAL)
465 # We'll have to use signals
469 dnl *****************************
470 dnl *** Checks for SOL_IP ***
471 dnl *****************************
472 AC_MSG_CHECKING(for SOL_IP)
473 AC_TRY_COMPILE([#include <netdb.h>], [
478 AC_DEFINE(HAVE_SOL_IP)
480 # We'll have to use getprotobyname
484 dnl *****************************
485 dnl *** Checks for SOL_IPV6 ***
486 dnl *****************************
487 AC_MSG_CHECKING(for SOL_IPV6)
488 AC_TRY_COMPILE([#include <netdb.h>], [
489 int level = SOL_IPV6;
493 AC_DEFINE(HAVE_SOL_IPV6)
495 # We'll have to use getprotobyname
499 dnl *****************************
500 dnl *** Checks for SOL_TCP ***
501 dnl *****************************
502 AC_MSG_CHECKING(for SOL_TCP)
503 AC_TRY_COMPILE([#include <netdb.h>], [
508 AC_DEFINE(HAVE_SOL_TCP)
510 # We'll have to use getprotobyname
514 dnl *****************************
515 dnl *** Checks for IP_PKTINFO ***
516 dnl *****************************
517 AC_MSG_CHECKING(for IP_PKTINFO)
518 AC_TRY_COMPILE([#include <netdb.h>], [
519 int level = IP_PKTINFO;
523 AC_DEFINE(HAVE_IP_PKTINFO)
528 dnl *********************************
529 dnl *** Check for struct ip_mreqn ***
530 dnl *********************************
531 AC_MSG_CHECKING(for struct ip_mreqn)
532 AC_TRY_COMPILE([#include <netinet/in.h>], [
533 struct ip_mreqn mreq;
534 mreq.imr_address.s_addr = 0;
538 AC_DEFINE(HAVE_STRUCT_IP_MREQN)
540 # We'll just have to try and use struct ip_mreq
542 AC_MSG_CHECKING(for struct ip_mreq)
543 AC_TRY_COMPILE([#include <netinet/in.h>], [
545 mreq.imr_interface.s_addr = 0;
549 AC_DEFINE(HAVE_STRUCT_IP_MREQ)
551 # No multicast support
556 dnl **********************************
557 dnl *** Check for gethostbyname2_r ***
558 dnl **********************************
559 AC_MSG_CHECKING(for gethostbyname2_r)
560 AC_TRY_LINK([#include <netdb.h>], [
561 gethostbyname2_r(NULL,0,NULL,NULL,0,NULL,NULL);
565 AC_DEFINE(HAVE_GETHOSTBYNAME2_R)
570 dnl *****************************
571 dnl *** Checks for libnsl ***
572 dnl *****************************
573 AC_CHECK_LIB(nsl, gethostbyaddr, LIBS="$LIBS -lnsl")
575 AC_CHECK_FUNCS(inet_pton inet_aton)
577 dnl ***********************************************
578 dnl *** Checks for size of sockaddr_un.sun_path ***
579 dnl ***********************************************
580 # AC_CHECK_SIZEOF can't cope with struct members :-(
581 AC_MSG_CHECKING(size of sockaddr_un.sun_path)
582 AC_CACHE_VAL(cv_mono_sizeof_sunpath,
584 #include <sys/types.h>
589 struct sockaddr_un sock_un;
590 FILE *f=fopen("conftestval", "w");
592 fprintf(f, "%d\n", sizeof(sock_un.sun_path));
595 ], cv_mono_sizeof_sunpath=`cat conftestval`,
596 cv_mono_sizeof_sunpath=0,
597 cv_mono_sizeof_sunpath=0)])dnl
598 AC_MSG_RESULT($cv_mono_sizeof_sunpath)
599 AC_DEFINE_UNQUOTED(MONO_SIZEOF_SUNPATH, $cv_mono_sizeof_sunpath)
601 dnl *************************************
602 dnl *** Checks for zero length arrays ***
603 dnl *************************************
604 AC_MSG_CHECKING(whether $CC supports zero length arrays)
612 AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 0)
615 AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 1)
618 dnl *****************************
619 dnl *** Checks for libxnet ***
620 dnl *****************************
623 AC_MSG_CHECKING(for Solaris XPG4 support)
624 if test -f /usr/lib/libxnet.so; then
625 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
626 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
627 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
634 if test "$GCC" = "yes"; then
635 CFLAGS="$CFLAGS -Wno-char-subscripts"
640 dnl *****************************
641 dnl *** Checks for libpthread ***
642 dnl *****************************
643 AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
644 AC_CHECK_HEADERS(pthread.h)
645 AC_CHECK_FUNCS(pthread_mutex_timedlock)
646 AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np)
647 AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
648 AC_TRY_COMPILE([ #include <pthread.h>], [
649 pthread_mutexattr_t attr;
650 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
655 AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
656 AC_DEFINE(USE_MONO_MUTEX)
658 AC_CHECK_FUNCS(pthread_attr_setstacksize)
660 dnl ***********************************
661 dnl *** Checks for working __thread ***
662 dnl ***********************************
663 AC_MSG_CHECKING(for working __thread)
664 if test "x$with_nptl" != "xyes"; then
665 AC_MSG_RESULT(disabled)
671 static int res1, res2;
673 void thread_main (void *arg)
688 pthread_create (&t1, NULL, thread_main, 1);
689 pthread_create (&t2, NULL, thread_main, 2);
691 pthread_join (t1, NULL);
692 pthread_join (t2, NULL);
694 return !(res1 + res2 == 2);
698 AC_DEFINE(HAVE_KW_THREAD)
704 dnl **************************************
705 dnl *** Checks for working sigaltstack ***
706 dnl **************************************
707 AC_MSG_CHECKING(for working sigaltstack)
708 if test "x$with_sigaltstack" != "xyes"; then
709 AC_MSG_RESULT(disabled)
717 #include <sys/wait.h>
720 sigsegv_signal_handler (int _dummy, siginfo_t *info, void *context)
738 struct sigaltstack sas;
742 sa.sa_sigaction = sigsegv_signal_handler;
743 sigemptyset (&sa.sa_mask);
744 sa.sa_flags = SA_SIGINFO | SA_STACK;
745 if (sigaction (SIGSEGV, &sa, NULL) == -1) {
750 sas.ss_sp = malloc (SIGSTKSZ);
751 sas.ss_size = SIGSTKSZ;
752 sas.ss_flags = SS_ONSTACK;
753 if (sigaltstack (&sas, NULL) == -1) {
758 pthread_attr_init (&attr);
759 if (pthread_create(&id, &attr, loop, &attr) != 0) {
784 for (i = 0; i < 3; ++i) {
786 waitpid (son, &status, WNOHANG);
787 if (WIFEXITED (status) && WEXITSTATUS (status) == 0)
797 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
804 dnl ********************************
805 dnl *** Checks for semaphore lib ***
806 dnl ********************************
807 # 'Real Time' functions on Solaris
808 # posix4 on Solaris 2.6
809 # pthread (first!) on Linux
810 AC_SEARCH_LIBS(sem_init, pthread rt posix4)
812 dnl ********************************
813 dnl *** Checks for timezone stuff **
814 dnl ********************************
815 AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
821 ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
822 if test $ac_cv_struct_tm_gmtoff = yes; then
823 AC_DEFINE(HAVE_TM_GMTOFF)
825 AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
830 ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
831 if test $ac_cv_var_timezone = yes; then
832 AC_DEFINE(HAVE_TIMEZONE)
834 AC_ERROR(unable to find a way to determine timezone)
838 dnl *********************************
839 dnl *** Checks for math functions ***
840 dnl *********************************
842 AC_CHECK_FUNCS(finite, , AC_MSG_CHECKING(for finite in math.h)
843 AC_TRY_LINK([#include <math.h>],
845 AC_DEFINE(HAVE_FINITE) AC_MSG_RESULT(yes),
847 AC_CHECK_FUNCS(isfinite, , AC_MSG_CHECKING(for isfinite in math.h)
848 AC_TRY_LINK([#include <math.h>],
850 AC_DEFINE(HAVE_ISFINITE) AC_MSG_RESULT(yes),
853 dnl ****************************************************************
854 dnl *** Checks for working poll() (macosx defines it but doesn't ***
855 dnl *** have it in the library (duh)) ***
856 dnl ****************************************************************
859 dnl *************************
860 dnl *** Check for signbit ***
861 dnl *************************
862 AC_MSG_CHECKING(for signbit)
863 AC_TRY_LINK([#include <math.h>], [
864 int s = signbit(1.0);
867 AC_DEFINE(HAVE_SIGNBIT)
872 dnl *********************
873 dnl *** Check for AIO ***
874 dnl *********************
875 AC_MSG_CHECKING([for SIGEV_THREAD definition])
876 dnl Some systems (FreeBSD at least) may have aio_read
877 dnl but don't support/define SIGEV_THREAD.
879 #include <sys/signal.h>
881 int x = SIGEV_THREAD;
883 ac_cv_c_sigev_thread=yes
889 if test "$ac_cv_c_sigev_thread" = "yes" ; then
890 AC_CHECK_HEADERS(aio.h sys/aio.h)
891 AC_CHECK_LIB(rt, aio_read, [ LIBS="$LIBS -lrt" ],)
892 SIGVAL_PTR="undefined"
893 if test "$ac_cv_header_aio_h" = "yes" -o "$ac_cv_header_sys_aio_h" = "yes" ; then
894 AC_CHECK_MEMBER(union sigval.sigval_ptr,SIGVAL_PTR="sigval_ptr",, [
895 #include <sys/signal.h>
897 AC_CHECK_MEMBER(union sigval.sival_ptr,SIGVAL_PTR="sival_ptr",, [
898 #include <sys/signal.h>
900 if test "$SIGVAL_PTR" = "undefined" ; then
901 AC_MSG_ERROR([Unable to detect field name in 'union sigval'])
904 AC_DEFINE_UNQUOTED(SIGVAL_PTR,$SIGVAL_PTR,[Pointer field name in 'union sigval'])
908 AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
909 AC_CHECK_LIB(psapi, main, LIBS="$LIBS -lpsapi", AC_ERROR(bad mingw install?))
913 AC_MSG_CHECKING(for socklen_t)
915 #include <sys/types.h>
916 #include <sys/socket.h>
920 ac_cv_c_socklen_t=yes
921 AC_DEFINE(HAVE_SOCKLEN_T)
927 AC_CHECK_FUNCS(trunc, , AC_MSG_CHECKING(for trunc in math.h)
928 AC_TRY_LINK([#include <math.h>],
931 AC_DEFINE(HAVE_TRUNC)
937 if test "x$ac_cv_truncl" != "xyes"; then
938 AC_CHECK_LIB(sunmath, aintl, [ AC_DEFINE(HAVE_AINTL) LIBS="$LIBS -lsunmath"])
941 dnl ****************************
942 dnl *** Look for /dev/random ***
943 dnl ****************************
945 AC_MSG_CHECKING([if usage of random device is requested])
946 AC_ARG_ENABLE(dev-random,
947 [ --disable-dev-random disable the use of the random device],
948 try_dev_random=$enableval, try_dev_random=yes)
949 AC_MSG_RESULT($try_dev_random)
953 NAME_DEV_RANDOM="/dev/srandom"
956 dnl Win32 does not have /dev/random, they have their own method...
958 *-*-mingw*|*-*-cygwin*)
959 ac_cv_have_dev_random=no
962 dnl Everywhere else, it's /dev/random
965 NAME_DEV_RANDOM="/dev/random"
969 AC_DEFINE_UNQUOTED(NAME_DEV_RANDOM, "$NAME_DEV_RANDOM")
971 dnl Now check if the device actually exists
973 if test "x$try_dev_random" = "xyes"; then
974 AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
975 [if test -r "$NAME_DEV_RANDOM" ; then
976 ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
977 if test "x$ac_cv_have_dev_random" = "xyes"; then
978 AC_DEFINE(HAVE_CRYPT_RNG)
981 AC_MSG_CHECKING(for random device)
982 ac_cv_have_dev_random=no
983 AC_MSG_RESULT(has been disabled)
986 if test "x$platform_win32" = "xyes"; then
987 AC_DEFINE(HAVE_CRYPT_RNG)
990 if test "x$ac_cv_have_dev_random" = "xno" \
991 && test "x$platform_win32" = "xno"; then
994 *** A system-provided entropy source was not found on this system.
995 *** Because of this, the System.Security.Cryptography random number generator
996 *** will throw a NotImplemented exception.
998 *** If you are seeing this message, and you know your system DOES have an
999 *** entropy collection in place, please contact <crichton@gimp.org> and
1000 *** provide information about the system and how to access the random device.
1002 *** Otherwise you can install either egd or prngd and set the environment
1003 *** variable MONO_EGD_SOCKET to point to the daemon's socket to use that.
1007 AC_MSG_CHECKING([if inter-process shared handles are requested])
1008 AC_ARG_ENABLE(shared-handles, [ --disable-shared-handles disable inter-process shared handles], try_shared_handles=$enableval, try_shared_handles=yes)
1009 AC_MSG_RESULT($try_shared_handles)
1010 if test "x$try_shared_handles" != "xyes"; then
1011 AC_DEFINE(DISABLE_SHARED_HANDLES)
1012 AC_SUBST(DISABLE_SHARED_HANDLES)
1023 AC_ARG_WITH(icu, [ --with-icu=yes/no],
1024 if test x$with_icu = xno; then
1026 AC_MSG_RESULT(Will not probe for ICU)
1031 AC_PATH_PROG(ICU_CONFIG, icu-config, no)
1032 if test "x$ICU_CONFIG" = "xno" -o ! -x "$ICU_CONFIG"; then
1033 AC_MSG_WARN([Only invariant locale available; install ICU for I18N support])
1034 enable_icu="no, if you want full i18n support download it from: http://oss.software.ibm.com/icu/index.html"
1036 enable_icu="yes. Version: `$ICU_CONFIG --version`"
1038 ICU_CFLAGS=`$ICU_CONFIG --cppflags`
1039 ICU_LIBS=`$ICU_CONFIG --ldflags`
1042 AC_SUBST(ICU_CFLAGS)
1046 ACCESS_UNALIGNED="yes"
1053 # mips-sgi-irix5.* | mips-sgi-irix6.*)
1055 # ACCESS_UNALIGNED="no"
1063 x86_64-*-* | amd64-*-*)
1072 ACCESS_UNALIGNED="no"
1076 # alpha*-*-linux* | alpha*-*-osf*)
1078 # ACCESS_UNALIGNED="no"
1080 # ia64-*-linux* | ia64-*-hpux*)
1084 # ACCESS_UNALIGNED="no";
1085 # case "$host_os" in
1086 # linux*) LIBC="libc.so.6.1";;
1087 # hpux*) LIBC="libc.so.1";;
1093 hppa2.0w-hp-hpux11.00 | hppa64-hp-hpux11.00)
1097 ACCESS_UNALIGNED="no"
1099 macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | \
1100 powerpc-*-sysv* | powerpc-*-darwin*)
1106 arm-*-linux-* | armv4l-*-linux-*)
1109 ACCESS_UNALIGNED="no"
1114 ACCESS_UNALIGNED="no"
1119 AC_ARG_WITH(jit, [ --with-jit=yes,no If you want to build scripts that default to the JIT],[
1124 if test x$JIT_SUPPORTED = xyes; then
1125 if $jit_wanted; then
1127 jit_status="Building and using the JIT"
1129 jit_status="Building the JIT, defaulting to the interpreter"
1132 jit_status="interpreter"
1135 AM_CONDITIONAL(USE_JIT, test x$USEJIT = xtrue)
1150 if test ${TARGET} = ARM; then
1151 dnl ******************************************
1152 dnl *** Check to see what FPU is available ***
1153 dnl ******************************************
1154 AC_MSG_CHECKING(which FPU to use)
1156 AC_TRY_COMPILE([], [
1157 __asm__ ("ldfd f0, [r0]");
1159 AC_TRY_COMPILE([], [
1160 __asm__ ("fldd d0, [r0]");
1161 ], fpu=VFP, fpu=NONE)
1165 CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu"
1169 if test ${TARGET} = unknown; then
1170 CPPFLAGS="$CPPFLAGS -DNO_PORT"
1171 AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
1174 if test ${ACCESS_UNALIGNED} = no; then
1175 CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
1179 AC_ARG_WITH(preview, [ --with-preview=yes,no If you want to install the 2.0 FX preview],[
1180 if test x$with_preview = xyes; then
1185 AM_CONDITIONAL(INSTALL_2_0, test x$PREVIEW = xyes)
1187 AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
1188 AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
1189 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
1190 AM_CONDITIONAL(X86, test x$TARGET = xX86)
1191 AM_CONDITIONAL(AMD64, test x$TARGET = xAMD64)
1192 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
1193 AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
1194 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
1195 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
1196 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
1197 AM_CONDITIONAL(S390, test x$TARGET = xS390)
1198 AM_CONDITIONAL(HPPA, test x$TARGET = xHPPA)
1200 AM_CONDITIONAL(JIT_SUPPORTED, test x$JIT_SUPPORTED = xyes)
1204 AC_SUBST(arch_target)
1215 mono/metadata/Makefile
1220 mono/os/win32/Makefile
1221 mono/os/unix/Makefile
1222 mono/arch/x86/Makefile
1223 mono/arch/amd64/Makefile
1224 mono/arch/hppa/Makefile
1225 mono/arch/ppc/Makefile
1226 mono/arch/sparc/Makefile
1227 mono/arch/s390/Makefile
1228 mono/arch/arm/Makefile
1229 mono/arch/alpha/Makefile
1230 mono/interpreter/Makefile
1232 mono/tests/tests-config
1233 mono/benchmark/Makefile
1234 mono/monoburg/Makefile
1235 mono/monograph/Makefile
1236 mono/io-layer/Makefile
1237 mono/handles/Makefile
1239 mono/profiler/Makefile
1242 runtime/net_1_1/Makefile
1243 runtime/net_2_0/Makefile
1254 tools/locale-builder/Makefile
1262 SIGALTSTACK: $with_sigaltstack
1265 JNI support: $jdk_headers_found