3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(mono,0.97)
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 # This is misnamed: __thread support has no relation to NPTL,
252 # but people already use it...
253 AC_ARG_WITH(nptl, [ --with-nptl=yes,no enable/disable support for __thread support],[],[with_nptl=yes])
255 # Enable support for using sigaltstack for SIGSEGV and stack overflow handling
256 # This does not work on some platforms (bug #55253)
257 AC_ARG_WITH(sigaltstack, [ --with-sigaltstack=yes,no enable/disable support for sigaltstack],[],[with_sigaltstack=no])
259 # assembly bundle support, see metadata/make-bundle.pl for more info
260 AC_ARG_WITH(bundle, [ --with-bundle=bundle_template],[
261 BUNDLE_FILE=$with_bundle
262 AC_SUBST(BUNDLE_FILE)
263 AC_DEFINE(WITH_BUNDLE)
265 AM_CONDITIONAL(WITH_BUNDLE, test x$with_bundle != xno)
272 AC_CHECK_HEADERS(gc.h gc/gc.h, gc_headers=yes)
273 AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
275 if test "x$found_boehm" != "xyes"; then
276 AC_MSG_ERROR("GC requested but libgc not found! Install libgc or run configure with --with-gc=none.")
278 if test "x$gc_headers" != "xyes"; then
279 AC_MSG_ERROR("GC requested but header files not found! You may need to install them by hand.")
282 AC_DEFINE(HAVE_BOEHM_GC)
283 AC_SUBST(HAVE_BOEHM_GC)
284 LIBGC_LIBS="-lgc $libdl"
286 # AC_CHECK_FUNCS does not work for some reason...
287 AC_CHECK_LIB(gc, GC_gcj_malloc, found_gcj_malloc="yes",,$libdl)
288 if test "x$found_gcj_malloc" = "xyes"; then
289 AC_DEFINE(HAVE_GC_GCJ_MALLOC)
291 AC_CHECK_LIB(gc, GC_enable, found_gc_enable="yes",,$libdl)
292 if test "x$found_gc_enable" = "xyes"; then
293 AC_DEFINE(HAVE_GC_ENABLE)
298 AC_CONFIG_SUBDIRS(libgc)
305 LIBGC_CFLAGS='-I$(top_srcdir)/libgc/include'
306 LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
308 AC_DEFINE(HAVE_BOEHM_GC)
309 AC_SUBST(HAVE_BOEHM_GC)
312 AC_DEFINE(USE_INCLUDED_LIBGC)
314 # The included libgc contains GCJ support
315 AC_DEFINE(HAVE_GC_GCJ_MALLOC)
316 AC_DEFINE(HAVE_GC_ENABLE)
320 AC_MSG_WARN("Compiling mono without GC.")
323 AC_MSG_ERROR([Invalid argument to --with-gc.])
328 # tell libgc/configure about what we want
329 ac_configure_args="$ac_configure_args --disable-embed-check --with-libgc-threads=$libgc_threads"
331 AM_CONDITIONAL(INCLUDED_LIBGC, test x$use_included_gc = xyes)
332 AC_SUBST(LIBGC_CFLAGS)
337 dnl End of libgc checks
340 if test x$platform_win32 = xno; then
342 dnl ******************************************************************
343 dnl *** Checks for the IKVM JNI interface library ***
344 dnl ******************************************************************
345 AC_ARG_WITH(ikvm-jni, [ --with-ikvm-jni=yes,no build the IKVM JNI interface library],[with_ikvm_jni=$withval],[with_ikvm_jni=yes])
346 AC_ARG_WITH(jdk, [ --with-jdk=DIRECTORY Use JDK from DIRECTORY],[with_jdk_dir=$withval],[with_jdk_dir=])
349 if test x$with_ikvm_jni = xyes; then
350 AC_MSG_CHECKING([JDK headers])
352 if test x$with_jdk_dir = x; then
353 # Try JAVA_HOME variable
354 if test x$JAVA_HOME != x; then
355 with_jdk_dir=$JAVA_HOME
360 if test -d $with_jdk_dir/include; then
361 jdk_headers_found=yes
363 if test -d $with_jdk_dir/include/linux; then
366 if test -d $with_jdk_dir/include/solaris; then
369 if test -f $with_jdk_dir/include/jni_md.h; then
370 # GNU Classpath sources
381 if test x$jdk_headers_found = xyes; then
382 AC_MSG_RESULT($with_jdk_dir/include $with_jdk_dir/include/$jdk_platform)
384 AC_MSG_RESULT(not found)
387 if test x$jdk_headers_found = xyes; then
388 ikvm_jni_dir=ikvm-jni
389 IKVM_JNI_CFLAGS="-I$with_jdk_dir/include -I$with_jdk_dir/include/$jdk_platform"
393 AC_SUBST(ikvm_jni_dir)
394 AC_SUBST(IKVM_JNI_CFLAGS)
396 AC_CHECK_FUNCS(getgrgid_r)
397 AC_CHECK_FUNCS(getgrnam_r)
398 AC_CHECK_FUNCS(getpwnam_r)
399 AC_CHECK_FUNCS(getpwuid_r)
400 AC_CHECK_FUNCS(getresuid)
401 AC_CHECK_FUNCS(setresuid)
403 dnl ******************************************************************
404 dnl *** Check for large file support ***
405 dnl *** (If we were using autoconf 2.50 we'd use AC_SYS_LARGEFILE) ***
406 dnl ******************************************************************
408 # Check that off_t can represent 2**63 - 1 correctly, working around
409 # potential compiler bugs. Defines LARGE_FILE_SUPPORT, adds $1 to
410 # CPPFLAGS and sets $large_offt to yes if the test succeeds
412 AC_DEFUN(LARGE_FILES, [
413 large_CPPFLAGS=$CPPFLAGS
414 CPPFLAGS="$CPPFLAGS $1"
416 #include <sys/types.h>
418 #define BIG_OFF_T (((off_t)1<<62)-1+((off_t)1<<62))
421 int big_off_t=((BIG_OFF_T%2147483629==721) &&
422 (BIG_OFF_T%2147483647==1));
431 AC_DEFINE(HAVE_LARGE_FILE_SUPPORT)
432 large_CPPFLAGS="$large_CPPFLAGS $1"
437 CPPFLAGS=$large_CPPFLAGS
440 AC_MSG_CHECKING(if off_t is 64 bits wide)
442 if test $large_offt = no; then
443 AC_MSG_CHECKING(if _FILE_OFFSET_BITS=64 gives 64 bit off_t)
444 LARGE_FILES("-D_FILE_OFFSET_BITS=64")
446 if test $large_offt = no; then
447 AC_MSG_WARN([No 64 bit file size support available])
450 dnl *****************************
451 dnl *** Checks for libsocket ***
452 dnl *****************************
453 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
455 dnl *******************************
456 dnl *** Checks for MSG_NOSIGNAL ***
457 dnl *******************************
458 AC_MSG_CHECKING(for MSG_NOSIGNAL)
459 AC_TRY_COMPILE([#include <sys/socket.h>], [
460 int f = MSG_NOSIGNAL;
464 AC_DEFINE(HAVE_MSG_NOSIGNAL)
466 # We'll have to use signals
470 dnl *****************************
471 dnl *** Checks for SOL_IP ***
472 dnl *****************************
473 AC_MSG_CHECKING(for SOL_IP)
474 AC_TRY_COMPILE([#include <netdb.h>], [
479 AC_DEFINE(HAVE_SOL_IP)
481 # We'll have to use getprotobyname
485 dnl *****************************
486 dnl *** Checks for SOL_IPV6 ***
487 dnl *****************************
488 AC_MSG_CHECKING(for SOL_IPV6)
489 AC_TRY_COMPILE([#include <netdb.h>], [
490 int level = SOL_IPV6;
494 AC_DEFINE(HAVE_SOL_IPV6)
496 # We'll have to use getprotobyname
500 dnl *****************************
501 dnl *** Checks for SOL_TCP ***
502 dnl *****************************
503 AC_MSG_CHECKING(for SOL_TCP)
504 AC_TRY_COMPILE([#include <netdb.h>], [
509 AC_DEFINE(HAVE_SOL_TCP)
511 # We'll have to use getprotobyname
515 dnl *****************************
516 dnl *** Checks for IP_PKTINFO ***
517 dnl *****************************
518 AC_MSG_CHECKING(for IP_PKTINFO)
519 AC_TRY_COMPILE([#include <netdb.h>], [
520 int level = IP_PKTINFO;
524 AC_DEFINE(HAVE_IP_PKTINFO)
529 dnl *********************************
530 dnl *** Check for struct ip_mreqn ***
531 dnl *********************************
532 AC_MSG_CHECKING(for struct ip_mreqn)
533 AC_TRY_COMPILE([#include <netinet/in.h>], [
534 struct ip_mreqn mreq;
535 mreq.imr_address.s_addr = 0;
539 AC_DEFINE(HAVE_STRUCT_IP_MREQN)
541 # We'll just have to try and use struct ip_mreq
543 AC_MSG_CHECKING(for struct ip_mreq)
544 AC_TRY_COMPILE([#include <netinet/in.h>], [
546 mreq.imr_interface.s_addr = 0;
550 AC_DEFINE(HAVE_STRUCT_IP_MREQ)
552 # No multicast support
557 dnl **********************************
558 dnl *** Check for gethostbyname2_r ***
559 dnl **********************************
560 AC_MSG_CHECKING(for gethostbyname2_r)
561 AC_TRY_LINK([#include <netdb.h>], [
562 gethostbyname2_r(NULL,0,NULL,NULL,0,NULL,NULL);
566 AC_DEFINE(HAVE_GETHOSTBYNAME2_R)
571 dnl *****************************
572 dnl *** Checks for libnsl ***
573 dnl *****************************
574 AC_CHECK_LIB(nsl, gethostbyaddr, LIBS="$LIBS -lnsl")
576 AC_CHECK_FUNCS(inet_pton inet_aton)
578 dnl ***********************************************
579 dnl *** Checks for size of sockaddr_un.sun_path ***
580 dnl ***********************************************
581 # AC_CHECK_SIZEOF can't cope with struct members :-(
582 AC_MSG_CHECKING(size of sockaddr_un.sun_path)
583 AC_CACHE_VAL(cv_mono_sizeof_sunpath,
585 #include <sys/types.h>
590 struct sockaddr_un sock_un;
591 FILE *f=fopen("conftestval", "w");
593 fprintf(f, "%d\n", sizeof(sock_un.sun_path));
596 ], cv_mono_sizeof_sunpath=`cat conftestval`,
597 cv_mono_sizeof_sunpath=0,
598 cv_mono_sizeof_sunpath=0)])dnl
599 AC_MSG_RESULT($cv_mono_sizeof_sunpath)
600 AC_DEFINE_UNQUOTED(MONO_SIZEOF_SUNPATH, $cv_mono_sizeof_sunpath)
602 dnl *************************************
603 dnl *** Checks for zero length arrays ***
604 dnl *************************************
605 AC_MSG_CHECKING(whether $CC supports zero length arrays)
613 AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 0)
616 AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 1)
619 dnl *****************************
620 dnl *** Checks for libxnet ***
621 dnl *****************************
624 AC_MSG_CHECKING(for Solaris XPG4 support)
625 if test -f /usr/lib/libxnet.so; then
626 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
627 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
628 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
635 if test "$GCC" = "yes"; then
636 CFLAGS="$CFLAGS -Wno-char-subscripts"
641 dnl *****************************
642 dnl *** Checks for libpthread ***
643 dnl *****************************
644 AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
645 AC_CHECK_HEADERS(pthread.h)
646 AC_CHECK_FUNCS(pthread_mutex_timedlock)
647 AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np)
648 AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
649 AC_TRY_COMPILE([ #include <pthread.h>], [
650 pthread_mutexattr_t attr;
651 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
656 AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
657 AC_DEFINE(USE_MONO_MUTEX)
659 AC_CHECK_FUNCS(pthread_attr_setstacksize)
661 dnl ***********************************
662 dnl *** Checks for working __thread ***
663 dnl ***********************************
664 AC_MSG_CHECKING(for working __thread)
665 if test "x$with_nptl" != "xyes"; then
666 AC_MSG_RESULT(disabled)
672 static int res1, res2;
674 void thread_main (void *arg)
689 pthread_create (&t1, NULL, thread_main, 1);
690 pthread_create (&t2, NULL, thread_main, 2);
692 pthread_join (t1, NULL);
693 pthread_join (t2, NULL);
695 return !(res1 + res2 == 2);
699 AC_DEFINE(HAVE_KW_THREAD)
705 dnl **************************************
706 dnl *** Checks for working sigaltstack ***
707 dnl **************************************
708 AC_MSG_CHECKING(for working sigaltstack)
709 if test "x$with_sigaltstack" != "xyes"; then
710 AC_MSG_RESULT(disabled)
718 #include <sys/wait.h>
721 sigsegv_signal_handler (int _dummy, siginfo_t *info, void *context)
739 struct sigaltstack sas;
743 sa.sa_sigaction = sigsegv_signal_handler;
744 sigemptyset (&sa.sa_mask);
745 sa.sa_flags = SA_SIGINFO | SA_STACK;
746 if (sigaction (SIGSEGV, &sa, NULL) == -1) {
751 sas.ss_sp = malloc (SIGSTKSZ);
752 sas.ss_size = SIGSTKSZ;
753 sas.ss_flags = SS_ONSTACK;
754 if (sigaltstack (&sas, NULL) == -1) {
759 pthread_attr_init (&attr);
760 if (pthread_create(&id, &attr, loop, &attr) != 0) {
785 for (i = 0; i < 3; ++i) {
787 waitpid (son, &status, WNOHANG);
788 if (WIFEXITED (status) && WEXITSTATUS (status) == 0)
798 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
805 dnl ********************************
806 dnl *** Checks for semaphore lib ***
807 dnl ********************************
808 # 'Real Time' functions on Solaris
809 # posix4 on Solaris 2.6
810 # pthread (first!) on Linux
811 AC_SEARCH_LIBS(sem_init, pthread rt posix4)
813 dnl ********************************
814 dnl *** Checks for timezone stuff **
815 dnl ********************************
816 AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
822 ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
823 if test $ac_cv_struct_tm_gmtoff = yes; then
824 AC_DEFINE(HAVE_TM_GMTOFF)
826 AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
831 ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
832 if test $ac_cv_var_timezone = yes; then
833 AC_DEFINE(HAVE_TIMEZONE)
835 AC_ERROR(unable to find a way to determine timezone)
839 dnl *********************************
840 dnl *** Checks for math functions ***
841 dnl *********************************
843 AC_CHECK_FUNCS(finite, , AC_MSG_CHECKING(for finite in math.h)
844 AC_TRY_LINK([#include <math.h>],
846 AC_DEFINE(HAVE_FINITE) AC_MSG_RESULT(yes),
848 AC_CHECK_FUNCS(isfinite, , AC_MSG_CHECKING(for isfinite in math.h)
849 AC_TRY_LINK([#include <math.h>],
851 AC_DEFINE(HAVE_ISFINITE) AC_MSG_RESULT(yes),
854 dnl ****************************************************************
855 dnl *** Checks for working poll() (macosx defines it but doesn't ***
856 dnl *** have it in the library (duh)) ***
857 dnl ****************************************************************
860 dnl *************************
861 dnl *** Check for signbit ***
862 dnl *************************
863 AC_MSG_CHECKING(for signbit)
864 AC_TRY_LINK([#include <math.h>], [
865 int s = signbit(1.0);
868 AC_DEFINE(HAVE_SIGNBIT)
873 dnl *********************
874 dnl *** Check for AIO ***
875 dnl *********************
876 AC_MSG_CHECKING([for SIGEV_THREAD definition])
877 dnl Some systems (FreeBSD at least) may have aio_read
878 dnl but don't support/define SIGEV_THREAD.
880 #include <sys/signal.h>
882 int x = SIGEV_THREAD;
884 ac_cv_c_sigev_thread=yes
890 if test "$ac_cv_c_sigev_thread" = "yes" ; then
891 AC_CHECK_HEADERS(aio.h sys/aio.h)
892 AC_CHECK_LIB(rt, aio_read, [ LIBS="$LIBS -lrt" ],)
893 SIGVAL_PTR="undefined"
894 if test "$ac_cv_header_aio_h" = "yes" -o "$ac_cv_header_sys_aio_h" = "yes" ; then
895 AC_CHECK_MEMBER(union sigval.sigval_ptr,SIGVAL_PTR="sigval_ptr",, [
896 #include <sys/signal.h>
898 AC_CHECK_MEMBER(union sigval.sival_ptr,SIGVAL_PTR="sival_ptr",, [
899 #include <sys/signal.h>
901 if test "$SIGVAL_PTR" = "undefined" ; then
902 AC_MSG_ERROR([Unable to detect field name in 'union sigval'])
905 AC_DEFINE_UNQUOTED(SIGVAL_PTR,$SIGVAL_PTR,[Pointer field name in 'union sigval'])
909 AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
910 AC_CHECK_LIB(psapi, main, LIBS="$LIBS -lpsapi", AC_ERROR(bad mingw install?))
912 dnl *********************************
913 dnl *** Check for struct ip_mreqn ***
914 dnl *********************************
915 AC_MSG_CHECKING(for struct ip_mreqn)
916 AC_TRY_COMPILE([#include <ws2tcpip.h>], [
917 struct ip_mreqn mreq;
918 mreq.imr_address.s_addr = 0;
922 AC_DEFINE(HAVE_STRUCT_IP_MREQN)
924 # We'll just have to try and use struct ip_mreq
926 AC_MSG_CHECKING(for struct ip_mreq)
927 AC_TRY_COMPILE([#include <ws2tcpip.h>], [
929 mreq.imr_interface.s_addr = 0;
933 AC_DEFINE(HAVE_STRUCT_IP_MREQ)
935 # No multicast support
942 AC_MSG_CHECKING(for socklen_t)
944 #include <sys/types.h>
945 #include <sys/socket.h>
949 ac_cv_c_socklen_t=yes
950 AC_DEFINE(HAVE_SOCKLEN_T)
956 AC_CHECK_FUNCS(trunc, , AC_MSG_CHECKING(for trunc in math.h)
957 AC_TRY_LINK([#include <math.h>],
960 AC_DEFINE(HAVE_TRUNC)
966 if test "x$ac_cv_truncl" != "xyes"; then
967 AC_CHECK_LIB(sunmath, aintl, [ AC_DEFINE(HAVE_AINTL) LIBS="$LIBS -lsunmath"])
970 dnl ****************************
971 dnl *** Look for /dev/random ***
972 dnl ****************************
974 AC_MSG_CHECKING([if usage of random device is requested])
975 AC_ARG_ENABLE(dev-random,
976 [ --disable-dev-random disable the use of the random device],
977 try_dev_random=$enableval, try_dev_random=yes)
978 AC_MSG_RESULT($try_dev_random)
982 NAME_DEV_RANDOM="/dev/srandom"
985 dnl Win32 does not have /dev/random, they have their own method...
987 *-*-mingw*|*-*-cygwin*)
988 ac_cv_have_dev_random=no
991 dnl Everywhere else, it's /dev/random
994 NAME_DEV_RANDOM="/dev/random"
998 AC_DEFINE_UNQUOTED(NAME_DEV_RANDOM, "$NAME_DEV_RANDOM")
1000 dnl Now check if the device actually exists
1002 if test "x$try_dev_random" = "xyes"; then
1003 AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
1004 [if test -r "$NAME_DEV_RANDOM" ; then
1005 ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
1006 if test "x$ac_cv_have_dev_random" = "xyes"; then
1007 AC_DEFINE(HAVE_CRYPT_RNG)
1010 AC_MSG_CHECKING(for random device)
1011 ac_cv_have_dev_random=no
1012 AC_MSG_RESULT(has been disabled)
1015 if test "x$platform_win32" = "xyes"; then
1016 AC_DEFINE(HAVE_CRYPT_RNG)
1019 if test "x$ac_cv_have_dev_random" = "xno" \
1020 && test "x$platform_win32" = "xno"; then
1023 *** A system-provided entropy source was not found on this system.
1024 *** Because of this, the System.Security.Cryptography random number generator
1025 *** will throw a NotImplemented exception.
1027 *** If you are seeing this message, and you know your system DOES have an
1028 *** entropy collection in place, please contact <crichton@gimp.org> and
1029 *** provide information about the system and how to access the random device.
1031 *** Otherwise you can install either egd or prngd and set the environment
1032 *** variable MONO_EGD_SOCKET to point to the daemon's socket to use that.
1036 AC_MSG_CHECKING([if inter-process shared handles are requested])
1037 AC_ARG_ENABLE(shared-handles, [ --disable-shared-handles disable inter-process shared handles], try_shared_handles=$enableval, try_shared_handles=yes)
1038 AC_MSG_RESULT($try_shared_handles)
1039 if test "x$try_shared_handles" != "xyes"; then
1040 AC_DEFINE(DISABLE_SHARED_HANDLES)
1041 AC_SUBST(DISABLE_SHARED_HANDLES)
1052 AC_ARG_WITH(icu, [ --with-icu=yes/no],
1053 if test x$with_icu = xno; then
1055 AC_MSG_RESULT(Will not probe for ICU)
1060 AC_PATH_PROG(ICU_CONFIG, icu-config, no)
1061 if test "x$ICU_CONFIG" = "xno" -o ! -x "$ICU_CONFIG"; then
1062 AC_MSG_WARN([Only invariant locale available; install ICU for I18N support])
1063 enable_icu="no, if you want full i18n support download it from: http://oss.software.ibm.com/icu/index.html"
1065 enable_icu="yes. Version: `$ICU_CONFIG --version`"
1067 ICU_CFLAGS=`$ICU_CONFIG --cppflags`
1068 ICU_LIBS=`$ICU_CONFIG --ldflags`
1071 AC_SUBST(ICU_CFLAGS)
1075 ACCESS_UNALIGNED="yes"
1083 # mips-sgi-irix5.* | mips-sgi-irix6.*)
1085 # ACCESS_UNALIGNED="no"
1093 x86_64-*-* | amd64-*-*)
1102 ACCESS_UNALIGNED="no"
1107 alpha*-*-linux* | alpha*-*-osf*)
1109 ACCESS_UNALIGNED="no"
1113 # ia64-*-linux* | ia64-*-hpux*)
1117 # ACCESS_UNALIGNED="no";
1118 # case "$host_os" in
1119 # linux*) LIBC="libc.so.6.1";;
1120 # hpux*) LIBC="libc.so.1";;
1126 hppa2.0w-hp-hpux11.00 | hppa64-hp-hpux11.00)
1130 ACCESS_UNALIGNED="no"
1135 ACCESS_UNALIGNED="no"
1137 macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | \
1138 powerpc-*-sysv* | powerpc-*-darwin*)
1144 arm-*-linux-* | armv4l-*-linux-*)
1147 ACCESS_UNALIGNED="no"
1152 ACCESS_UNALIGNED="no"
1157 AC_ARG_WITH(jit, [ --with-jit=yes,no If you want to build scripts that default to the JIT],[
1162 if test x$JIT_SUPPORTED = xyes; then
1163 if $jit_wanted; then
1165 jit_status="Building and using the JIT"
1167 jit_status="Building the JIT, defaulting to the interpreter"
1170 jit_status="interpreter"
1173 AM_CONDITIONAL(USE_JIT, test x$USEJIT = xtrue)
1181 INTL="libintl.dylib"
1189 if test ${TARGET} = ARM; then
1190 dnl ******************************************
1191 dnl *** Check to see what FPU is available ***
1192 dnl ******************************************
1193 AC_MSG_CHECKING(which FPU to use)
1195 AC_TRY_COMPILE([], [
1196 __asm__ ("ldfd f0, [r0]");
1198 AC_TRY_COMPILE([], [
1199 __asm__ ("fldd d0, [r0]");
1200 ], fpu=VFP, fpu=NONE)
1204 CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu"
1208 if test ${TARGET} = unknown; then
1209 CPPFLAGS="$CPPFLAGS -DNO_PORT"
1210 AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
1213 if test ${ACCESS_UNALIGNED} = no; then
1214 CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
1218 AC_ARG_WITH(preview, [ --with-preview=yes,no If you want to install the 2.0 FX preview],[
1219 if test x$with_preview = xyes; then
1224 AM_CONDITIONAL(INSTALL_2_0, test x$PREVIEW = xyes)
1226 AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
1227 AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
1228 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
1229 AM_CONDITIONAL(X86, test x$TARGET = xX86)
1230 AM_CONDITIONAL(AMD64, test x$TARGET = xAMD64)
1231 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
1232 AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
1233 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
1234 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
1235 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
1236 AM_CONDITIONAL(S390, test x$TARGET = xS390)
1237 AM_CONDITIONAL(HPPA, test x$TARGET = xHPPA)
1239 AM_CONDITIONAL(JIT_SUPPORTED, test x$JIT_SUPPORTED = xyes)
1244 AC_SUBST(arch_target)
1255 mono/metadata/Makefile
1260 mono/os/win32/Makefile
1261 mono/os/unix/Makefile
1262 mono/arch/x86/Makefile
1263 mono/arch/amd64/Makefile
1264 mono/arch/hppa/Makefile
1265 mono/arch/ppc/Makefile
1266 mono/arch/sparc/Makefile
1267 mono/arch/s390/Makefile
1268 mono/arch/arm/Makefile
1269 mono/arch/alpha/Makefile
1270 mono/interpreter/Makefile
1272 mono/tests/tests-config
1273 mono/benchmark/Makefile
1274 mono/monoburg/Makefile
1275 mono/monograph/Makefile
1276 mono/io-layer/Makefile
1277 mono/handles/Makefile
1279 mono/profiler/Makefile
1282 runtime/net_1_1/Makefile
1283 runtime/net_2_0/Makefile
1294 tools/locale-builder/Makefile
1301 __thread: $with_nptl
1302 SIGALTSTACK: $with_sigaltstack
1305 JNI support: $jdk_headers_found