3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(mono,1.0.2)
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 # these flags will work for all versions of -STABLE
74 if test "x$PTHREAD_CFLAGS" = "x"; then
75 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS"
76 libmono_cflags="-D_THREAD_SAFE"
78 CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS -DGC_FREEBSD_THREADS"
79 libmono_cflags="$PTHREAD_CFLAGS"
81 if test "x$PTHREAD_LIBS" = "x"; then
82 LDFLAGS="$LDFLAGS -pthread"
83 libmono_ldflags="-pthread"
85 LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
86 libmono_ldflags="$PTHREAD_LIBS"
89 AC_DEFINE(PTHREAD_POINTER_ID)
91 libgc_threads=pthreads
92 # TLS isn't implemented at all on -STABLE
96 # older versions of -CURRENT will break with these flags but testing
97 # indicates these older versions won't run Mono anyway
101 if test "x$PTHREAD_CFLAGS" = "x"; then
102 CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS"
105 CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS -DGC_FREEBSD_THREADS"
106 libmono_cflags="$PTHREAD_CFLAGS"
108 if test "x$PTHREAD_LIBS" = "x"; then
109 LDFLAGS="$LDFLAGS -lpthread"
110 libmono_ldflags="-lpthread"
112 LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
113 libmono_ldflags="$PTHREAD_LIBS"
116 AC_DEFINE(PTHREAD_POINTER_ID)
118 libgc_threads=pthreads
119 # TLS is only partially implemented on -CURRENT (compiler support
120 # but NOT library support)
127 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS"
128 libmono_cflags="-D_THREAD_SAFE"
129 LDFLAGS="$LDFLAGS -pthread"
130 libmono_ldflags="-pthread"
132 AC_DEFINE(PTHREAD_POINTER_ID)
134 libgc_threads=pthreads
138 CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT"
139 libmono_cflags="-D_REENTRANT"
140 libmono_ldflags="-lpthread"
142 libgc_threads=pthreads
146 CPPFLAGS="$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT"
147 CFLAGS="$CFLAGS +ESdbgasm"
148 LDFLAGS="$LDFLAGS -z"
149 libmono_cflags="-D_REENTRANT"
150 libmono_ldflags="-lpthread"
151 libgc_threads=pthreads
156 CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT"
158 libmono_cflags="-D_REENTRANT"
159 libgc_threads=pthreads
163 CPPFLAGS="$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS"
164 libmono_cflags="-D_THREAD_SAFE"
165 LDFLAGS="$LDFLAGS -pthread"
166 libmono_ldflags="-pthread"
168 AC_DEFINE(PTHREAD_POINTER_ID)
169 AC_DEFINE(USE_MACH_SEMA)
170 no_version_script=yes
172 libgc_threads=pthreads
175 AC_MSG_WARN([*** Please add $host to configure.in checks!])
182 if test x$need_link_unlink = xyes; then
183 AC_DEFINE(NEED_LINK_UNLINK, 1, [Define if Unix sockets cannot be created in an anonymous namespace])
186 AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
188 AC_CHECK_TOOL(CC, gcc, gcc)
192 dnl We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
194 # Set ASFLAGS if not already set.
195 : ${CCASFLAGS='$(CFLAGS)'}
199 AC_CHECK_PROG(BISON, bison,yes,no)
200 if test "x$BISON" = "xno";
202 AC_MSG_ERROR([You need to install bison])
205 dnl may require a specific autoconf version
206 dnl AC_PROG_CC_FOR_BUILD
207 dnl CC_FOR_BUILD not automatically detected
210 if test "x$cross_compiling" = "xyes"; then
214 AC_SUBST(CC_FOR_BUILD)
216 AC_SUBST(BUILD_EXEEXT)
223 # Test whenever ld supports -version-script
226 if test "x$lt_cv_prog_gnu_ld" = "xno"; then
227 no_version_script=yes
230 AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
232 AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h sys/un.h)
234 # for mono/mini/tramp-x86.c
235 AC_CHECK_HEADERS(valgrind/memcheck.h)
237 # for mono/metadata/debug-symfile.c
238 AC_CHECK_HEADERS(elf.h)
241 AC_CHECK_HEADERS(wchar.h)
243 # not 64 bit clean in cross-compile
244 AC_CHECK_SIZEOF(void *, 4)
247 if test x"$GCC" = xyes; then
248 WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings'
249 # The runtime code does not respect ANSI C strict aliasing rules
250 CFLAGS="$CFLAGS -fno-strict-aliasing"
252 # The Sun Forte compiler complains about inline functions that access static variables
253 # so disable all inlining.
256 CFLAGS="$CFLAGS -Dinline="
260 CFLAGS="$CFLAGS -g $WARN"
262 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
263 if test "x$PKG_CONFIG" = "xno"; then
264 AC_MSG_ERROR([You need to install pkg-config])
267 dnl for use on the build system
268 dnl pkg-config is stupid
269 BUILD_GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
270 BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
271 AC_SUBST(BUILD_GLIB_CFLAGS)
272 AC_SUBST(BUILD_GLIB_LIBS)
275 AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir],
276 if test x$with_crosspkgdir = "x"; then
277 if test -s $PKG_CONFIG_PATH; then
278 PKG_PATH=$PKG_CONFIG_PATH
281 PKG_PATH=$with_crosspkgdir
282 PKG_CONFIG_PATH=$PKG_PATH
283 export PKG_CONFIG_PATH
287 ## Versions of dependencies
288 GLIB_REQUIRED_VERSION=1.3.11
290 PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION)
292 GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
293 GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
294 GMODULE_CFLAGS=`$PKG_CONFIG --cflags gmodule-2.0`
295 GMODULE_LIBS=`$PKG_CONFIG --libs gmodule-2.0`
297 AC_SUBST(GLIB_CFLAGS)
299 AC_SUBST(GMODULE_CFLAGS)
300 AC_SUBST(GMODULE_LIBS)
302 AC_ARG_WITH(gc, [ --with-gc=boehm,included,none],[gc=$with_gc],[gc=$gc_default])
304 # Enable support for fast thread-local storage
305 # Some systems have broken support, so we allow to disable it.
306 AC_ARG_WITH(tls, [ --with-tls=__thread,pthread select Thread Local Storage implementation],[],[with_tls=__thread])
308 # Kept for compatibility
309 AC_ARG_WITH(nptl, [ --with-nptl=yes,no deprecated, use --with-tls instead],[],[with_nptl=default])
311 if test "x$with_nptl" != "xdefault"; then
312 if test "x$with_nptl" = "xyes"; then
313 AC_MSG_WARN([--with-nptl=yes is deprecated, use --with-tls=__thread option instead.])
316 if test "x$with_nptl" = "xno"; then
317 AC_MSG_WARN([--with-nptl=no is deprecated, use --with-tls=pthread option instead.])
322 # Enable support for using sigaltstack for SIGSEGV and stack overflow handling
323 # This does not work on some platforms (bug #55253)
324 AC_ARG_WITH(sigaltstack, [ --with-sigaltstack=yes,no enable/disable support for sigaltstack],[],[with_sigaltstack=no])
326 # assembly bundle support, see metadata/make-bundle.pl for more info
327 AC_ARG_WITH(bundle, [ --with-bundle=bundle_template],[
328 BUNDLE_FILE=$with_bundle
329 AC_SUBST(BUNDLE_FILE)
330 AC_DEFINE(WITH_BUNDLE)
332 AM_CONDITIONAL(WITH_BUNDLE, test x$with_bundle != xno)
339 AC_CHECK_HEADERS(gc.h gc/gc.h, gc_headers=yes)
340 AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
342 if test "x$found_boehm" != "xyes"; then
343 AC_MSG_ERROR("GC requested but libgc not found! Install libgc or run configure with --with-gc=none.")
345 if test "x$gc_headers" != "xyes"; then
346 AC_MSG_ERROR("GC requested but header files not found! You may need to install them by hand.")
349 AC_DEFINE(HAVE_BOEHM_GC)
350 AC_SUBST(HAVE_BOEHM_GC)
351 LIBGC_LIBS="-lgc $libdl"
353 # AC_CHECK_FUNCS does not work for some reason...
354 AC_CHECK_LIB(gc, GC_gcj_malloc, found_gcj_malloc="yes",,$libdl)
355 if test "x$found_gcj_malloc" = "xyes"; then
356 AC_DEFINE(HAVE_GC_GCJ_MALLOC)
358 AC_CHECK_LIB(gc, GC_enable, found_gc_enable="yes",,$libdl)
359 if test "x$found_gc_enable" = "xyes"; then
360 AC_DEFINE(HAVE_GC_ENABLE)
365 AC_CONFIG_SUBDIRS(libgc)
372 LIBGC_CFLAGS='-I$(top_srcdir)/libgc/include'
373 LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
375 AC_DEFINE(HAVE_BOEHM_GC)
376 AC_SUBST(HAVE_BOEHM_GC)
379 AC_DEFINE(USE_INCLUDED_LIBGC)
381 # The included libgc contains GCJ support
382 AC_DEFINE(HAVE_GC_GCJ_MALLOC)
383 AC_DEFINE(HAVE_GC_ENABLE)
387 AC_MSG_WARN("Compiling mono without GC.")
390 AC_MSG_ERROR([Invalid argument to --with-gc.])
395 # tell libgc/configure about what we want
396 ac_configure_args="$ac_configure_args --disable-embed-check --with-libgc-threads=$libgc_threads"
398 AM_CONDITIONAL(INCLUDED_LIBGC, test x$use_included_gc = xyes)
399 AC_SUBST(LIBGC_CFLAGS)
404 dnl End of libgc checks
407 if test x$platform_win32 = xno; then
409 dnl ******************************************************************
410 dnl *** Checks for the IKVM JNI interface library ***
411 dnl ******************************************************************
412 AC_ARG_WITH(ikvm-jni, [ --with-ikvm-jni=yes,no build the IKVM JNI interface library],[with_ikvm_jni=$withval],[with_ikvm_jni=yes])
413 AC_ARG_WITH(jdk, [ --with-jdk=DIRECTORY Use JDK from DIRECTORY],[with_jdk_dir=$withval],[with_jdk_dir=])
416 if test x$with_ikvm_jni = xyes; then
417 AC_MSG_CHECKING([JDK headers])
419 if test x$with_jdk_dir = x; then
420 # Try JAVA_HOME variable
421 if test x$JAVA_HOME != x; then
422 with_jdk_dir=$JAVA_HOME
427 if test -d $with_jdk_dir/include; then
428 jdk_headers_found=yes
430 if test -d $with_jdk_dir/include/linux; then
433 if test -d $with_jdk_dir/include/solaris; then
436 if test -f $with_jdk_dir/include/jni_md.h; then
437 # GNU Classpath sources
448 if test x$jdk_headers_found = xyes; then
449 AC_MSG_RESULT($with_jdk_dir/include $with_jdk_dir/include/$jdk_platform)
451 AC_MSG_RESULT(not found)
454 if test x$jdk_headers_found = xyes; then
455 ikvm_jni_dir=ikvm-jni
456 IKVM_JNI_CFLAGS="-I$with_jdk_dir/include -I$with_jdk_dir/include/$jdk_platform"
460 AC_SUBST(ikvm_jni_dir)
461 AC_SUBST(IKVM_JNI_CFLAGS)
463 AC_CHECK_FUNCS(getgrgid_r)
464 AC_CHECK_FUNCS(getgrnam_r)
465 AC_CHECK_FUNCS(getpwnam_r)
466 AC_CHECK_FUNCS(getpwuid_r)
467 AC_CHECK_FUNCS(getresuid)
468 AC_CHECK_FUNCS(setresuid)
469 AC_CHECK_FUNCS(kqueue)
471 dnl ******************************************************************
472 dnl *** Check for large file support ***
473 dnl *** (If we were using autoconf 2.50 we'd use AC_SYS_LARGEFILE) ***
474 dnl ******************************************************************
476 # Check that off_t can represent 2**63 - 1 correctly, working around
477 # potential compiler bugs. Defines LARGE_FILE_SUPPORT, adds $1 to
478 # CPPFLAGS and sets $large_offt to yes if the test succeeds
480 AC_DEFUN(LARGE_FILES, [
481 large_CPPFLAGS=$CPPFLAGS
482 CPPFLAGS="$CPPFLAGS $1"
484 #include <sys/types.h>
486 #define BIG_OFF_T (((off_t)1<<62)-1+((off_t)1<<62))
489 int big_off_t=((BIG_OFF_T%2147483629==721) &&
490 (BIG_OFF_T%2147483647==1));
499 AC_DEFINE(HAVE_LARGE_FILE_SUPPORT)
500 large_CPPFLAGS="$large_CPPFLAGS $1"
505 CPPFLAGS=$large_CPPFLAGS
508 AC_MSG_CHECKING(if off_t is 64 bits wide)
510 if test $large_offt = no; then
511 AC_MSG_CHECKING(if _FILE_OFFSET_BITS=64 gives 64 bit off_t)
512 LARGE_FILES("-D_FILE_OFFSET_BITS=64")
514 if test $large_offt = no; then
515 AC_MSG_WARN([No 64 bit file size support available])
518 dnl *****************************
519 dnl *** Checks for libsocket ***
520 dnl *****************************
521 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
523 dnl *******************************
524 dnl *** Checks for MSG_NOSIGNAL ***
525 dnl *******************************
526 AC_MSG_CHECKING(for MSG_NOSIGNAL)
527 AC_TRY_COMPILE([#include <sys/socket.h>], [
528 int f = MSG_NOSIGNAL;
532 AC_DEFINE(HAVE_MSG_NOSIGNAL)
534 # We'll have to use signals
538 dnl *****************************
539 dnl *** Checks for SOL_IP ***
540 dnl *****************************
541 AC_MSG_CHECKING(for SOL_IP)
542 AC_TRY_COMPILE([#include <netdb.h>], [
547 AC_DEFINE(HAVE_SOL_IP)
549 # We'll have to use getprotobyname
553 dnl *****************************
554 dnl *** Checks for SOL_IPV6 ***
555 dnl *****************************
556 AC_MSG_CHECKING(for SOL_IPV6)
557 AC_TRY_COMPILE([#include <netdb.h>], [
558 int level = SOL_IPV6;
562 AC_DEFINE(HAVE_SOL_IPV6)
564 # We'll have to use getprotobyname
568 dnl *****************************
569 dnl *** Checks for SOL_TCP ***
570 dnl *****************************
571 AC_MSG_CHECKING(for SOL_TCP)
572 AC_TRY_COMPILE([#include <netdb.h>], [
577 AC_DEFINE(HAVE_SOL_TCP)
579 # We'll have to use getprotobyname
583 dnl *****************************
584 dnl *** Checks for IP_PKTINFO ***
585 dnl *****************************
586 AC_MSG_CHECKING(for IP_PKTINFO)
587 AC_TRY_COMPILE([#include <netdb.h>], [
588 int level = IP_PKTINFO;
592 AC_DEFINE(HAVE_IP_PKTINFO)
597 dnl *********************************
598 dnl *** Check for struct ip_mreqn ***
599 dnl *********************************
600 AC_MSG_CHECKING(for struct ip_mreqn)
601 AC_TRY_COMPILE([#include <netinet/in.h>], [
602 struct ip_mreqn mreq;
603 mreq.imr_address.s_addr = 0;
607 AC_DEFINE(HAVE_STRUCT_IP_MREQN)
609 # We'll just have to try and use struct ip_mreq
611 AC_MSG_CHECKING(for struct ip_mreq)
612 AC_TRY_COMPILE([#include <netinet/in.h>], [
614 mreq.imr_interface.s_addr = 0;
618 AC_DEFINE(HAVE_STRUCT_IP_MREQ)
620 # No multicast support
625 dnl **********************************
626 dnl *** Check for gethostbyname2_r ***
627 dnl **********************************
628 AC_MSG_CHECKING(for gethostbyname2_r)
629 AC_TRY_LINK([#include <netdb.h>], [
630 gethostbyname2_r(NULL,0,NULL,NULL,0,NULL,NULL);
634 AC_DEFINE(HAVE_GETHOSTBYNAME2_R)
639 dnl *****************************
640 dnl *** Checks for libnsl ***
641 dnl *****************************
642 AC_CHECK_LIB(nsl, gethostbyaddr, LIBS="$LIBS -lnsl")
644 AC_CHECK_FUNCS(inet_pton inet_aton)
646 dnl ***********************************************
647 dnl *** Checks for size of sockaddr_un.sun_path ***
648 dnl ***********************************************
649 # AC_CHECK_SIZEOF can't cope with struct members :-(
650 AC_MSG_CHECKING(size of sockaddr_un.sun_path)
651 AC_CACHE_VAL(cv_mono_sizeof_sunpath,
653 #include <sys/types.h>
658 struct sockaddr_un sock_un;
659 FILE *f=fopen("conftestval", "w");
661 fprintf(f, "%d\n", sizeof(sock_un.sun_path));
664 ], cv_mono_sizeof_sunpath=`cat conftestval`,
665 cv_mono_sizeof_sunpath=0,
666 cv_mono_sizeof_sunpath=0)])dnl
667 AC_MSG_RESULT($cv_mono_sizeof_sunpath)
668 AC_DEFINE_UNQUOTED(MONO_SIZEOF_SUNPATH, $cv_mono_sizeof_sunpath)
670 dnl *************************************
671 dnl *** Checks for zero length arrays ***
672 dnl *************************************
673 AC_MSG_CHECKING(whether $CC supports zero length arrays)
681 AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 0)
684 AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 1)
687 dnl *****************************
688 dnl *** Checks for libxnet ***
689 dnl *****************************
692 AC_MSG_CHECKING(for Solaris XPG4 support)
693 if test -f /usr/lib/libxnet.so; then
694 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
695 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
696 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
703 if test "$GCC" = "yes"; then
704 CFLAGS="$CFLAGS -Wno-char-subscripts"
709 dnl *****************************
710 dnl *** Checks for libpthread ***
711 dnl *****************************
712 # on FreeBSD -STABLE, the pthreads functions all reside in libc_r
713 # and libpthread does not exist
717 AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread")
720 AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
723 AC_CHECK_HEADERS(pthread.h)
724 AC_CHECK_FUNCS(pthread_mutex_timedlock)
725 AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np)
726 AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
727 AC_TRY_COMPILE([ #include <pthread.h>], [
728 pthread_mutexattr_t attr;
729 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
734 AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
735 AC_DEFINE(USE_MONO_MUTEX)
737 AC_CHECK_FUNCS(pthread_attr_setstacksize)
739 dnl ***********************************
740 dnl *** Checks for working __thread ***
741 dnl ***********************************
742 AC_MSG_CHECKING(for working __thread)
743 if test "x$with_tls" != "x__thread"; then
744 AC_MSG_RESULT(disabled)
750 static int res1, res2;
752 void thread_main (void *arg)
767 pthread_create (&t1, NULL, thread_main, 1);
768 pthread_create (&t2, NULL, thread_main, 2);
770 pthread_join (t1, NULL);
771 pthread_join (t2, NULL);
773 return !(res1 + res2 == 2);
777 AC_DEFINE(HAVE_KW_THREAD)
783 dnl **************************************
784 dnl *** Checks for working sigaltstack ***
785 dnl **************************************
786 AC_MSG_CHECKING(for working sigaltstack)
787 if test "x$with_sigaltstack" != "xyes"; then
788 AC_MSG_RESULT(disabled)
796 #include <sys/wait.h>
799 sigsegv_signal_handler (int _dummy, siginfo_t *info, void *context)
817 struct sigaltstack sas;
821 sa.sa_sigaction = sigsegv_signal_handler;
822 sigemptyset (&sa.sa_mask);
823 sa.sa_flags = SA_SIGINFO | SA_STACK;
824 if (sigaction (SIGSEGV, &sa, NULL) == -1) {
829 sas.ss_sp = malloc (SIGSTKSZ);
830 sas.ss_size = SIGSTKSZ;
831 sas.ss_flags = SS_ONSTACK;
832 if (sigaltstack (&sas, NULL) == -1) {
837 pthread_attr_init (&attr);
838 if (pthread_create(&id, &attr, loop, &attr) != 0) {
863 for (i = 0; i < 3; ++i) {
865 waitpid (son, &status, WNOHANG);
866 if (WIFEXITED (status) && WEXITSTATUS (status) == 0)
876 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
883 dnl ********************************
884 dnl *** Checks for semaphore lib ***
885 dnl ********************************
886 # 'Real Time' functions on Solaris
887 # posix4 on Solaris 2.6
888 # pthread (first!) on Linux
889 AC_SEARCH_LIBS(sem_init, pthread rt posix4)
891 dnl ********************************
892 dnl *** Checks for timezone stuff **
893 dnl ********************************
894 AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
900 ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
901 if test $ac_cv_struct_tm_gmtoff = yes; then
902 AC_DEFINE(HAVE_TM_GMTOFF)
904 AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
909 ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
910 if test $ac_cv_var_timezone = yes; then
911 AC_DEFINE(HAVE_TIMEZONE)
913 AC_ERROR(unable to find a way to determine timezone)
917 dnl *********************************
918 dnl *** Checks for math functions ***
919 dnl *********************************
921 AC_CHECK_FUNCS(finite, , AC_MSG_CHECKING(for finite in math.h)
922 AC_TRY_LINK([#include <math.h>],
924 AC_DEFINE(HAVE_FINITE) AC_MSG_RESULT(yes),
926 AC_CHECK_FUNCS(isfinite, , AC_MSG_CHECKING(for isfinite in math.h)
927 AC_TRY_LINK([#include <math.h>],
929 AC_DEFINE(HAVE_ISFINITE) AC_MSG_RESULT(yes),
932 dnl ****************************************************************
933 dnl *** Checks for working poll() (macosx defines it but doesn't ***
934 dnl *** have it in the library (duh)) ***
935 dnl ****************************************************************
938 dnl *************************
939 dnl *** Check for signbit ***
940 dnl *************************
941 AC_MSG_CHECKING(for signbit)
942 AC_TRY_LINK([#include <math.h>], [
943 int s = signbit(1.0);
946 AC_DEFINE(HAVE_SIGNBIT)
951 dnl *********************
952 dnl *** Check for AIO ***
953 dnl *********************
954 AC_MSG_CHECKING([for SIGEV_THREAD definition])
955 dnl Some systems (FreeBSD at least) may have aio_read
956 dnl but don't support/define SIGEV_THREAD.
958 #include <sys/signal.h>
960 int x = SIGEV_THREAD;
962 ac_cv_c_sigev_thread=yes
968 if test "$ac_cv_c_sigev_thread" = "yes" ; then
969 AC_CHECK_HEADERS(aio.h sys/aio.h)
970 AC_CHECK_LIB(rt, aio_read, [ LIBS="$LIBS -lrt" ],)
971 SIGVAL_PTR="undefined"
972 if test "$ac_cv_header_aio_h" = "yes" -o "$ac_cv_header_sys_aio_h" = "yes" ; then
973 AC_CHECK_MEMBER(union sigval.sigval_ptr,SIGVAL_PTR="sigval_ptr",, [
974 #include <sys/signal.h>
976 AC_CHECK_MEMBER(union sigval.sival_ptr,SIGVAL_PTR="sival_ptr",, [
977 #include <sys/signal.h>
979 if test "$SIGVAL_PTR" = "undefined" ; then
980 AC_MSG_ERROR([Unable to detect field name in 'union sigval'])
983 AC_DEFINE_UNQUOTED(SIGVAL_PTR,$SIGVAL_PTR,[Pointer field name in 'union sigval'])
987 AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
988 AC_CHECK_LIB(psapi, main, LIBS="$LIBS -lpsapi", AC_ERROR(bad mingw install?))
990 dnl *********************************
991 dnl *** Check for struct ip_mreqn ***
992 dnl *********************************
993 AC_MSG_CHECKING(for struct ip_mreqn)
994 AC_TRY_COMPILE([#include <ws2tcpip.h>], [
995 struct ip_mreqn mreq;
996 mreq.imr_address.s_addr = 0;
1000 AC_DEFINE(HAVE_STRUCT_IP_MREQN)
1002 # We'll just have to try and use struct ip_mreq
1004 AC_MSG_CHECKING(for struct ip_mreq)
1005 AC_TRY_COMPILE([#include <ws2tcpip.h>], [
1006 struct ip_mreq mreq;
1007 mreq.imr_interface.s_addr = 0;
1009 # Yes, we have it...
1011 AC_DEFINE(HAVE_STRUCT_IP_MREQ)
1013 # No multicast support
1020 AC_MSG_CHECKING(for socklen_t)
1022 #include <sys/types.h>
1023 #include <sys/socket.h>
1027 ac_cv_c_socklen_t=yes
1028 AC_DEFINE(HAVE_SOCKLEN_T)
1034 AC_CHECK_FUNCS(trunc, , AC_MSG_CHECKING(for trunc in math.h)
1035 # Simply calling trunc (0.0) is no good since gcc will optimize the call away
1036 AC_TRY_LINK([#include <math.h>],
1037 [ static void *p = &trunc; ],
1039 AC_DEFINE(HAVE_TRUNC)
1045 if test "x$ac_cv_truncl" != "xyes"; then
1046 AC_CHECK_LIB(sunmath, aintl, [ AC_DEFINE(HAVE_AINTL) LIBS="$LIBS -lsunmath"])
1049 dnl ****************************
1050 dnl *** Look for /dev/random ***
1051 dnl ****************************
1053 AC_MSG_CHECKING([if usage of random device is requested])
1054 AC_ARG_ENABLE(dev-random,
1055 [ --disable-dev-random disable the use of the random device],
1056 try_dev_random=$enableval, try_dev_random=yes)
1057 AC_MSG_RESULT($try_dev_random)
1061 NAME_DEV_RANDOM="/dev/srandom"
1064 dnl Win32 does not have /dev/random, they have their own method...
1066 *-*-mingw*|*-*-cygwin*)
1067 ac_cv_have_dev_random=no
1070 dnl Everywhere else, it's /dev/random
1073 NAME_DEV_RANDOM="/dev/random"
1077 AC_DEFINE_UNQUOTED(NAME_DEV_RANDOM, "$NAME_DEV_RANDOM")
1079 dnl Now check if the device actually exists
1081 if test "x$try_dev_random" = "xyes"; then
1082 AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
1083 [if test -r "$NAME_DEV_RANDOM" ; then
1084 ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
1085 if test "x$ac_cv_have_dev_random" = "xyes"; then
1086 AC_DEFINE(HAVE_CRYPT_RNG)
1089 AC_MSG_CHECKING(for random device)
1090 ac_cv_have_dev_random=no
1091 AC_MSG_RESULT(has been disabled)
1094 if test "x$platform_win32" = "xyes"; then
1095 AC_DEFINE(HAVE_CRYPT_RNG)
1098 if test "x$ac_cv_have_dev_random" = "xno" \
1099 && test "x$platform_win32" = "xno"; then
1102 *** A system-provided entropy source was not found on this system.
1103 *** Because of this, the System.Security.Cryptography random number generator
1104 *** will throw a NotImplemented exception.
1106 *** If you are seeing this message, and you know your system DOES have an
1107 *** entropy collection in place, please contact <crichton@gimp.org> and
1108 *** provide information about the system and how to access the random device.
1110 *** Otherwise you can install either egd or prngd and set the environment
1111 *** variable MONO_EGD_SOCKET to point to the daemon's socket to use that.
1115 AC_MSG_CHECKING([if inter-process shared handles are requested])
1116 AC_ARG_ENABLE(shared-handles, [ --disable-shared-handles disable inter-process shared handles], try_shared_handles=$enableval, try_shared_handles=yes)
1117 AC_MSG_RESULT($try_shared_handles)
1118 if test "x$try_shared_handles" != "xyes"; then
1119 AC_DEFINE(DISABLE_SHARED_HANDLES)
1120 AC_SUBST(DISABLE_SHARED_HANDLES)
1131 AC_ARG_WITH(icu, [ --with-icu=yes/no],
1132 if test x$with_icu = xno; then
1134 AC_MSG_RESULT(Will not probe for ICU)
1139 AC_PATH_PROG(ICU_CONFIG, icu-config, no)
1140 if test "x$ICU_CONFIG" = "xno" -o ! -x "$ICU_CONFIG"; then
1141 AC_MSG_WARN([Only invariant locale available; install ICU for I18N support])
1142 enable_icu="no, if you want full i18n support download it from: http://oss.software.ibm.com/icu/index.html"
1144 enable_icu="yes. Version: `$ICU_CONFIG --version`"
1146 ICU_CFLAGS=`$ICU_CONFIG --cppflags`
1147 ICU_LIBS=`$ICU_CONFIG --ldflags`
1150 AC_SUBST(ICU_CFLAGS)
1154 ACCESS_UNALIGNED="yes"
1162 # mips-sgi-irix5.* | mips-sgi-irix6.*)
1164 # ACCESS_UNALIGNED="no"
1172 x86_64-*-* | amd64-*-*)
1178 if test "x$ac_cv_sizeof_void_p" = "x8"; then
1185 ACCESS_UNALIGNED="no"
1190 alpha*-*-linux* | alpha*-*-osf*)
1192 ACCESS_UNALIGNED="no"
1196 # ia64-*-linux* | ia64-*-hpux*)
1200 # ACCESS_UNALIGNED="no";
1201 # case "$host_os" in
1202 # linux*) LIBC="libc.so.6.1";;
1203 # hpux*) LIBC="libc.so.1";;
1209 hppa2.0w-hp-hpux11.00 | hppa64-hp-hpux11.00)
1213 ACCESS_UNALIGNED="no"
1218 ACCESS_UNALIGNED="no"
1220 macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | \
1221 powerpc-*-sysv* | powerpc-*-darwin*)
1227 arm-*-linux-* | armv4l-*-linux-*)
1230 ACCESS_UNALIGNED="no"
1235 ACCESS_UNALIGNED="no"
1240 AC_ARG_WITH(jit, [ --with-jit=yes,no If you want to build scripts that default to the JIT],[
1245 if test x$JIT_SUPPORTED = xyes; then
1246 if $jit_wanted; then
1248 jit_status="Building and using the JIT"
1250 jit_status="Building the JIT, defaulting to the interpreter"
1253 jit_status="interpreter"
1256 AM_CONDITIONAL(USE_JIT, test x$USEJIT = xtrue)
1264 INTL="libintl.dylib"
1281 if test ${TARGET} = ARM; then
1282 dnl ******************************************
1283 dnl *** Check to see what FPU is available ***
1284 dnl ******************************************
1285 AC_MSG_CHECKING(which FPU to use)
1287 AC_TRY_COMPILE([], [
1288 __asm__ ("ldfd f0, [r0]");
1290 AC_TRY_COMPILE([], [
1291 __asm__ ("fldd d0, [r0]");
1292 ], fpu=VFP, fpu=NONE)
1296 CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu"
1300 if test ${TARGET} = unknown; then
1301 CPPFLAGS="$CPPFLAGS -DNO_PORT"
1302 AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
1305 if test ${ACCESS_UNALIGNED} = no; then
1306 CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
1310 AC_ARG_WITH(preview, [ --with-preview=yes,no If you want to install the 2.0 FX preview],[
1311 if test x$with_preview = xyes; then
1316 AM_CONDITIONAL(INSTALL_2_0, test x$PREVIEW = xyes)
1318 AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
1319 AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
1320 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
1321 AM_CONDITIONAL(SPARC64, test x$TARGET = xSPARC64)
1322 AM_CONDITIONAL(X86, test x$TARGET = xX86)
1323 AM_CONDITIONAL(AMD64, test x$TARGET = xAMD64)
1324 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
1325 AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
1326 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
1327 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
1328 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
1329 AM_CONDITIONAL(S390, test x$TARGET = xS390)
1330 AM_CONDITIONAL(HPPA, test x$TARGET = xHPPA)
1332 AM_CONDITIONAL(JIT_SUPPORTED, test x$JIT_SUPPORTED = xyes)
1337 AC_SUBST(arch_target)
1348 mono/metadata/Makefile
1353 mono/os/win32/Makefile
1354 mono/os/unix/Makefile
1355 mono/arch/x86/Makefile
1356 mono/arch/amd64/Makefile
1357 mono/arch/hppa/Makefile
1358 mono/arch/ppc/Makefile
1359 mono/arch/sparc/Makefile
1360 mono/arch/s390/Makefile
1361 mono/arch/arm/Makefile
1362 mono/arch/alpha/Makefile
1363 mono/interpreter/Makefile
1365 mono/tests/tests-config
1366 mono/benchmark/Makefile
1367 mono/monoburg/Makefile
1368 mono/monograph/Makefile
1369 mono/io-layer/Makefile
1370 mono/handles/Makefile
1372 mono/profiler/Makefile
1375 runtime/net_1_1/Makefile
1376 runtime/net_2_0/Makefile
1387 tools/locale-builder/Makefile
1395 SIGALTSTACK: $with_sigaltstack
1398 JNI support: $jdk_headers_found