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