1.0
[mono.git] / configure.in
1 AC_INIT(README)
2 AC_CANONICAL_SYSTEM
3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(mono,1.0)
5 AM_MAINTAINER_MODE
6
7 AC_PROG_LN_S
8
9 dnl
10 dnl libgc checks
11 dnl
12
13 gc_headers=no
14 gc=included
15 use_included_gc=no
16
17 if test -d $srcdir/libgc ; then
18   gc_default=included
19 else
20   gc_default=boehm
21 fi
22
23 #
24 # These are the flags that need to be stored in the mono.pc file for 
25 # compiling code that will embed Mono
26 #
27 libmono_cflags=""
28 libmono_ldflags=""
29 AC_SUBST(libmono_cflags)
30 AC_SUBST(libmono_ldflags)
31
32 dnl if linker handles the version script
33 no_version_script=no
34
35 # Set to yes if Unix sockets cannot be created in an anonymous namespace
36 need_link_unlink=no
37
38 # Thread configuration inspired by sleepycat's db
39 AC_MSG_CHECKING([host platform characteristics])
40 libgc_threads=no
41 case "$host" in
42         *-*-mingw*|*-*-cygwin*)
43                 platform_win32=yes
44                 AC_DEFINE(PLATFORM_WIN32,1,[Platform is Win32])
45                 CC="gcc -mno-cygwin"
46                 HOST_CC="gcc"
47                 # So libgc configure gets -mno-cygwin
48                 export CC
49 # latest libgc already defines GC_WIN32_THREADS
50 #               CPPFLAGS="$CPPFLAGS -DGC_WIN32_THREADS -DWIN32_THREADS"
51                 CPPFLAGS="$CPPFLAGS -DWIN32_THREADS"
52                 libdl=
53                 libgc_threads=win32
54                 gc_default=boehm 
55                 with_nptl=no
56                 with_sigaltstack=no
57                 LN_S=cp
58
59                 ;;
60         *-*-*netbsd*)
61                 platform_win32=no
62                 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
63                 libmono_cflags="-D_REENTRANT"
64                 LDFLAGS="$LDFLAGS -pthread"
65                 libmono_ldflags="-pthread"
66                 need_link_unlink=yes
67                 libdl=
68                 libgc_threads=no
69                 ;;
70         *-*-*freebsd*|*-*-*openbsd*)
71                 platform_win32=no
72                 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS"
73                 libmono_cflags="-D_THREAD_SAFE"
74                 LDFLAGS="$LDFLAGS -pthread"
75                 libmono_ldflags="-pthread"
76                 need_link_unlink=yes
77                 AC_DEFINE(PTHREAD_POINTER_ID)
78                 libdl=
79                 libgc_threads=pthreads
80                 ;;
81         *-*-linux*)
82                 platform_win32=no
83                 CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT"
84                 libmono_cflags="-D_REENTRANT"
85                 libmono_ldflags="-lpthread"
86                 libdl="-ldl"
87                 libgc_threads=pthreads
88                 ;;
89         *-*-hpux*)
90                 platform_win32=no
91                 CPPFLAGS="$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT"
92                 CFLAGS="$CFLAGS +ESdbgasm"
93                 LDFLAGS="$LDFLAGS -z"
94                 libmono_cflags="-D_REENTRANT"
95                 libmono_ldflags="-lpthread"
96                 libgc_threads=pthreads
97                 need_link_unlink=yes
98                 ;;
99         *-*-solaris*)
100                 platform_win32=no
101                 CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT"
102                 need_link_unlink=yes
103                 libmono_cflags="-D_REENTRANT"
104                 libgc_threads=pthreads
105                 ;;
106         *-*-darwin*)
107                 platform_win32=no
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"
112                 need_link_unlink=yes
113                 AC_DEFINE(PTHREAD_POINTER_ID)
114                 AC_DEFINE(USE_MACH_SEMA)
115                 no_version_script=yes
116                 libdl=
117                 libgc_threads=pthreads
118                 ;;
119         *)
120                 AC_MSG_WARN([*** Please add $host to configure.in checks!])
121                 platform_win32=no
122                 libdl="-ldl"
123                 ;;
124 esac
125 AC_MSG_RESULT(ok)
126
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])
129 fi
130
131 AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
132
133 AC_CHECK_TOOL(CC, gcc, gcc)
134 AC_PROG_CC
135 AM_PROG_CC_STDC
136 AC_PROG_INSTALL
137 dnl We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
138 : ${CCAS='$(CC)'}
139 # Set ASFLAGS if not already set.
140 : ${CCASFLAGS='$(CFLAGS)'}
141 AC_SUBST(CCAS)
142 AC_SUBST(CCASFLAGS)
143
144 AC_CHECK_PROG(BISON, bison,yes,no)
145 if test "x$BISON" = "xno";
146 then
147         AC_MSG_ERROR([You need to install bison])
148 fi
149
150 dnl may require a specific autoconf version
151 dnl AC_PROG_CC_FOR_BUILD
152 dnl CC_FOR_BUILD not automatically detected
153 CC_FOR_BUILD=$CC
154 BUILD_EXEEXT=
155 if test "x$cross_compiling" = "xyes"; then
156         CC_FOR_BUILD=cc
157         BUILD_EXEEXT=""
158 fi
159 AC_SUBST(CC_FOR_BUILD)
160 AC_SUBST(HOST_CC)
161 AC_SUBST(BUILD_EXEEXT)
162
163 # Set STDC_HEADERS
164 AC_HEADER_STDC
165 AC_LIBTOOL_WIN32_DLL
166 AM_PROG_LIBTOOL
167
168 # Test whenever ld supports -version-script
169 AC_PROG_LD
170 AC_PROG_LD_GNU
171 if test "x$lt_cv_prog_gnu_ld" = "xno"; then
172    no_version_script=yes
173 fi
174
175 AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
176
177 AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h sys/un.h)
178
179 # for mono/mini/tramp-x86.c
180 AC_CHECK_HEADERS(valgrind/memcheck.h)
181
182 # for mono/metadata/debug-symfile.c
183 AC_CHECK_HEADERS(elf.h)
184
185 # for mono/dis
186 AC_CHECK_HEADERS(wchar.h)
187
188 # not 64 bit clean in cross-compile
189 AC_CHECK_SIZEOF(void *, 4)
190
191 WARN=''
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"
196 else
197         # The Sun Forte compiler complains about inline functions that access static variables
198         # so disable all inlining.
199         case "$host" in
200         *-*-solaris*)
201                 CFLAGS="$CFLAGS -Dinline="
202                 ;;
203         esac
204 fi
205 CFLAGS="$CFLAGS -g $WARN"
206
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])
210 fi
211
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)
218
219 PKG_PATH=
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
224                 fi
225         else
226                 PKG_PATH=$with_crosspkgdir
227                 PKG_CONFIG_PATH=$PKG_PATH
228                 export PKG_CONFIG_PATH
229         fi
230 )
231
232 ## Versions of dependencies
233 GLIB_REQUIRED_VERSION=1.3.11
234
235 PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION)
236
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`
241
242 AC_SUBST(GLIB_CFLAGS)
243 AC_SUBST(GLIB_LIBS)
244 AC_SUBST(GMODULE_CFLAGS)
245 AC_SUBST(GMODULE_LIBS)
246
247 AC_ARG_WITH(gc, [  --with-gc=boehm,included,none],[gc=$with_gc],[gc=$gc_default])
248
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])
254
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])
258
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)
264 ],[with_bundle=no])
265 AM_CONDITIONAL(WITH_BUNDLE, test x$with_bundle != xno)
266
267 LIBGC_CFLAGS=
268 LIBGC_LIBS=
269 libgc_dir=
270 case "x$gc" in
271         xboehm|xbohem|xyes)
272                 AC_CHECK_HEADERS(gc.h gc/gc.h, gc_headers=yes)
273                 AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
274
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.")
277                 fi
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.")
280                 fi
281
282                 AC_DEFINE(HAVE_BOEHM_GC)
283                 AC_SUBST(HAVE_BOEHM_GC)
284                 LIBGC_LIBS="-lgc $libdl"
285
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)
290                 fi
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)
294                 fi
295                 ;;
296
297         xincluded)
298                 AC_CONFIG_SUBDIRS(libgc)
299
300                 found_boehm=yes
301                 gc_headers=yes
302                 use_included_gc=yes
303                 libgc_dir=libgc
304
305                 LIBGC_CFLAGS='-I$(top_srcdir)/libgc/include'
306                 LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
307
308                 AC_DEFINE(HAVE_BOEHM_GC)
309                 AC_SUBST(HAVE_BOEHM_GC)
310
311                 AC_DEFINE(HAVE_GC_H)
312                 AC_DEFINE(USE_INCLUDED_LIBGC)
313
314                 # The included libgc contains GCJ support
315                 AC_DEFINE(HAVE_GC_GCJ_MALLOC)
316                 AC_DEFINE(HAVE_GC_ENABLE)
317                 ;;
318
319         xnone)
320                 AC_MSG_WARN("Compiling mono without GC.")
321                 ;;
322         *)
323                 AC_MSG_ERROR([Invalid argument to --with-gc.])
324                 ;;
325 esac
326
327
328 # tell libgc/configure about what we want
329 ac_configure_args="$ac_configure_args --disable-embed-check --with-libgc-threads=$libgc_threads"
330
331 AM_CONDITIONAL(INCLUDED_LIBGC, test x$use_included_gc = xyes)
332 AC_SUBST(LIBGC_CFLAGS)
333 AC_SUBST(LIBGC_LIBS)
334 AC_SUBST(libgc_dir)
335
336 dnl
337 dnl End of libgc checks
338 dnl
339
340 if test x$platform_win32 = xno; then
341
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=])
347
348         ikvm_jni_dir=
349         if test x$with_ikvm_jni = xyes; then
350                 AC_MSG_CHECKING([JDK headers])
351
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
356                         fi
357                 fi
358         
359                 jdk_platform=
360                 if test -d $with_jdk_dir/include; then
361                         jdk_headers_found=yes
362
363                         if test -d $with_jdk_dir/include/linux; then
364                                 jdk_platform=linux
365                         else
366                         if test -d $with_jdk_dir/include/solaris; then
367                                 jdk_platform=solaris
368                         else
369                         if test -f $with_jdk_dir/include/jni_md.h; then
370                                 # GNU Classpath sources
371                                 jdk_platform=
372                         else
373                                 jdk_headers_found=no
374                         fi
375                         fi
376                         fi
377                 else
378                         jdk_headers_found=no
379                 fi
380
381                 if test x$jdk_headers_found = xyes; then
382                         AC_MSG_RESULT($with_jdk_dir/include $with_jdk_dir/include/$jdk_platform)
383                 else
384                         AC_MSG_RESULT(not found)
385                 fi
386
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"
390                 fi
391         fi
392
393         AC_SUBST(ikvm_jni_dir)
394         AC_SUBST(IKVM_JNI_CFLAGS)
395
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)
402
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 ******************************************************************
407         
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
411         large_offt=no
412         AC_DEFUN(LARGE_FILES, [
413                 large_CPPFLAGS=$CPPFLAGS
414                 CPPFLAGS="$CPPFLAGS $1"
415                 AC_TRY_RUN([
416                         #include <sys/types.h>
417
418                         #define BIG_OFF_T (((off_t)1<<62)-1+((off_t)1<<62))
419
420                         int main(void) {
421                                 int big_off_t=((BIG_OFF_T%2147483629==721) &&
422                                                (BIG_OFF_T%2147483647==1));
423                                 if(big_off_t) {
424                                         exit(0);
425                                 } else {
426                                         exit(1);
427                                 }
428                         }
429                 ], [
430                         AC_MSG_RESULT(ok)
431                         AC_DEFINE(HAVE_LARGE_FILE_SUPPORT)
432                         large_CPPFLAGS="$large_CPPFLAGS $1"
433                         large_offt=yes
434                 ], [
435                         AC_MSG_RESULT(no)
436                 ], "")
437                 CPPFLAGS=$large_CPPFLAGS
438         ])
439
440         AC_MSG_CHECKING(if off_t is 64 bits wide)
441         LARGE_FILES("")
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")
445         fi
446         if test $large_offt = no; then
447                 AC_MSG_WARN([No 64 bit file size support available])
448         fi
449         
450         dnl *****************************
451         dnl *** Checks for libsocket  ***
452         dnl *****************************
453         AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
454
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;
461         ], [
462                 # Yes, we have it...
463                 AC_MSG_RESULT(yes)
464                 AC_DEFINE(HAVE_MSG_NOSIGNAL)
465         ], [
466                 # We'll have to use signals
467                 AC_MSG_RESULT(no)
468         ])
469
470         dnl *****************************
471         dnl *** Checks for SOL_IP     ***
472         dnl *****************************
473         AC_MSG_CHECKING(for SOL_IP)
474         AC_TRY_COMPILE([#include <netdb.h>], [
475                 int level = SOL_IP;
476         ], [
477                 # Yes, we have it...
478                 AC_MSG_RESULT(yes)
479                 AC_DEFINE(HAVE_SOL_IP)
480         ], [
481                 # We'll have to use getprotobyname
482                 AC_MSG_RESULT(no)
483         ])
484
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;
491         ], [
492                 # Yes, we have it...
493                 AC_MSG_RESULT(yes)
494                 AC_DEFINE(HAVE_SOL_IPV6)
495         ], [
496                 # We'll have to use getprotobyname
497                 AC_MSG_RESULT(no)
498         ])
499
500         dnl *****************************
501         dnl *** Checks for SOL_TCP    ***
502         dnl *****************************
503         AC_MSG_CHECKING(for SOL_TCP)
504         AC_TRY_COMPILE([#include <netdb.h>], [
505                 int level = SOL_TCP;
506         ], [
507                 # Yes, we have it...
508                 AC_MSG_RESULT(yes)
509                 AC_DEFINE(HAVE_SOL_TCP)
510         ], [
511                 # We'll have to use getprotobyname
512                 AC_MSG_RESULT(no)
513         ])
514
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;
521         ], [
522                 # Yes, we have it...
523                 AC_MSG_RESULT(yes)
524                 AC_DEFINE(HAVE_IP_PKTINFO)
525         ], [
526                 AC_MSG_RESULT(no)
527         ])
528
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;
536         ], [
537                 # Yes, we have it...
538                 AC_MSG_RESULT(yes)
539                 AC_DEFINE(HAVE_STRUCT_IP_MREQN)
540         ], [
541                 # We'll just have to try and use struct ip_mreq
542                 AC_MSG_RESULT(no)
543                 AC_MSG_CHECKING(for struct ip_mreq)
544                 AC_TRY_COMPILE([#include <netinet/in.h>], [
545                         struct ip_mreq mreq;
546                         mreq.imr_interface.s_addr = 0;
547                 ], [
548                         # Yes, we have it...
549                         AC_MSG_RESULT(yes)
550                         AC_DEFINE(HAVE_STRUCT_IP_MREQ)
551                 ], [
552                         # No multicast support
553                         AC_MSG_RESULT(no)
554                 ])
555         ])
556         
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);
563         ], [
564                 # Yes, we have it...
565                 AC_MSG_RESULT(yes)
566                 AC_DEFINE(HAVE_GETHOSTBYNAME2_R)
567         ], [
568                 AC_MSG_RESULT(no)
569         ])
570
571         dnl *****************************
572         dnl *** Checks for libnsl     ***
573         dnl *****************************
574         AC_CHECK_LIB(nsl, gethostbyaddr, LIBS="$LIBS -lnsl")
575
576         AC_CHECK_FUNCS(inet_pton inet_aton)
577
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,
584                 [AC_TRY_RUN([
585                         #include <sys/types.h>
586                         #include <stdio.h>
587                         #include <sys/un.h>
588
589                         int main(void) {
590                                 struct sockaddr_un sock_un;
591                                 FILE *f=fopen("conftestval", "w");
592                                 if(!f) exit(1);
593                                 fprintf(f, "%d\n", sizeof(sock_un.sun_path));
594                                 exit(0);
595                         }
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)
601
602         dnl *************************************
603         dnl *** Checks for zero length arrays ***
604         dnl *************************************
605         AC_MSG_CHECKING(whether $CC supports zero length arrays)
606         AC_TRY_COMPILE([
607                 struct s {
608                         int  length;
609                         char data [0];
610                 };
611         ], [], [
612                 AC_MSG_RESULT(yes)
613                 AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 0)
614         ], [
615                 AC_MSG_RESULT(no)
616                 AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 1)
617         ])
618
619         dnl *****************************
620         dnl *** Checks for libxnet    ***
621         dnl *****************************
622         case "${host}" in
623                 *solaris* )
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"
629                                 LIBS="$LIBS -lxnet"
630                                 AC_MSG_RESULT(yes)
631                         else
632                                 AC_MSG_RESULT(no)
633                         fi
634
635                         if test "$GCC" = "yes"; then
636                                 CFLAGS="$CFLAGS -Wno-char-subscripts"
637                         fi
638                 ;;
639         esac
640
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);
652         ], [
653                 AC_MSG_RESULT(ok)
654         ], [
655                 AC_MSG_RESULT(no)
656                 AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
657                 AC_DEFINE(USE_MONO_MUTEX)
658         ])
659         AC_CHECK_FUNCS(pthread_attr_setstacksize)
660
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)
667         else
668                 AC_TRY_RUN([
669                         #include <pthread.h>
670
671                         __thread int i;
672                         static int res1, res2;
673
674                         void thread_main (void *arg)
675                         {
676                                 i = arg;
677                                 sleep (1);
678                                 if (arg == 1)
679                                         res1 = (i == arg);
680                                 else
681                                         res2 = (i == arg);
682                         }
683
684                         int main () {
685                                 pthread_t t1, t2;
686
687                                 i = 5;
688
689                                 pthread_create (&t1, NULL, thread_main, 1);
690                                 pthread_create (&t2, NULL, thread_main, 2);
691
692                                 pthread_join (t1, NULL);
693                                 pthread_join (t2, NULL);
694
695                                 return !(res1 + res2 == 2);
696                         }
697                 ], [
698                                 AC_MSG_RESULT(yes)
699                                 AC_DEFINE(HAVE_KW_THREAD)
700                 ], [
701                                 AC_MSG_RESULT(no)
702                 ])
703         fi
704
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)
711         else
712                 AC_TRY_RUN([
713                         #include <stdio.h>
714                         #include <stdlib.h>
715                         #include <unistd.h>
716                         #include <signal.h>
717                         #include <pthread.h>
718                         #include <sys/wait.h>
719
720                         static void
721                         sigsegv_signal_handler (int _dummy, siginfo_t *info, void *context)
722                         {
723                                 exit (0);
724                         }
725
726                         static void *
727                         loop (void *ignored)
728                         {
729                                 char *ptr = NULL;
730
731                                 *ptr = 0;
732                                 return NULL;
733                         }
734
735                         static void
736                         child ()
737                         {
738                                 struct sigaction sa;
739                                 struct sigaltstack sas;
740                                 pthread_t id;
741                                 pthread_attr_t attr;
742
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) {
747                                         perror ("lala");
748                                         return;
749                                 }
750
751                                 sas.ss_sp = malloc (SIGSTKSZ);
752                                 sas.ss_size = SIGSTKSZ;
753                                 sas.ss_flags = SS_ONSTACK;
754                                 if (sigaltstack (&sas, NULL) == -1) {
755                                         perror ("lala");
756                                         return;
757                                 }
758
759                                 pthread_attr_init (&attr);
760                                 if (pthread_create(&id, &attr, loop, &attr) != 0) {
761                                         printf ("failed\n");
762                                         return;
763                                 }
764
765                                 sleep (100);
766                         }
767
768                         int
769                         main ()
770                         {
771                                 pid_t son;
772                                 int status;
773                                 int i;
774
775                                 son = fork ();
776                                 if (son == -1) {
777                                         return 1;
778                                 }
779
780                                 if (son == 0) {
781                                         child ();
782                                         return 0;
783                                 }
784
785                                 for (i = 0; i < 3; ++i) {
786                                         sleep (1);
787                                         waitpid (son, &status, WNOHANG);
788                                         if (WIFEXITED (status) && WEXITSTATUS (status) == 0)
789                                                 return 0;
790                                 }
791
792                                 kill (son, SIGKILL);
793                                 return 1;
794                         }
795
796                 ], [
797                                 AC_MSG_RESULT(yes)
798                                 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
799                 ], [
800                                 with_sigaltstack=no
801                                 AC_MSG_RESULT(no)
802                 ])
803         fi
804
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) 
812
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,
817                 AC_TRY_COMPILE([
818                         #include <time.h>
819                         ], [
820                         struct tm tm;
821                         tm.tm_gmtoff = 1;
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)
825         else
826                 AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
827                         AC_TRY_COMPILE([
828                                 #include <time.h>
829                         ], [
830                                 timezone = 1;
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)
834                 else
835                         AC_ERROR(unable to find a way to determine timezone)
836                 fi
837         fi
838
839         dnl *********************************
840         dnl *** Checks for math functions ***
841         dnl *********************************
842         LIBS="$LIBS -lm";
843         AC_CHECK_FUNCS(finite, , AC_MSG_CHECKING(for finite in math.h)
844                 AC_TRY_LINK([#include <math.h>], 
845                 [ finite(0.0); ], 
846                 AC_DEFINE(HAVE_FINITE) AC_MSG_RESULT(yes),
847                 AC_MSG_RESULT(no)))
848         AC_CHECK_FUNCS(isfinite, , AC_MSG_CHECKING(for isfinite in math.h)
849                 AC_TRY_LINK([#include <math.h>], 
850                 [ isfinite(0.0); ], 
851                 AC_DEFINE(HAVE_ISFINITE) AC_MSG_RESULT(yes),
852                 AC_MSG_RESULT(no)))
853
854         dnl ****************************************************************
855         dnl *** Checks for working poll() (macosx defines it but doesn't ***
856         dnl *** have it in the library (duh))                            ***
857         dnl ****************************************************************
858         AC_CHECK_FUNCS(poll)
859
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);
866         ], [
867                 AC_MSG_RESULT(yes)
868                 AC_DEFINE(HAVE_SIGNBIT)
869         ], [
870                 AC_MSG_RESULT(no)
871         ]) 
872
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.
879         AC_TRY_COMPILE([
880         #include <sys/signal.h>
881         ],[
882         int x = SIGEV_THREAD;
883         ],[
884                 ac_cv_c_sigev_thread=yes
885                 AC_MSG_RESULT(yes)
886         ],[
887                 AC_MSG_RESULT(no)
888         ])
889
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>
897                                         ])
898                         AC_CHECK_MEMBER(union sigval.sival_ptr,SIGVAL_PTR="sival_ptr",, [
899                                         #include <sys/signal.h>
900                                         ])
901                         if test "$SIGVAL_PTR" = "undefined" ; then
902                                 AC_MSG_ERROR([Unable to detect field name in 'union sigval'])
903                         fi
904                 fi
905                 AC_DEFINE_UNQUOTED(SIGVAL_PTR,$SIGVAL_PTR,[Pointer field name in 'union sigval'])
906         fi
907 else
908         jdk_headers_found=no
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?))
911
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;
919         ], [
920                 # Yes, we have it...
921                 AC_MSG_RESULT(yes)
922                 AC_DEFINE(HAVE_STRUCT_IP_MREQN)
923         ], [
924                 # We'll just have to try and use struct ip_mreq
925                 AC_MSG_RESULT(no)
926                 AC_MSG_CHECKING(for struct ip_mreq)
927                 AC_TRY_COMPILE([#include <ws2tcpip.h>], [
928                         struct ip_mreq mreq;
929                         mreq.imr_interface.s_addr = 0;
930                 ], [
931                         # Yes, we have it...
932                         AC_MSG_RESULT(yes)
933                         AC_DEFINE(HAVE_STRUCT_IP_MREQ)
934                 ], [
935                         # No multicast support
936                         AC_MSG_RESULT(no)
937                 ])
938         ])
939 fi
940
941 dnl socklen_t check
942 AC_MSG_CHECKING(for socklen_t)
943 AC_TRY_COMPILE([
944 #include <sys/types.h>
945 #include <sys/socket.h>
946 ],[
947   socklen_t foo;
948 ],[
949 ac_cv_c_socklen_t=yes
950         AC_DEFINE(HAVE_SOCKLEN_T)
951         AC_MSG_RESULT(yes)
952 ],[
953         AC_MSG_RESULT(no)
954 ])
955
956 AC_CHECK_FUNCS(trunc, , AC_MSG_CHECKING(for trunc in math.h)
957         AC_TRY_LINK([#include <math.h>], 
958         [ trunc(0.0); ], 
959         [
960                 AC_DEFINE(HAVE_TRUNC) 
961                 AC_MSG_RESULT(yes)
962                 ac_cv_trunc=yes
963         ],
964         AC_MSG_RESULT(no)))
965
966 if test "x$ac_cv_truncl" != "xyes"; then
967    AC_CHECK_LIB(sunmath, aintl, [ AC_DEFINE(HAVE_AINTL) LIBS="$LIBS -lsunmath"])
968 fi
969
970 dnl ****************************
971 dnl *** Look for /dev/random ***
972 dnl ****************************
973
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)
979
980 case "{$target}" in
981     *-openbsd*)
982     NAME_DEV_RANDOM="/dev/srandom"
983     ;;
984
985 dnl Win32 does not have /dev/random, they have their own method...
986
987     *-*-mingw*|*-*-cygwin*)
988     ac_cv_have_dev_random=no
989     ;;
990
991 dnl Everywhere else, it's /dev/random
992
993     *)
994     NAME_DEV_RANDOM="/dev/random"
995     ;;
996 esac
997
998 AC_DEFINE_UNQUOTED(NAME_DEV_RANDOM, "$NAME_DEV_RANDOM")
999
1000 dnl Now check if the device actually exists
1001
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)
1008     fi
1009 else
1010     AC_MSG_CHECKING(for random device)
1011     ac_cv_have_dev_random=no
1012     AC_MSG_RESULT(has been disabled)
1013 fi
1014
1015 if test "x$platform_win32" = "xyes"; then
1016     AC_DEFINE(HAVE_CRYPT_RNG)
1017 fi
1018
1019 if test "x$ac_cv_have_dev_random" = "xno" \
1020     && test "x$platform_win32" = "xno"; then
1021     AC_MSG_WARN([[
1022 ***
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.
1026 ***
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.
1030 ***
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.
1033 ***]])
1034 fi
1035  
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)
1042 fi
1043
1044 #
1045 # ICU 
1046 #
1047 ICU_CFLAGS=""
1048 ICU_LIBS=""
1049 enable_icu=no
1050
1051 probe_icu=true
1052 AC_ARG_WITH(icu, [  --with-icu=yes/no],
1053         if test x$with_icu = xno; then
1054            probe_icu=false;
1055            AC_MSG_RESULT(Will not probe for ICU)
1056         fi
1057 )
1058
1059 if $probe_icu; then
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"
1064         else
1065                 enable_icu="yes. Version: `$ICU_CONFIG --version`"
1066                 AC_DEFINE(HAVE_ICU)
1067                 ICU_CFLAGS=`$ICU_CONFIG --cppflags`
1068                 ICU_LIBS=`$ICU_CONFIG --ldflags`
1069         fi
1070 fi
1071 AC_SUBST(ICU_CFLAGS)
1072 AC_SUBST(ICU_LIBS)
1073
1074 TARGET="unknown"
1075 ACCESS_UNALIGNED="yes"
1076
1077 JIT_SUPPORTED=no
1078 LIBC="libc.so.6"
1079 INTL="libc.so.6"
1080
1081 jit_wanted=false
1082 case "$host" in
1083 #       mips-sgi-irix5.* | mips-sgi-irix6.*)
1084 #               TARGET=MIPS;
1085 #               ACCESS_UNALIGNED="no"
1086 #               ;;
1087         i*86-*-*)
1088                 TARGET=X86;
1089                 arch_target=x86;
1090                 JIT_SUPPORTED=yes
1091                 jit_wanted=true
1092                 ;;
1093         x86_64-*-* | amd64-*-*)
1094                 TARGET=AMD64;
1095                 arch_target=amd64;
1096                 JIT_SUPPORTED=no
1097                 ;;
1098         sparc*-*-*)
1099                 TARGET=SPARC;
1100                 arch_target=sparc;
1101                 JIT_SUPPORTED=yes
1102                 ACCESS_UNALIGNED="no"
1103                 LIBC="libc.so"
1104                 INTL="libintl.so"
1105                 jit_wanted=true
1106                 ;;
1107        alpha*-*-linux* | alpha*-*-osf*)
1108                 TARGET=ALPHA;
1109                 ACCESS_UNALIGNED="no"
1110                 JIT_SUPPORTED=no
1111                 arch_target=alpha;
1112                ;;
1113 #       ia64-*-linux* | ia64-*-hpux*)
1114 #               TARGET=IA64;
1115 #               arch_target=ia64;
1116 #               JIT_SUPPORTED=no;
1117 #               ACCESS_UNALIGNED="no";
1118 #               case "$host_os" in
1119 #                       linux*) LIBC="libc.so.6.1";;
1120 #                       hpux*)  LIBC="libc.so.1";;
1121 #               esac
1122 #               ;;
1123 #       m68k-*-linux*)
1124 #               TARGET=M68K
1125 #               ;;
1126         hppa2.0w-hp-hpux11.00 | hppa64-hp-hpux11.00)
1127                 TARGET=HPPA;
1128                 arch_target=hppa; 
1129                 LIBC="libc.sl"
1130                 ACCESS_UNALIGNED="no"
1131                 ;;
1132         hppa*linux*)
1133                 TARGET=HPPA;
1134                 arch_target=hppa; 
1135                 ACCESS_UNALIGNED="no"
1136                 ;;
1137         macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | \
1138         powerpc-*-sysv* | powerpc-*-darwin*)
1139                 TARGET=POWERPC;
1140                 arch_target=ppc;
1141                 JIT_SUPPORTED=yes
1142                 jit_wanted=true
1143                 ;;
1144         arm-*-linux-* | armv4l-*-linux-*)
1145                 TARGET=ARM;
1146                 arch_target=arm;
1147                 ACCESS_UNALIGNED="no"
1148                 ;;
1149         s390-*-linux*)
1150                 TARGET=S390;
1151                 arch_target=s390;
1152                 ACCESS_UNALIGNED="no"
1153                 JIT_SUPPORTED=yes
1154                 ;;
1155 esac
1156
1157 AC_ARG_WITH(jit, [  --with-jit=yes,no       If you want to build scripts that default to the JIT],[
1158         jit_wanted=true
1159 ])
1160
1161 USEJIT=false
1162 if test x$JIT_SUPPORTED = xyes; then
1163    if $jit_wanted; then
1164       USEJIT=true
1165       jit_status="Building and using the JIT"
1166    else
1167       jit_status="Building the JIT, defaulting to the interpreter"
1168    fi
1169 else
1170    jit_status="interpreter"
1171 fi
1172
1173 AM_CONDITIONAL(USE_JIT, test x$USEJIT = xtrue)
1174
1175 libsuffix=".so"
1176
1177 case "$host" in
1178      powerpc-*-darwin*)
1179         libsuffix=".dylib"
1180         LIBC="libc.dylib"
1181         INTL="libintl.dylib"
1182         ;;
1183      *-*-*netbsd*)
1184         LIBC="libc.so.12"
1185         INTL="libintl.so.0"
1186         ;;
1187 esac
1188 AC_SUBST(libsuffix)
1189
1190 if test ${TARGET} = ARM; then
1191         dnl ******************************************
1192         dnl *** Check to see what FPU is available ***
1193         dnl ******************************************
1194         AC_MSG_CHECKING(which FPU to use)
1195
1196         AC_TRY_COMPILE([], [
1197                 __asm__ ("ldfd f0, [r0]");
1198                 ], fpu=FPA, [
1199                         AC_TRY_COMPILE([], [
1200                                 __asm__ ("fldd d0, [r0]");
1201                         ], fpu=VFP, fpu=NONE)
1202                 ])
1203
1204         AC_MSG_RESULT($fpu)
1205         CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu"
1206         unset fpu
1207 fi
1208
1209 if test ${TARGET} = unknown; then
1210         CPPFLAGS="$CPPFLAGS -DNO_PORT"
1211         AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
1212 fi
1213
1214 if test ${ACCESS_UNALIGNED} = no; then
1215         CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
1216 fi
1217
1218 PREVIEW=no
1219 AC_ARG_WITH(preview, [ --with-preview=yes,no     If you want to install the 2.0 FX preview],[
1220         if test x$with_preview = xyes; then
1221               PREVIEW=yes
1222         fi
1223 ])
1224
1225 AM_CONDITIONAL(INSTALL_2_0, test x$PREVIEW = xyes)
1226
1227 AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
1228 AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
1229 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
1230 AM_CONDITIONAL(X86, test x$TARGET = xX86)
1231 AM_CONDITIONAL(AMD64, test x$TARGET = xAMD64)
1232 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
1233 AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
1234 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
1235 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
1236 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
1237 AM_CONDITIONAL(S390, test x$TARGET = xS390)
1238 AM_CONDITIONAL(HPPA, test x$TARGET = xHPPA)
1239
1240 AM_CONDITIONAL(JIT_SUPPORTED, test x$JIT_SUPPORTED = xyes)
1241
1242 AC_SUBST(LIBC)
1243 AC_SUBST(INTL)
1244
1245 AC_SUBST(arch_target)
1246 AC_SUBST(CFLAGS)
1247 AC_SUBST(CPPFLAGS)
1248 AC_SUBST(LDFLAGS)
1249
1250 AC_OUTPUT([
1251 Makefile
1252 mint.pc
1253 mono.pc
1254 mono/Makefile
1255 mono/utils/Makefile
1256 mono/metadata/Makefile
1257 mono/dis/Makefile
1258 mono/cil/Makefile
1259 mono/arch/Makefile
1260 mono/os/Makefile
1261 mono/os/win32/Makefile
1262 mono/os/unix/Makefile
1263 mono/arch/x86/Makefile
1264 mono/arch/amd64/Makefile
1265 mono/arch/hppa/Makefile
1266 mono/arch/ppc/Makefile
1267 mono/arch/sparc/Makefile
1268 mono/arch/s390/Makefile
1269 mono/arch/arm/Makefile
1270 mono/arch/alpha/Makefile
1271 mono/interpreter/Makefile
1272 mono/tests/Makefile
1273 mono/tests/tests-config
1274 mono/benchmark/Makefile
1275 mono/monoburg/Makefile
1276 mono/monograph/Makefile
1277 mono/io-layer/Makefile
1278 mono/handles/Makefile
1279 mono/mini/Makefile
1280 mono/profiler/Makefile
1281 ikvm-jni/Makefile
1282 runtime/Makefile
1283 runtime/net_1_1/Makefile
1284 runtime/net_2_0/Makefile
1285 scripts/Makefile
1286 man/Makefile
1287 web/Makefile
1288 docs/Makefile
1289 data/Makefile
1290 samples/Makefile
1291 support/Makefile
1292 data/config
1293 mono.spec
1294 tools/Makefile
1295 tools/locale-builder/Makefile
1296 ])
1297
1298 echo "
1299
1300         GC:          $gc
1301         ICU:         $enable_icu
1302         __thread:    $with_nptl
1303         SIGALTSTACK: $with_sigaltstack
1304         Engine:      $jit_status
1305         2.0 Alpha:   $PREVIEW
1306         JNI support: $jdk_headers_found
1307
1308 "