3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(mono,0.91.99)
15 if test -d $srcdir/libgc ; then
22 # These are the flags that need to be stored in the mono.pc file for
23 # compiling code that will embed Mono
27 AC_SUBST(libmono_cflags)
28 AC_SUBST(libmono_ldflags)
30 dnl if linker handles the version script
33 # Set to yes if Unix sockets cannot be created in an anonymous namespace
36 # Thread configuration inspired by sleepycat's db
37 AC_MSG_CHECKING([host platform characteristics])
40 *-*-mingw*|*-*-cygwin*)
42 AC_DEFINE(PLATFORM_WIN32,1,[Platform is Win32])
45 # latest libgc already defines GC_WIN32_THREADS
46 # CPPFLAGS="$CPPFLAGS -DGC_WIN32_THREADS -DWIN32_THREADS"
47 CPPFLAGS="$CPPFLAGS -DWIN32_THREADS"
54 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
55 libmono_cflags="-D_REENTRANT"
56 LDFLAGS="$LDFLAGS -pthread"
57 libmono_ldflags="-pthread"
62 *-*-*freebsd*|*-*-*openbsd*)
64 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS"
65 libmono_cflags="-D_THREAD_SAFE"
66 LDFLAGS="$LDFLAGS -pthread"
67 libmono_ldflags="-pthread"
69 AC_DEFINE(PTHREAD_POINTER_ID)
71 libgc_threads=pthreads
75 CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -DMONO_USE_EXC_TABLES -D_GNU_SOURCE -D_REENTRANT -fexceptions"
76 libmono_cflags="-DMONO_USE_EXC_TABLES -fexceptions -D_REENTRANT"
77 libmono_ldflags="-lpthread"
79 libgc_threads=pthreads
83 CPPFLAGS="$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT"
84 CFLAGS="$CFLAGS +ESdbgasm"
86 libmono_cflags="-D_REENTRANT"
87 libmono_ldflags="-lpthread"
88 libgc_threads=pthreads
93 CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT"
95 libmono_cflags="-D_REENTRANT"
96 libgc_threads=pthreads
100 CPPFLAGS="$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS"
101 libmono_cflags="-D_THREAD_SAFE"
102 LDFLAGS="$LDFLAGS -pthread"
103 libmono_ldflags="-pthread"
105 AC_DEFINE(PTHREAD_POINTER_ID)
106 AC_DEFINE(USE_MACH_SEMA)
107 no_version_script=yes
113 AC_MSG_WARN([*** Please add $host to configure.in checks!])
120 if test x$need_link_unlink = xyes; then
121 AC_DEFINE(NEED_LINK_UNLINK, 1, [Define if Unix sockets cannot be created in an anonymous namespace])
124 AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
126 AC_CHECK_TOOL(CC, gcc, gcc)
130 dnl We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
132 # Set ASFLAGS if not already set.
133 : ${CCASFLAGS='$(CFLAGS)'}
137 AC_CHECK_PROG(BISON, bison,yes,no)
138 if test "x$BISON" = "xno";
140 AC_MSG_ERROR([You need to install bison])
143 dnl may require a specific autoconf version
144 dnl AC_PROG_CC_FOR_BUILD
145 dnl CC_FOR_BUILD not automatically detected
148 if test "x$cross_compiling" = "xyes"; then
152 AC_SUBST(CC_FOR_BUILD)
154 AC_SUBST(BUILD_EXEEXT)
161 # Test whenever ld supports -version-script
164 if test "x$lt_cv_prog_gnu_ld" = "xno"; then
165 no_version_script=yes
168 AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
170 AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h sys/un.h)
172 # for mono/mini/tramp-x86.c
173 AC_CHECK_HEADERS(valgrind/memcheck.h)
175 # for mono/metadata/debug-symfile.c
176 AC_CHECK_HEADERS(elf.h)
179 AC_CHECK_HEADERS(wchar.h)
181 # not 64 bit clean in cross-compile
182 AC_CHECK_SIZEOF(void *, 4)
185 if test x"$GCC" = xyes; then
186 WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings'
187 # The runtime code does not respect ANSI C strict aliasing rules
188 CFLAGS="$CFLAGS -fno-strict-aliasing"
190 # The Sun Forte compiler complains about inline functions that access static variables
191 # so disable all inlining.
194 CFLAGS="$CFLAGS -Dinline="
198 CFLAGS="$CFLAGS -g $WARN"
200 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
201 if test "x$PKG_CONFIG" = "xno"; then
202 AC_MSG_ERROR([You need to install pkg-config])
205 dnl for use on the build system
206 dnl pkg-config is stupid
207 BUILD_GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
208 BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
209 AC_SUBST(BUILD_GLIB_CFLAGS)
210 AC_SUBST(BUILD_GLIB_LIBS)
213 AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir],
214 if test x$with_crosspkgdir = "x"; then
215 if test -s $PKG_CONFIG_PATH; then
216 PKG_PATH=$PKG_CONFIG_PATH
219 PKG_PATH=$with_crosspkgdir
220 PKG_CONFIG_PATH=$PKG_PATH
221 export PKG_CONFIG_PATH
225 ## Versions of dependencies
226 GLIB_REQUIRED_VERSION=1.3.11
228 PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION)
230 GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
231 GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
232 GMODULE_CFLAGS=`$PKG_CONFIG --cflags gmodule-2.0`
233 GMODULE_LIBS=`$PKG_CONFIG --libs gmodule-2.0`
235 AC_SUBST(GLIB_CFLAGS)
237 AC_SUBST(GMODULE_CFLAGS)
238 AC_SUBST(GMODULE_LIBS)
240 AC_ARG_WITH(gc, [ --with-gc=boehm,included,none],[gc=$with_gc],[gc=$gc_default])
242 # Enable support for NPTL only features like fast thread-local storage
243 # We can't reliably detect nptl at compile & run time
244 # so this option will stay until nptl becomes more widespread
245 AC_ARG_WITH(nptl, [ --with-nptl=yes,no enable/disable support for NPTL],[],[with_nptl=yes])
247 # Enable support for using sigaltstack for SIGSEGV and stack overflow handling
248 # This does not work on some platforms (bug #55253)
249 AC_ARG_WITH(sigaltstack, [ --with-sigaltstack=yes,no enable/disable support for sigaltstack],[],[with_sigaltstack=yes])
251 # assembly bundle support, see metadata/make-bundle.pl for more info
252 AC_ARG_WITH(bundle, [ --with-bundle=bundle_template],[
253 BUNDLE_FILE=$with_bundle
254 AC_SUBST(BUNDLE_FILE)
255 AC_DEFINE(WITH_BUNDLE)
257 AM_CONDITIONAL(WITH_BUNDLE, test x$with_bundle != xno)
264 AC_CHECK_HEADERS(gc.h gc/gc.h, gc_headers=yes)
265 AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
267 if test "x$found_boehm" != "xyes"; then
268 AC_MSG_ERROR("GC requested but libgc not found! Install libgc or run configure with --with-gc=none.")
270 if test "x$gc_headers" != "xyes"; then
271 AC_MSG_ERROR("GC requested but header files not found! You may need to install them by hand.")
274 AC_DEFINE(HAVE_BOEHM_GC)
275 AC_SUBST(HAVE_BOEHM_GC)
276 LIBGC_LIBS="-lgc $libdl"
278 # AC_CHECK_FUNCS does not work for some reason...
279 AC_CHECK_LIB(gc, GC_gcj_malloc, found_gcj_malloc="yes",,$libdl)
280 if test "x$found_gcj_malloc" = "xyes"; then
281 AC_DEFINE(HAVE_GC_GCJ_MALLOC)
283 AC_CHECK_LIB(gc, GC_enable, found_gc_enable="yes",,$libdl)
284 if test "x$found_gc_enable" = "xyes"; then
285 AC_DEFINE(HAVE_GC_ENABLE)
290 AC_CONFIG_SUBDIRS(libgc)
297 LIBGC_CFLAGS='-I$(top_srcdir)/libgc/include'
298 LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
300 AC_DEFINE(HAVE_BOEHM_GC)
301 AC_SUBST(HAVE_BOEHM_GC)
304 AC_DEFINE(USE_INCLUDED_LIBGC)
306 # The included libgc contains GCJ support
307 AC_DEFINE(HAVE_GC_GCJ_MALLOC)
308 AC_DEFINE(HAVE_GC_ENABLE)
312 AC_MSG_WARN("Compiling mono without GC.")
315 AC_MSG_ERROR([Invalid argument to --with-gc.])
320 # tell libgc/configure about what we want
321 ac_configure_args="$ac_configure_args --disable-embed-check --with-libgc-threads=$libgc_threads"
323 AM_CONDITIONAL(INCLUDED_LIBGC, test x$use_included_gc = xyes)
324 AC_SUBST(LIBGC_CFLAGS)
329 dnl End of libgc checks
332 if test x$platform_win32 = xno; then
334 dnl ******************************************************************
335 dnl *** Checks for the IKVM JNI interface library ***
336 dnl ******************************************************************
337 AC_ARG_WITH(ikvm-jni, [ --with-ikvm-jni=yes,no build the IKVM JNI interface library],[with_ikvm_jni=$withval],[with_ikvm_jni=yes])
338 AC_ARG_WITH(jdk, [ --with-jdk=DIRECTORY Use JDK from DIRECTORY],[with_jdk_dir=$withval],[with_jdk_dir=])
341 if test x$with_ikvm_jni = xyes; then
342 AC_MSG_CHECKING([JDK headers])
344 if test x$with_jdk_dir = x; then
345 # Try JAVA_HOME variable
346 if test x$JAVA_HOME != x; then
347 with_jdk_dir=$JAVA_HOME
352 if test -d $with_jdk_dir/include; then
353 jdk_headers_found=yes
355 if test -d $with_jdk_dir/include/linux; then
358 if test -d $with_jdk_dir/include/solaris; then
361 if test -f $with_jdk_dir/include/jni_md.h; then
362 # GNU Classpath sources
373 if test x$jdk_headers_found = xyes; then
374 AC_MSG_RESULT($with_jdk_dir/include $with_jdk_dir/include/$jdk_platform)
376 AC_MSG_RESULT(not found)
379 if test x$jdk_headers_found = xyes; then
380 ikvm_jni_dir=ikvm-jni
381 IKVM_JNI_CFLAGS="-I$with_jdk_dir/include -I$with_jdk_dir/include/$jdk_platform"
385 AC_SUBST(ikvm_jni_dir)
386 AC_SUBST(IKVM_JNI_CFLAGS)
388 AC_CHECK_FUNCS(getgrgid_r)
389 AC_CHECK_FUNCS(getgrnam_r)
390 AC_CHECK_FUNCS(getpwnam_r)
391 AC_CHECK_FUNCS(getpwuid_r)
392 AC_CHECK_FUNCS(getresuid)
393 AC_CHECK_FUNCS(setresuid)
395 dnl ******************************************************************
396 dnl *** Check for large file support ***
397 dnl *** (If we were using autoconf 2.50 we'd use AC_SYS_LARGEFILE) ***
398 dnl ******************************************************************
400 # Check that off_t can represent 2**63 - 1 correctly, working around
401 # potential compiler bugs. Defines LARGE_FILE_SUPPORT, adds $1 to
402 # CPPFLAGS and sets $large_offt to yes if the test succeeds
404 AC_DEFUN(LARGE_FILES, [
405 large_CPPFLAGS=$CPPFLAGS
406 CPPFLAGS="$CPPFLAGS $1"
408 #include <sys/types.h>
410 #define BIG_OFF_T (((off_t)1<<62)-1+((off_t)1<<62))
413 int big_off_t=((BIG_OFF_T%2147483629==721) &&
414 (BIG_OFF_T%2147483647==1));
423 AC_DEFINE(HAVE_LARGE_FILE_SUPPORT)
424 large_CPPFLAGS="$large_CPPFLAGS $1"
429 CPPFLAGS=$large_CPPFLAGS
432 AC_MSG_CHECKING(if off_t is 64 bits wide)
434 if test $large_offt = no; then
435 AC_MSG_CHECKING(if _FILE_OFFSET_BITS=64 gives 64 bit off_t)
436 LARGE_FILES("-D_FILE_OFFSET_BITS=64")
438 if test $large_offt = no; then
439 AC_MSG_WARN([No 64 bit file size support available])
442 dnl *****************************
443 dnl *** Checks for libsocket ***
444 dnl *****************************
445 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
447 dnl *******************************
448 dnl *** Checks for MSG_NOSIGNAL ***
449 dnl *******************************
450 AC_MSG_CHECKING(for MSG_NOSIGNAL)
451 AC_TRY_COMPILE([#include <sys/socket.h>], [
452 int f = MSG_NOSIGNAL;
456 AC_DEFINE(HAVE_MSG_NOSIGNAL)
458 # We'll have to use signals
462 dnl *****************************
463 dnl *** Checks for SOL_IP ***
464 dnl *****************************
465 AC_MSG_CHECKING(for SOL_IP)
466 AC_TRY_COMPILE([#include <netdb.h>], [
471 AC_DEFINE(HAVE_SOL_IP)
473 # We'll have to use getprotobyname
477 dnl *****************************
478 dnl *** Checks for SOL_IPV6 ***
479 dnl *****************************
480 AC_MSG_CHECKING(for SOL_IPV6)
481 AC_TRY_COMPILE([#include <netdb.h>], [
482 int level = SOL_IPV6;
486 AC_DEFINE(HAVE_SOL_IPV6)
488 # We'll have to use getprotobyname
492 dnl *****************************
493 dnl *** Checks for SOL_TCP ***
494 dnl *****************************
495 AC_MSG_CHECKING(for SOL_TCP)
496 AC_TRY_COMPILE([#include <netdb.h>], [
501 AC_DEFINE(HAVE_SOL_TCP)
503 # We'll have to use getprotobyname
507 dnl *****************************
508 dnl *** Checks for IP_PKTINFO ***
509 dnl *****************************
510 AC_MSG_CHECKING(for IP_PKTINFO)
511 AC_TRY_COMPILE([#include <netdb.h>], [
512 int level = IP_PKTINFO;
516 AC_DEFINE(HAVE_IP_PKTINFO)
521 dnl *********************************
522 dnl *** Check for struct ip_mreqn ***
523 dnl *********************************
524 AC_MSG_CHECKING(for struct ip_mreqn)
525 AC_TRY_COMPILE([#include <netinet/in.h>], [
526 struct ip_mreqn mreq;
527 mreq.imr_address.s_addr = 0;
531 AC_DEFINE(HAVE_STRUCT_IP_MREQN)
533 # We'll just have to try and use struct ip_mreq
535 AC_MSG_CHECKING(for struct ip_mreq)
536 AC_TRY_COMPILE([#include <netinet/in.h>], [
538 mreq.imr_interface.s_addr = 0;
542 AC_DEFINE(HAVE_STRUCT_IP_MREQ)
544 # No multicast support
549 dnl **********************************
550 dnl *** Check for gethostbyname2_r ***
551 dnl **********************************
552 AC_MSG_CHECKING(for gethostbyname2_r)
553 AC_TRY_LINK([#include <netdb.h>], [
554 gethostbyname2_r(NULL,0,NULL,NULL,0,NULL,NULL);
558 AC_DEFINE(HAVE_GETHOSTBYNAME2_R)
563 dnl *****************************
564 dnl *** Checks for libnsl ***
565 dnl *****************************
566 AC_CHECK_LIB(nsl, gethostbyaddr, LIBS="$LIBS -lnsl")
568 AC_CHECK_FUNCS(inet_pton inet_aton)
570 dnl ***********************************************
571 dnl *** Checks for size of sockaddr_un.sun_path ***
572 dnl ***********************************************
573 # AC_CHECK_SIZEOF can't cope with struct members :-(
574 AC_MSG_CHECKING(size of sockaddr_un.sun_path)
575 AC_CACHE_VAL(cv_mono_sizeof_sunpath,
577 #include <sys/types.h>
582 struct sockaddr_un sock_un;
583 FILE *f=fopen("conftestval", "w");
585 fprintf(f, "%d\n", sizeof(sock_un.sun_path));
588 ], cv_mono_sizeof_sunpath=`cat conftestval`,
589 cv_mono_sizeof_sunpath=0,
590 cv_mono_sizeof_sunpath=0)])dnl
591 AC_MSG_RESULT($cv_mono_sizeof_sunpath)
592 AC_DEFINE_UNQUOTED(MONO_SIZEOF_SUNPATH, $cv_mono_sizeof_sunpath)
594 dnl *************************************
595 dnl *** Checks for zero length arrays ***
596 dnl *************************************
597 AC_MSG_CHECKING(whether $CC supports zero length arrays)
605 AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 0)
608 AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 1)
611 dnl *****************************
612 dnl *** Checks for libxnet ***
613 dnl *****************************
616 AC_MSG_CHECKING(for Solaris XPG4 support)
617 if test -f /usr/lib/libxnet.so; then
618 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
619 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
620 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
627 if test "$GCC" = "yes"; then
628 CFLAGS="$CFLAGS -Wno-char-subscripts"
633 dnl *****************************
634 dnl *** Checks for libpthread ***
635 dnl *****************************
636 AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
637 AC_CHECK_HEADERS(pthread.h)
638 AC_CHECK_FUNCS(pthread_mutex_timedlock)
639 AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np)
640 AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
641 AC_TRY_COMPILE([ #include <pthread.h>], [
642 pthread_mutexattr_t attr;
643 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
648 AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
649 AC_DEFINE(USE_MONO_MUTEX)
651 AC_CHECK_FUNCS(pthread_attr_setstacksize)
653 dnl ***********************************
654 dnl *** Checks for working __thread ***
655 dnl ***********************************
656 AC_MSG_CHECKING(for working __thread)
657 if test "x$with_nptl" != "xyes"; then
658 AC_MSG_RESULT(disabled)
664 static int res1, res2;
666 void thread_main (void *arg)
681 pthread_create (&t1, NULL, thread_main, 1);
682 pthread_create (&t2, NULL, thread_main, 2);
684 pthread_join (t1, NULL);
685 pthread_join (t2, NULL);
687 return !(res1 + res2 == 2);
691 AC_DEFINE(HAVE_KW_THREAD)
697 dnl **************************************
698 dnl *** Checks for working sigaltstack ***
699 dnl **************************************
700 AC_MSG_CHECKING(for working sigaltstack)
701 if test "x$with_sigaltstack" != "xyes"; then
702 AC_MSG_RESULT(disabled)
710 #include <sys/wait.h>
713 sigsegv_signal_handler (int _dummy, siginfo_t *info, void *context)
731 struct sigaltstack sas;
735 sa.sa_sigaction = sigsegv_signal_handler;
736 sigemptyset (&sa.sa_mask);
737 sa.sa_flags = SA_SIGINFO | SA_STACK;
738 if (sigaction (SIGSEGV, &sa, NULL) == -1) {
743 sas.ss_sp = malloc (SIGSTKSZ);
744 sas.ss_size = SIGSTKSZ;
745 sas.ss_flags = SS_ONSTACK;
746 if (sigaltstack (&sas, NULL) == -1) {
751 pthread_attr_init (&attr);
752 if (pthread_create(&id, &attr, loop, &attr) != 0) {
777 for (i = 0; i < 3; ++i) {
779 waitpid (son, &status, WNOHANG);
780 if (WIFEXITED (status) && WEXITSTATUS (status) == 0)
790 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
797 dnl ********************************
798 dnl *** Checks for semaphore lib ***
799 dnl ********************************
800 # 'Real Time' functions on Solaris
801 # posix4 on Solaris 2.6
802 # pthread (first!) on Linux
803 AC_SEARCH_LIBS(sem_init, pthread rt posix4)
805 dnl ********************************
806 dnl *** Checks for timezone stuff **
807 dnl ********************************
808 AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
814 ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
815 if test $ac_cv_struct_tm_gmtoff = yes; then
816 AC_DEFINE(HAVE_TM_GMTOFF)
818 AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
823 ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
824 if test $ac_cv_var_timezone = yes; then
825 AC_DEFINE(HAVE_TIMEZONE)
827 AC_ERROR(unable to find a way to determine timezone)
831 dnl *********************************
832 dnl *** Checks for math functions ***
833 dnl *********************************
835 AC_CHECK_FUNCS(finite, , AC_MSG_CHECKING(for finite in math.h)
836 AC_TRY_LINK([#include <math.h>],
838 AC_DEFINE(HAVE_FINITE) AC_MSG_RESULT(yes),
840 AC_CHECK_FUNCS(isfinite, , AC_MSG_CHECKING(for isfinite in math.h)
841 AC_TRY_LINK([#include <math.h>],
843 AC_DEFINE(HAVE_ISFINITE) AC_MSG_RESULT(yes),
846 dnl ****************************************************************
847 dnl *** Checks for working poll() (macosx defines it but doesn't ***
848 dnl *** have it in the library (duh)) ***
849 dnl ****************************************************************
852 dnl *************************
853 dnl *** Check for signbit ***
854 dnl *************************
855 AC_MSG_CHECKING(for signbit)
856 AC_TRY_LINK([#include <math.h>], [
857 int s = signbit(1.0);
860 AC_DEFINE(HAVE_SIGNBIT)
865 dnl *********************
866 dnl *** Check for AIO ***
867 dnl *********************
868 AC_MSG_CHECKING([for SIGEV_THREAD definition])
869 dnl Some systems (FreeBSD at least) may have aio_read
870 dnl but don't support/define SIGEV_THREAD.
872 #include <sys/signal.h>
874 int x = SIGEV_THREAD;
876 ac_cv_c_sigev_thread=yes
882 if test "$ac_cv_c_sigev_thread" = "yes" ; then
883 AC_CHECK_HEADERS(aio.h sys/aio.h)
884 AC_CHECK_LIB(rt, aio_read, [ LIBS="$LIBS -lrt" ],)
885 SIGVAL_PTR="undefined"
886 if test "$ac_cv_header_aio_h" = "yes" -o "$ac_cv_header_sys_aio_h" = "yes" ; then
887 AC_CHECK_MEMBER(union sigval.sigval_ptr,SIGVAL_PTR="sigval_ptr",, [
888 #include <sys/signal.h>
890 AC_CHECK_MEMBER(union sigval.sival_ptr,SIGVAL_PTR="sival_ptr",, [
891 #include <sys/signal.h>
893 if test "$SIGVAL_PTR" = "undefined" ; then
894 AC_MSG_ERROR([Unable to detect field name in 'union sigval'])
897 AC_DEFINE_UNQUOTED(SIGVAL_PTR,$SIGVAL_PTR,[Pointer field name in 'union sigval'])
900 AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
901 AC_CHECK_LIB(psapi, main, LIBS="$LIBS -lpsapi", AC_ERROR(bad mingw install?))
905 AC_MSG_CHECKING(for socklen_t)
907 #include <sys/types.h>
908 #include <sys/socket.h>
912 ac_cv_c_socklen_t=yes
913 AC_DEFINE(HAVE_SOCKLEN_T)
919 AC_CHECK_FUNCS(truncl, , AC_MSG_CHECKING(for truncl in math.h)
920 AC_TRY_LINK([#include <math.h>],
923 AC_DEFINE(HAVE_TRUNCL)
929 if test "x$ac_cv_truncl" != "xyes"; then
930 AC_CHECK_LIB(sunmath, aintl, [ AC_DEFINE(HAVE_AINTL) LIBS="$LIBS -lsunmath"])
933 dnl ****************************
934 dnl *** Look for /dev/random ***
935 dnl ****************************
937 AC_MSG_CHECKING([if usage of random device is requested])
938 AC_ARG_ENABLE(dev-random,
939 [ --disable-dev-random disable the use of the random device],
940 try_dev_random=$enableval, try_dev_random=yes)
941 AC_MSG_RESULT($try_dev_random)
945 NAME_DEV_RANDOM="/dev/srandom"
948 dnl Win32 does not have /dev/random, they have their own method...
950 *-*-mingw*|*-*-cygwin*)
951 ac_cv_have_dev_random = no
954 dnl Everywhere else, it's /dev/random
957 NAME_DEV_RANDOM="/dev/random"
961 AC_DEFINE_UNQUOTED(NAME_DEV_RANDOM, "$NAME_DEV_RANDOM")
963 dnl Now check if the device actually exists
965 if test "x$try_dev_random" = "xyes"; then
966 AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
967 [if test -r "$NAME_DEV_RANDOM" ; then
968 ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
969 if test "x$ac_cv_have_dev_random" = "xyes"; then
970 AC_DEFINE(HAVE_CRYPT_RNG)
973 AC_MSG_CHECKING(for random device)
974 ac_cv_have_dev_random=no
975 AC_MSG_RESULT(has been disabled)
978 if test "x$platform_win32" = "xyes"; then
979 AC_DEFINE(HAVE_CRYPT_RNG)
982 if test "x$ac_cv_have_dev_random" = "xno" \
983 && test "x$platform_win32" = "xno"; then
986 *** A system-provided entropy source was not found on this system.
987 *** Because of this, the System.Security.Cryptography random number generator
988 *** will throw a NotImplemented exception.
990 *** If you are seeing this message, and you know your system DOES have an
991 *** entropy collection in place, please contact <crichton@gimp.org> and
992 *** provide information about the system and how to access the random device.
994 *** Otherwise you can install either egd or prngd and set the environment
995 *** variable MONO_EGD_SOCKET to point to the daemon's socket to use that.
999 AC_MSG_CHECKING([if inter-process shared handles are requested])
1000 AC_ARG_ENABLE(shared-handles, [ --disable-shared-handles disable inter-process shared handles], try_shared_handles=$enableval, try_shared_handles=yes)
1001 AC_MSG_RESULT($try_shared_handles)
1002 if test "x$try_shared_handles" != "xyes"; then
1003 AC_DEFINE(DISABLE_SHARED_HANDLES)
1004 AC_SUBST(DISABLE_SHARED_HANDLES)
1015 AC_ARG_WITH(icu, [ --with-icu=yes/no],
1016 if test x$with_icu = xno; then
1018 AC_MSG_RESULT(Will not probe for ICU)
1023 AC_PATH_PROG(ICU_CONFIG, icu-config, no)
1024 if test "x$ICU_CONFIG" = "xno" -o ! -x "$ICU_CONFIG"; then
1025 AC_MSG_WARN([Only invariant locale available; install ICU for I18N support])
1026 enable_icu="no, if you want full i18n support download it from: http://oss.software.ibm.com/icu/index.html"
1028 enable_icu="yes. Version: `$ICU_CONFIG --version`"
1030 ICU_CFLAGS=`$ICU_CONFIG --cppflags`
1031 ICU_LIBS=`$ICU_CONFIG --ldflags`
1034 AC_SUBST(ICU_CFLAGS)
1038 ACCESS_UNALIGNED="yes"
1045 # mips-sgi-irix5.* | mips-sgi-irix6.*)
1047 # ACCESS_UNALIGNED="no"
1055 x86_64-*-* | amd64-*-*)
1064 ACCESS_UNALIGNED="no"
1068 # alpha*-*-linux* | alpha*-*-osf*)
1070 # ACCESS_UNALIGNED="no"
1072 # ia64-*-linux* | ia64-*-hpux*)
1076 # ACCESS_UNALIGNED="no";
1077 # case "$host_os" in
1078 # linux*) LIBC="libc.so.6.1";;
1079 # hpux*) LIBC="libc.so.1";;
1085 hppa2.0w-hp-hpux11.00 | hppa64-hp-hpux11.00)
1089 ACCESS_UNALIGNED="no"
1091 macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | \
1092 powerpc-*-sysv* | powerpc-*-darwin*)
1098 arm-*-linux-* | armv4l-*-linux-*)
1101 ACCESS_UNALIGNED="no"
1106 ACCESS_UNALIGNED="no"
1111 AC_ARG_WITH(jit, [ --with-jit=yes,no If you want to build scripts that default to the JIT],[
1116 if test x$JIT_SUPPORTED = xyes; then
1117 if $jit_wanted; then
1119 jit_status="Building and using the JIT"
1121 jit_status="Building the JIT, defaulting to the interpreter"
1124 jit_status="interpreter"
1127 AM_CONDITIONAL(USE_JIT, test x$USEJIT = xtrue)
1139 if test ${TARGET} = ARM; then
1140 dnl ******************************************
1141 dnl *** Check to see what FPU is available ***
1142 dnl ******************************************
1143 AC_MSG_CHECKING(which FPU to use)
1145 AC_TRY_COMPILE([], [
1146 __asm__ ("ldfd f0, [r0]");
1148 AC_TRY_COMPILE([], [
1149 __asm__ ("fldd d0, [r0]");
1150 ], fpu=VFP, fpu=NONE)
1154 CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu"
1158 if test ${TARGET} = unknown; then
1159 CPPFLAGS="$CPPFLAGS -DNO_PORT"
1160 AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
1163 if test ${ACCESS_UNALIGNED} = no; then
1164 CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
1168 AC_ARG_WITH(preview, [ --with-preview=yes,no If you want to install the 2.0 FX preview],[
1169 if test x$with_preview = xyes; then
1174 AM_CONDITIONAL(INSTALL_2_0, test x$PREVIEW = xyes)
1176 AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
1177 AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
1178 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
1179 AM_CONDITIONAL(X86, test x$TARGET = xX86)
1180 AM_CONDITIONAL(AMD64, test x$TARGET = xAMD64)
1181 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
1182 AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
1183 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
1184 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
1185 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
1186 AM_CONDITIONAL(S390, test x$TARGET = xS390)
1187 AM_CONDITIONAL(HPPA, test x$TARGET = xHPPA)
1189 AM_CONDITIONAL(JIT_SUPPORTED, test x$JIT_SUPPORTED = xyes)
1193 AC_SUBST(arch_target)
1204 mono/metadata/Makefile
1209 mono/os/win32/Makefile
1210 mono/os/unix/Makefile
1211 mono/arch/x86/Makefile
1212 mono/arch/amd64/Makefile
1213 mono/arch/hppa/Makefile
1214 mono/arch/ppc/Makefile
1215 mono/arch/sparc/Makefile
1216 mono/arch/s390/Makefile
1217 mono/arch/arm/Makefile
1218 mono/arch/alpha/Makefile
1219 mono/interpreter/Makefile
1221 mono/tests/tests-config
1222 mono/benchmark/Makefile
1223 mono/monoburg/Makefile
1224 mono/monograph/Makefile
1225 mono/io-layer/Makefile
1226 mono/handles/Makefile
1228 mono/profiler/Makefile
1231 runtime/net_1_1/Makefile
1232 runtime/net_2_0/Makefile
1249 SIGALTSTACK: $with_sigaltstack
1252 JNI support: $jdk_headers_found