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