TARGET_J2EE fixes
[mono.git] / configure.in
1 AC_INIT(README)
2 AC_CANONICAL_SYSTEM
3
4 # Gross hack to enable 'make dist' on automake 1.9+tar 1.14.
5 # The extra brackets are to foil regex-based scans.
6 m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
7
8 AM_CONFIG_HEADER(config.h)
9 AM_INIT_AUTOMAKE(mono,1.1.9)
10 AM_MAINTAINER_MODE
11
12 AC_PROG_LN_S
13
14 # In case of cygwin, override LN_S, irrespective of what it determines.
15 # The build uses cygwin, but the actual runtime doesn't.
16 case $host_os in
17 *cygwin* ) LN_S='cp -p';;
18 esac
19
20
21 dnl
22 dnl libgc checks
23 dnl
24
25 gc_headers=no
26 gc=included
27 use_included_gc=no
28 libgc_configure_args=
29
30 if test -d $srcdir/libgc ; then
31   gc_default=included
32 else
33   gc_default=boehm
34 fi
35
36 #
37 # These are the flags that need to be stored in the mono.pc file for 
38 # compiling code that will embed Mono
39 #
40 libmono_cflags=""
41 libmono_ldflags=""
42 AC_SUBST(libmono_cflags)
43 AC_SUBST(libmono_ldflags)
44
45 dnl if linker handles the version script
46 no_version_script=no
47
48 # Set to yes if Unix sockets cannot be created in an anonymous namespace
49 need_link_unlink=no
50
51 # Thread configuration inspired by sleepycat's db
52 AC_MSG_CHECKING([host platform characteristics])
53 libgc_threads=no
54 case "$host" in
55         *-*-mingw*|*-*-cygwin*)
56                 platform_win32=yes
57                 AC_DEFINE(PLATFORM_WIN32,1,[Platform is Win32])
58                 if test "x$cross_compiling" = "xno"; then
59                         CC="gcc -mno-cygwin -g"
60                         # So libgc configure gets -mno-cygwin
61                         export CC
62                 fi
63                 HOST_CC="gcc"
64                 CPPFLAGS="$CPPFLAGS -DWIN32_THREADS -DFD_SETSIZE=1024"
65                 libdl=
66                 libgc_threads=win32
67                 gc_default=included
68                 with_nptl=default
69                 with_sigaltstack=no
70                 LN_S=cp
71                 # This forces libgc to use the DllMain based thread registration code on win32
72                 libgc_configure_args="$libgc_configure_args --enable-win32-dllmain=yes"
73                 ;;
74         *-*-*netbsd*)
75                 platform_win32=no
76                 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
77                 libmono_cflags="-D_REENTRANT"
78                 LDFLAGS="$LDFLAGS -pthread"
79                 libmono_ldflags="-pthread"
80                 need_link_unlink=yes
81                 libdl=
82                 libgc_threads=no
83                 ;;
84 # these flags will work for all versions of -STABLE
85 #
86         *-*-*freebsd4*)
87                 platform_win32=no
88                 if test "x$PTHREAD_CFLAGS" = "x"; then
89                         CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS"
90                         libmono_cflags="-D_THREAD_SAFE"
91                 else
92                         CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS -DGC_FREEBSD_THREADS"
93                         libmono_cflags="$PTHREAD_CFLAGS"
94                 fi
95                 if test "x$PTHREAD_LIBS" = "x"; then
96                         LDFLAGS="$LDFLAGS -pthread"
97                         libmono_ldflags="-pthread"
98                 else
99                         LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
100                         libmono_ldflags="$PTHREAD_LIBS"
101                 fi
102                 need_link_unlink=yes
103                 AC_DEFINE(PTHREAD_POINTER_ID)
104                 libdl=
105                 libgc_threads=pthreads
106 # TLS isn't implemented at all on 4-STABLE
107                 with_nptl=no
108                 with_tls=pthread
109                 ;;
110         *-*-*freebsd5*)
111                 platform_win32=no
112                 if test "x$PTHREAD_CFLAGS" = "x"; then
113                         CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS"
114                         libmono_cflags=
115                 else
116                         CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS -DGC_FREEBSD_THREADS"
117                         libmono_cflags="$PTHREAD_CFLAGS"
118                 fi
119                 if test "x$PTHREAD_LIBS" = "x"; then
120                         LDFLAGS="$LDFLAGS -pthread"
121                         libmono_ldflags="-pthread"
122                 else
123                         LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
124                         libmono_ldflags="$PTHREAD_LIBS"
125                 fi
126                 need_link_unlink=yes
127                 AC_DEFINE(PTHREAD_POINTER_ID)
128                 libdl=
129                 with_sigaltstack=yes
130                 libgc_threads=pthreads
131 # TLS is only partially implemented on 5-STABLE (compiler support
132 # but NOT library support)
133 #
134                 with_tls=pthread
135                 ;;
136         *-*-*freebsd6*)
137                 platform_win32=no
138                 if test "x$PTHREAD_CFLAGS" = "x"; then
139                         CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS"
140                         libmono_cflags=
141                 else
142                         CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS -DGC_FREEBSD_THREADS"
143                         libmono_cflags="$PTHREAD_CFLAGS"
144                 fi
145                 if test "x$PTHREAD_LIBS" = "x"; then
146                         LDFLAGS="$LDFLAGS -pthread"
147                         libmono_ldflags="-pthread"
148                 else
149                         LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
150                         libmono_ldflags="$PTHREAD_LIBS"
151                 fi
152                 need_link_unlink=yes
153                 AC_DEFINE(PTHREAD_POINTER_ID)
154                 libdl=
155                 libgc_threads=pthreads
156                 with_sigaltstack=yes
157 # TLS is only partially implemented on -CURRENT (compiler support
158 # but NOT library support)
159 #
160                 with_tls=pthread
161                 ;;
162         *-*-*openbsd*)
163                 platform_win32=no
164                 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS"
165                 libmono_cflags="-D_THREAD_SAFE"
166                 LDFLAGS="$LDFLAGS -pthread"
167                 libmono_ldflags="-pthread"
168                 need_link_unlink=yes
169                 AC_DEFINE(PTHREAD_POINTER_ID)
170                 libdl=
171                 libgc_threads=pthreads
172                 ;;
173         *-*-linux*)
174                 platform_win32=no
175                 CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP"
176                 libmono_cflags="-D_REENTRANT"
177                 libmono_ldflags="-lpthread"
178                 libdl="-ldl"
179                 libgc_threads=pthreads
180                 ;;
181         *-*-hpux*)
182                 platform_win32=no
183                 CPPFLAGS="$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT"
184                 CFLAGS="$CFLAGS +ESdbgasm"
185                 LDFLAGS="$LDFLAGS -z"
186                 libmono_cflags="-D_REENTRANT"
187                 libmono_ldflags="-lpthread"
188                 libgc_threads=pthreads
189                 need_link_unlink=yes
190                 ;;
191         *-*-solaris*)
192                 platform_win32=no
193                 CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_MMAP -DUSE_MUNMAP"
194                 need_link_unlink=yes
195                 libmono_cflags="-D_REENTRANT"
196                 libgc_threads=pthreads
197                 ;;
198         *-*-darwin*)
199                 platform_win32=no
200                 CPPFLAGS="$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS"
201                 libmono_cflags="-D_THREAD_SAFE"
202                 LDFLAGS="$LDFLAGS -pthread"
203                 libmono_ldflags="-pthread"
204                 need_link_unlink=yes
205                 AC_DEFINE(PTHREAD_POINTER_ID)
206                 AC_DEFINE(USE_MACH_SEMA)
207                 no_version_script=yes
208                 libdl=
209                 libgc_threads=pthreads
210                 ;;
211         *)
212                 AC_MSG_WARN([*** Please add $host to configure.in checks!])
213                 platform_win32=no
214                 libdl="-ldl"
215                 ;;
216 esac
217 AC_MSG_RESULT(ok)
218
219 if test x$need_link_unlink = xyes; then
220    AC_DEFINE(NEED_LINK_UNLINK, 1, [Define if Unix sockets cannot be created in an anonymous namespace])
221 fi
222
223 AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
224
225 AC_CHECK_TOOL(CC, gcc, gcc)
226 AC_PROG_CC
227 AM_PROG_CC_STDC
228 AC_PROG_INSTALL
229 AC_PROG_AWK
230 dnl We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
231 : ${CCAS='$(CC)'}
232 # Set ASFLAGS if not already set.
233 : ${CCASFLAGS='$(CFLAGS)'}
234 AC_SUBST(CCAS)
235 AC_SUBST(CCASFLAGS)
236
237 AC_CHECK_PROG(BISON, bison,yes,no)
238 if test "x$BISON" = "xno";
239 then
240         AC_MSG_ERROR([You need to install bison])
241 fi
242
243 dnl may require a specific autoconf version
244 dnl AC_PROG_CC_FOR_BUILD
245 dnl CC_FOR_BUILD not automatically detected
246 CC_FOR_BUILD=$CC
247 BUILD_EXEEXT=
248 if test "x$cross_compiling" = "xyes"; then
249         CC_FOR_BUILD=cc
250         BUILD_EXEEXT=""
251 fi
252 AC_SUBST(CC_FOR_BUILD)
253 AC_SUBST(HOST_CC)
254 AC_SUBST(BUILD_EXEEXT)
255
256 # Set STDC_HEADERS
257 AC_HEADER_STDC
258 AC_LIBTOOL_WIN32_DLL
259 AC_DISABLE_FAST_INSTALL
260 AM_PROG_LIBTOOL
261
262 # Test whenever ld supports -version-script
263 AC_PROG_LD
264 AC_PROG_LD_GNU
265 if test "x$lt_cv_prog_gnu_ld" = "xno"; then
266    no_version_script=yes
267 fi
268
269 AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
270
271 AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h sys/un.h linux/rtc.h)
272
273 AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
274
275 AM_CONDITIONAL(HAVE_ZLIB, test x$have_zlib = xyes)
276
277 # for mono/metadata/debug-symfile.c
278 AC_CHECK_HEADERS(elf.h)
279
280 # for support
281 AC_CHECK_HEADERS(poll.h)
282 AC_CHECK_HEADERS(sys/poll.h)
283 AC_CHECK_HEADERS(sys/wait.h)
284 AC_CHECK_HEADERS(grp.h)
285 AC_CHECK_HEADERS(syslog.h)
286
287 # for mono/dis
288 AC_CHECK_HEADERS(wchar.h)
289 case "$host" in
290         *-*-*freebsd6*)
291                 AC_CHECK_HEADERS(ieeefp.h)
292         ;;
293         *-*-*freebsd*)
294                 /* Only freebsd6 has a working ieeefp.h */
295         ;;
296         *)
297                 AC_CHECK_HEADERS(ieeefp.h)
298         ;;
299 esac
300 AC_MSG_CHECKING(for isinf)
301 AC_TRY_LINK([#include <math.h>], [
302         int f = isinf (1);
303 ], [
304         AC_MSG_RESULT(yes)
305         AC_DEFINE(HAVE_ISINF, 1, [isinf available])
306 ], [
307         # We'll have to use signals
308         AC_MSG_RESULT(no)
309 ])
310
311
312 # not 64 bit clean in cross-compile
313 AC_CHECK_SIZEOF(void *, 4)
314
315 WARN=''
316 if test x"$GCC" = xyes; then
317         WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings'
318                 # The runtime code does not respect ANSI C strict aliasing rules
319                 CFLAGS="$CFLAGS -fno-strict-aliasing"
320
321                 ORIG_CFLAGS=$CFLAGS
322                 CFLAGS="$CFLAGS -Wdeclaration-after-statement"
323                 AC_MSG_CHECKING(for -Wdeclaration-after-statement option to gcc)
324                 AC_TRY_COMPILE([], [
325                                                    void main () { }
326                 ], [
327                    AC_MSG_RESULT(yes)
328                 ], [
329                    AC_MSG_RESULT(no)
330                    CFLAGS=$ORIG_CFLAGS
331                 ])
332 else
333         # The Sun Forte compiler complains about inline functions that access static variables
334         # so disable all inlining.
335         case "$host" in
336         *-*-solaris*)
337                 CFLAGS="$CFLAGS -Dinline="
338                 ;;
339         esac
340 fi
341 CFLAGS="$CFLAGS -g $WARN"
342
343 # Where's the 'mcs' source tree?
344 if test -d $srcdir/mcs; then
345   mcsdir=mcs
346 else
347   mcsdir=../mcs
348 fi
349
350 mcs_topdir='$(top_srcdir)/'$mcsdir
351 mcs_topdir_from_srcdir='$(top_builddir)/'$mcsdir
352
353 AC_SUBST([mcs_topdir])
354 AC_SUBST([mcs_topdir_from_srcdir])
355
356 AC_ARG_WITH([libgdiplus], 
357         [  --with-libgdiplus=installed|sibling|<path>   Override the libgdiplus used for System.Drawing tests (defaults to NO)], 
358         [], [with_libgdiplus=installed])
359
360 case $with_libgdiplus in
361 no|installed) libgdiplus_loc= ;;
362 yes|sibling) libgdiplus_loc=`cd ../libgdiplus && pwd`/src/libgdiplus.la ;;
363 /*) libgdiplus_loc=$with_libgdiplus ;;
364 *) libgdiplus_loc=`pwd`/$with_libgdiplus ;;
365 esac
366 AC_SUBST([libgdiplus_loc])
367
368 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
369 if test "x$PKG_CONFIG" = "xno"; then
370         AC_MSG_ERROR([You need to install pkg-config])
371 fi
372
373 dnl for use on the build system
374 dnl pkg-config is stupid
375 BUILD_GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
376 BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
377 AC_SUBST(BUILD_GLIB_CFLAGS)
378 AC_SUBST(BUILD_GLIB_LIBS)
379
380 pkg_config_path=
381 AC_ARG_WITH(crosspkgdir, [  --with-crosspkgdir=/path/to/pkg-config/dir],
382         if test x$with_crosspkgdir = "x"; then
383                 if test -s $PKG_CONFIG_PATH; then
384                         pkg_config_path=$PKG_CONFIG_PATH
385                 fi
386         else
387                 pkg_config_path=$with_crosspkgdir
388                 PKG_CONFIG_PATH=$pkg_config_path
389                 export PKG_CONFIG_PATH
390         fi
391 )
392
393 ## Versions of dependencies
394 GLIB_REQUIRED_VERSION=1.3.11
395
396 PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION)
397
398 if test "x$cross_compiling" = "xno"; then
399    GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
400    GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
401    GMODULE_CFLAGS=`$PKG_CONFIG --cflags gmodule-2.0`
402    GMODULE_LIBS=`$PKG_CONFIG --libs gmodule-2.0`
403 fi
404
405 AC_SUBST(GLIB_CFLAGS)
406 AC_SUBST(GLIB_LIBS)
407 AC_SUBST(GMODULE_CFLAGS)
408 AC_SUBST(GMODULE_LIBS)
409
410 if test x$platform_win32 = xyes -a x$cross_compiling = xno; then   
411    AC_MSG_CHECKING(for cygwin glib2-dev package)
412    if [ cygcheck --f /usr/lib/libglib-2.0.dll.a | grep -q glib2-devel ]; then
413       AC_MSG_RESULT(found)
414           AC_MSG_ERROR([Mono cannot be built with the cygwin glib2-devel package installed, because that package doesn't work with -mno-cygwin. Please uninstall it then re-run configure.])
415    else
416       AC_MSG_RESULT(not found, ok)
417    fi
418
419    AC_MSG_CHECKING(for broken gwin32.h)
420    glib_include=`$PKG_CONFIG --cflags-only-I glib-2.0 | sed -e 's/ -I.*//g' | sed -e 's/-I//g'`
421    if test -f $glib_include/glib/gwin32.h; then
422           if [ grep ftruncate $glib_include/glib/gwin32.h | grep -q define ]; then
423                  AC_MSG_RESULT(failed)
424                  hashmark='#'
425                  AC_MSG_ERROR([Your version of gwin32.h is broken and will cause compilation errors when building mono. Please fix it by deleting the line: '$hashmark   define ftruncate...' from '$glib_include/glib/gwin32.h' then re-run configure.])
426           fi
427    fi
428    AC_MSG_RESULT(ok)
429 fi
430
431 AC_ARG_WITH(gc, [  --with-gc=boehm,included,none],[gc=$with_gc],[gc=$gc_default])
432
433 # Enable support for fast thread-local storage
434 # Some systems have broken support, so we allow to disable it.
435 AC_ARG_WITH(tls, [  --with-tls=__thread,pthread       select Thread Local Storage implementation],[],[with_tls=__thread])
436
437 # Kept for compatibility
438 AC_ARG_WITH(nptl, [  --with-nptl=yes,no      deprecated, use --with-tls instead],[],[with_nptl=default])
439
440 if test "x$with_nptl" != "xdefault"; then
441    if test "x$with_nptl" = "xyes"; then
442       AC_MSG_WARN([--with-nptl=yes is deprecated, use --with-tls=__thread option instead.])
443           with_tls=__thread
444    fi
445    if test "x$with_nptl" = "xno"; then
446       AC_MSG_WARN([--with-nptl=no is deprecated, use --with-tls=pthread option instead.])
447           with_tls=pthread
448    fi
449 fi
450
451 # Enable support for using sigaltstack for SIGSEGV and stack overflow handling
452 # This does not work on some platforms (bug #55253)
453 AC_ARG_WITH(sigaltstack, [  --with-sigaltstack=yes,no      enable/disable support for sigaltstack],[],[with_sigaltstack=no])
454
455 AC_ARG_WITH(static_mono, [  --with-static_mono=yes,no      link mono statically to libmono (faster)],[],[with_static_mono=yes])
456
457 if test "x$enable_static" = "xno"; then
458    with_static_mono=no
459 fi
460
461 if test "x$platform_win32" = "xyes"; then
462    # Boehm GC requires the runtime to be in its own dll
463    with_static_mono=no
464 fi
465
466 AM_CONDITIONAL(STATIC_MONO, test x$with_static_mono != xno)
467
468 AC_ARG_ENABLE(minimal, [  --enable-minimal=LIST      drop support for LIST subsystems.
469   LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, reflection_emit.],
470 [
471         for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
472                 eval "mono_feature_disable_$feature='yes'"
473                 AC_MSG_NOTICE([Disabled support for feature: $feature])
474         done
475         disabled="Disabled:    $enable_minimal"
476 ],[])
477
478 if test "x$mono_feature_disable_aot" = "xyes"; then
479         AC_DEFINE(DISABLE_AOT, 1, [Disable AOT support])
480 fi
481
482 if test "x$mono_feature_disable_profiler" = "xyes"; then
483         AC_DEFINE(DISABLE_PROFILER, 1, [Disable default profiler support])
484 fi
485
486 if test "x$mono_feature_disable_decimal" = "xyes"; then
487         AC_DEFINE(DISABLE_DECIMAL, 1, [Disable System.Decimal support])
488 fi
489
490 if test "x$mono_feature_disable_pinvoke" = "xyes"; then
491         AC_DEFINE(DISABLE_PINVOKE, 1, [Disable P/Invoke support])
492 fi
493
494 if test "x$mono_feature_disable_debug" = "xyes"; then
495         AC_DEFINE(DISABLE_DEBUG, 1, [Disable runtime debugging support])
496 fi
497
498 if test "x$mono_feature_disable_reflection_emit" = "xyes"; then
499         AC_DEFINE(DISABLE_REFLECTION_EMIT, 1, [Disable reflection emit support])
500 fi
501
502 LIBGC_CFLAGS=
503 LIBGC_LIBS=
504 LIBGC_STATIC_LIBS=
505 libgc_dir=
506 case "x$gc" in
507         xboehm|xbohem|xyes)
508                 AC_CHECK_HEADERS(gc.h gc/gc.h, gc_headers=yes)
509                 AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
510
511                 if test "x$found_boehm" != "xyes"; then
512                         AC_MSG_ERROR("GC requested but libgc not found! Install libgc or run configure with --with-gc=none.")
513                 fi
514                 if test "x$gc_headers" != "xyes"; then
515                         AC_MSG_ERROR("GC requested but header files not found! You may need to install them by hand.")
516                 fi
517
518                 AC_DEFINE(HAVE_BOEHM_GC)
519                 AC_SUBST(HAVE_BOEHM_GC)
520                 LIBGC_LIBS="-lgc $libdl"
521                 LIBGC_STATIC_LIBS="$LIBGC_LIBS"
522
523                 # AC_CHECK_FUNCS does not work for some reason...
524                 AC_CHECK_LIB(gc, GC_gcj_malloc, found_gcj_malloc="yes",,$libdl)
525                 if test "x$found_gcj_malloc" = "xyes"; then
526                         AC_DEFINE(HAVE_GC_GCJ_MALLOC)
527                 fi
528                 AC_CHECK_LIB(gc, GC_enable, found_gc_enable="yes",,$libdl)
529                 if test "x$found_gc_enable" = "xyes"; then
530                         AC_DEFINE(HAVE_GC_ENABLE)
531                 fi
532                 ;;
533
534         xincluded)
535                 AC_CONFIG_SUBDIRS(libgc)
536
537                 found_boehm=yes
538                 gc_headers=yes
539                 use_included_gc=yes
540                 libgc_dir=libgc
541
542                 LIBGC_CFLAGS='-I$(top_srcdir)/libgc/include'
543                 LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
544                 LIBGC_STATIC_LIBS='$(top_builddir)/libgc/libmonogc-static.la'
545
546                 AC_DEFINE(HAVE_BOEHM_GC)
547                 AC_SUBST(HAVE_BOEHM_GC)
548
549                 AC_DEFINE(HAVE_GC_H)
550                 AC_DEFINE(USE_INCLUDED_LIBGC)
551
552                 # The included libgc contains GCJ support
553                 AC_DEFINE(HAVE_GC_GCJ_MALLOC)
554                 AC_DEFINE(HAVE_GC_ENABLE)
555                 ;;
556
557         xnone)
558                 AC_MSG_WARN("Compiling mono without GC.")
559                 ;;
560         *)
561                 AC_MSG_ERROR([Invalid argument to --with-gc.])
562                 ;;
563 esac
564
565 AC_ARG_WITH(large-heap, [  --with-large-heap=yes,no    Enable support for GC heaps larger than 3GB], [large_heap=$withval], [large_heap=no])
566 if test "x$large_heap" = "xyes"; then
567    echo "FOO"
568    CPPFLAGS="$CPPFLAGS -DLARGE_CONFIG"
569 fi
570
571 # tell libgc/configure about what we want
572 ac_configure_args="$ac_configure_args --disable-embed-check --with-libgc-threads=$libgc_threads $libgc_configure_args"
573
574 AM_CONDITIONAL(INCLUDED_LIBGC, test x$use_included_gc = xyes)
575 AC_SUBST(LIBGC_CFLAGS)
576 AC_SUBST(LIBGC_LIBS)
577 AC_SUBST(LIBGC_STATIC_LIBS)
578 AC_SUBST(libgc_dir)
579
580 dnl
581 dnl End of libgc checks
582 dnl
583
584 if test x$platform_win32 = xno; then
585
586         dnl ******************************************************************
587         dnl *** Checks for the IKVM JNI interface library                  ***
588         dnl ******************************************************************
589         AC_ARG_WITH(ikvm-native, [  --with-ikvm-native=yes,no  build the IKVM JNI interface library],[with_ikvm_native=$withval],[with_ikvm_native=yes])
590
591         ikvm_native_dir=
592         if test x$with_ikvm_native = xyes; then
593                 ikvm_native_dir=ikvm-native
594                 jdk_headers_found="IKVM Native"
595         fi
596
597         AC_SUBST(ikvm_native_dir)
598
599         AC_CHECK_FUNCS(getgrgid_r)
600         AC_CHECK_FUNCS(getgrnam_r)
601         AC_CHECK_FUNCS(getpwnam_r)
602         AC_CHECK_FUNCS(getpwuid_r)
603         AC_CHECK_FUNCS(getresuid)
604         AC_CHECK_FUNCS(setresuid)
605         AC_CHECK_FUNCS(kqueue)
606         AC_CHECK_FUNCS(backtrace_symbols)
607
608         dnl ******************************************************************
609         dnl *** Check for large file support                               ***
610         dnl *** (If we were using autoconf 2.50 we'd use AC_SYS_LARGEFILE) ***
611         dnl ******************************************************************
612         
613         # Check that off_t can represent 2**63 - 1 correctly, working around
614         # potential compiler bugs.  Defines LARGE_FILE_SUPPORT, adds $1 to
615         # CPPFLAGS and sets $large_offt to yes if the test succeeds
616         large_offt=no
617         AC_DEFUN([LARGE_FILES], [
618                 large_CPPFLAGS=$CPPFLAGS
619                 CPPFLAGS="$CPPFLAGS $1"
620                 AC_TRY_RUN([
621                         #include <sys/types.h>
622
623                         #define BIG_OFF_T (((off_t)1<<62)-1+((off_t)1<<62))
624
625                         int main(void) {
626                                 int big_off_t=((BIG_OFF_T%2147483629==721) &&
627                                                (BIG_OFF_T%2147483647==1));
628                                 if(big_off_t) {
629                                         exit(0);
630                                 } else {
631                                         exit(1);
632                                 }
633                         }
634                 ], [
635                         AC_MSG_RESULT(ok)
636                         AC_DEFINE(HAVE_LARGE_FILE_SUPPORT)
637                         large_CPPFLAGS="$large_CPPFLAGS $1"
638                         large_offt=yes
639                 ], [
640                         AC_MSG_RESULT(no)
641                 ], "")
642                 CPPFLAGS=$large_CPPFLAGS
643         ])
644
645         AC_MSG_CHECKING(if off_t is 64 bits wide)
646         LARGE_FILES("")
647         if test $large_offt = no; then
648                 AC_MSG_CHECKING(if _FILE_OFFSET_BITS=64 gives 64 bit off_t)
649                 LARGE_FILES("-D_FILE_OFFSET_BITS=64")
650         fi
651         if test $large_offt = no; then
652                 AC_MSG_WARN([No 64 bit file size support available])
653         fi
654         
655         dnl *****************************
656         dnl *** Checks for libsocket  ***
657         dnl *****************************
658         AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
659
660         dnl *******************************
661         dnl *** Checks for MSG_NOSIGNAL ***
662         dnl *******************************
663         AC_MSG_CHECKING(for MSG_NOSIGNAL)
664         AC_TRY_COMPILE([#include <sys/socket.h>], [
665                 int f = MSG_NOSIGNAL;
666         ], [
667                 # Yes, we have it...
668                 AC_MSG_RESULT(yes)
669                 AC_DEFINE(HAVE_MSG_NOSIGNAL)
670         ], [
671                 # We'll have to use signals
672                 AC_MSG_RESULT(no)
673         ])
674
675         dnl *****************************
676         dnl *** Checks for SOL_IP     ***
677         dnl *****************************
678         AC_MSG_CHECKING(for SOL_IP)
679         AC_TRY_COMPILE([#include <netdb.h>], [
680                 int level = SOL_IP;
681         ], [
682                 # Yes, we have it...
683                 AC_MSG_RESULT(yes)
684                 AC_DEFINE(HAVE_SOL_IP)
685         ], [
686                 # We'll have to use getprotobyname
687                 AC_MSG_RESULT(no)
688         ])
689
690         dnl *****************************
691         dnl *** Checks for SOL_IPV6     ***
692         dnl *****************************
693         AC_MSG_CHECKING(for SOL_IPV6)
694         AC_TRY_COMPILE([#include <netdb.h>], [
695                 int level = SOL_IPV6;
696         ], [
697                 # Yes, we have it...
698                 AC_MSG_RESULT(yes)
699                 AC_DEFINE(HAVE_SOL_IPV6)
700         ], [
701                 # We'll have to use getprotobyname
702                 AC_MSG_RESULT(no)
703         ])
704
705         dnl *****************************
706         dnl *** Checks for SOL_TCP    ***
707         dnl *****************************
708         AC_MSG_CHECKING(for SOL_TCP)
709         AC_TRY_COMPILE([#include <netdb.h>], [
710                 int level = SOL_TCP;
711         ], [
712                 # Yes, we have it...
713                 AC_MSG_RESULT(yes)
714                 AC_DEFINE(HAVE_SOL_TCP)
715         ], [
716                 # We'll have to use getprotobyname
717                 AC_MSG_RESULT(no)
718         ])
719
720         dnl *****************************
721         dnl *** Checks for IP_PKTINFO ***
722         dnl *****************************
723         AC_MSG_CHECKING(for IP_PKTINFO)
724         AC_TRY_COMPILE([#include <netdb.h>], [
725                 int level = IP_PKTINFO;
726         ], [
727                 # Yes, we have it...
728                 AC_MSG_RESULT(yes)
729                 AC_DEFINE(HAVE_IP_PKTINFO)
730         ], [
731                 AC_MSG_RESULT(no)
732         ])
733
734         dnl *****************************
735     dnl *** Checks for IPV6_PKTINFO ***
736     dnl *****************************
737     AC_MSG_CHECKING(for IPV6_PKTINFO)
738     AC_TRY_COMPILE([#include <netdb.h>], [
739         int level = IPV6_PKTINFO;
740     ], [
741         # Yes, we have it...
742         AC_MSG_RESULT(yes)
743         AC_DEFINE(HAVE_IPV6_PKTINFO)
744     ], [
745         AC_MSG_RESULT(no)
746     ])
747  
748         dnl *********************************
749         dnl *** Check for struct ip_mreqn ***
750         dnl *********************************
751         AC_MSG_CHECKING(for struct ip_mreqn)
752         AC_TRY_COMPILE([#include <netinet/in.h>], [
753                 struct ip_mreqn mreq;
754                 mreq.imr_address.s_addr = 0;
755         ], [
756                 # Yes, we have it...
757                 AC_MSG_RESULT(yes)
758                 AC_DEFINE(HAVE_STRUCT_IP_MREQN)
759         ], [
760                 # We'll just have to try and use struct ip_mreq
761                 AC_MSG_RESULT(no)
762                 AC_MSG_CHECKING(for struct ip_mreq)
763                 AC_TRY_COMPILE([#include <netinet/in.h>], [
764                         struct ip_mreq mreq;
765                         mreq.imr_interface.s_addr = 0;
766                 ], [
767                         # Yes, we have it...
768                         AC_MSG_RESULT(yes)
769                         AC_DEFINE(HAVE_STRUCT_IP_MREQ)
770                 ], [
771                         # No multicast support
772                         AC_MSG_RESULT(no)
773                 ])
774         ])
775         
776         dnl **********************************
777         dnl *** Check for gethostbyname2_r ***
778         dnl **********************************
779         AC_MSG_CHECKING(for gethostbyname2_r)
780                 AC_TRY_LINK([#include <netdb.h>], [
781                 gethostbyname2_r(NULL,0,NULL,NULL,0,NULL,NULL);
782         ], [
783                 # Yes, we have it...
784                 AC_MSG_RESULT(yes)
785                 AC_DEFINE(HAVE_GETHOSTBYNAME2_R)
786         ], [
787                 AC_MSG_RESULT(no)
788         ])
789
790         dnl *****************************
791         dnl *** Checks for libnsl     ***
792         dnl *****************************
793         AC_CHECK_LIB(nsl, gethostbyaddr, LIBS="$LIBS -lnsl")
794
795         AC_CHECK_FUNCS(inet_pton inet_aton)
796
797         dnl ***********************************************
798         dnl *** Checks for size of sockaddr_un.sun_path ***
799         dnl ***********************************************
800         # AC_CHECK_SIZEOF can't cope with struct members :-(
801         AC_MSG_CHECKING(size of sockaddr_un.sun_path)
802         AC_CACHE_VAL(cv_mono_sizeof_sunpath,
803                 [AC_TRY_RUN([
804                         #include <sys/types.h>
805                         #include <stdio.h>
806                         #include <sys/un.h>
807
808                         int main(void) {
809                                 struct sockaddr_un sock_un;
810                                 FILE *f=fopen("conftestval", "w");
811                                 if(!f) exit(1);
812                                 fprintf(f, "%d\n", sizeof(sock_un.sun_path));
813                                 exit(0);
814                         }
815                 ], cv_mono_sizeof_sunpath=`cat conftestval`,
816                    cv_mono_sizeof_sunpath=0,
817                    cv_mono_sizeof_sunpath=0)])dnl
818         AC_MSG_RESULT($cv_mono_sizeof_sunpath)
819         AC_DEFINE_UNQUOTED(MONO_SIZEOF_SUNPATH, $cv_mono_sizeof_sunpath)
820
821         dnl *************************************
822         dnl *** Checks for zero length arrays ***
823         dnl *************************************
824         AC_MSG_CHECKING(whether $CC supports zero length arrays)
825         AC_TRY_COMPILE([
826                 struct s {
827                         int  length;
828                         char data [0];
829                 };
830         ], [], [
831                 AC_MSG_RESULT(yes)
832                 AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 0)
833         ], [
834                 AC_MSG_RESULT(no)
835                 AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 1)
836         ])
837
838         dnl *****************************
839         dnl *** Checks for libxnet    ***
840         dnl *****************************
841         case "${host}" in
842                 *solaris* )
843                         AC_MSG_CHECKING(for Solaris XPG4 support)
844                         if test -f /usr/lib/libxnet.so; then
845                                 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
846                                 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
847                                 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
848                                 LIBS="$LIBS -lxnet"
849                                 AC_MSG_RESULT(yes)
850                         else
851                                 AC_MSG_RESULT(no)
852                         fi
853
854                         if test "$GCC" = "yes"; then
855                                 CFLAGS="$CFLAGS -Wno-char-subscripts"
856                         fi
857                 ;;
858         esac
859
860         dnl *****************************
861         dnl *** Checks for libpthread ***
862         dnl *****************************
863 # on FreeBSD -STABLE, the pthreads functions all reside in libc_r
864 # and libpthread does not exist
865 #
866         case "${host}" in
867                 *-*-*freebsd4*)
868                         AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread")
869                 ;;
870                 *-*-*freebsd5*)
871                         AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread")
872                 ;;
873                 *-*-*freebsd6*)
874                         AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread")
875                 ;;
876                 *)
877                         AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
878                 ;;
879         esac
880         AC_CHECK_HEADERS(pthread.h)
881         AC_CHECK_FUNCS(pthread_mutex_timedlock)
882         AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np)
883         AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
884         AC_TRY_COMPILE([ #include <pthread.h>], [
885                 pthread_mutexattr_t attr;
886                 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
887         ], [
888                 AC_MSG_RESULT(ok)
889         ], [
890                 AC_MSG_RESULT(no)
891                 AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
892                 AC_DEFINE(USE_MONO_MUTEX)
893         ])
894         AC_CHECK_FUNCS(pthread_attr_setstacksize)
895
896         dnl ***********************************
897         dnl *** Checks for working __thread ***
898         dnl ***********************************
899         AC_MSG_CHECKING(for working __thread)
900         if test "x$with_tls" != "x__thread"; then
901                 AC_MSG_RESULT(disabled)
902         else
903                 AC_TRY_RUN([
904                         #include <pthread.h>
905                         __thread int i;
906                         static int res1, res2;
907
908                         void thread_main (void *arg)
909                         {
910                                 i = arg;
911                                 sleep (1);
912                                 if (arg == 1)
913                                         res1 = (i == arg);
914                                 else
915                                         res2 = (i == arg);
916                         }
917
918                         int main () {
919                                 pthread_t t1, t2;
920
921                                 i = 5;
922
923                                 pthread_create (&t1, NULL, thread_main, 1);
924                                 pthread_create (&t2, NULL, thread_main, 2);
925
926                                 pthread_join (t1, NULL);
927                                 pthread_join (t2, NULL);
928
929                                 return !(res1 + res2 == 2);
930                         }
931                 ], [
932                                 AC_MSG_RESULT(yes)
933                 ], [
934                                 AC_MSG_RESULT(no)
935                                 with_tls=pthread
936                 ])
937         fi
938
939         dnl **************************************
940         dnl *** Checks for working sigaltstack ***
941         dnl **************************************
942         AC_MSG_CHECKING(for working sigaltstack)
943         if test "x$with_sigaltstack" != "xyes"; then
944                 AC_MSG_RESULT(disabled)
945         else
946                 AC_TRY_RUN([
947                         #include <stdio.h>
948                         #include <stdlib.h>
949                         #include <unistd.h>
950                         #include <signal.h>
951                         #include <pthread.h>
952                         #include <sys/wait.h>
953                         #if defined(__FreeBSD__) || defined(__NetBSD__)
954                         #define SA_STACK SA_ONSTACK
955                         #endif
956                         static void
957                         sigsegv_signal_handler (int _dummy, siginfo_t *info, void *context)
958                         {
959                                 exit (0);
960                         }
961
962                         static void *
963                         loop (void *ignored)
964                         {
965                                 char *ptr = NULL;
966
967                                 *ptr = 0;
968                                 return NULL;
969                         }
970
971                         static void
972                         child ()
973                         {
974                                 struct sigaction sa;
975                                 struct sigaltstack sas;
976                                 pthread_t id;
977                                 pthread_attr_t attr;
978
979                                 sa.sa_sigaction = sigsegv_signal_handler;
980                                 sigemptyset (&sa.sa_mask);
981                                 sa.sa_flags = SA_SIGINFO | SA_ONSTACK;
982                                 if (sigaction (SIGSEGV, &sa, NULL) == -1) {
983                                         perror ("sigaction");
984                                         return;
985                                 }
986
987                                 sas.ss_sp = malloc (SIGSTKSZ);
988                                 sas.ss_size = SIGSTKSZ;
989                                 sas.ss_flags = 0;
990                                 if (sigaltstack (&sas, NULL) == -1) {
991                                         perror ("sigaltstack");
992                                         return;
993                                 }
994
995                                 pthread_attr_init (&attr);
996                                 if (pthread_create(&id, &attr, loop, &attr) != 0) {
997                                         printf ("pthread_create\n");
998                                         return;
999                                 }
1000
1001                                 sleep (100);
1002                         }
1003
1004                         int
1005                         main ()
1006                         {
1007                                 pid_t son;
1008                                 int status;
1009                                 int i;
1010
1011                                 son = fork ();
1012                                 if (son == -1) {
1013                                         return 1;
1014                                 }
1015
1016                                 if (son == 0) {
1017                                         child ();
1018                                         return 0;
1019                                 }
1020
1021                                 for (i = 0; i < 3; ++i) {
1022                                         sleep (1);
1023                                         waitpid (son, &status, WNOHANG);
1024                                         if (WIFEXITED (status) && WEXITSTATUS (status) == 0)
1025                                                 return 0;
1026                                 }
1027
1028                                 kill (son, SIGKILL);
1029                                 return 1;
1030                         }
1031
1032                 ], [
1033                                 AC_MSG_RESULT(yes)
1034                                 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
1035                 ], [
1036                                 with_sigaltstack=no
1037                                 AC_MSG_RESULT(no)
1038                 ])
1039         fi
1040
1041         dnl ********************************
1042         dnl *** Checks for semaphore lib ***
1043         dnl ********************************
1044         # 'Real Time' functions on Solaris
1045         # posix4 on Solaris 2.6
1046         # pthread (first!) on Linux
1047         AC_SEARCH_LIBS(sem_init, pthread rt posix4) 
1048
1049         dnl ********************************
1050         dnl *** Checks for timezone stuff **
1051         dnl ********************************
1052         AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
1053                 AC_TRY_COMPILE([
1054                         #include <time.h>
1055                         ], [
1056                         struct tm tm;
1057                         tm.tm_gmtoff = 1;
1058                         ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
1059         if test $ac_cv_struct_tm_gmtoff = yes; then
1060                 AC_DEFINE(HAVE_TM_GMTOFF)
1061         else
1062                 AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
1063                         AC_TRY_COMPILE([
1064                                 #include <time.h>
1065                         ], [
1066                                 timezone = 1;
1067                         ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
1068                 if test $ac_cv_var_timezone = yes; then
1069                         AC_DEFINE(HAVE_TIMEZONE)
1070                 else
1071                         AC_ERROR(unable to find a way to determine timezone)
1072                 fi
1073         fi
1074
1075         dnl *********************************
1076         dnl *** Checks for math functions ***
1077         dnl *********************************
1078         LIBS="$LIBS -lm";
1079         AC_CHECK_FUNCS(finite, , AC_MSG_CHECKING(for finite in math.h)
1080                 AC_TRY_LINK([#include <math.h>], 
1081                 [ finite(0.0); ], 
1082                 AC_DEFINE(HAVE_FINITE) AC_MSG_RESULT(yes),
1083                 AC_MSG_RESULT(no)))
1084         AC_CHECK_FUNCS(isfinite, , AC_MSG_CHECKING(for isfinite in math.h)
1085                 AC_TRY_LINK([#include <math.h>], 
1086                 [ isfinite(0.0); ], 
1087                 AC_DEFINE(HAVE_ISFINITE) AC_MSG_RESULT(yes),
1088                 AC_MSG_RESULT(no)))
1089
1090         dnl ****************************************************************
1091         dnl *** Checks for working poll() (macosx defines it but doesn't ***
1092         dnl *** have it in the library (duh))                            ***
1093         dnl ****************************************************************
1094         AC_CHECK_FUNCS(poll)
1095
1096         dnl *************************
1097         dnl *** Check for signbit ***
1098         dnl *************************
1099         AC_MSG_CHECKING(for signbit)
1100         AC_TRY_LINK([#include <math.h>], [
1101                 int s = signbit(1.0);
1102         ], [
1103                 AC_MSG_RESULT(yes)
1104                 AC_DEFINE(HAVE_SIGNBIT)
1105         ], [
1106                 AC_MSG_RESULT(no)
1107         ]) 
1108
1109         dnl *********************
1110         dnl *** Check for AIO ***
1111         dnl *********************
1112         AC_MSG_CHECKING([for SIGEV_THREAD definition])
1113         dnl Some systems (FreeBSD at least) may have aio_read
1114         dnl but don't support/define SIGEV_THREAD.
1115         AC_TRY_COMPILE([
1116         #include <sys/signal.h>
1117         ],[
1118         int x = SIGEV_THREAD;
1119         ],[
1120                 ac_cv_c_sigev_thread=yes
1121                 AC_MSG_RESULT(yes)
1122         ],[
1123                 AC_MSG_RESULT(no)
1124         ])
1125
1126         if test "$ac_cv_c_sigev_thread" = "yes" ; then
1127                 AC_CHECK_HEADERS(aio.h sys/aio.h)
1128                 AC_CHECK_LIB(rt, aio_read, [ LIBS="$LIBS -lrt" ],)
1129                 SIGVAL_PTR="undefined"
1130                 if test "$ac_cv_header_aio_h" = "yes" -o "$ac_cv_header_sys_aio_h" = "yes" ; then
1131                         AC_CHECK_MEMBER(union sigval.sigval_ptr,SIGVAL_PTR="sigval_ptr",, [
1132                                         #include <sys/signal.h>
1133                                         ])
1134                         AC_CHECK_MEMBER(union sigval.sival_ptr,SIGVAL_PTR="sival_ptr",, [
1135                                         #include <sys/signal.h>
1136                                         ])
1137                         if test "$SIGVAL_PTR" = "undefined" ; then
1138                                 AC_MSG_ERROR([Unable to detect field name in 'union sigval'])
1139                         fi
1140                 fi
1141                 AC_DEFINE_UNQUOTED(SIGVAL_PTR,$SIGVAL_PTR,[Pointer field name in 'union sigval'])
1142         fi
1143
1144         dnl **********************************
1145         dnl *** epoll                      ***
1146         dnl **********************************
1147         AC_CHECK_HEADERS(sys/epoll.h)
1148         haveepoll=no
1149         AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], )
1150         if test "x$haveepoll" = "xyes" -a "x$ac_cv_header_sys_epoll_h" = "xyes" ; then
1151                 AC_DEFINE(HAVE_EPOLL, 1, [epoll supported])
1152         fi
1153
1154         dnl ******************************
1155         dnl *** Checks for SIOCGIFCONF ***
1156         dnl ******************************
1157         AC_CHECK_HEADERS(sys/ioctl.h)
1158         AC_CHECK_HEADERS(net/if.h)
1159         AC_MSG_CHECKING(for ifreq)
1160         AC_TRY_COMPILE([
1161                 #include <sys/ioctl.h>
1162                 #include <net/if.h>
1163                 ], [
1164                 struct ifconf ifc;
1165                 struct ifreq *ifr;
1166                 void *x;
1167                 ifc.ifc_len = 0;
1168                 ifc.ifc_buf = NULL;
1169                 x = (void *) &ifr->ifr_addr;
1170                 ],[
1171                         AC_MSG_RESULT(yes)
1172                         AC_DEFINE(HAVE_SIOCGIFCONF, 1, [Can get interface list])
1173                 ], [
1174                         AC_MSG_RESULT(no)
1175                 ])
1176         dnl **********************************
1177         dnl *** Checks for MonoPosixHelper ***
1178         dnl **********************************
1179         AC_CHECK_HEADERS(checklist.h)
1180         AC_CHECK_HEADERS(fstab.h)
1181         AC_CHECK_HEADERS(attr/xattr.h)
1182         AC_CHECK_HEADERS(sys/extattr.h)
1183         AC_CHECK_HEADERS(sys/sendfile.h)
1184         AC_CHECK_HEADERS(sys/statvfs.h)
1185         AC_CHECK_HEADERS(sys/vfstab.h)
1186         AC_CHECK_HEADERS(sys/xattr.h)
1187         AC_CHECK_FUNCS(getdomainname)
1188         AC_CHECK_FUNCS(setdomainname)
1189         AC_CHECK_FUNCS(fgetgrent)
1190         AC_CHECK_FUNCS(fgetpwent)
1191         AC_CHECK_FUNCS(fgetpwent)
1192         AC_CHECK_FUNCS(getfsstat)
1193         AC_CHECK_FUNCS(mremap)
1194         AC_CHECK_FUNCS(remap_file_pages)
1195         AC_CHECK_FUNCS(posix_fadvise)
1196         AC_CHECK_FUNCS(posix_fallocate)
1197         AC_CHECK_FUNCS(posix_madvise)
1198         AC_CHECK_FUNCS(vsnprintf)
1199         AC_CHECK_FUNCS(sendfile)
1200         AC_CHECK_FUNCS(sethostid)
1201         AC_CHECK_FUNCS(statfs)
1202         AC_CHECK_FUNCS(fstatfs)
1203         AC_CHECK_FUNCS(statvfs)
1204         AC_CHECK_FUNCS(fstatvfs)
1205         AC_CHECK_FUNCS(stime)
1206         AC_CHECK_FUNCS(strerror_r)
1207         AC_CHECK_FUNCS(ttyname_r)
1208         AC_CHECK_SIZEOF(size_t)
1209         AC_CHECK_MEMBERS(
1210                 [struct dirent.d_off, struct dirent.d_reclen, struct dirent.d_type],,, 
1211                 [#include <sys/types.h>
1212                  #include <dirent.h>])
1213
1214         dnl Favour xattr through glibc, but use libattr if we have to
1215         AC_CHECK_FUNC(lsetxattr, ,
1216                 AC_CHECK_LIB(attr, lsetxattr, XATTR_LIB="-lattr",)
1217         )
1218         AC_SUBST(XATTR_LIB)
1219
1220         dnl *********************************
1221         dnl *** Check for Console 2.0 I/O ***
1222         dnl *********************************
1223         AC_CHECK_HEADERS([curses.h])
1224         AC_CHECK_HEADERS([term.h], [], [],
1225         [#if HAVE_CURSES_H
1226          #include <curses.h>
1227          #endif
1228         ])
1229         AC_CHECK_HEADERS([termios.h])
1230 else
1231         jdk_headers_found=no
1232         AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
1233         AC_CHECK_LIB(psapi, main, LIBS="$LIBS -lpsapi", AC_ERROR(bad mingw install?))
1234         AC_CHECK_LIB(ole32, main, LIBS="$LIBS -lole32", AC_ERROR(bad mingw install?))
1235
1236         dnl *********************************
1237         dnl *** Check for struct ip_mreqn ***
1238         dnl *********************************
1239         AC_MSG_CHECKING(for struct ip_mreqn)
1240         AC_TRY_COMPILE([#include <ws2tcpip.h>], [
1241                 struct ip_mreqn mreq;
1242                 mreq.imr_address.s_addr = 0;
1243         ], [
1244                 # Yes, we have it...
1245                 AC_MSG_RESULT(yes)
1246                 AC_DEFINE(HAVE_STRUCT_IP_MREQN)
1247         ], [
1248                 # We'll just have to try and use struct ip_mreq
1249                 AC_MSG_RESULT(no)
1250                 AC_MSG_CHECKING(for struct ip_mreq)
1251                 AC_TRY_COMPILE([#include <ws2tcpip.h>], [
1252                         struct ip_mreq mreq;
1253                         mreq.imr_interface.s_addr = 0;
1254                 ], [
1255                         # Yes, we have it...
1256                         AC_MSG_RESULT(yes)
1257                         AC_DEFINE(HAVE_STRUCT_IP_MREQ)
1258                 ], [
1259                         # No multicast support
1260                         AC_MSG_RESULT(no)
1261                 ])
1262         ])
1263 fi
1264
1265 dnl socklen_t check
1266 AC_MSG_CHECKING(for socklen_t)
1267 AC_TRY_COMPILE([
1268 #include <sys/types.h>
1269 #include <sys/socket.h>
1270 ],[
1271   socklen_t foo;
1272 ],[
1273 ac_cv_c_socklen_t=yes
1274         AC_DEFINE(HAVE_SOCKLEN_T)
1275         AC_MSG_RESULT(yes)
1276 ],[
1277         AC_MSG_RESULT(no)
1278 ])
1279
1280 AC_MSG_CHECKING(for array element initalizer support)
1281 AC_TRY_COMPILE([#include <sys/socket.h>], [
1282         const int array[] = {[1] = 2,};
1283 ], [
1284         # Yes, we have it...
1285         AC_MSG_RESULT(yes)
1286         AC_DEFINE(HAVE_ARRAY_ELEM_INIT,1,[Supports C99 array initialization])
1287 ], [
1288         # We'll have to use signals
1289         AC_MSG_RESULT(no)
1290 ])
1291
1292 AC_CHECK_FUNCS(trunc, , AC_MSG_CHECKING(for trunc in math.h)
1293         # Simply calling trunc (0.0) is no good since gcc will optimize the call away
1294         AC_TRY_LINK([#include <math.h>], 
1295         [ static void *p = &trunc; ],
1296         [
1297                 AC_DEFINE(HAVE_TRUNC) 
1298                 AC_MSG_RESULT(yes)
1299                 ac_cv_trunc=yes
1300         ],
1301         AC_MSG_RESULT(no)))
1302
1303 if test "x$ac_cv_truncl" != "xyes"; then
1304    AC_CHECK_LIB(sunmath, aintl, [ AC_DEFINE(HAVE_AINTL) LIBS="$LIBS -lsunmath"])
1305 fi
1306
1307 dnl ****************************
1308 dnl *** Look for /dev/random ***
1309 dnl ****************************
1310
1311 AC_MSG_CHECKING([if usage of random device is requested])
1312 AC_ARG_ENABLE(dev-random,
1313 [  --disable-dev-random    disable the use of the random device],
1314 try_dev_random=$enableval, try_dev_random=yes)
1315 AC_MSG_RESULT($try_dev_random)
1316
1317 case "{$target}" in
1318     *-openbsd*)
1319     NAME_DEV_RANDOM="/dev/srandom"
1320     ;;
1321
1322 dnl Win32 does not have /dev/random, they have their own method...
1323
1324     *-*-mingw*|*-*-cygwin*)
1325     ac_cv_have_dev_random=no
1326     ;;
1327
1328 dnl Everywhere else, it's /dev/random
1329
1330     *)
1331     NAME_DEV_RANDOM="/dev/random"
1332     ;;
1333 esac
1334
1335 AC_DEFINE_UNQUOTED(NAME_DEV_RANDOM, "$NAME_DEV_RANDOM")
1336
1337 dnl Now check if the device actually exists
1338
1339 if test "x$try_dev_random" = "xyes"; then
1340     AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
1341     [if test -r "$NAME_DEV_RANDOM" ; then
1342         ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
1343     if test "x$ac_cv_have_dev_random" = "xyes"; then
1344         AC_DEFINE(HAVE_CRYPT_RNG)
1345     fi
1346 else
1347     AC_MSG_CHECKING(for random device)
1348     ac_cv_have_dev_random=no
1349     AC_MSG_RESULT(has been disabled)
1350 fi
1351
1352 if test "x$platform_win32" = "xyes"; then
1353     AC_DEFINE(HAVE_CRYPT_RNG)
1354 fi
1355
1356 if test "x$ac_cv_have_dev_random" = "xno" \
1357     && test "x$platform_win32" = "xno"; then
1358     AC_MSG_WARN([[
1359 ***
1360 *** A system-provided entropy source was not found on this system.
1361 *** Because of this, the System.Security.Cryptography random number generator
1362 *** will throw a NotImplemented exception.
1363 ***
1364 *** If you are seeing this message, and you know your system DOES have an
1365 *** entropy collection in place, please contact <crichton@gimp.org> and
1366 *** provide information about the system and how to access the random device.
1367 ***
1368 *** Otherwise you can install either egd or prngd and set the environment
1369 *** variable MONO_EGD_SOCKET to point to the daemon's socket to use that.
1370 ***]])
1371 fi
1372  
1373 AC_MSG_CHECKING([if inter-process shared handles are requested])
1374 AC_ARG_ENABLE(shared-handles, [  --disable-shared-handles disable inter-process shared handles], try_shared_handles=$enableval, try_shared_handles=yes)
1375 AC_MSG_RESULT($try_shared_handles)
1376 if test "x$try_shared_handles" != "xyes"; then
1377         AC_DEFINE(DISABLE_SHARED_HANDLES)
1378         AC_SUBST(DISABLE_SHARED_HANDLES)
1379 fi
1380
1381 AC_ARG_ENABLE(nunit-tests, [ --enable-nunit-tests       Run the nunit tests of the class library on 'make check'])
1382 AM_CONDITIONAL(ENABLE_NUNIT_TESTS, [test x$enable_nunit_tests = xyes])
1383
1384 TARGET="unknown"
1385 ACCESS_UNALIGNED="yes"
1386
1387 JIT_SUPPORTED=no
1388 INTERP_SUPPORTED=no
1389 LIBC="libc.so.6"
1390 INTL="libc.so.6"
1391 SQLITE="libsqlite.so.0"
1392 SQLITE3="libsqlite3.so.0"
1393 X11="libX11.so"
1394
1395 jit_wanted=false
1396 interp_wanted=false
1397 case "$host" in
1398 #       mips-sgi-irix5.* | mips-sgi-irix6.*)
1399 #               TARGET=MIPS;
1400 #               ACCESS_UNALIGNED="no"
1401 #               ;;
1402         i*86-*-*)
1403                 TARGET=X86;
1404                 arch_target=x86;
1405                 JIT_SUPPORTED=yes
1406                 jit_wanted=true
1407                 ;;
1408         x86_64-*-* | amd64-*-*)
1409                 TARGET=AMD64;
1410                 arch_target=amd64;
1411                 JIT_SUPPORTED=yes
1412                 jit_wanted=true
1413                 ;;
1414         ia64-*-*)
1415                 TARGET=IA64
1416                 arch_target=ia64
1417                 ACCESS_UNALIGNED="no"
1418                 JIT_SUPPORTED=yes
1419                 jit_wanted=true
1420                 LIBC="libc.so.6.1"
1421                 AC_CHECK_LIB(unwind, _U_dyn_register, [], [AC_MSG_ERROR(library libunwind not found)])
1422                 libmono_ldflags="-lunwind"
1423                 ;;
1424         sparc*-*-*)
1425                 if test "x$ac_cv_sizeof_void_p" = "x8"; then
1426                    TARGET=SPARC64
1427                 else
1428                         TARGET=SPARC
1429                 fi
1430                 arch_target=sparc;
1431                 JIT_SUPPORTED=yes
1432                 ACCESS_UNALIGNED="no"
1433                 case $host_os in
1434                   linux*) ;;
1435                   *)
1436                         LIBC="libc.so"
1437                         INTL="libintl.so"
1438                 esac
1439                 jit_wanted=true
1440                 if test x"$GCC" = xyes; then
1441                         CFLAGS="$CFLAGS -Wno-cast-align"
1442                 fi
1443                 ;;
1444        alpha*-*-linux* | alpha*-*-osf*)
1445                 TARGET=ALPHA;
1446                 ACCESS_UNALIGNED="no"
1447                 JIT_SUPPORTED=no
1448                 INTERP_SUPPORTED=yes
1449                 interp_wanted=true
1450                 arch_target=alpha;
1451                 case $host_os in
1452                   linux*)
1453                         LIBC="libc.so.6.1"
1454                         INTL="libc.so.6.1"
1455                 esac
1456                ;;
1457         *-*-mingw*|*-*-cygwin*)
1458                 INTL="intl"
1459                 ;;
1460         hppa2.0w-hp-hpux11.00 | hppa64-hp-hpux11.00)
1461                 TARGET=HPPA;
1462                 arch_target=hppa; 
1463                 LIBC="libc.sl"
1464                 ACCESS_UNALIGNED="no"
1465                 INTERP_SUPPORTED=yes
1466                 interp_wanted=true
1467                 ;;
1468         hppa*linux*)
1469                 TARGET=HPPA;
1470                 arch_target=hppa; 
1471                 ACCESS_UNALIGNED="no"
1472                 INTERP_SUPPORTED=yes
1473                 interp_wanted=true
1474                 ;;
1475         macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | \
1476         powerpc-*-sysv* | powerpc-*-darwin*)
1477                 TARGET=POWERPC;
1478                 AC_DEFINE(MONO_ARCH_REGPARMS,1,[Architecture uses registers for Parameters])
1479                 arch_target=ppc;
1480                 JIT_SUPPORTED=yes
1481                 jit_wanted=true
1482                 ;;
1483         arm*-linux-*)
1484                 TARGET=ARM;
1485                 arch_target=arm;
1486                 ACCESS_UNALIGNED="no"
1487                 JIT_SUPPORTED=yes
1488                 jit_wanted=true
1489                 ;;
1490         s390-*-linux*)
1491                 TARGET=S390;
1492                 AC_DEFINE(MONO_ARCH_REGPARMS,1,[Architecture uses registers for Parameters])
1493                 arch_target=s390;
1494                 ACCESS_UNALIGNED="no"
1495                 JIT_SUPPORTED=yes
1496                 ;;
1497         s390x-*-linux*)
1498                 TARGET=S390x;
1499                 AC_DEFINE(MONO_ARCH_REGPARMS,1,[Architecture uses registers for Parameters])
1500                 arch_target=s390x;
1501                 ACCESS_UNALIGNED="no"
1502                 JIT_SUPPORTED=yes
1503                 ;;
1504 esac
1505
1506 AC_ARG_WITH(jit, [  --with-jit=yes,no       If you want to build scripts that default to the JIT],[
1507         if test x$withval = xyes; then
1508            jit_wanted=true
1509         else
1510            jit_wanted=false
1511         fi
1512 ])
1513
1514 AC_ARG_WITH(interp, [  --with-interp=yes,no    If you want to build scripts that default to the interpreter],[
1515         if test x$withval = xyes; then
1516            interp_wanted=true
1517         else
1518            interp_wanted=false
1519         fi
1520 ])
1521
1522 USEJIT=false
1523 if test x$JIT_SUPPORTED = xyes; then
1524    if $jit_wanted; then
1525       USEJIT=true
1526       jit_status="Building and using the JIT"
1527    else
1528       if $interp_wanted; then
1529          jit_status="Building the JIT, defaulting to the interpreter"
1530       else
1531          AC_ERROR(No JIT or interpreter support available or selected.)
1532       fi
1533    fi
1534 else
1535    if test x$interp_wanted = xtrue; then
1536       jit_status="interpreter"
1537    else
1538       AC_ERROR(No JIT or interpreter support available or selected.)
1539    fi
1540 fi
1541
1542 AM_CONDITIONAL(USE_JIT, test x$USEJIT = xtrue)
1543
1544 libsuffix=".so"
1545
1546 case "$host" in
1547      *-*-darwin*)
1548         libsuffix=".dylib"
1549         LIBC="libc.dylib"
1550         INTL="libintl.dylib"
1551         SQLITE="libsqlite.0.dylib"
1552         SQLITE3="libsqlite3.0.dylib"
1553         X11="libX11.dylib"
1554         ;;
1555      *-*-*netbsd*)
1556         LIBC="libc.so.12"
1557         INTL="libintl.so.0"
1558         ;;
1559     *-*-*freebsd*)
1560         LIBC="libc.so"
1561         INTL="libintl.so"
1562         ;;
1563     *-*-*openbsd*)
1564         LIBC="libc.so"
1565         INTL="libintl.so"
1566         ;;
1567     *-*-*linux*)
1568         AC_PATH_X
1569         AC_MSG_CHECKING(for the soname of libX11.so)
1570         for i in $x_libraries /usr/lib /usr/lib64; do
1571                 for r in 4 5 6; do
1572                         if test -f $i/libX11.so.$r; then
1573                                 X11=libX11.so.$r
1574                                 AC_MSG_RESULT($X11)
1575                         fi
1576                 done
1577         done
1578         
1579         if test "x$X11" = "xlibX11.so"; then
1580                 AC_MSG_WARN([Could not find X development libs. Do you have the -devel package installed? WinForms may not work...]);
1581         fi
1582         ;;
1583 esac
1584
1585
1586 AC_SUBST(libsuffix)
1587
1588 if test "x$TARGET" != "xAMD64"; then
1589    # valgrind headers don't compile under x86-64
1590    AC_CHECK_HEADERS(valgrind/memcheck.h)
1591 fi
1592
1593 if test "x$TARGET" = "xAMD64" -o "x$TARGET" = "xX86"; then
1594         if test "x$with_tls" = "x__thread"; then
1595                 #
1596                 # On some linux distributions, TLS works in executables, but linking 
1597                 # against a shared library containing TLS fails with:
1598                 # undefined reference to `__tls_get_addr'
1599                 #
1600                 rm -f conftest.c conftest.so conftest
1601                 echo "static __thread int foo; void main () { foo = 5; }" > conftest.c
1602                 $CC -fPIC --shared -o conftest.so conftest.c > /dev/null 2>&1
1603                 $CC -o conftest conftest.so > /dev/null 2>&1
1604                 if test ! -f conftest; then
1605                    AC_MSG_WARN([Disabling usage of __thread.]);
1606                    with_tls=pthread
1607                 fi
1608                 rm -f conftest.c conftest.so conftest
1609         fi
1610 fi
1611
1612 if test "x$with_tls" = "x__thread"; then
1613         AC_DEFINE(HAVE_KW_THREAD)
1614    # Pass the information to libgc
1615         CPPFLAGS="$CPPFLAGS -DUSE_COMPILER_TLS"
1616         export CPPFLAGS
1617         AC_MSG_CHECKING(if the tls_model attribute is supported)
1618         AC_TRY_COMPILE([static __thread int foo __attribute__((tls_model("initial-exec")));], [
1619                 ], [
1620                         AC_MSG_RESULT(yes)
1621                         AC_DEFINE(HAVE_TLS_MODEL_ATTR, 1, [tld_model available])
1622                 ], [
1623                         AC_MSG_RESULT(no)
1624         ])
1625 fi
1626
1627 if test ${TARGET} = ARM; then
1628         dnl ******************************************
1629         dnl *** Check to see what FPU is available ***
1630         dnl ******************************************
1631         AC_MSG_CHECKING(which FPU to use)
1632
1633         AC_TRY_COMPILE([], [
1634                 __asm__ ("ldfd f0, [r0]");
1635                 ], fpu=FPA, [
1636                         AC_TRY_COMPILE([], [
1637                                 __asm__ ("fldd d0, [r0]");
1638                         ], fpu=VFP, fpu=NONE)
1639                 ])
1640
1641         AC_MSG_RESULT($fpu)
1642         CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu"
1643         unset fpu
1644 fi
1645
1646 if test ${TARGET} = unknown; then
1647         CPPFLAGS="$CPPFLAGS -DNO_PORT"
1648         AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
1649 fi
1650
1651 if test ${ACCESS_UNALIGNED} = no; then
1652         CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
1653 fi
1654
1655 PREVIEW=yes
1656 AC_ARG_WITH(preview, [ --with-preview=yes,no     If you want to install the 2.0 FX preview],[
1657         if test x$with_preview = xno; then
1658               PREVIEW=no
1659         fi
1660 ])
1661
1662 AM_CONDITIONAL(INSTALL_2_0, test x$PREVIEW = xyes)
1663
1664 AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
1665 AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
1666 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
1667 AM_CONDITIONAL(SPARC64, test x$TARGET = xSPARC64)
1668 AM_CONDITIONAL(X86, test x$TARGET = xX86)
1669 AM_CONDITIONAL(AMD64, test x$TARGET = xAMD64)
1670 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
1671 AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
1672 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
1673 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
1674 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
1675 AM_CONDITIONAL(S390, test x$TARGET = xS390)
1676 AM_CONDITIONAL(S390x, test x$TARGET = xS390x)
1677 AM_CONDITIONAL(HPPA, test x$TARGET = xHPPA)
1678
1679 AM_CONDITIONAL(JIT_SUPPORTED, test x$JIT_SUPPORTED = xyes)
1680 AM_CONDITIONAL(INTERP_SUPPORTED, test x$interp_wanted = xtrue)
1681 AM_CONDITIONAL(INCLUDED_LIBGC, test x$gc = xincluded)
1682
1683 AC_SUBST(LIBC)
1684 AC_SUBST(INTL)
1685 AC_SUBST(SQLITE)
1686 AC_SUBST(SQLITE3)
1687 AC_SUBST(X11)
1688
1689 AC_SUBST(arch_target)
1690 AC_SUBST(CFLAGS)
1691 AC_SUBST(CPPFLAGS)
1692 AC_SUBST(LDFLAGS)
1693
1694 mono_build_root=`pwd`
1695 AC_SUBST(mono_build_root)
1696
1697 if test x$USEJIT = xtrue; then
1698   mono_runtime=mono/mini/mono
1699 else
1700   mono_runtime=mono/interpreter/mint
1701 fi
1702 AC_SUBST(mono_runtime)
1703
1704 mono_cfg_root=$mono_build_root/runtime
1705 if test x$platform_win32 = xyes; then
1706   mono_cfg_dir=`cygpath -w -a $mono_cfg_root`\\etc
1707 else
1708   mono_cfg_dir=$mono_cfg_root/etc
1709 fi
1710 AC_SUBST(mono_cfg_dir)
1711
1712 AC_CONFIG_FILES([runtime/mono-wrapper],[chmod +x runtime/mono-wrapper])
1713 AC_CONFIG_FILES([runtime/monodis-wrapper],[chmod +x runtime/monodis-wrapper])
1714 AC_CONFIG_FILES([runtime/semdel-wrapper],[chmod +x runtime/semdel-wrapper])
1715
1716 AC_CONFIG_COMMANDS([runtime/etc/mono/1.0/machine.config],
1717 [   depth=../../../..
1718     case $srcdir in
1719     [\\/$]* | ?:[\\/]* ) reldir=$srcdir ;;
1720     .) reldir=$depth ;;
1721     *) reldir=$depth/$srcdir ;;
1722     esac
1723     $ac_aux_dir/install-sh -d runtime/etc/mono/1.0
1724     cd runtime/etc/mono/1.0
1725     rm -f machine.config
1726     $LN_S $reldir/data/net_1_1/machine.config machine.config
1727     cd $depth
1728 ],[LN_S='$LN_S'])
1729
1730 AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/machine.config],
1731 [   depth=../../../..
1732     case $srcdir in
1733     [\\/$]* | ?:[\\/]* ) reldir=$srcdir ;;
1734     .) reldir=$depth ;;
1735     *) reldir=$depth/$srcdir ;;
1736     esac
1737     $ac_aux_dir/install-sh -d runtime/etc/mono/2.0
1738     cd runtime/etc/mono/2.0
1739     rm -f machine.config
1740     $LN_S $reldir/data/net_2_0/machine.config machine.config
1741     cd $depth
1742 ],[LN_S='$LN_S'])
1743
1744 AC_OUTPUT([
1745 Makefile
1746 mint.pc
1747 mono.pc
1748 dotnet.pc
1749 mono-uninstalled.pc
1750 scripts/mono-nunit.pc
1751 scripts/mono-find-provides
1752 scripts/mono-find-requires
1753 mono/Makefile
1754 mono/utils/Makefile
1755 mono/metadata/Makefile
1756 mono/dis/Makefile
1757 mono/cil/Makefile
1758 mono/arch/Makefile
1759 mono/os/Makefile
1760 mono/os/win32/Makefile
1761 mono/os/unix/Makefile
1762 mono/arch/x86/Makefile
1763 mono/arch/amd64/Makefile
1764 mono/arch/hppa/Makefile
1765 mono/arch/ppc/Makefile
1766 mono/arch/sparc/Makefile
1767 mono/arch/s390/Makefile
1768 mono/arch/s390x/Makefile
1769 mono/arch/arm/Makefile
1770 mono/arch/alpha/Makefile
1771 mono/arch/ia64/Makefile
1772 mono/interpreter/Makefile
1773 mono/tests/Makefile
1774 mono/tests/tests-config
1775 mono/benchmark/Makefile
1776 mono/monoburg/Makefile
1777 mono/monograph/Makefile
1778 mono/io-layer/Makefile
1779 mono/mini/Makefile
1780 mono/handles/Makefile
1781 mono/profiler/Makefile
1782 ikvm-native/Makefile
1783 scripts/Makefile
1784 man/Makefile
1785 web/Makefile
1786 docs/Makefile
1787 data/Makefile
1788 data/net_1_1/Makefile
1789 data/net_2_0/Makefile
1790 samples/Makefile
1791 support/Makefile
1792 data/config
1793 tools/Makefile
1794 tools/locale-builder/Makefile
1795 runtime/Makefile
1796 ])
1797
1798 if test x$platform_win32 = xyes; then
1799    # Get rid of 'cyg' prefixes in library names
1800    sed -e "s/\/cyg\//\/\//" libtool > libtool.new; mv libtool.new libtool; chmod 755 libtool
1801 fi
1802
1803 (
1804   case $prefix in
1805   NONE) prefix=$ac_default_prefix ;;
1806   esac
1807   case $exec_prefix in
1808   NONE) exec_prefix='${prefix}' ;;
1809   esac
1810
1811   test -w $srcdir/$mcsdir/build || chmod +w $srcdir/$mcsdir/build
1812
1813   echo "prefix=$prefix" > $srcdir/$mcsdir/build/config.make
1814   echo "exec_prefix=$exec_prefix" >> $srcdir/$mcsdir/build/config.make
1815   echo 'mono_libdir=${exec_prefix}/lib' >> $srcdir/$mcsdir/build/config.make
1816   echo 'MCS_FLAGS = $(PLATFORM_DEBUG_FLAGS)' >> $srcdir/$mcsdir/build/config.make
1817   echo 'IL_FLAGS = /debug' >> $srcdir/$mcsdir/build/config.make
1818   echo "RUNTIME = $mono_build_root/runtime/mono-wrapper" >> $srcdir/$mcsdir/build/config.make
1819   echo "ILDISASM = $mono_build_root/runtime/monodis-wrapper" >> $srcdir/$mcsdir/build/config.make
1820   echo "INSTALL = $INSTALL" >> $srcdir/$mcsdir/build/config.make
1821
1822   export VERSION
1823   [myver=$($AWK 'BEGIN {
1824     split (ENVIRON["VERSION"] ".0.0.0", vsplit, ".")
1825     print vsplit [1] "." vsplit [2] "." vsplit [3] "." vsplit [4]
1826   }')]
1827
1828   # Generate Consts.cs
1829   sed -e "s/@MONO_VERSION@/$myver/" $srcdir/$mcsdir/build/common/Consts.cs.in > $srcdir/$mcsdir/build/common/Consts.cs
1830 )
1831
1832 libgdiplus_msg=${libgdiplus_loc:-assumed to be installed}
1833
1834 echo "
1835         mcs source:  $mcs_topdir
1836         GC:          $gc
1837         Globalization:     $enable_glob
1838         TLS:         $with_tls
1839         SIGALTSTACK: $with_sigaltstack
1840         Engine:      $jit_status
1841         2.0 Alpha:   $PREVIEW
1842         JNI support: $jdk_headers_found
1843         libgdiplus:  $libgdiplus_msg
1844         $disabled
1845
1846 "