2003-07-29 Miguel de Icaza <miguel@ximian.com>
[mono.git] / configure.in
1 AC_INIT(README)
2 AC_CANONICAL_SYSTEM
3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(mono,0.25.99.2)
5 AM_MAINTAINER_MODE
6
7 dnl
8 dnl libgc checks
9 dnl
10
11 gc_headers=no
12 gc=included
13 use_included_gc=no
14
15 if test -d $srcdir/libgc ; then
16   gc_default=included
17 else
18   gc_default=boehm
19 fi
20
21 #
22 # These are the flags that need to be stored in the mono.pc file for 
23 # compiling code that will embed Mono
24 #
25 libmono_cflags=""
26 libmono_ldflags=""
27 AC_SUBST(libmono_cflags)
28 AC_SUBST(libmono_ldflags)
29
30 # Thread configuration inspired by sleepycat's db
31 AC_MSG_CHECKING([host platform characteristics])
32 libgc_threads=no
33 case "$host" in
34         *-*-mingw*|*-*-cygwin*)
35                 platform_win32=yes
36                 AC_DEFINE(PLATFORM_WIN32)
37                 CC="gcc -mno-cygwin"
38                 HOST_CC="gcc"
39 # latest libgc already defines GC_WIN32_THREADS
40 #               CPPFLAGS="$CPPFLAGS -DGC_WIN32_THREADS -DWIN32_THREADS"
41                 CPPFLAGS="$CPPFLAGS -DWIN32_THREADS"
42                 libdl=
43                 libgc_threads=win32
44                 gc_default=boehm 
45                 ;;
46         *-*-*netbsd*)
47                 platform_win32=no
48                 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
49                 libmono_cflags="-D_REENTRANT"
50                 LDFLAGS="$LDFLAGS -pthread"
51                 libmono_ldflags="-pthread"
52                 AC_DEFINE(NEED_LINK_UNLINK)
53                 libdl=
54                 libgc_threads=pthreads
55                 ;;
56         *-*-*freebsd*|*-*-*openbsd*)
57                 platform_win32=no
58                 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
59                 libmono_cflags="-D_THREAD_SAFE"
60                 LDFLAGS="$LDFLAGS -pthread"
61                 libmono_ldflags="-pthread"
62                 AC_DEFINE(NEED_LINK_UNLINK)
63                 AC_DEFINE(PTHREAD_POINTER_ID)
64                 libdl=
65                 libgc_threads=pthreads
66                 ;;
67         *-*-linux*)
68                 platform_win32=no
69                 CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -DMONO_USE_EXC_TABLES -D_GNU_SOURCE -D_REENTRANT -fexceptions"
70                 libmono_cflags="-DMONO_USE_EXC_TABLES -fexceptions -D_REENTRANT"
71                 libmono_ldflags="-lpthread"
72                 libdl="-ldl"
73                 libgc_threads=pthreads
74                 ;;
75         *-*-solaris*)
76                 platform_win32=no
77                 CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT"
78                 AC_DEFINE(NEED_LINK_UNLINK)
79                 libmono_cflags="-D_REENTRANT"
80                 libgc_threads=pthreads
81                 ;;
82         *-*-darwin*)
83                 platform_win32=no
84                 CPPFLAGS="$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE"
85                 libmono_cflags="-D_THREAD_SAFE"
86                 LDFLAGS="$LDFLAGS -pthread"
87                 libmono_ldflags="-pthread"
88                 AC_DEFINE(NEED_LINK_UNLINK)
89                 AC_DEFINE(PTHREAD_POINTER_ID)
90                 libdl=
91                 libgc_threads=no
92                 gc_default=none 
93                 ;;
94         *)
95                 AC_MSG_WARN([*** Please add $host to configure.in checks!])
96                 platform_win32=no
97                 libdl="-ldl"
98                 ;;
99 esac
100 AC_MSG_RESULT(ok)
101 AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
102
103 AC_CHECK_TOOL(CC, gcc, gcc)
104 AC_PROG_CC
105 AM_PROG_CC_STDC
106 AC_PROG_INSTALL
107 dnl We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
108 : ${CCAS='$(CC)'}
109 # Set ASFLAGS if not already set.
110 : ${CCASFLAGS='$(CFLAGS)'}
111 AC_SUBST(CCAS)
112 AC_SUBST(CCASFLAGS)
113
114 AC_CHECK_PROG(BISON, bison,yes,no)
115 if test "x$BISON" = "xno";
116 then
117         AC_MSG_ERROR([You need to install bison])
118 fi
119
120 dnl may require a specific autoconf version
121 dnl AC_PROG_CC_FOR_BUILD
122 dnl CC_FOR_BUILD not automatically detected
123 CC_FOR_BUILD=$CC
124 BUILD_EXEEXT=
125 if test "x$cross_compiling" = "xyes"; then
126         CC_FOR_BUILD=cc
127         BUILD_EXEEXT=""
128 fi
129 AC_SUBST(CC_FOR_BUILD)
130 AC_SUBST(HOST_CC)
131 AC_SUBST(BUILD_EXEEXT)
132
133 # Set STDC_HEADERS
134 AC_HEADER_STDC
135 AC_LIBTOOL_WIN32_DLL
136 AM_PROG_LIBTOOL
137
138 AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h sys/un.h)
139
140 # for mono/metadata/debug-symfile.c
141 AC_CHECK_HEADERS(elf.h)
142
143 # for mono/dis
144 AC_CHECK_HEADERS(wchar.h)
145
146 # not 64 bit clean in cross-compile
147 AC_CHECK_SIZEOF(void *, 4)
148
149 CFLAGS='-g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings'
150
151 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
152 if test "x$PKG_CONFIG" = "xno"; then
153         AC_MSG_ERROR([You need to install pkg-config])
154 fi
155
156 dnl for use on the build system
157 dnl pkg-config is stupid
158 BUILD_GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
159 BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
160 AC_SUBST(BUILD_GLIB_CFLAGS)
161 AC_SUBST(BUILD_GLIB_LIBS)
162
163 PKG_PATH=
164 AC_ARG_WITH(crosspkgdir, [  --with-crosspkgdir=/path/to/pkg-config/dir],
165         if test x$with_crosspkgdir = "x"; then
166                 if test -s $PKG_CONFIG_PATH; then
167                         PKG_PATH=$PKG_CONFIG_PATH
168                 fi
169         else
170                 PKG_PATH=$with_crosspkgdir
171                 PKG_CONFIG_PATH=$PKG_PATH
172                 export PKG_CONFIG_PATH
173         fi
174 )
175
176 ## Versions of dependencies
177 GLIB_REQUIRED_VERSION=1.3.11
178
179 PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION)
180
181 GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
182 GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
183 GMODULE_CFLAGS=`$PKG_CONFIG --cflags gmodule-2.0`
184 GMODULE_LIBS=`$PKG_CONFIG --libs gmodule-2.0`
185
186 AC_SUBST(GLIB_CFLAGS)
187 AC_SUBST(GLIB_LIBS)
188 AC_SUBST(GMODULE_CFLAGS)
189 AC_SUBST(GMODULE_LIBS)
190
191 AC_ARG_WITH(gc, [  --with-gc=boehm,included,none],[gc=$with_gc],[gc=$gc_default])
192
193 # assembly bundle support, see metadata/make-bundle.pl for more info
194 AC_ARG_WITH(bundle, [  --with-bundle=bundle_template],[
195         BUNDLE_FILE=$with_bundle
196         AC_SUBST(BUNDLE_FILE)
197         AC_DEFINE(WITH_BUNDLE)
198 ],[with_bundle=no])
199 AM_CONDITIONAL(WITH_BUNDLE, test x$with_bundle != xno)
200
201 LIBGC_CFLAGS=
202 LIBGC_LIBS=
203 libgc_dir=
204 case "x$gc" in
205         xboehm|xbohem|xyes)
206                 AC_CHECK_HEADERS(gc.h gc/gc.h, gc_headers=yes)
207                 AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
208
209                 if test "x$found_boehm" != "xyes"; then
210                         AC_MSG_ERROR("GC requested but libgc not found! Install libgc or run configure with --with-gc=none.")
211                 fi
212                 if test "x$gc_headers" != "xyes"; then
213                         AC_MSG_ERROR("GC requested but header files not found! You may need to install them by hand.")
214                 fi
215
216                 AC_DEFINE(HAVE_BOEHM_GC)
217                 AC_SUBST(HAVE_BOEHM_GC)
218                 LIBGC_LIBS="-lgc $libdl"
219
220                 # AC_CHECK_FUNCS does not work for some reason...
221                 AC_CHECK_LIB(gc, GC_gcj_malloc, found_gcj_malloc="yes",,$libdl)
222                 if test "x$found_gcj_malloc" = "xyes"; then
223                         AC_DEFINE(HAVE_GC_GCJ_MALLOC)
224                 fi
225                 ;;
226
227         xincluded)
228                 AC_CONFIG_SUBDIRS(libgc)
229
230                 found_boehm=yes
231                 gc_headers=yes
232                 use_included_gc=yes
233                 libgc_dir=libgc
234
235                 LIBGC_CFLAGS='-I$(top_srcdir)/libgc/include'
236                 LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
237
238                 AC_DEFINE(HAVE_BOEHM_GC)
239                 AC_SUBST(HAVE_BOEHM_GC)
240
241                 AC_DEFINE(HAVE_GC_H)
242                 AC_DEFINE(USE_INCLUDED_LIBGC)
243
244                 # The included libgc contains GCJ support
245                 AC_DEFINE(HAVE_GC_GCJ_MALLOC)
246                 ;;
247
248         xnone)
249                 AC_MSG_WARN("Compiling mono without GC.")
250                 ;;
251         *)
252                 AC_MSG_ERROR([Invalid argument to --with-gc.])
253                 ;;
254 esac
255
256 we_are_embedded_in_mono=yes
257 export we_are_embedded_in_mono
258 export libgc_threads
259
260 AM_CONDITIONAL(INCLUDED_LIBGC, test x$use_included_gc = xyes)
261 AC_SUBST(LIBGC_CFLAGS)
262 AC_SUBST(LIBGC_LIBS)
263 AC_SUBST(libgc_dir)
264
265 dnl
266 dnl End of libgc checks
267 dnl
268
269 if test x$platform_win32 = xno; then
270         dnl ******************************************************************
271         dnl *** Check for large file support                               ***
272         dnl *** (If we were using autoconf 2.50 we'd use AC_SYS_LARGEFILE) ***
273         dnl ******************************************************************
274         
275         # Check that off_t can represent 2**63 - 1 correctly, working around
276         # potential compiler bugs.  Defines LARGE_FILE_SUPPORT, adds $1 to
277         # CPPFLAGS and sets $large_offt to yes if the test succeeds
278         large_offt=no
279         AC_DEFUN(LARGE_FILES, [
280                 large_CPPFLAGS=$CPPFLAGS
281                 CPPFLAGS="$CPPFLAGS $1"
282                 AC_TRY_RUN([
283                         #include <sys/types.h>
284
285                         #define BIG_OFF_T (((off_t)1<<62)-1+((off_t)1<<62))
286
287                         int main(void) {
288                                 int big_off_t=((BIG_OFF_T%2147483629==721) &&
289                                                (BIG_OFF_T%2147483647==1));
290                                 if(big_off_t) {
291                                         exit(0);
292                                 } else {
293                                         exit(1);
294                                 }
295                         }
296                 ], [
297                         AC_MSG_RESULT(ok)
298                         AC_DEFINE(HAVE_LARGE_FILE_SUPPORT)
299                         large_CPPFLAGS="$large_CPPFLAGS $1"
300                         large_offt=yes
301                 ], [
302                         AC_MSG_RESULT(no)
303                 ], "")
304                 CPPFLAGS=$large_CPPFLAGS
305         ])
306
307         AC_MSG_CHECKING(if off_t is 64 bits wide)
308         LARGE_FILES("")
309         if test $large_offt = no; then
310                 AC_MSG_CHECKING(if _FILE_OFFSET_BITS=64 gives 64 bit off_t)
311                 LARGE_FILES("-D_FILE_OFFSET_BITS=64")
312         fi
313         if test $large_offt = no; then
314                 AC_MSG_WARN([No 64 bit file size support available])
315         fi
316         
317         dnl *****************************
318         dnl *** Checks for libsocket  ***
319         dnl *****************************
320         AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
321
322         dnl *******************************
323         dnl *** Checks for MSG_NOSIGNAL ***
324         dnl *******************************
325         AC_MSG_CHECKING(for MSG_NOSIGNAL)
326         AC_TRY_COMPILE([#include <sys/socket.h>], [
327                 int f = MSG_NOSIGNAL;
328         ], [
329                 # Yes, we have it...
330                 AC_MSG_RESULT(yes)
331                 AC_DEFINE(HAVE_MSG_NOSIGNAL)
332         ], [
333                 # We'll have to use signals
334                 AC_MSG_RESULT(no)
335         ])
336
337         dnl *****************************
338         dnl *** Checks for SOL_IP     ***
339         dnl *****************************
340         AC_MSG_CHECKING(for SOL_IP)
341         AC_TRY_COMPILE([#include <netdb.h>], [
342                 int level = SOL_IP;
343         ], [
344                 # Yes, we have it...
345                 AC_MSG_RESULT(yes)
346                 AC_DEFINE(HAVE_SOL_IP)
347         ], [
348                 # We'll have to use getprotobyname
349                 AC_MSG_RESULT(no)
350         ])
351
352         dnl *****************************
353         dnl *** Checks for SOL_IPV6     ***
354         dnl *****************************
355         AC_MSG_CHECKING(for SOL_IPV6)
356         AC_TRY_COMPILE([#include <netdb.h>], [
357                 int level = SOL_IPV6;
358         ], [
359                 # Yes, we have it...
360                 AC_MSG_RESULT(yes)
361                 AC_DEFINE(HAVE_SOL_IPV6)
362         ], [
363                 # We'll have to use getprotobyname
364                 AC_MSG_RESULT(no)
365         ])
366
367         dnl *****************************
368         dnl *** Checks for SOL_TCP    ***
369         dnl *****************************
370         AC_MSG_CHECKING(for SOL_TCP)
371         AC_TRY_COMPILE([#include <netdb.h>], [
372                 int level = SOL_TCP;
373         ], [
374                 # Yes, we have it...
375                 AC_MSG_RESULT(yes)
376                 AC_DEFINE(HAVE_SOL_TCP)
377         ], [
378                 # We'll have to use getprotobyname
379                 AC_MSG_RESULT(no)
380         ])
381
382         dnl *****************************
383         dnl *** Checks for IP_PKTINFO ***
384         dnl *****************************
385         AC_MSG_CHECKING(for IP_PKTINFO)
386         AC_TRY_COMPILE([#include <netdb.h>], [
387                 int level = IP_PKTINFO;
388         ], [
389                 # Yes, we have it...
390                 AC_MSG_RESULT(yes)
391                 AC_DEFINE(HAVE_IP_PKTINFO)
392         ], [
393                 AC_MSG_RESULT(no)
394         ])
395
396         dnl *********************************
397         dnl *** Check for struct ip_mreqn ***
398         dnl *********************************
399         AC_MSG_CHECKING(for struct ip_mreqn)
400         AC_TRY_COMPILE([#include <netinet/in.h>], [
401                 struct ip_mreqn mreq;
402                 mreq.imr_address.s_addr = 0;
403         ], [
404                 # Yes, we have it...
405                 AC_MSG_RESULT(yes)
406                 AC_DEFINE(HAVE_STRUCT_IP_MREQN)
407         ], [
408                 # We'll just have to try and use struct ip_mreq
409                 AC_MSG_RESULT(no)
410                 AC_MSG_CHECKING(for struct ip_mreq)
411                 AC_TRY_COMPILE([#include <netinet/in.h>], [
412                         struct ip_mreq mreq;
413                         mreq.imr_interface.s_addr = 0;
414                 ], [
415                         # Yes, we have it...
416                         AC_MSG_RESULT(yes)
417                         AC_DEFINE(HAVE_STRUCT_IP_MREQ)
418                 ], [
419                         # No multicast support
420                         AC_MSG_RESULT(no)
421                 ])
422         ])
423         
424         dnl **********************************
425         dnl *** Check for gethostbyname2_r ***
426         dnl **********************************
427         AC_MSG_CHECKING(for gethostbyname2_r)
428                 AC_TRY_LINK([#include <netdb.h>], [
429                 gethostbyname2_r(NULL,0,NULL,NULL,0,NULL,NULL);
430         ], [
431                 # Yes, we have it...
432                 AC_MSG_RESULT(yes)
433                 AC_DEFINE(HAVE_GETHOSTBYNAME2_R)
434         ])
435
436         dnl *****************************
437         dnl *** Checks for libnsl     ***
438         dnl *****************************
439         AC_CHECK_LIB(nsl, gethostbyaddr, LIBS="$LIBS -lnsl")
440
441         AC_CHECK_FUNCS(inet_pton inet_aton)
442
443         dnl ***********************************************
444         dnl *** Checks for size of sockaddr_un.sun_path ***
445         dnl ***********************************************
446         # AC_CHECK_SIZEOF can't cope with struct members :-(
447         AC_MSG_CHECKING(size of sockaddr_un.sun_path)
448         AC_CACHE_VAL(cv_mono_sizeof_sunpath,
449                 [AC_TRY_RUN([
450                         #include <sys/types.h>
451                         #include <stdio.h>
452                         #include <sys/un.h>
453
454                         int main(void) {
455                                 struct sockaddr_un sock_un;
456                                 FILE *f=fopen("conftestval", "w");
457                                 if(!f) exit(1);
458                                 fprintf(f, "%d\n", sizeof(sock_un.sun_path));
459                                 exit(0);
460                         }
461                 ], cv_mono_sizeof_sunpath=`cat conftestval`,
462                    cv_mono_sizeof_sunpath=0,
463                    cv_mono_sizeof_sunpath=0)])dnl
464         AC_MSG_RESULT($cv_mono_sizeof_sunpath)
465         AC_DEFINE_UNQUOTED(MONO_SIZEOF_SUNPATH, $cv_mono_sizeof_sunpath)
466
467         dnl *****************************
468         dnl *** Checks for libxnet    ***
469         dnl *****************************
470         case "${host}" in
471                 *solaris* )
472                         AC_MSG_CHECKING(for Solaris XPG4 support)
473                         if test -f /usr/lib/libxnet.so; then
474                                 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
475                                 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
476                                 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
477                                 LIBS="$LIBS -lxnet"
478                                 AC_MSG_RESULT(yes)
479                         else
480                                 AC_MSG_RESULT(no)
481                         fi
482
483                         if test "$GCC" = "yes"; then
484                                 CFLAGS="$CFLAGS -Wno-char-subscripts"
485                         fi
486                 ;;
487         esac
488
489         dnl *****************************
490         dnl *** Checks for libpthread ***
491         dnl *****************************
492         AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
493         AC_CHECK_FUNCS(pthread_mutex_timedlock)
494         AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
495         AC_TRY_COMPILE([ #include <pthread.h>], [
496                 pthread_mutexattr_t attr;
497                 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
498         ], [
499                 AC_MSG_RESULT(ok)
500         ], [
501                 AC_MSG_RESULT(no)
502                 AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
503                 AC_DEFINE(USE_MONO_MUTEX)
504         ])
505
506         dnl ********************************
507         dnl *** Checks for semaphore lib ***
508         dnl ********************************
509         AC_CHECK_LIB(rt, sem_init, LIBS="$LIBS -lrt")
510
511         dnl ********************************
512         dnl *** Checks for timezone stuff **
513         dnl ********************************
514         AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
515                 AC_TRY_COMPILE([
516                         #include <time.h>
517                         ], [
518                         struct tm tm;
519                         tm.tm_gmtoff = 1;
520                         ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
521         if test $ac_cv_struct_tm_gmtoff = yes; then
522                 AC_DEFINE(HAVE_TM_GMTOFF)
523         else
524                 AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
525                         AC_TRY_COMPILE([
526                                 #include <time.h>
527                         ], [
528                                 timezone = 1;
529                         ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
530                 if test $ac_cv_var_timezone = yes; then
531                         AC_DEFINE(HAVE_TIMEZONE)
532                 else
533                         AC_ERROR(unable to find a way to determine timezone)
534                 fi
535         fi
536
537         dnl ****************************************************************
538         dnl *** Checks for working poll() (macosx defines it but doesn't ***
539         dnl *** have it in the library (duh))                            ***
540         dnl ****************************************************************
541         AC_CHECK_FUNCS(poll)
542 else
543         AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
544         AC_CHECK_LIB(psapi, main, LIBS="$LIBS -lpsapi", AC_ERROR(bad mingw install?))
545 fi
546
547 dnl ****************************
548 dnl *** Look for /dev/random ***
549 dnl ****************************
550
551 AC_MSG_CHECKING([if usage of random device is requested])
552 AC_ARG_ENABLE(dev-random,
553 [  --disable-dev-random    disable the use of the random device],
554 try_dev_random=$enableval, try_dev_random=yes)
555 AC_MSG_RESULT($try_dev_random)
556
557 case "{$target}" in
558     *-openbsd*)
559     NAME_DEV_RANDOM="/dev/srandom"
560     ;;
561
562 dnl Win32 does not have /dev/random, they have their own method...
563
564     *-*-mingw*|*-*-cygwin*)
565     ac_cv_have_dev_random = no
566     ;;
567
568 dnl Everywhere else, it's /dev/random
569
570     *)
571     NAME_DEV_RANDOM="/dev/random"
572     ;;
573 esac
574
575 AC_DEFINE_UNQUOTED(NAME_DEV_RANDOM, "$NAME_DEV_RANDOM")
576
577 dnl Now check if the device actually exists
578
579 if test "x$try_dev_random" = "xyes"; then
580     AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
581     [if test -r "$NAME_DEV_RANDOM" ; then
582         ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
583     if test "x$ac_cv_have_dev_random" = "xyes"; then
584         AC_DEFINE(HAVE_CRYPT_RNG)
585     fi
586 else
587     AC_MSG_CHECKING(for random device)
588     ac_cv_have_dev_random=no
589     AC_MSG_RESULT(has been disabled)
590 fi
591
592 if test "x$platform_win32" = "xyes"; then
593     AC_DEFINE(HAVE_CRYPT_RNG)
594 fi
595
596 if test "x$ac_cv_have_dev_random" = "xno" \
597     && test "x$platform_win32" = "xno"; then
598     AC_MSG_WARN([[
599 ***
600 *** A system-provided entropy source was not found on this system.
601 *** Because of this, the System.Security.Cryptography random number generator
602 *** will throw a NotImplemented exception.
603 ***
604 *** If you are seeing this message, and you know your system DOES have an
605 *** entropy collection in place, please contact <crichton@gimp.org> and
606 *** provide information about the system and how to access the random device.
607 ***
608 *** For those systems who lack a random device, EGD support is forthcoming.
609 ***]])
610 fi
611  
612 AC_MSG_CHECKING([if inter-process shared handles are requested])
613 AC_ARG_ENABLE(shared-handles, [  --disable-shared-handles disable inter-process shared handles], try_shared_handles=$enableval, try_shared_handles=yes)
614 AC_MSG_RESULT($try_shared_handles)
615 if test "x$try_shared_handles" != "xyes"; then
616         AC_DEFINE(DISABLE_SHARED_HANDLES)
617         AC_SUBST(DISABLE_SHARED_HANDLES)
618 fi
619
620 TARGET="unknown"
621 ACCESS_UNALIGNED="yes"
622
623 JIT_SUPPORTED=no
624
625 case "$host" in
626 #mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; ACCESS_UNALIGNED="no";;
627 i*86-*-*) TARGET=X86; arch_target=x86; JIT_SUPPORTED=yes;;
628 sparc*-*-*) TARGET=SPARC; arch_target=sparc; ACCESS_UNALIGNED="no";;
629 #alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; ACCESS_UNALIGNED="no";;
630 #m68k-*-linux*) TARGET=M68K;;
631 macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | powerpc-*-sysv* | powerpc-*-darwin*) TARGET=POWERPC; arch_target=ppc; JIT_SUPPORTED=yes;;
632 arm-*-linux-* | armv4l-*-linux-*) TARGET=ARM; arch_target=arm; ACCESS_UNALIGNED="no";;
633 s390-*-linux*) TARGET=S390; arch_target=s390; ACCESS_UNALIGNED="no";;
634 esac
635
636 if test ${TARGET} = unknown; then
637         CPPFLAGS="$CPPFLAGS -DNO_PORT"
638         AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
639 fi
640
641 if test ${ACCESS_UNALIGNED} = no; then
642         CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
643 fi
644
645 AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
646 AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
647 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
648 AM_CONDITIONAL(X86, test x$TARGET = xX86)
649 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
650 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
651 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
652 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
653 AM_CONDITIONAL(S390, test x$TARGET = xS390)
654
655 AM_CONDITIONAL(JIT_SUPPORTED, test x$JIT_SUPPORTED = xyes)
656
657 LIBC="libc.so.6"
658 AC_SUBST(LIBC)
659
660 AC_SUBST(arch_target)
661 AC_SUBST(CFLAGS)
662 AC_SUBST(CPPFLAGS)
663 AC_SUBST(LDFLAGS)
664
665 AC_OUTPUT([
666 Makefile
667 mono.pc
668 mono/Makefile
669 mono/utils/Makefile
670 mono/metadata/Makefile
671 mono/dis/Makefile
672 mono/cil/Makefile
673 mono/arch/Makefile
674 mono/os/Makefile
675 mono/os/win32/Makefile
676 mono/os/unix/Makefile
677 mono/arch/x86/Makefile
678 mono/arch/ppc/Makefile
679 mono/arch/sparc/Makefile
680 mono/arch/s390/Makefile
681 mono/arch/arm/Makefile
682 mono/arch/alpha/Makefile
683 mono/interpreter/Makefile
684 mono/tests/Makefile
685 mono/benchmark/Makefile
686 mono/monoburg/Makefile
687 mono/monograph/Makefile
688 mono/io-layer/Makefile
689 mono/handles/Makefile
690 mono/mini/Makefile
691 mono/profiler/Makefile
692 runtime/Makefile
693 scripts/Makefile
694 man/Makefile
695 doc/Makefile
696 docs/Makefile
697 data/Makefile
698 mono.spec
699 ])
700
701 echo "
702
703         GC:     $gc
704
705 "