3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(mono,1.0)
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 fast thread-local storage
250 # Some systems have broken support, so we allow to disable it.
251 AC_ARG_WITH(tls, [ --with-tls=__thread,pthread select Thread Local Storage implementation],[],[with_tls=__thread])
253 # Kept for compatibility
254 AC_ARG_WITH(nptl, [ --with-nptl=yes,no deprecated, use --with-tls instead],[],[with_nptl=default])
256 if test "x$with_nptl" != "xdefault"; then
257 if test "x$with_nptl" = "xyes"; then
258 AC_MSG_WARN([--with-nptl=yes is deprecated, use --with-tls=__thread option instead.])
261 if test "x$with_nptl" = "xno"; then
262 AC_MSG_WARN([--with-nptl=no is deprecated, use --with-tls=pthread option instead.])
267 # Enable support for using sigaltstack for SIGSEGV and stack overflow handling
268 # This does not work on some platforms (bug #55253)
269 AC_ARG_WITH(sigaltstack, [ --with-sigaltstack=yes,no enable/disable support for sigaltstack],[],[with_sigaltstack=no])
271 # assembly bundle support, see metadata/make-bundle.pl for more info
272 AC_ARG_WITH(bundle, [ --with-bundle=bundle_template],[
273 BUNDLE_FILE=$with_bundle
274 AC_SUBST(BUNDLE_FILE)
275 AC_DEFINE(WITH_BUNDLE)
277 AM_CONDITIONAL(WITH_BUNDLE, test x$with_bundle != xno)
284 AC_CHECK_HEADERS(gc.h gc/gc.h, gc_headers=yes)
285 AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
287 if test "x$found_boehm" != "xyes"; then
288 AC_MSG_ERROR("GC requested but libgc not found! Install libgc or run configure with --with-gc=none.")
290 if test "x$gc_headers" != "xyes"; then
291 AC_MSG_ERROR("GC requested but header files not found! You may need to install them by hand.")
294 AC_DEFINE(HAVE_BOEHM_GC)
295 AC_SUBST(HAVE_BOEHM_GC)
296 LIBGC_LIBS="-lgc $libdl"
298 # AC_CHECK_FUNCS does not work for some reason...
299 AC_CHECK_LIB(gc, GC_gcj_malloc, found_gcj_malloc="yes",,$libdl)
300 if test "x$found_gcj_malloc" = "xyes"; then
301 AC_DEFINE(HAVE_GC_GCJ_MALLOC)
303 AC_CHECK_LIB(gc, GC_enable, found_gc_enable="yes",,$libdl)
304 if test "x$found_gc_enable" = "xyes"; then
305 AC_DEFINE(HAVE_GC_ENABLE)
310 AC_CONFIG_SUBDIRS(libgc)
317 LIBGC_CFLAGS='-I$(top_srcdir)/libgc/include'
318 LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
320 AC_DEFINE(HAVE_BOEHM_GC)
321 AC_SUBST(HAVE_BOEHM_GC)
324 AC_DEFINE(USE_INCLUDED_LIBGC)
326 # The included libgc contains GCJ support
327 AC_DEFINE(HAVE_GC_GCJ_MALLOC)
328 AC_DEFINE(HAVE_GC_ENABLE)
332 AC_MSG_WARN("Compiling mono without GC.")
335 AC_MSG_ERROR([Invalid argument to --with-gc.])
340 # tell libgc/configure about what we want
341 ac_configure_args="$ac_configure_args --disable-embed-check --with-libgc-threads=$libgc_threads"
343 AM_CONDITIONAL(INCLUDED_LIBGC, test x$use_included_gc = xyes)
344 AC_SUBST(LIBGC_CFLAGS)
349 dnl End of libgc checks
352 if test x$platform_win32 = xno; then
354 dnl ******************************************************************
355 dnl *** Checks for the IKVM JNI interface library ***
356 dnl ******************************************************************
357 AC_ARG_WITH(ikvm-jni, [ --with-ikvm-jni=yes,no build the IKVM JNI interface library],[with_ikvm_jni=$withval],[with_ikvm_jni=yes])
358 AC_ARG_WITH(jdk, [ --with-jdk=DIRECTORY Use JDK from DIRECTORY],[with_jdk_dir=$withval],[with_jdk_dir=])
361 if test x$with_ikvm_jni = xyes; then
362 AC_MSG_CHECKING([JDK headers])
364 if test x$with_jdk_dir = x; then
365 # Try JAVA_HOME variable
366 if test x$JAVA_HOME != x; then
367 with_jdk_dir=$JAVA_HOME
372 if test -d $with_jdk_dir/include; then
373 jdk_headers_found=yes
375 if test -d $with_jdk_dir/include/linux; then
378 if test -d $with_jdk_dir/include/solaris; then
381 if test -f $with_jdk_dir/include/jni_md.h; then
382 # GNU Classpath sources
393 if test x$jdk_headers_found = xyes; then
394 AC_MSG_RESULT($with_jdk_dir/include $with_jdk_dir/include/$jdk_platform)
396 AC_MSG_RESULT(not found)
399 if test x$jdk_headers_found = xyes; then
400 ikvm_jni_dir=ikvm-jni
401 IKVM_JNI_CFLAGS="-I$with_jdk_dir/include -I$with_jdk_dir/include/$jdk_platform"
405 AC_SUBST(ikvm_jni_dir)
406 AC_SUBST(IKVM_JNI_CFLAGS)
408 AC_CHECK_FUNCS(getgrgid_r)
409 AC_CHECK_FUNCS(getgrnam_r)
410 AC_CHECK_FUNCS(getpwnam_r)
411 AC_CHECK_FUNCS(getpwuid_r)
412 AC_CHECK_FUNCS(getresuid)
413 AC_CHECK_FUNCS(setresuid)
415 dnl ******************************************************************
416 dnl *** Check for large file support ***
417 dnl *** (If we were using autoconf 2.50 we'd use AC_SYS_LARGEFILE) ***
418 dnl ******************************************************************
420 # Check that off_t can represent 2**63 - 1 correctly, working around
421 # potential compiler bugs. Defines LARGE_FILE_SUPPORT, adds $1 to
422 # CPPFLAGS and sets $large_offt to yes if the test succeeds
424 AC_DEFUN(LARGE_FILES, [
425 large_CPPFLAGS=$CPPFLAGS
426 CPPFLAGS="$CPPFLAGS $1"
428 #include <sys/types.h>
430 #define BIG_OFF_T (((off_t)1<<62)-1+((off_t)1<<62))
433 int big_off_t=((BIG_OFF_T%2147483629==721) &&
434 (BIG_OFF_T%2147483647==1));
443 AC_DEFINE(HAVE_LARGE_FILE_SUPPORT)
444 large_CPPFLAGS="$large_CPPFLAGS $1"
449 CPPFLAGS=$large_CPPFLAGS
452 AC_MSG_CHECKING(if off_t is 64 bits wide)
454 if test $large_offt = no; then
455 AC_MSG_CHECKING(if _FILE_OFFSET_BITS=64 gives 64 bit off_t)
456 LARGE_FILES("-D_FILE_OFFSET_BITS=64")
458 if test $large_offt = no; then
459 AC_MSG_WARN([No 64 bit file size support available])
462 dnl *****************************
463 dnl *** Checks for libsocket ***
464 dnl *****************************
465 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
467 dnl *******************************
468 dnl *** Checks for MSG_NOSIGNAL ***
469 dnl *******************************
470 AC_MSG_CHECKING(for MSG_NOSIGNAL)
471 AC_TRY_COMPILE([#include <sys/socket.h>], [
472 int f = MSG_NOSIGNAL;
476 AC_DEFINE(HAVE_MSG_NOSIGNAL)
478 # We'll have to use signals
482 dnl *****************************
483 dnl *** Checks for SOL_IP ***
484 dnl *****************************
485 AC_MSG_CHECKING(for SOL_IP)
486 AC_TRY_COMPILE([#include <netdb.h>], [
491 AC_DEFINE(HAVE_SOL_IP)
493 # We'll have to use getprotobyname
497 dnl *****************************
498 dnl *** Checks for SOL_IPV6 ***
499 dnl *****************************
500 AC_MSG_CHECKING(for SOL_IPV6)
501 AC_TRY_COMPILE([#include <netdb.h>], [
502 int level = SOL_IPV6;
506 AC_DEFINE(HAVE_SOL_IPV6)
508 # We'll have to use getprotobyname
512 dnl *****************************
513 dnl *** Checks for SOL_TCP ***
514 dnl *****************************
515 AC_MSG_CHECKING(for SOL_TCP)
516 AC_TRY_COMPILE([#include <netdb.h>], [
521 AC_DEFINE(HAVE_SOL_TCP)
523 # We'll have to use getprotobyname
527 dnl *****************************
528 dnl *** Checks for IP_PKTINFO ***
529 dnl *****************************
530 AC_MSG_CHECKING(for IP_PKTINFO)
531 AC_TRY_COMPILE([#include <netdb.h>], [
532 int level = IP_PKTINFO;
536 AC_DEFINE(HAVE_IP_PKTINFO)
541 dnl *********************************
542 dnl *** Check for struct ip_mreqn ***
543 dnl *********************************
544 AC_MSG_CHECKING(for struct ip_mreqn)
545 AC_TRY_COMPILE([#include <netinet/in.h>], [
546 struct ip_mreqn mreq;
547 mreq.imr_address.s_addr = 0;
551 AC_DEFINE(HAVE_STRUCT_IP_MREQN)
553 # We'll just have to try and use struct ip_mreq
555 AC_MSG_CHECKING(for struct ip_mreq)
556 AC_TRY_COMPILE([#include <netinet/in.h>], [
558 mreq.imr_interface.s_addr = 0;
562 AC_DEFINE(HAVE_STRUCT_IP_MREQ)
564 # No multicast support
569 dnl **********************************
570 dnl *** Check for gethostbyname2_r ***
571 dnl **********************************
572 AC_MSG_CHECKING(for gethostbyname2_r)
573 AC_TRY_LINK([#include <netdb.h>], [
574 gethostbyname2_r(NULL,0,NULL,NULL,0,NULL,NULL);
578 AC_DEFINE(HAVE_GETHOSTBYNAME2_R)
583 dnl *****************************
584 dnl *** Checks for libnsl ***
585 dnl *****************************
586 AC_CHECK_LIB(nsl, gethostbyaddr, LIBS="$LIBS -lnsl")
588 AC_CHECK_FUNCS(inet_pton inet_aton)
590 dnl ***********************************************
591 dnl *** Checks for size of sockaddr_un.sun_path ***
592 dnl ***********************************************
593 # AC_CHECK_SIZEOF can't cope with struct members :-(
594 AC_MSG_CHECKING(size of sockaddr_un.sun_path)
595 AC_CACHE_VAL(cv_mono_sizeof_sunpath,
597 #include <sys/types.h>
602 struct sockaddr_un sock_un;
603 FILE *f=fopen("conftestval", "w");
605 fprintf(f, "%d\n", sizeof(sock_un.sun_path));
608 ], cv_mono_sizeof_sunpath=`cat conftestval`,
609 cv_mono_sizeof_sunpath=0,
610 cv_mono_sizeof_sunpath=0)])dnl
611 AC_MSG_RESULT($cv_mono_sizeof_sunpath)
612 AC_DEFINE_UNQUOTED(MONO_SIZEOF_SUNPATH, $cv_mono_sizeof_sunpath)
614 dnl *************************************
615 dnl *** Checks for zero length arrays ***
616 dnl *************************************
617 AC_MSG_CHECKING(whether $CC supports zero length arrays)
625 AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 0)
628 AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 1)
631 dnl *****************************
632 dnl *** Checks for libxnet ***
633 dnl *****************************
636 AC_MSG_CHECKING(for Solaris XPG4 support)
637 if test -f /usr/lib/libxnet.so; then
638 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
639 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
640 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
647 if test "$GCC" = "yes"; then
648 CFLAGS="$CFLAGS -Wno-char-subscripts"
653 dnl *****************************
654 dnl *** Checks for libpthread ***
655 dnl *****************************
656 AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
657 AC_CHECK_HEADERS(pthread.h)
658 AC_CHECK_FUNCS(pthread_mutex_timedlock)
659 AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np)
660 AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
661 AC_TRY_COMPILE([ #include <pthread.h>], [
662 pthread_mutexattr_t attr;
663 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
668 AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
669 AC_DEFINE(USE_MONO_MUTEX)
671 AC_CHECK_FUNCS(pthread_attr_setstacksize)
673 dnl ***********************************
674 dnl *** Checks for working __thread ***
675 dnl ***********************************
676 AC_MSG_CHECKING(for working __thread)
677 if test "x$with_tls" != "x__thread"; then
678 AC_MSG_RESULT(disabled)
684 static int res1, res2;
686 void thread_main (void *arg)
701 pthread_create (&t1, NULL, thread_main, 1);
702 pthread_create (&t2, NULL, thread_main, 2);
704 pthread_join (t1, NULL);
705 pthread_join (t2, NULL);
707 return !(res1 + res2 == 2);
711 AC_DEFINE(HAVE_KW_THREAD)
717 dnl **************************************
718 dnl *** Checks for working sigaltstack ***
719 dnl **************************************
720 AC_MSG_CHECKING(for working sigaltstack)
721 if test "x$with_sigaltstack" != "xyes"; then
722 AC_MSG_RESULT(disabled)
730 #include <sys/wait.h>
733 sigsegv_signal_handler (int _dummy, siginfo_t *info, void *context)
751 struct sigaltstack sas;
755 sa.sa_sigaction = sigsegv_signal_handler;
756 sigemptyset (&sa.sa_mask);
757 sa.sa_flags = SA_SIGINFO | SA_STACK;
758 if (sigaction (SIGSEGV, &sa, NULL) == -1) {
763 sas.ss_sp = malloc (SIGSTKSZ);
764 sas.ss_size = SIGSTKSZ;
765 sas.ss_flags = SS_ONSTACK;
766 if (sigaltstack (&sas, NULL) == -1) {
771 pthread_attr_init (&attr);
772 if (pthread_create(&id, &attr, loop, &attr) != 0) {
797 for (i = 0; i < 3; ++i) {
799 waitpid (son, &status, WNOHANG);
800 if (WIFEXITED (status) && WEXITSTATUS (status) == 0)
810 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
817 dnl ********************************
818 dnl *** Checks for semaphore lib ***
819 dnl ********************************
820 # 'Real Time' functions on Solaris
821 # posix4 on Solaris 2.6
822 # pthread (first!) on Linux
823 AC_SEARCH_LIBS(sem_init, pthread rt posix4)
825 dnl ********************************
826 dnl *** Checks for timezone stuff **
827 dnl ********************************
828 AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
834 ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
835 if test $ac_cv_struct_tm_gmtoff = yes; then
836 AC_DEFINE(HAVE_TM_GMTOFF)
838 AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
843 ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
844 if test $ac_cv_var_timezone = yes; then
845 AC_DEFINE(HAVE_TIMEZONE)
847 AC_ERROR(unable to find a way to determine timezone)
851 dnl *********************************
852 dnl *** Checks for math functions ***
853 dnl *********************************
855 AC_CHECK_FUNCS(finite, , AC_MSG_CHECKING(for finite in math.h)
856 AC_TRY_LINK([#include <math.h>],
858 AC_DEFINE(HAVE_FINITE) AC_MSG_RESULT(yes),
860 AC_CHECK_FUNCS(isfinite, , AC_MSG_CHECKING(for isfinite in math.h)
861 AC_TRY_LINK([#include <math.h>],
863 AC_DEFINE(HAVE_ISFINITE) AC_MSG_RESULT(yes),
866 dnl ****************************************************************
867 dnl *** Checks for working poll() (macosx defines it but doesn't ***
868 dnl *** have it in the library (duh)) ***
869 dnl ****************************************************************
872 dnl *************************
873 dnl *** Check for signbit ***
874 dnl *************************
875 AC_MSG_CHECKING(for signbit)
876 AC_TRY_LINK([#include <math.h>], [
877 int s = signbit(1.0);
880 AC_DEFINE(HAVE_SIGNBIT)
885 dnl *********************
886 dnl *** Check for AIO ***
887 dnl *********************
888 AC_MSG_CHECKING([for SIGEV_THREAD definition])
889 dnl Some systems (FreeBSD at least) may have aio_read
890 dnl but don't support/define SIGEV_THREAD.
892 #include <sys/signal.h>
894 int x = SIGEV_THREAD;
896 ac_cv_c_sigev_thread=yes
902 if test "$ac_cv_c_sigev_thread" = "yes" ; then
903 AC_CHECK_HEADERS(aio.h sys/aio.h)
904 AC_CHECK_LIB(rt, aio_read, [ LIBS="$LIBS -lrt" ],)
905 SIGVAL_PTR="undefined"
906 if test "$ac_cv_header_aio_h" = "yes" -o "$ac_cv_header_sys_aio_h" = "yes" ; then
907 AC_CHECK_MEMBER(union sigval.sigval_ptr,SIGVAL_PTR="sigval_ptr",, [
908 #include <sys/signal.h>
910 AC_CHECK_MEMBER(union sigval.sival_ptr,SIGVAL_PTR="sival_ptr",, [
911 #include <sys/signal.h>
913 if test "$SIGVAL_PTR" = "undefined" ; then
914 AC_MSG_ERROR([Unable to detect field name in 'union sigval'])
917 AC_DEFINE_UNQUOTED(SIGVAL_PTR,$SIGVAL_PTR,[Pointer field name in 'union sigval'])
921 AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
922 AC_CHECK_LIB(psapi, main, LIBS="$LIBS -lpsapi", AC_ERROR(bad mingw install?))
924 dnl *********************************
925 dnl *** Check for struct ip_mreqn ***
926 dnl *********************************
927 AC_MSG_CHECKING(for struct ip_mreqn)
928 AC_TRY_COMPILE([#include <ws2tcpip.h>], [
929 struct ip_mreqn mreq;
930 mreq.imr_address.s_addr = 0;
934 AC_DEFINE(HAVE_STRUCT_IP_MREQN)
936 # We'll just have to try and use struct ip_mreq
938 AC_MSG_CHECKING(for struct ip_mreq)
939 AC_TRY_COMPILE([#include <ws2tcpip.h>], [
941 mreq.imr_interface.s_addr = 0;
945 AC_DEFINE(HAVE_STRUCT_IP_MREQ)
947 # No multicast support
954 AC_MSG_CHECKING(for socklen_t)
956 #include <sys/types.h>
957 #include <sys/socket.h>
961 ac_cv_c_socklen_t=yes
962 AC_DEFINE(HAVE_SOCKLEN_T)
968 AC_CHECK_FUNCS(trunc, , AC_MSG_CHECKING(for trunc in math.h)
969 # Simply calling trunc (0.0) is no good since gcc will optimize the call away
970 AC_TRY_LINK([#include <math.h>],
971 [ static void *p = &trunc; ],
973 AC_DEFINE(HAVE_TRUNC)
979 if test "x$ac_cv_truncl" != "xyes"; then
980 AC_CHECK_LIB(sunmath, aintl, [ AC_DEFINE(HAVE_AINTL) LIBS="$LIBS -lsunmath"])
983 dnl ****************************
984 dnl *** Look for /dev/random ***
985 dnl ****************************
987 AC_MSG_CHECKING([if usage of random device is requested])
988 AC_ARG_ENABLE(dev-random,
989 [ --disable-dev-random disable the use of the random device],
990 try_dev_random=$enableval, try_dev_random=yes)
991 AC_MSG_RESULT($try_dev_random)
995 NAME_DEV_RANDOM="/dev/srandom"
998 dnl Win32 does not have /dev/random, they have their own method...
1000 *-*-mingw*|*-*-cygwin*)
1001 ac_cv_have_dev_random=no
1004 dnl Everywhere else, it's /dev/random
1007 NAME_DEV_RANDOM="/dev/random"
1011 AC_DEFINE_UNQUOTED(NAME_DEV_RANDOM, "$NAME_DEV_RANDOM")
1013 dnl Now check if the device actually exists
1015 if test "x$try_dev_random" = "xyes"; then
1016 AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
1017 [if test -r "$NAME_DEV_RANDOM" ; then
1018 ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
1019 if test "x$ac_cv_have_dev_random" = "xyes"; then
1020 AC_DEFINE(HAVE_CRYPT_RNG)
1023 AC_MSG_CHECKING(for random device)
1024 ac_cv_have_dev_random=no
1025 AC_MSG_RESULT(has been disabled)
1028 if test "x$platform_win32" = "xyes"; then
1029 AC_DEFINE(HAVE_CRYPT_RNG)
1032 if test "x$ac_cv_have_dev_random" = "xno" \
1033 && test "x$platform_win32" = "xno"; then
1036 *** A system-provided entropy source was not found on this system.
1037 *** Because of this, the System.Security.Cryptography random number generator
1038 *** will throw a NotImplemented exception.
1040 *** If you are seeing this message, and you know your system DOES have an
1041 *** entropy collection in place, please contact <crichton@gimp.org> and
1042 *** provide information about the system and how to access the random device.
1044 *** Otherwise you can install either egd or prngd and set the environment
1045 *** variable MONO_EGD_SOCKET to point to the daemon's socket to use that.
1049 AC_MSG_CHECKING([if inter-process shared handles are requested])
1050 AC_ARG_ENABLE(shared-handles, [ --disable-shared-handles disable inter-process shared handles], try_shared_handles=$enableval, try_shared_handles=yes)
1051 AC_MSG_RESULT($try_shared_handles)
1052 if test "x$try_shared_handles" != "xyes"; then
1053 AC_DEFINE(DISABLE_SHARED_HANDLES)
1054 AC_SUBST(DISABLE_SHARED_HANDLES)
1065 AC_ARG_WITH(icu, [ --with-icu=yes/no],
1066 if test x$with_icu = xno; then
1068 AC_MSG_RESULT(Will not probe for ICU)
1073 AC_PATH_PROG(ICU_CONFIG, icu-config, no)
1074 if test "x$ICU_CONFIG" = "xno" -o ! -x "$ICU_CONFIG"; then
1075 AC_MSG_WARN([Only invariant locale available; install ICU for I18N support])
1076 enable_icu="no, if you want full i18n support download it from: http://oss.software.ibm.com/icu/index.html"
1078 enable_icu="yes. Version: `$ICU_CONFIG --version`"
1080 ICU_CFLAGS=`$ICU_CONFIG --cppflags`
1081 ICU_LIBS=`$ICU_CONFIG --ldflags`
1084 AC_SUBST(ICU_CFLAGS)
1088 ACCESS_UNALIGNED="yes"
1096 # mips-sgi-irix5.* | mips-sgi-irix6.*)
1098 # ACCESS_UNALIGNED="no"
1106 x86_64-*-* | amd64-*-*)
1112 if test "x$ac_cv_sizeof_void_p" = "x8"; then
1119 ACCESS_UNALIGNED="no"
1124 alpha*-*-linux* | alpha*-*-osf*)
1126 ACCESS_UNALIGNED="no"
1130 # ia64-*-linux* | ia64-*-hpux*)
1134 # ACCESS_UNALIGNED="no";
1135 # case "$host_os" in
1136 # linux*) LIBC="libc.so.6.1";;
1137 # hpux*) LIBC="libc.so.1";;
1143 hppa2.0w-hp-hpux11.00 | hppa64-hp-hpux11.00)
1147 ACCESS_UNALIGNED="no"
1152 ACCESS_UNALIGNED="no"
1154 macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | \
1155 powerpc-*-sysv* | powerpc-*-darwin*)
1161 arm-*-linux-* | armv4l-*-linux-*)
1164 ACCESS_UNALIGNED="no"
1169 ACCESS_UNALIGNED="no"
1174 AC_ARG_WITH(jit, [ --with-jit=yes,no If you want to build scripts that default to the JIT],[
1179 if test x$JIT_SUPPORTED = xyes; then
1180 if $jit_wanted; then
1182 jit_status="Building and using the JIT"
1184 jit_status="Building the JIT, defaulting to the interpreter"
1187 jit_status="interpreter"
1190 AM_CONDITIONAL(USE_JIT, test x$USEJIT = xtrue)
1198 INTL="libintl.dylib"
1207 if test ${TARGET} = ARM; then
1208 dnl ******************************************
1209 dnl *** Check to see what FPU is available ***
1210 dnl ******************************************
1211 AC_MSG_CHECKING(which FPU to use)
1213 AC_TRY_COMPILE([], [
1214 __asm__ ("ldfd f0, [r0]");
1216 AC_TRY_COMPILE([], [
1217 __asm__ ("fldd d0, [r0]");
1218 ], fpu=VFP, fpu=NONE)
1222 CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu"
1226 if test ${TARGET} = unknown; then
1227 CPPFLAGS="$CPPFLAGS -DNO_PORT"
1228 AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
1231 if test ${ACCESS_UNALIGNED} = no; then
1232 CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
1236 AC_ARG_WITH(preview, [ --with-preview=yes,no If you want to install the 2.0 FX preview],[
1237 if test x$with_preview = xyes; then
1242 AM_CONDITIONAL(INSTALL_2_0, test x$PREVIEW = xyes)
1244 AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
1245 AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
1246 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
1247 AM_CONDITIONAL(SPARC64, test x$TARGET = xSPARC64)
1248 AM_CONDITIONAL(X86, test x$TARGET = xX86)
1249 AM_CONDITIONAL(AMD64, test x$TARGET = xAMD64)
1250 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
1251 AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
1252 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
1253 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
1254 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
1255 AM_CONDITIONAL(S390, test x$TARGET = xS390)
1256 AM_CONDITIONAL(HPPA, test x$TARGET = xHPPA)
1258 AM_CONDITIONAL(JIT_SUPPORTED, test x$JIT_SUPPORTED = xyes)
1263 AC_SUBST(arch_target)
1274 mono/metadata/Makefile
1279 mono/os/win32/Makefile
1280 mono/os/unix/Makefile
1281 mono/arch/x86/Makefile
1282 mono/arch/amd64/Makefile
1283 mono/arch/hppa/Makefile
1284 mono/arch/ppc/Makefile
1285 mono/arch/sparc/Makefile
1286 mono/arch/s390/Makefile
1287 mono/arch/arm/Makefile
1288 mono/arch/alpha/Makefile
1289 mono/interpreter/Makefile
1291 mono/tests/tests-config
1292 mono/benchmark/Makefile
1293 mono/monoburg/Makefile
1294 mono/monograph/Makefile
1295 mono/io-layer/Makefile
1296 mono/handles/Makefile
1298 mono/profiler/Makefile
1301 runtime/net_1_1/Makefile
1302 runtime/net_2_0/Makefile
1313 tools/locale-builder/Makefile
1321 SIGALTSTACK: $with_sigaltstack
1324 JNI support: $jdk_headers_found