1 cmake_minimum_required(VERSION 2.6.4)
3 # FIXME: Sanitize the variables, no need for the duplicate am conditionals
4 # - It would be nice to rename 'CMakeFiles' to something like '.cmake'
5 # - It would be nice to have a per-target VERBOSE setting
6 # - or a way to change the setting name to 'V' and the output to CC <src>
7 # to be similar to the current build output
9 # We use lowercase commands as advocated by the kde cmake coding style
11 include(CheckIncludeFile)
12 include(CheckCSourceCompiles)
14 # Implementation of AC_CHECK_HEADERS
15 # In addition, it also records the list of variables in the variable
16 # 'autoheader_vars', and for each variable, a documentation string in the
18 function(ac_check_headers headers)
19 foreach (header ${ARGV})
20 string(TOUPPER ${header} header_var)
21 string(REPLACE "." "_" header_var ${header_var})
22 string(REPLACE "/" "_" header_var ${header_var})
23 set(header_var "HAVE_${header_var}")
24 check_include_file (${header} ${header_var})
25 set("${header_var}_doc" "Define to 1 if you have the <${header}> header file." PARENT_SCOPE)
27 set("${header_var}_defined" "1" PARENT_SCOPE)
29 set("${header_var}_val" "1" PARENT_SCOPE)
30 set (autoheader_vars ${autoheader_vars} ${header_var})
32 set (autoheader_vars ${autoheader_vars} PARENT_SCOPE)
35 function(ac_check_funcs funcs)
36 foreach (func ${ARGV})
37 string(TOUPPER ${func} var)
38 set(var "HAVE_${var}")
40 check_function_exists (${func} ${var})
41 set("${var}_doc" "Define to 1 if you have the '${func}' function." PARENT_SCOPE)
43 set("${var}_defined" "1" PARENT_SCOPE)
44 set(${var} yes PARENT_SCOPE)
46 set("${var}_val" "1" PARENT_SCOPE)
47 set (autoheader_vars ${autoheader_vars} ${var})
49 set (autoheader_vars ${autoheader_vars} PARENT_SCOPE)
52 # Implementation of AC_DEFINE
53 function(ac_define varname value doc)
54 if (${varname} MATCHES ",")
55 message(FATAL_ERROR ",")
57 set("${varname}_doc" ${doc} PARENT_SCOPE)
58 set("${varname}_defined" 1 PARENT_SCOPE)
59 set("${varname}_val" ${value} PARENT_SCOPE)
60 set (autoheader_vars ${autoheader_vars} ${varname} PARENT_SCOPE)
63 # Implementation of AC_DEFINE_UNQUOTED
64 function(ac_define_unquoted varname value doc)
65 if (${varname} MATCHES ",")
66 message(FATAL_ERROR ",")
68 set("${varname}_doc" ${doc} PARENT_SCOPE)
69 set("${varname}_defined" 1 PARENT_SCOPE)
70 set("${varname}_val" \"${value}\" PARENT_SCOPE)
71 set (autoheader_vars ${autoheader_vars} ${varname} PARENT_SCOPE)
74 Include(CheckTypeSize)
76 # Implementation of AC_CHECK_SIZEOF
77 # FIXME: cross compiling
78 function(ac_check_sizeof type)
79 check_type_size(${type} size)
80 if (HAVE_size STREQUAL "TRUE")
82 message(FATAL_ERROR "Type ${type} not found.")
84 string(TOUPPER "SIZEOF_${type}" varname)
85 string(REPLACE " " "_" varname ${varname})
86 string(REPLACE "*" "P" varname ${varname})
88 set("${varname}_doc" "The size of '${type}' as computed by sizeof" PARENT_SCOPE)
89 set("${varname}_defined" 1 PARENT_SCOPE)
90 set("${varname}_val" ${size} PARENT_SCOPE)
91 set (autoheader_vars ${autoheader_vars} ${varname} PARENT_SCOPE)
94 # Implementation of autoheader
95 function(AUTOHEADER filename variables)
96 set(tmp_filename "${filename}.tmp")
97 file(WRITE ${tmp_filename} "")
98 foreach(var ${${variables}})
99 file(APPEND ${tmp_filename} "\n/* ${${var}_doc} */\n")
100 if(${${var}_defined})
101 file(APPEND ${tmp_filename} "#define ${var} ${${var}_val}\n")
103 file(APPEND ${tmp_filename} "/* #undef ${var} */\n")
106 # FIXME: This is unix specific
107 execute_process(COMMAND diff ${filename} ${filename}.tmp RESULT_VARIABLE diff_res OUTPUT_QUIET)
108 if (NOT diff_res STREQUAL 0)
109 message(STATUS "generating ${filename}.")
110 execute_process(COMMAND mv ${filename}.tmp ${filename})
112 message(STATUS "${filename} is unchanged.")
116 function(ac_msg_checking)
117 message(STATUS "checking ${ARGV}...")
118 set(last_msg_checking ${ARGV} PARENT_SCOPE)
121 function(ac_msg_result)
122 message(STATUS "checking ${last_msg_checking}... ${ARGV}")
125 function(ac_msg_error)
126 message(FATAL_ERROR "${ARGV}")
129 function(ac_msg_warn)
130 message(STATUS "WARNING: ${ARGV}")
133 # The lines commented out using ### are the stuff from configure.in which still
134 # need to be ported to cmake
135 # The svn revision of the configure.in used is r132691
137 ac_define_unquoted(VERSION 2.5 "Version number of package")
144 #### In case of cygwin, override LN_S, irrespective of what it determines.
145 #### The build uses cygwin, but the actual runtime doesn't.
147 ###*cygwin* ) set(LN_S 'cp -p';;)
153 # These variables are the CPPFLAGS/CFLAGS passed to libgc's configure
154 # libgc should inherit the original CFLAGS/CPPFLAGS passed to configure, i.e. -O0
156 set(CPPFLAGS_FOR_LIBGC ${CPPFLAGS})
157 set(CFLAGS_FOR_LIBGC ${CFLAGS})
160 # These are the flags that need to be stored in the mono.pc file for
161 # compiling code that will embed Mono
163 set(libmono_cflags "")
164 set(libmono_ldflags "")
166 ###AC_SUBST(libmono_cflags)
167 ###AC_SUBST(libmono_ldflags)
169 #### Variable to have relocatable .pc files (lib, or lib64)
170 ###set(reloc_libdir `basename ${libdir}`)
171 ###AC_SUBST(reloc_libdir)
173 # if linker handles the version script
174 set(no_version_script no)
176 # Set to yes if Unix sockets cannot be created in an anonymous namespace
177 set(need_link_unlink no)
183 # Obtain the GNU style target
184 # From GetTargetTriple.cmake in LLVM
185 function( get_target_triple var )
187 set( ${var} "i686-pc-win32" PARENT_SCOPE )
189 set(config_guess config.guess)
190 execute_process(COMMAND sh ${config_guess}
191 RESULT_VARIABLE TT_RV
192 OUTPUT_VARIABLE TT_OUT
193 OUTPUT_STRIP_TRAILING_WHITESPACE)
194 if( NOT TT_RV EQUAL 0 )
195 message(FATAL_ERROR "Failed to execute ${config_guess}")
196 endif( NOT TT_RV EQUAL 0 )
197 set( ${var} ${TT_OUT} PARENT_SCOPE )
199 endfunction( get_target_triple var )
201 get_target_triple(host)
203 message(STATUS "checking host platform characteristics...")
205 set(libgc_threads no)
207 set(parallel_mark yes)
209 if(host MATCHES .*-.*-linux.*)
210 set(platform_win32 no)
211 set(CPPFLAGS "${CPPFLAGS} -DHAVE_CONFIG_H -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP")
212 set(libmono_cflags "-D_REENTRANT")
213 set(libmono_ldflags "-lpthread")
215 set(libgc_threads pthreads)
216 set(AOT_SUPPORTED "yes")
217 set(use_sigposix yes)
219 message(FATAL_ERROR "The cmake build doesn't yet support host '${host}'.")
222 #### Thread configuration inspired by sleepycat's db
224 ### *-*-mingw*|*-*-cygwin*)
225 ### set(platform_win32 yes)
226 ### ac_define(PLATFORM_WIN32,1,[Platform is Win32])
227 ### ac_define(DISABLE_PORTABILITY,1,[Disable the io-portability layer])
228 ### ac_define(PLATFORM_NO_SYMLINKS,1,[This platform does not support symlinks])
229 ### if test "x$cross_compiling" = "xno"; then
230 ### set(CC "gcc -mno-cygwin -g")
231 ### # So libgc configure gets -mno-cygwin
234 ### set(HOST_CC "gcc")
235 ### # Windows 2000 is required that includes Internet Explorer 5.01
236 ### set(CPPFLAGS "$CPPFLAGS -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024")
237 ### set(libmono_cflags "-mno-cygwin -mms-bitfields -mwindows")
238 ### set(libmono_ldflags "-mno-cygwin -mms-bitfields -mwindows")
240 ### set(libgc_threads win32)
241 ### set(gc_default included)
242 ### set(with_sigaltstack no)
244 ### # This forces libgc to use the DllMain based thread registration code on win32
245 ### set(libgc_configure_args "$libgc_configure_args --enable-win32-dllmain=yes")
248 ### set(platform_win32 no)
249 ### set(CPPFLAGS "$CPPFLAGS -D_REENTRANT -DGC_NETBSD_THREADS -D_GNU_SOURCE")
250 ### set(libmono_cflags "-D_REENTRANT")
251 ### set(LDFLAGS "$LDFLAGS -pthread")
252 ### set(CPPFLAGS "$CPPFLAGS -DPLATFORM_BSD")
253 ### set(libmono_ldflags "-pthread")
254 ### set(need_link_unlink yes)
255 ### set(libdl "-ldl")
256 ### set(libgc_threads pthreads)
257 ### set(with_sigaltstack no)
258 ### set(use_sigposix yes)
261 ### set(platform_win32 no)
262 ### if test "x$PTHREAD_CFLAGS" = "x"; then
263 ### set(CPPFLAGS "$CPPFLAGS -DGC_FREEBSD_THREADS")
264 ### set(libmono_cflags )
266 ### set(CPPFLAGS "$CPPFLAGS $PTHREAD_CFLAGS -DGC_FREEBSD_THREADS")
267 ### set(libmono_cflags "$PTHREAD_CFLAGS")
269 ### if test "x$PTHREAD_LIBS" = "x"; then
270 ### set(LDFLAGS "$LDFLAGS -pthread")
271 ### set(libmono_ldflags "-pthread")
273 ### set(LDFLAGS "$LDFLAGS $PTHREAD_LIBS")
274 ### set(libmono_ldflags "$PTHREAD_LIBS")
276 ### set(CPPFLAGS "$CPPFLAGS -DPLATFORM_BSD")
277 ### set(need_link_unlink yes)
278 ### ac_define(PTHREAD_POINTER_ID, 1, [pthread is a pointer])
280 ### set(libgc_threads pthreads)
281 ### # This doesn't seem to work as of 7.0 on amd64
282 ### set(with_sigaltstack no)
283 #### TLS is only partially implemented on -CURRENT (compiler support
284 #### but NOT library support)
286 ### set(with_tls pthread)
287 ### set(use_sigposix yes)
290 ### set(platform_win32 no)
291 ### set(CPPFLAGS "$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS -DPLATFORM_BSD")
292 ### set(libmono_cflags "-D_THREAD_SAFE")
293 ### set(LDFLAGS "$LDFLAGS -pthread")
294 ### set(libmono_ldflags "-pthread")
295 ### set(need_link_unlink yes)
296 ### ac_define(PTHREAD_POINTER_ID)
298 ### set(libgc_threads pthreads)
299 ### set(use_sigposix yes)
302 ### set(platform_win32 no)
303 ### set(CPPFLAGS "$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP")
304 ### set(libmono_cflags "-D_REENTRANT")
305 ### set(libmono_ldflags "-lpthread")
306 ### set(libdl "-ldl")
307 ### set(libgc_threads pthreads)
308 ### set(AOT_SUPPORTED "yes")
309 ### set(use_sigposix yes)
312 ### set(platform_win32 no)
313 ### set(CPPFLAGS "$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT")
314 ### # +ESdbgasm only valid on bundled cc on RISC
315 ### # silently ignored for ia64
316 ### if test $GCC != "yes"; then
317 ### set(CFLAGS "$CFLAGS +ESdbgasm")
318 ### # Arrange for run-time dereferencing of null
319 ### # pointers to produce a SIGSEGV signal.
320 ### set(LDFLAGS "$LDFLAGS -z")
322 ### set(CFLAGS "$CFLAGS +ESdbgasm")
323 ### set(LDFLAGS "$LDFLAGS -z")
324 ### set(libmono_cflags "-D_REENTRANT")
325 ### set(libmono_ldflags "-lpthread")
326 ### set(libgc_threads pthreads)
327 ### set(need_link_unlink yes)
328 ### set(use_sigposix yes)
331 ### set(platform_win32 no)
332 ### set(CPPFLAGS "$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_MMAP -DUSE_MUNMAP -DPLATFORM_SOLARIS")
333 ### set(need_link_unlink yes)
334 ### set(libmono_cflags "-D_REENTRANT")
335 ### set(libgc_threads pthreads)
336 ### # This doesn't seem to work on solaris/x86, but the configure test runs
337 ### set(with_tls pthread)
338 ### set(has_dtrace yes)
339 ### set(use_sigposix yes)
342 ### set(parallel_mark "Disabled_Currently_Hangs_On_MacOSX")
343 ### set(platform_win32 no)
344 ### set(platform_darwin yes)
345 ### set(CPPFLAGS "$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP")
346 ### set(CPPFLAGS "$CPPFLAGS -DGetCurrentProcess=MonoGetCurrentProcess -DGetCurrentThread=MonoGetCurrentThread -DCreateEvent=MonoCreateEvent")
347 ### set(libmono_cflags "-D_THREAD_SAFE")
348 ### set(LDFLAGS "$LDFLAGS -pthread")
349 ### set(libmono_ldflags "-pthread")
350 ### set(need_link_unlink yes)
351 ### ac_define(PTHREAD_POINTER_ID)
352 ### ac_define(USE_MACH_SEMA, 1, [...])
353 ### set(no_version_script yes)
355 ### set(libgc_threads pthreads)
356 ### set(has_dtrace yes)
357 ### if test "x$cross_compiling" = "xyes"; then
358 ### set(has_broken_apple_cpp yes)
362 ### AC_MSG_WARN([*** Please add $host to configure.in checks!])
363 ### set(platform_win32 no)
364 ### set(libdl "-ldl")
369 ###if test x$need_link_unlink = xyes; then
370 ### ac_define(NEED_LINK_UNLINK, 1, [Define if Unix sockets cannot be created in an anonymous namespace])
375 set(PLATFORM_SIGPOSIX 1)
378 set(PLATFORM_WIN32 yes)
380 if(${target_os} MATCHES "*linux*")
381 set(PLATFORM_LINUX yes)
384 set(PLATFORM_DARWIN yes)
387 include(CMakeDetermineASM-ATTCompiler)
389 find_program(BISON NAMES bison)
391 if(BISON STREQUAL "BISON-NOTFOUND")
392 message(FATAL_ERROR "You need to install bison")
394 message(STATUS "Found bison: ${BISON}")
399 #### We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
400 ###: ${set(CCAS '$(CC)'})
401 #### Set ASFLAGS if not already set.
402 ###: ${set(CCASFLAGS '$(CFLAGS)'})
404 ###AC_SUBST(CCASFLAGS)
406 #### may require a specific autoconf version
407 #### AC_PROG_CC_FOR_BUILD
408 #### CC_FOR_BUILD not automatically detected
409 ###set(CC_FOR_BUILD $CC)
410 ###set(CFLAGS_FOR_BUILD $CFLAGS)
411 ###set(BUILD_EXEEXT )
412 ###if test "x$cross_compiling" = "xyes"; then
413 ### set(CC_FOR_BUILD cc)
414 ### set(CFLAGS_FOR_BUILD )
415 ### set(BUILD_EXEEXT "")
417 ###AC_SUBST(CC_FOR_BUILD)
418 ###AC_SUBST(CFLAGS_FOR_BUILD)
420 ###AC_SUBST(BUILD_EXEEXT)
422 ###AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
423 ###AM_CONDITIONAL(USE_BATCH_FILES, [test x$platform_win32 = xyes -a x$cross_compiling = xyes])
425 #### Set STDC_HEADERS
427 ###AC_LIBTOOL_WIN32_DLL
428 #### This causes monodis to not link correctly
429 ####AC_DISABLE_FAST_INSTALL
430 ###set(export_ldflags `(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`)
431 ###AC_SUBST(export_ldflags)
433 #### Test whenever ld supports -version-script
436 ###if test "x$lt_cv_prog_gnu_ld" = "xno"; then
437 ### set(no_version_script yes)
440 ###AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
443 ac_check_headers(unistd.h stdint.h sys/types.h)
444 ac_check_headers(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h)
445 ac_check_headers(sys/user.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h)
447 ac_check_headers(zlib.h)
448 set(have_zlib ${HAVE_ZLIB_H})
451 check_c_source_compiles("
454 #if defined(ZLIB_VERNUM) && (ZLIB_VERNUM >= 0x1230)
457 #error No good zlib found
461 ac_msg_result("Using system zlib")
462 set(zlib_msg "system zlib")
465 ac_msg_result("Using embedded zlib")
467 set(zlib_msg "bundled zlib")
474 ac_define(HAVE_ZLIB 1 "Have system zlib")
476 # for mono/metadata/debug-symfile.c
477 ac_check_headers(elf.h)
480 ac_check_headers(poll.h)
481 ac_check_headers(sys/poll.h)
482 ac_check_headers(sys/wait.h)
483 ac_check_headers(grp.h)
484 ac_check_headers(syslog.h)
487 ac_check_headers(wchar.h)
488 ac_check_headers(ieeefp.h)
490 # Check whenever using GCC
491 include(CheckCSourceCompiles)
492 include(CheckCCompilerFlag)
493 check_c_source_compiles("
501 ac_msg_checking("for isinf")
503 check_c_source_compiles("
511 ac_define(HAVE_ISINF 1 "isinf available")
516 # not 64 bit clean in cross-compile
517 ac_check_sizeof("void *" 4)
522 set(WARN "-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings")
523 # The runtime code does not respect ANSI C strict aliasing rules
524 set(CFLAGS "${CFLAGS} -fno-strict-aliasing")
525 CHECK_C_COMPILER_FLAG("-Wdeclaration-after-statement" HAS_WDECL_AFTER_STATEMENT)
526 if(HAS_WDECL_AFTER_STATEMENT)
527 set(WARN "${WARN} -Wdeclaration-after-statement")
530 # The Sun Forte compiler complains about inline functions that access static variables
531 # so disable all inlining.
534 ### set(CFLAGS "$CFLAGS -Dinline=")
540 set(CFLAGS "${CFLAGS} -g ${WARN}")
542 ###set(CFLAGS_FOR_LIBGC "$CFLAGS_FOR_LIBGC -g")
545 set(srcdir ${CMAKE_SOURCE_DIR})
546 set(top_srcdir ${CMAKE_SOURCE_DIR})
549 set(top_builddir ${CMAKE_BINARY_DIR})
551 # Where's the 'mcs' source tree?
552 if(EXISTS ${srcdir}/mcs)
559 # A sanity check to catch cases where the package was unpacked
560 # with an ancient tar program (Solaris)
562 ac_msg_checking("integrity of package")
563 if(EXISTS ${srcdir}/${mcsdir}/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs)
566 set(errorm "Your mono distribution is incomplete; if unpacking from a tar file, make sure you use GNU tar; see http://www.mono-project.com/IncompletePackage for more details")
567 ac_msg_error(${errorm})
570 set(mcs_topdir ${top_srcdir}/${mcsdir})
571 set(mcs_topdir_from_srcdir ${top_builddir}/${mcsdir})
573 ##### Maybe should also disable if mcsdir is invalid. Let's punt the issue for now.
574 ###AM_CONDITIONAL(BUILD_MCS, [test x$cross_compiling = xno && test x$enable_mcs_build != xno])
576 ###AC_SUBST([mcs_topdir])
577 ###AC_SUBST([mcs_topdir_from_srcdir])
579 #### Where's the 'olive' source tree?
580 ###if test -d $srcdir/olive; then
581 ### set(olivedir olive)
583 ### set(olivedir ../olive)
586 ###if test -d $srcdir/$olivedir; then
587 ###set(olive_topdir '$(top_srcdir)/'$olivedir)
590 #### gettext: prepare the translation directories.
591 #### we do not configure the full gettext, as we consume it dynamically from C#
594 ###if test "x$USE_NLS" = "xyes"; then
595 ### AC_CHECK_PROG(HAVE_MSGFMT, msgfmt,yes,no)
597 ### if test "x$HAVE_MSGFMT" = "xno"; then
598 ### ac_msg_error([msgfmt not found. You need to install the 'gettext' package, or pass --enable-set(nls no to configure.]))
602 set(libgdiplus installed CACHE STRING "=installed|sibling|<path> Override the libgdiplus used for System.Drawing tests (defaults to installed)")
603 set(with_libgdiplus ${libgdiplus})
605 ###case $with_libgdiplus in
606 ###no|installed) set(libgdiplus_loc ;;)
607 ###yes|sibling) set(libgdiplus_loc `cd ../libgdiplus && pwd`/src/libgdiplus.la ;;)
608 ###/*) set(libgdiplus_loc $with_libgdiplus ;;)
609 ###*) set(libgdiplus_loc `pwd`/$with_libgdiplus ;;)
611 ###AC_SUBST([libgdiplus_loc])
614 ###set(pkg_config_path )
615 ###set(crosspkgdir, [ --with-set(crosspkgdir /path/to/pkg-config/dir Change pkg-config dir to custom dir],)
616 ### if test x$with_crosspkgdir = "x"; then
617 ### if test -s $PKG_CONFIG_PATH; then
618 ### set(pkg_config_path $PKG_CONFIG_PATH)
621 ### set(pkg_config_path $with_crosspkgdir)
622 ### set(PKG_CONFIG_PATH $pkg_config_path)
623 ### export PKG_CONFIG_PATH
628 ### [ --with-set(glib embedded|system Choose glib API: system or embedded (default to system)],)
629 ### [], [set(with_glib system]))
634 include(FindPkgConfig)
637 set(with_glib "system")
638 if (${with_glib} STREQUAL "system")
639 ### if test "x$cross_compiling" = "xyes"; then
640 ### set(pkg_config_path "$PKG_CONFIG_PATH")
641 ### unset PKG_CONFIG_PATH
643 PKG_CHECK_MODULES(GLIB2 REQUIRED glib-2.0 gthread-2.0)
644 set(BUILD_GLIB_CFLAGS ${GLIB2_CFLAGS})
645 set(BUILD_GLIB_LIBS ${GLIB2_LIBRARIES})
647 ### if test "x$cross_compiling" = "xyes"; then
648 ### set(PKG_CONFIG_PATH $pkg_config_path)
649 ### export PKG_CONFIG_PATH
652 ## Versions of dependencies
653 set(GLIB_REQUIRED_VERSION 2.4.0)
655 PKG_CHECK_MODULES(GLIB2 REQUIRED glib-2.0 >= ${GLIB_REQUIRED_VERSION} gthread-2.0)
656 set(GLIB_CFLAGS ${GLIB2_CFLAGS})
657 set(GLIB_LIBS ${GLIB2_LIBRARIES})
658 PKG_CHECK_MODULES(GMODULE REQUIRED gmodule-2.0)
659 set(GMODULE_CFLAGS ${GMODULE_CFLAGS})
660 set(GMODULE_LIBS ${GMODULE_LIBRARIES})
663 ###case $with_glib in
665 ### set(GLIB_CFLAGS '-I$(top_srcdir)/eglib/src -I$(top_builddir)/eglib/src')
666 ### set(GLIB_LIBS '-L$(top_builddir)/eglib/src -leglib -lm')
667 ### set(BUILD_GLIB_CFLAGS "$GLIB_CFLAGS")
668 ### set(BUILD_GLIB_LIBS "$GLIB_LIBS")
669 ### set(GMODULE_CFLAGS "$GLIB_CFLAGS")
670 ### set(GMODULE_LIBS "$GLIB_LIBS")
671 ### set(eglib_dir eglib)
672 ### AC_CONFIG_SUBDIRS(eglib)
675 ### ac_msg_error([Invalid argument to --with-glib.])
677 if(with_glib STREQUAL "embedded")
681 ###AC_SUBST(GLIB_CFLAGS)
682 ###AC_SUBST(GLIB_LIBS)
683 ###AC_SUBST(GMODULE_CFLAGS)
684 ###AC_SUBST(GMODULE_LIBS)
685 ###AC_SUBST(BUILD_GLIB_CFLAGS)
686 ###AC_SUBST(BUILD_GLIB_LIBS)
687 ###AC_SUBST(eglib_dir)
689 ###if test x$cross_compiling$platform_win32 = xnoyes; then
690 ### ac_msg_checking(for cygwin glib2-dev package)
691 ### if [ cygcheck --f /usr/lib/libglib-2.0.dll.a | grep -q glib2-devel ]; then
692 ### ac_msg_result(found)
693 ### 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.])
695 ### ac_msg_result(not found, ok)
698 ### ac_msg_checking(for broken gwin32.h)
699 ### set(glib_include `$PKG_CONFIG --cflags-only-I glib-2.0 | sed -e 's/ -I.*//g' | sed -e 's/-I//g'`)
700 ### if test -f $glib_include/glib/gwin32.h; then
701 ### if [ grep ftruncate $glib_include/glib/gwin32.h | grep -q define ]; then
702 ### ac_msg_result(failed)
703 ### set(hashmark '#')
704 ### 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.])
707 ### ac_msg_result(ok)
710 # Enable support for fast thread-local storage
711 # Some systems have broken support, so we allow to disable it.
712 set(tls __thread CACHE STRING "Select Thread Local Storage implementation. Possible values are '__thread_' and 'pthread' (defaults to __thread)")
715 # Enable support for using sigaltstack for SIGSEGV and stack overflow handling
716 # This does not work on some platforms (bug #55253)
717 set(sigaltstack yes CACHE BOOL "Enable/disable support for sigaltstack (defaults to yes)")
718 set(with_sigaltstack ${sigaltstack})
720 set(static_mono yes CACHE BOOL "Link mono statically to libmono (faster) (defaults to yes)")
721 set(with_static_mono ${static_mono})
723 ###if test "x$enable_static" = "xno"; then
724 ### set(with_static_mono no)
727 ###if test "x$platform_win32" = "xyes"; then
728 ### # Boehm GC requires the runtime to be in its own dll
729 ### set(with_static_mono no)
735 ###AC_ARG_ENABLE(mcs-build, [ --disable-mcs-build disable the build of the mcs directory], set(try_mcs_build $enableval, enable_mcs_build=yes))
737 ###set(xen_opt, [ --with-set(xen_opt yes,no Enable Xen-specific behaviour (defaults to yes)],[],[with_xen_opt=yes]))
738 ###if test "x$with_xen_opt" = "xyes"; then
739 ### ac_define(MONO_XEN_OPT, 1, [Xen-specific behaviour])
740 ### set(ORIG_CFLAGS $CFLAGS)
741 ### set(CFLAGS "$CFLAGS -mno-tls-direct-seg-refs")
742 ### ac_msg_checking(for -mno-tls-direct-seg-refs option to gcc)
743 ### AC_TRY_COMPILE([], [
746 ### ac_msg_result(yes)
747 ### # Pass it to libgc as well
748 ### set(CFLAGS_FOR_LIBGC "$CFLAGS_FOR_LIBGC -mno-tls-direct-seg-refs")
750 ### ac_msg_result(no)
751 ### set(CFLAGS $ORIG_CFLAGS)
755 set (quiet-build yes CACHE BOOL "Enable quiet runtime build (on by default)")
757 set(DISABLED_FEATURES none)
759 ###AC_ARG_ENABLE(minimal, [ --enable-set(minimal LIST drop support for LIST subsystems.)
760 ### LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug,
761 ### reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd.],
763 ### for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
764 ### eval "mono_feature_disable_$set(feature 'yes'")
765 ### AC_MSG_NOTICE([Disabled support for feature: $feature])
767 ### set(DISABLED_FEATURES $enable_minimal)
768 ### set(disabled "Disabled: $enable_minimal")
771 ac_define_unquoted(DISABLED_FEATURES "${DISABLED_FEATURES}" "String of disabled features")
773 ###if test "x$mono_feature_disable_aot" = "xyes"; then
774 ### ac_define(DISABLE_AOT, 1, [Disable AOT support])
777 ###if test "x$mono_feature_disable_profiler" = "xyes"; then
778 ### ac_define(DISABLE_PROFILER, 1, [Disable default profiler support])
780 ###AM_CONDITIONAL(DISABLE_PROFILER, test x$mono_feature_disable_profiler = xyes)
782 ###if test "x$mono_feature_disable_decimal" = "xyes"; then
783 ### ac_define(DISABLE_DECIMAL, 1, [Disable System.Decimal support])
786 ###if test "x$mono_feature_disable_pinvoke" = "xyes"; then
787 ### ac_define(DISABLE_PINVOKE, 1, [Disable P/Invoke support])
790 ###if test "x$mono_feature_disable_debug" = "xyes"; then
791 ### ac_define(DISABLE_DEBUG, 1, [Disable runtime debugging support])
794 ###if test "x$mono_feature_disable_reflection_emit" = "xyes"; then
795 ### ac_define(DISABLE_REFLECTION_EMIT, 1, [Disable reflection emit support])
796 ### set(mono_feature_disable_reflection_emit_save yes)
799 ###if test "x$mono_feature_disable_reflection_emit_save" = "xyes"; then
800 ### ac_define(DISABLE_REFLECTION_EMIT_SAVE, 1, [Disable assembly saving support in reflection emit])
803 ###if test "x$mono_feature_disable_large_code" = "xyes"; then
804 ### ac_define(DISABLE_LARGE_CODE, 1, [Disable support for huge assemblies])
807 ###if test "x$mono_feature_disable_logging" = "xyes"; then
808 ### ac_define(DISABLE_LOGGING, 1, [Disable support debug logging])
811 ###if test "x$mono_feature_disable_com" = "xyes"; then
812 ### ac_define(DISABLE_COM, 1, [Disable COM support])
815 ###if test "x$mono_feature_disable_ssa" = "xyes"; then
816 ### ac_define(DISABLE_SSA, 1, [Disable advanced SSA JIT optimizations])
819 ###if test "x$mono_feature_disable_generics" = "xyes"; then
820 ### ac_define(DISABLE_GENERICS, 1, [Disable generics support])
823 ###if test "x$mono_feature_disable_attach" = "xyes"; then
824 ### ac_define(DISABLE_ATTACH, 1, [Disable agent attach support])
827 ###if test "x$mono_feature_disable_jit" = "xyes"; then
828 ### ac_define(DISABLE_JIT, 1, [Disable the JIT, only full-aot mode will be supported by the runtime.])
831 ###AM_CONDITIONAL(DISABLE_JIT, test x$mono_feature_disable_jit = xyes)
833 ###if test "x$mono_feature_disable_simd" = "xyes"; then
834 ### ac_define(DISABLE_SIMD, 1, [Disable SIMD intrinsics related optimizations.])
837 ###ac_msg_checking(for visibility __attribute__)
838 ###AC_TRY_COMPILE([], [
839 ### void __attribute__ ((visibility ("hidden"))) doit (void) {}
840 ### void main () { doit (); }
842 ### set(have_visibility_hidden yes)
843 ### ac_msg_result(yes)
845 ### set(have_visibility_hidden no)
846 ### ac_msg_result(no)
856 set(use_included_gc no)
857 set(libgc_configure_args)
858 set(gc_default included)
860 set(gc ${gc_default} CACHE STRING "The GC library to use (defaults to included)")
864 set(enable_parallel_mark yes)
865 ###AC_ARG_ENABLE(parallel-mark, [ --enable-parallel-mark Enables GC Parallel Marking], set(enable_parallel_mark $enableval, enable_parallel_mark=$parallel_mark))
866 ###if test x$enable_parallel_mark = xyes; then
867 ### set(libgc_configure_args "$libgc_configure_args --enable-parallel-mark")
872 set(LIBGC_STATIC_LIBS )
875 if (gc STREQUAL included)
878 set(use_included_gc yes)
881 set(LIBGC_CFLAGS '-I${top_srcdir}/libgc/include')
882 set(LIBGC_LIBS '${top_builddir}/libgc/libmonogc.la')
883 set(LIBGC_STATIC_LIBS '${top_builddir}/libgc/libmonogc-static.la')
885 ac_define(HAVE_BOEHM_GC 1 "Have Boehm GC")
886 ### AC_SUBST(HAVE_BOEHM_GC)
888 ac_define(HAVE_GC_H 1 "Have gc.h")
889 ac_define(USE_INCLUDED_LIBGC 1 "Use included libgc")
891 # The included libgc contains GCJ support
892 ac_define(HAVE_GC_GCJ_MALLOC 1 "Have GC_gcj_malloc")
893 ac_define(HAVE_GC_ENABLE 1 "Have GC_enable")
894 if (enable_parallel_mark STREQUAL yes)
895 ac_define_unquoted(USED_GC_NAME "Included Boehm (with typed GC and Parallel Mark)" "GC description")
897 ac_define_unquoted(USED_GC_NAME "Included Boehm (with typed GC)" "GC description")
902 ### xboehm|xbohem|xyes)
903 ### ac_check_headers(gc.h gc/gc.h, set(gc_headers yes))
904 ### AC_CHECK_LIB(gc, GC_malloc, set(found_boehm "yes",,$libdl))
906 ### if test "x$found_boehm" != "xyes"; then
907 ### ac_msg_error("GC requested but libgc not found! Install libgc or run configure with --with-set(gc none."))
909 ### if test "x$gc_headers" != "xyes"; then
910 ### ac_msg_error("GC requested but header files not found! You may need to install them by hand.")
913 ### ac_define(HAVE_BOEHM_GC, 1, [Have Boehm GC])
914 ### AC_SUBST(HAVE_BOEHM_GC)
915 ### set(LIBGC_LIBS "-lgc $libdl")
916 ### set(LIBGC_STATIC_LIBS "$LIBGC_LIBS")
918 ### # ac_check_funcs does not work for some reason...
919 ### AC_CHECK_LIB(gc, GC_gcj_malloc, set(found_gcj_malloc "yes",,$libdl))
920 ### if test "x$found_gcj_malloc" = "xyes"; then
921 ### ac_define(HAVE_GC_GCJ_MALLOC, 1, [Have GC_gcj_malloc])
922 ### ac_define_unquoted(USED_GC_NAME, "System Boehm (with typed GC)", [GC description])
924 ### ac_define_unquoted(USED_GC_NAME, "System Boehm (no typed GC)", [GC description])
926 ### AC_CHECK_LIB(gc, GC_enable, set(found_gc_enable "yes",,$libdl))
927 ### if test "x$found_gc_enable" = "xyes"; then
928 ### ac_define(HAVE_GC_ENABLE, 1, [Have 'GC_enable'])
933 ### set(found_boehm yes)
934 ### set(gc_headers yes)
935 ### set(use_included_gc yes)
936 ### set(libgc_dir libgc)
938 ### set(LIBGC_CFLAGS '-I$(top_srcdir)/libgc/include')
939 ### set(LIBGC_LIBS '$(top_builddir)/libgc/libmonogc.la')
940 ### set(LIBGC_STATIC_LIBS '$(top_builddir)/libgc/libmonogc-static.la')
942 ### ac_define(HAVE_BOEHM_GC, 1, [Have Boehm GC])
943 ### AC_SUBST(HAVE_BOEHM_GC)
945 ### ac_define(HAVE_GC_H, 1, [Have gc.h])
946 ### ac_define(USE_INCLUDED_LIBGC, 1, [Use included libgc])
948 ### # The included libgc contains GCJ support
949 ### ac_define(HAVE_GC_GCJ_MALLOC, 1, [Have GC_gcj_malloc])
950 ### ac_define(HAVE_GC_ENABLE, 1, [Have GC_enable])
951 ### if test x$enable_parallel_mark = xyes; then
952 ### ac_define_unquoted(USED_GC_NAME, "Included Boehm (with typed GC and Parallel Mark)", [GC description])
954 ### ac_define_unquoted(USED_GC_NAME, "Included Boehm (with typed GC)", [GC description])
959 ### set(found_boehm no)
960 ### set(gc_headers no)
961 ### set(use_included_gc no)
962 ### ac_define(HAVE_SGEN_GC,1,[Using the simple generational GC.])
963 ### ac_define(HAVE_MOVING_COLLECTOR,1,[The GC can move objects.])
964 ### ac_define(HAVE_WRITE_BARRIERS,1,[The GC needs write barriers.])
965 ### ac_define_unquoted(USED_GC_NAME, "Simple generational", [GC description])
969 ### AC_MSG_WARN("Compiling mono without GC.")
970 ### ac_define_unquoted(USED_GC_NAME, "none", [GC description])
971 ### ac_define(HAVE_NULL_GC,1,[No GC support.])
974 ### ac_msg_error([Invalid argument to --with-gc.])
978 ###set(large-heap, [ --with-large-set(heap yes,no Enable support for GC heaps larger than 3GB (defaults to no)], [large_heap=$withval], [large_heap=no]))
979 ###if test "x$large_heap" = "xyes"; then
981 ### set(CPPFLAGS "$CPPFLAGS -DLARGE_CONFIG")
984 ###AM_CONDITIONAL(INCLUDED_LIBGC, test x$use_included_gc = xyes)
985 ###AC_SUBST(LIBGC_CFLAGS)
986 ###AC_SUBST(LIBGC_LIBS)
987 ###AC_SUBST(LIBGC_STATIC_LIBS)
988 ###AC_SUBST(libgc_dir)
991 # End of libgc checks
994 include(CheckFunctionExists)
995 include(CheckLibraryExists)
997 if(platform_win32 STREQUAL no)
1000 # hires monotonic clock support
1001 ### AC_SEARCH_LIBS(clock_gettime, rt)
1003 check_function_exists (dlopen dlopen_found)
1007 check_library_exists (-ldl dlopen "" libdl_found)
1015 if (dl_support STREQUAL no)
1017 ### AC_MSG_WARN([No dynamic loading support available])
1019 set(LIBS ${LIBS} ${DL_LIB})
1020 ac_define(HAVE_DL_LOADER 1 "dlopen-based dynamic loader available")
1022 ### # from glib's configure.in
1023 ### AC_CACHE_CHECK([for preceeding underscore in symbols],
1024 ### mono_cv_uscore,[
1025 ### AC_TRY_RUN([#include <dlfcn.h>
1026 ### int mono_underscore_test (void) { return 42; }
1028 ### void *f1 = (void*)0, *f2 = (void*)0, *handle;
1029 ### handle = dlopen ((void*)0, 0);
1031 ### f1 = dlsym (handle, "mono_underscore_test");
1032 ### f2 = dlsym (handle, "_mono_underscore_test");
1033 ### } return (!f2 || f1);
1035 ### [set(mono_cv_uscore yes],)
1036 ### [set(mono_cv_uscore no],)
1039 ### if test "x$mono_cv_uscore" = "xyes"; then
1040 ### set(MONO_DL_NEED_USCORE 1)
1042 ### set(MONO_DL_NEED_USCORE 0)
1044 ### AC_SUBST(MONO_DL_NEED_USCORE)
1045 ### AC_CHECK_FUNC(dlerror)
1048 # ******************************************************************
1049 # *** Checks for the IKVM JNI interface library ***
1050 # ******************************************************************
1051 set(ikvm-native yes CACHE BOOL "Build the IKVM JNI interface library (defaults to yes)")
1052 set(with_ikvm_native ${ikvm-native})
1053 set(ikvm_native_dir )
1054 if(with_ikvm_native)
1055 set(ikvm_native_dir ikvm-native)
1056 set(jdk_headers_found "IKVM Native")
1059 ac_check_headers(execinfo.h)
1061 ac_check_funcs(getgrgid_r)
1062 ac_check_funcs(getgrnam_r)
1063 ac_check_funcs(getpwnam_r)
1064 ac_check_funcs(getpwuid_r)
1065 ac_check_funcs(getresuid)
1066 ac_check_funcs(setresuid)
1067 ac_check_funcs(kqueue)
1068 ac_check_funcs(backtrace_symbols)
1069 ac_check_funcs(mkstemp)
1070 ac_check_funcs(mmap)
1071 ac_check_funcs(madvise)
1072 ac_check_funcs(getrusage)
1073 ac_check_funcs(getpriority)
1074 ac_check_funcs(setpriority)
1076 ac_check_funcs(sched_setaffinity)
1078 # ******************************************************************
1079 # *** Check for large file support ***
1080 # *** (If we were using autoconf 2.50 we'd use AC_SYS_LARGEFILE) ***
1081 # ******************************************************************
1083 # Check that off_t can represent 2**63 - 1 correctly, working around
1084 # potential compiler bugs. Defines LARGE_FILE_SUPPORT, adds $1 to
1085 # CPPFLAGS and sets $large_offt to yes if the test succeeds
1086 ### set(large_offt no)
1087 ### AC_DEFUN([LARGE_FILES], [
1088 ### set(large_CPPFLAGS $CPPFLAGS)
1089 ### set(CPPFLAGS "$CPPFLAGS $1")
1091 ### #include <sys/types.h>
1093 ### #define BIG_OFF_T (((off_t)1<<62)-1+((off_t)1<<62))
1095 ### int main(void) {
1096 ### int set(big_off_t ((BIG_OFF_T%2147483629==721) &&)
1097 ### (BIG_OFF_T%set(2147483647 =1));)
1105 ### ac_msg_result(ok)
1106 ### ac_define(HAVE_LARGE_FILE_SUPPORT, 1, [Have large file support])
1107 ### set(large_CPPFLAGS "$large_CPPFLAGS $1")
1108 ### set(large_offt yes)
1110 ### ac_msg_result(no)
1112 ### set(CPPFLAGS $large_CPPFLAGS)
1115 ### ac_msg_checking(if off_t is 64 bits wide)
1117 ### if test $large_offt = no; then
1118 ### ac_msg_checking(if set(_FILE_OFFSET_BITS 64 gives 64 bit off_t))
1119 ### LARGE_FILES("-set(D_FILE_OFFSET_BITS 64"))
1121 ### if test $large_offt = no; then
1122 ### AC_MSG_WARN([No 64 bit file size support available])
1125 # *****************************
1126 # *** Checks for libsocket ***
1127 # *****************************
1128 ### AC_CHECK_LIB(socket, socket, set(LIBS "$LIBS -lsocket"))
1130 # *******************************
1131 # *** Checks for MSG_NOSIGNAL ***
1132 # *******************************
1133 ### ac_msg_checking(for MSG_NOSIGNAL)
1134 ### AC_TRY_COMPILE([#include <sys/socket.h>], [
1135 ### int f = MSG_NOSIGNAL;
1137 ### # Yes, we have it...
1138 ### ac_msg_result(yes)
1139 ### ac_define(HAVE_MSG_NOSIGNAL, 1, [Have MSG_NOSIGNAL])
1141 ### # We'll have to use signals
1142 ### ac_msg_result(no)
1145 # *****************************
1146 # *** Checks for SOL_IP ***
1147 # *****************************
1148 ### ac_msg_checking(for SOL_IP)
1149 ### AC_TRY_COMPILE([#include <netdb.h>], [
1150 ### int level = SOL_IP;
1152 ### # Yes, we have it...
1153 ### ac_msg_result(yes)
1154 ### ac_define(HAVE_SOL_IP, 1, [Have SOL_IP])
1156 ### # We'll have to use getprotobyname
1157 ### ac_msg_result(no)
1160 # *****************************
1161 # *** Checks for SOL_IPV6 ***
1162 # *****************************
1163 ### ac_msg_checking(for SOL_IPV6)
1164 ### AC_TRY_COMPILE([#include <netdb.h>], [
1165 ### int level = SOL_IPV6;
1167 ### # Yes, we have it...
1168 ### ac_msg_result(yes)
1169 ### ac_define(HAVE_SOL_IPV6, 1, [Have SOL_IPV6])
1171 ### # We'll have to use getprotobyname
1172 ### ac_msg_result(no)
1175 # *****************************
1176 # *** Checks for SOL_TCP ***
1177 # *****************************
1178 ### ac_msg_checking(for SOL_TCP)
1179 ### AC_TRY_COMPILE([#include <netdb.h>], [
1180 ### int level = SOL_TCP;
1182 ### # Yes, we have it...
1183 ### ac_msg_result(yes)
1184 ### ac_define(HAVE_SOL_TCP, 1, [Have SOL_TCP])
1186 ### # We'll have to use getprotobyname
1187 ### ac_msg_result(no)
1190 # *****************************
1191 # *** Checks for IP_PKTINFO ***
1192 # *****************************
1193 ### ac_msg_checking(for IP_PKTINFO)
1194 ### AC_TRY_COMPILE([#include <netdb.h>], [
1195 ### int level = IP_PKTINFO;
1197 ### # Yes, we have it...
1198 ### ac_msg_result(yes)
1199 ### ac_define(HAVE_IP_PKTINFO, 1, [Have IP_PKTINFO])
1201 ### ac_msg_result(no)
1204 # *****************************
1205 # *** Checks for IPV6_PKTINFO ***
1206 # *****************************
1207 ### ac_msg_checking(for IPV6_PKTINFO)
1208 ### AC_TRY_COMPILE([#include <netdb.h>], [
1209 ### int level = IPV6_PKTINFO;
1211 ### # Yes, we have it...
1212 ### ac_msg_result(yes)
1213 ### ac_define(HAVE_IPV6_PKTINFO, 1, [Have IPV6_PKTINFO])
1215 ### ac_msg_result(no)
1218 # **********************************
1219 # *** Checks for IP_DONTFRAGMENT ***
1220 # **********************************
1221 ### ac_msg_checking(for IP_DONTFRAGMENT)
1222 ### AC_TRY_COMPILE([#include <netdb.h>], [
1223 ### int level = IP_DONTFRAGMENT;
1225 ### # Yes, we have it...
1226 ### ac_msg_result(yes)
1227 ### ac_define(HAVE_IP_DONTFRAGMENT, 1, [Have IP_DONTFRAGMENT])
1229 ### ac_msg_result(no)
1232 # **********************************
1233 # *** Checks for IP_MTU_DISCOVER ***
1234 # **********************************
1235 ### ac_msg_checking(for IP_MTU_DISCOVER)
1236 ### AC_TRY_COMPILE([#include <netdb.h>], [
1237 ### int level = IP_MTU_DISCOVER;
1239 ### # Yes, we have it...
1240 ### ac_msg_result(yes)
1241 ### ac_define(HAVE_IP_MTU_DISCOVER, 1, [Have IP_MTU_DISCOVER])
1243 ### ac_msg_result(no)
1246 ### # *********************************
1247 # *** Check for struct ip_mreqn ***
1248 # *********************************
1249 ### ac_msg_checking(for struct ip_mreqn)
1250 ### AC_TRY_COMPILE([#include <netinet/in.h>], [
1251 ### struct ip_mreqn mreq;
1252 ### mreq.imr_address.s_addr = 0;
1254 ### # Yes, we have it...
1255 ### ac_msg_result(yes)
1256 ### ac_define(HAVE_STRUCT_IP_MREQN, 1, [Have struct ip_mreqn])
1258 ### # We'll just have to try and use struct ip_mreq
1259 ### ac_msg_result(no)
1260 ### ac_msg_checking(for struct ip_mreq)
1261 ### AC_TRY_COMPILE([#include <netinet/in.h>], [
1262 ### struct ip_mreq mreq;
1263 ### mreq.imr_interface.s_addr = 0;
1265 ### # Yes, we have it...
1266 ### ac_msg_result(yes)
1267 ### ac_define(HAVE_STRUCT_IP_MREQ, 1, [Have struct ip_mreq])
1269 ### # No multicast support
1270 ### ac_msg_result(no)
1274 # **********************************
1275 # *** Check for gethostbyname2_r ***
1276 # **********************************
1277 ### ac_msg_checking(for gethostbyname2_r)
1278 ### AC_TRY_LINK([#include <netdb.h>], [
1279 ### gethostbyname2_r(NULL,0,NULL,NULL,0,NULL,NULL);
1281 ### # Yes, we have it...
1282 ### ac_msg_result(yes)
1283 ### ac_define(HAVE_GETHOSTBYNAME2_R, 1, [Have gethostbyname2_r])
1285 ### ac_msg_result(no)
1288 # *****************************
1289 # *** Checks for libnsl ***
1290 # *****************************
1291 ### AC_CHECK_FUNC(gethostbyaddr, , AC_CHECK_LIB(nsl, gethostbyaddr, set(LIBS "$LIBS -lnsl")))
1293 ac_check_funcs(inet_pton inet_aton)
1295 # ***********************************************
1296 # *** Checks for size of sockaddr_un.sun_path ***
1297 # ***********************************************
1299 ac_msg_checking("size of sockaddr_un.sun_path")
1301 FILE(WRITE "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.c"
1303 #include <sys/types.h>
1308 struct sockaddr_un sock_un;
1309 printf(\"%d\\n\", sizeof(sock_un.sun_path));
1314 TRY_RUN(run_res run_compiled
1316 ${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.c
1317 RUN_OUTPUT_VARIABLE output)
1319 set(mono_cv_sizeof_sunpath 0)
1321 if (run_res EQUAL 0)
1322 string(REGEX MATCH "[0-9]+" mono_cv_sizeof_sunpath ${output})
1326 ac_msg_result(${mono_cv_sizeof_sunpath})
1327 ac_define(MONO_SIZEOF_SUNPATH ${mono_cv_sizeof_sunpath} "Sizeof sock_un.sun_path")
1329 # *************************************
1330 # *** Checks for zero length arrays ***
1331 # *************************************
1332 ### ac_msg_checking(whether $CC supports zero length arrays)
1333 ### AC_TRY_COMPILE([
1339 ### ac_msg_result(yes)
1340 ### ac_define_unquoted(MONO_ZERO_ARRAY_LENGTH, 0, [Length of zero length arrays])
1342 ### ac_msg_result(no)
1343 ### ac_define_unquoted(MONO_ZERO_ARRAY_LENGTH, 1, [Length of zero length arrays])
1346 # *****************************
1347 # *** Checks for libxnet ***
1348 # *****************************
1349 ### case "${host}" in
1351 ### ac_msg_checking(for Solaris XPG4 support)
1352 ### if test -f /usr/lib/libxnet.so; then
1353 ### set(CPPFLAGS "$CPPFLAGS -D_XOPEN_SOURCE=500")
1354 ### set(CPPFLAGS "$CPPFLAGS -D__EXTENSIONS__")
1355 ### set(CPPFLAGS "$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1")
1356 ### set(LIBS "$LIBS -lxnet")
1357 ### ac_msg_result(yes)
1359 ### ac_msg_result(no)
1362 ### if test "$GCC" = "yes"; then
1363 ### set(CFLAGS "$CFLAGS -Wno-char-subscripts")
1368 # *****************************
1369 # *** Checks for libpthread ***
1370 # *****************************
1371 # on FreeBSD -STABLE, the pthreads functions all reside in libc_r
1372 # and libpthread does not exist
1374 ### case "${host}" in
1376 ### AC_CHECK_LIB(pthread, main, set(LIBS "$LIBS -pthread"))
1379 ### AC_CHECK_LIB(pthread, main, set(LIBS "$LIBS -lpthread"))
1382 ac_check_headers(pthread.h)
1383 ### ac_check_funcs(pthread_mutex_timedlock)
1384 ### ac_check_funcs(pthread_getattr_np pthread_attr_get_np)
1385 ### ac_msg_checking(for PTHREAD_MUTEX_RECURSIVE)
1386 ### AC_TRY_COMPILE([ #include <pthread.h>], [
1387 ### pthread_mutexattr_t attr;
1388 ### pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
1390 ### ac_msg_result(ok)
1392 ### ac_msg_result(no)
1393 ### AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
1394 ### ac_define(USE_MONO_MUTEX, 1, [Use mono_mutex_t])
1396 ### ac_check_funcs(pthread_attr_setstacksize)
1397 ### ac_check_funcs(pthread_attr_getstack)
1398 ### ac_check_funcs(pthread_get_stacksize_np pthread_get_stackaddr_np)
1400 # ***********************************
1401 # *** Checks for working __thread ***
1402 # ***********************************
1403 ### ac_msg_checking(for working __thread)
1404 ### if test "x$with_tls" != "x__thread"; then
1405 ### ac_msg_result(disabled)
1408 ### #include <pthread.h>
1410 ### static int res1, res2;
1412 ### void thread_main (void *arg)
1417 ### res1 = (i == arg);
1419 ### res2 = (i == arg);
1423 ### pthread_t t1, t2;
1427 ### pthread_create (&t1, NULL, thread_main, 1);
1428 ### pthread_create (&t2, NULL, thread_main, 2);
1430 ### pthread_join (t1, NULL);
1431 ### pthread_join (t2, NULL);
1433 ### return !(res1 + res2 == 2);
1436 ### ac_msg_result(yes)
1438 ### ac_msg_result(no)
1439 ### set(with_tls pthread)
1443 # **************************************
1444 # *** Checks for working sigaltstack ***
1445 # **************************************
1446 ### ac_msg_checking(for working sigaltstack)
1447 ### if test "x$with_sigaltstack" != "xyes"; then
1448 ### ac_msg_result(disabled)
1451 ### #include <stdio.h>
1452 ### #include <stdlib.h>
1453 ### #include <unistd.h>
1454 ### #include <signal.h>
1455 ### #include <pthread.h>
1456 ### #include <sys/wait.h>
1457 ### #if defined(__FreeBSD__) || defined(__NetBSD__)
1458 ### #define SA_STACK SA_ONSTACK
1461 ### sigsegv_signal_handler (int _dummy, siginfo_t *info, void *context)
1467 ### loop (void *ignored)
1469 ### char *ptr = NULL;
1478 ### struct sigaction sa;
1479 ### struct sigaltstack sas;
1481 ### pthread_attr_t attr;
1483 ### sa.sa_sigaction = sigsegv_signal_handler;
1484 ### sigemptyset (&sa.sa_mask);
1485 ### sa.sa_flags = SA_SIGINFO | SA_ONSTACK;
1486 ### if (sigaction (SIGSEGV, &sa, NULL) == -1) {
1487 ### perror ("sigaction");
1491 ### sas.ss_sp = malloc (SIGSTKSZ);
1492 ### sas.ss_size = SIGSTKSZ;
1493 ### sas.ss_flags = 0;
1494 ### if (sigaltstack (&sas, NULL) == -1) {
1495 ### perror ("sigaltstack");
1499 ### pthread_attr_init (&attr);
1500 ### if (pthread_create(&id, &attr, loop, &attr) != 0) {
1501 ### printf ("pthread_create\n");
1516 ### if (son == -1) {
1525 ### for (i = 0; i < 3; ++i) {
1527 ### waitpid (son, &status, WNOHANG);
1528 ### if (WIFEXITED (status) && WEXITSTATUS (status) == 0)
1532 ### kill (son, SIGKILL);
1537 ### ac_msg_result(yes)
1538 ### ac_define(HAVE_WORKING_SIGALTSTACK, 1, [Have a working sigaltstack])
1540 ### set(with_sigaltstack no)
1541 ### ac_msg_result(no)
1545 # ********************************
1546 # *** Checks for semaphore lib ***
1547 # ********************************
1548 # 'Real Time' functions on Solaris
1549 # posix4 on Solaris 2.6
1550 # pthread (first!) on Linux
1551 ### AC_SEARCH_LIBS(sem_init, pthread rt posix4)
1552 check_library_exists(pthread shm_open "" HAVE_SHM_OPEN1)
1556 check_library_exists(rt shm_open "" HAVE_SHM_OPEN2)
1558 set(LIBS ${LIBS} -lrt)
1559 set(CMAKE_REQUIRED_LIBRARIES rt)
1560 ac_check_funcs(shm_open)
1561 set(CMAKE_REQUIRED_LIBRARIES)
1567 # ********************************
1568 # *** Checks for timezone stuff **
1569 # ********************************
1570 ### AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
1571 ### AC_TRY_COMPILE([
1572 ### #include <time.h>
1575 ### tm.tm_gmtoff = 1;
1576 ### ], set(ac_cv_struct_tm_gmtoff yes, ac_cv_struct_tm_gmtoff=no)))
1577 ### if test $ac_cv_struct_tm_gmtoff = yes; then
1578 ### ac_define(HAVE_TM_GMTOFF, 1, [Have tm_gmtoff])
1580 ### AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
1581 ### AC_TRY_COMPILE([
1582 ### #include <time.h>
1585 ### ], set(ac_cv_var_timezone yes, ac_cv_var_timezone=no)))
1586 ### if test $ac_cv_var_timezone = yes; then
1587 ### ac_define(HAVE_TIMEZONE, 1, [Have timezone variable])
1589 ### AC_ERROR(unable to find a way to determine timezone)
1593 # *********************************
1594 # *** Checks for math functions ***
1595 # *********************************
1596 set(LIBS ${LIBS} -lm)
1597 ### if test "x$has_broken_apple_cpp" != "xyes"; then
1598 ### ac_check_funcs(finite, , ac_msg_checking(for finite in math.h)
1599 ### AC_TRY_LINK([#include <math.h>],
1600 ### [ finite(0.0); ],
1601 ### ac_define(HAVE_FINITE, 1, [Have finite]) ac_msg_result(yes),
1602 ### ac_msg_result(no)))
1604 ### ac_check_funcs(isfinite, , ac_msg_checking(for isfinite in math.h)
1605 ### AC_TRY_LINK([#include <math.h>],
1606 ### [ isfinite(0.0); ],
1607 ### ac_define(HAVE_ISFINITE, 1, [Have isfinite]) ac_msg_result(yes),
1608 ### ac_msg_result(no)))
1610 # ****************************************************************
1611 # *** Checks for working poll() (macosx defines it but doesn't ***
1612 # *** have it in the library (duh)) ***
1613 # ****************************************************************
1614 ### ac_check_funcs(poll)
1616 # *************************
1617 # *** Check for signbit ***
1618 # *************************
1619 ### ac_msg_checking(for signbit)
1620 ### AC_TRY_LINK([#include <math.h>], [
1621 ### int s = signbit(1.0);
1623 ### ac_msg_result(yes)
1624 ### ac_define(HAVE_SIGNBIT, 1, [Have signbit])
1626 ### ac_msg_result(no)
1629 # **********************************
1631 # **********************************
1632 ac_check_headers(sys/epoll.h)
1634 ### ac_check_funcs(epoll_ctl, [set(haveepoll yes], ))
1635 ### if test "x$haveepoll" = "xyes" -a "x$ac_cv_header_sys_epoll_h" = "xyes" ; then
1636 ### ac_define(HAVE_EPOLL, 1, [epoll supported])
1639 # ******************************
1640 # *** Checks for SIOCGIFCONF ***
1641 # ******************************
1642 ac_check_headers(sys/ioctl.h)
1643 ac_check_headers(net/if.h)
1644 ### ac_msg_checking(for ifreq)
1645 ### AC_TRY_COMPILE([
1646 ### #include <stdio.h>
1647 ### #include <sys/ioctl.h>
1648 ### #include <net/if.h>
1650 ### struct ifconf ifc;
1651 ### struct ifreq *ifr;
1653 ### ifc.ifc_len = 0;
1654 ### ifc.ifc_buf = NULL;
1655 ### x = (void *) &ifr->ifr_addr;
1657 ### ac_msg_result(yes)
1658 ### ac_define(HAVE_SIOCGIFCONF, 1, [Can get interface list])
1660 ### ac_msg_result(no)
1662 # **********************************
1663 # *** Checks for sin_len ***
1664 # **********************************
1665 ### ac_msg_checking(for sockaddr_in.sin_len)
1666 ### AC_TRY_COMPILE([
1667 ### #include <netinet/in.h>
1669 ### struct sockaddr_in saddr;
1670 ### saddr.sin_len = sizeof (saddr);
1672 ### ac_msg_result(yes)
1673 ### ac_define(HAVE_SOCKADDR_IN_SIN_LEN, 1, [sockaddr_in has sin_len])
1675 ### ac_msg_result(no)
1677 # **********************************
1678 # *** Checks for sin6_len ***
1679 # **********************************
1680 ### ac_msg_checking(for sockaddr_in6.sin6_len)
1681 ### AC_TRY_COMPILE([
1682 ### #include <netinet/in.h>
1684 ### struct sockaddr_in6 saddr6;
1685 ### saddr6.sin6_len = sizeof (saddr6);
1687 ### ac_msg_result(yes)
1688 ### ac_define(HAVE_SOCKADDR_IN6_SIN_LEN, 1, [sockaddr_in6 has sin6_len])
1690 ### ac_msg_result(no)
1692 # **********************************
1693 # *** Checks for MonoPosixHelper ***
1694 # **********************************
1695 ac_check_headers(checklist.h)
1696 ac_check_headers(fstab.h)
1697 ac_check_headers(attr/xattr.h)
1698 ac_check_headers(sys/extattr.h)
1699 ac_check_headers(sys/sendfile.h)
1700 ac_check_headers(sys/statvfs.h)
1701 ac_check_headers(sys/statfs.h)
1702 ac_check_headers(sys/vfstab.h)
1703 ac_check_headers(sys/xattr.h)
1704 ac_check_headers(sys/mman.h)
1705 ac_check_headers(sys/param.h)
1706 ac_check_headers(sys/mount.h)
1707 ### ac_check_funcs(getdomainname)
1708 ### ac_check_funcs(setdomainname)
1709 ### ac_check_funcs(fgetgrent)
1710 ### ac_check_funcs(fgetpwent)
1711 ### ac_check_funcs(fgetpwent)
1712 ### ac_check_funcs(getfsstat)
1713 ### ac_check_funcs(lutimes)
1714 ### ac_check_funcs(mremap)
1715 ### ac_check_funcs(remap_file_pages)
1716 ### ac_check_funcs(posix_fadvise)
1717 ### ac_check_funcs(posix_fallocate)
1718 ### ac_check_funcs(posix_madvise)
1719 ### ac_check_funcs(vsnprintf)
1720 ### ac_check_funcs(sendfile)
1721 ### ac_check_funcs(sethostid)
1722 ### ac_check_funcs(statfs)
1723 ### ac_check_funcs(fstatfs)
1724 ### ac_check_funcs(statvfs)
1725 ### ac_check_funcs(fstatvfs)
1726 ### ac_check_funcs(stime)
1727 ### ac_check_funcs(strerror_r)
1728 ### ac_check_funcs(ttyname_r)
1729 ac_check_sizeof(size_t)
1730 ### AC_CHECK_TYPES([blksize_t], [ac_define(HAVE_BLKSIZE_T)], ,
1731 ### [#include <sys/types.h>
1732 ### #include <sys/stat.h>
1733 ### #include <unistd.h>])
1734 ### AC_CHECK_TYPES([blkcnt_t], [ac_define(HAVE_BLKCNT_T)], ,
1735 ### [#include <sys/types.h>
1736 ### #include <sys/stat.h>
1737 ### #include <unistd.h>])
1738 ### AC_CHECK_TYPES([suseconds_t], [ac_define(HAVE_SUSECONDS_T)], ,
1739 ### [#include <sys/time.h>])
1740 ### AC_CHECK_TYPES([struct flock], [ac_define(HAVE_STRUCT_FLOCK)], ,
1741 ### [#include <unistd.h>
1742 ### #include <fcntl.h>])
1743 ### AC_CHECK_TYPES([struct pollfd], [ac_define(HAVE_STRUCT_POLLFD)], ,
1744 ### [#include <sys/poll.h>])
1745 ### AC_CHECK_TYPES([struct stat], [ac_define(HAVE_STRUCT_STAT)], ,
1746 ### [#include <sys/types.h>
1747 ### #include <sys/stat.h>
1748 ### #include <unistd.h>])
1749 ### AC_CHECK_TYPES([struct timespec], [ac_define(HAVE_STRUCT_TIMESPEC)], ,
1750 ### [#include <time.h>])
1751 ### AC_CHECK_TYPES([struct timeval], [ac_define(HAVE_STRUCT_TIMEVAL)], ,
1752 ### [#include <sys/time.h>
1753 ### #include <sys/types.h>
1754 ### #include <utime.h>])
1755 ### AC_CHECK_TYPES([struct timezone], [ac_define(HAVE_STRUCT_TIMEZONE)], ,
1756 ### [#include <sys/time.h>])
1757 ### AC_CHECK_TYPES([struct utimbuf], [ac_define(HAVE_STRUCT_UTIMBUF)], ,
1758 ### [#include <sys/types.h>
1759 ### #include <utime.h>])
1760 ### AC_CHECK_MEMBERS(
1761 ### [struct dirent.d_off, struct dirent.d_reclen, struct dirent.d_type],,,
1762 ### [#include <sys/types.h>
1763 ### #include <dirent.h>])
1765 # Favour xattr through glibc, but use libattr if we have to
1766 ### AC_CHECK_FUNC(lsetxattr, ,
1767 ### AC_CHECK_LIB(attr, lsetxattr, set(XATTR_LIB "-lattr",))
1769 ### AC_SUBST(XATTR_LIB)
1771 # kinfo_proc.kp_proc works on darwin but fails on other simil-bsds
1772 ### AC_CHECK_MEMBERS(
1773 ### [struct kinfo_proc.kp_proc],,,
1774 ### [#include <sys/types.h>
1775 ### #include <sys/sysctl.h>
1776 ### #include <sys/proc.h>
1779 # *********************************
1780 # *** Checks for Windows compilation ***
1781 # *********************************
1782 ac_check_headers(sys/time.h)
1783 ac_check_headers(sys/param.h)
1784 ac_check_headers(dirent.h)
1786 # *********************************
1787 # *** Check for Console 2.0 I/O ***
1788 # *********************************
1789 ac_check_headers(curses.h)
1790 ac_check_headers(term.h)
1791 ### ac_check_headers([term.h], [], [],
1792 ### [#if HAVE_CURSES_H
1793 ### #include <curses.h>
1796 ac_check_headers(termios.h)
1798 # * This is provided in io-layer, but on windows it's only available
1800 ### ac_define(HAVE_GETPROCESSID, 1, [Define if GetProcessId is available])
1802 ### set(jdk_headers_found no)
1803 ### AC_CHECK_LIB(ws2_32, main, set(LIBS "$LIBS -lws2_32", AC_ERROR(bad mingw install?)))
1804 ### AC_CHECK_LIB(psapi, main, set(LIBS "$LIBS -lpsapi", AC_ERROR(bad mingw install?)))
1805 ### AC_CHECK_LIB(ole32, main, set(LIBS "$LIBS -lole32", AC_ERROR(bad mingw install?)))
1806 ### AC_CHECK_LIB(winmm, main, set(LIBS "$LIBS -lwinmm", AC_ERROR(bad mingw install?)))
1807 ### AC_CHECK_LIB(oleaut32, main, set(LIBS "$LIBS -loleaut32", AC_ERROR(bad mingw install?)))
1808 ### AC_CHECK_LIB(advapi32, main, set(LIBS "$LIBS -ladvapi32", AC_ERROR(bad mingw install?)))
1809 ### AC_CHECK_LIB(version, main, set(LIBS "$LIBS -lversion", AC_ERROR(bad mingw install?)))
1811 # *********************************
1812 # *** Check for struct ip_mreqn ***
1813 # *********************************
1814 ### ac_msg_checking(for struct ip_mreqn)
1815 ### AC_TRY_COMPILE([#include <ws2tcpip.h>], [
1816 ### struct ip_mreqn mreq;
1817 ### mreq.imr_address.s_addr = 0;
1819 ### # Yes, we have it...
1820 ### ac_msg_result(yes)
1821 ### ac_define(HAVE_STRUCT_IP_MREQN)
1823 ### # We'll just have to try and use struct ip_mreq
1824 ### ac_msg_result(no)
1825 ### ac_msg_checking(for struct ip_mreq)
1826 ### AC_TRY_COMPILE([#include <ws2tcpip.h>], [
1827 ### struct ip_mreq mreq;
1828 ### mreq.imr_interface.s_addr = 0;
1830 ### # Yes, we have it...
1831 ### ac_msg_result(yes)
1832 ### ac_define(HAVE_STRUCT_IP_MREQ)
1834 ### # No multicast support
1835 ### ac_msg_result(no)
1838 ### ac_check_funcs(GetProcessId)
1844 ac_msg_checking("for socklen_t")
1845 check_c_source_compiles("
1846 #include <sys/types.h>
1847 #include <sys/socket.h>
1852 ac_define(HAVE_SOCKLEN_T 1 "Have socklen_t")
1858 ###ac_msg_checking(for array element initalizer support)
1859 ###AC_TRY_COMPILE([#include <sys/socket.h>], [
1860 ### const int array[] = {[1] = 2,};
1862 # Yes, we have it...
1863 ### ac_msg_result(yes)
1864 ### ac_define(HAVE_ARRAY_ELEM_INIT,1,[Supports C99 array initialization])
1866 # We'll have to use signals
1867 ### ac_msg_result(no)
1870 ac_check_funcs(trunc)
1872 ac_msg_checking("for trunc in math.h")
1873 # Simply calling trunc (0.0) is no good since gcc will optimize the call away
1875 check_c_source_compiles("
1878 static void *p = &trunc;
1882 ac_define(HAVE_TRUNC 1 "")
1889 ###if test "x$ac_cv_truncl" != "xyes"; then
1890 ### AC_CHECK_LIB(sunmath, aintl, [ ac_define(HAVE_AINTL, 1, [Has the 'aintl' function]) set(LIBS "$LIBS -lsunmath"]))
1893 ac_check_funcs(round)
1894 ac_check_funcs(rint)
1896 # ****************************
1897 # *** Look for /dev/random ***
1898 # ****************************
1900 ###ac_msg_checking([if usage of random device is requested])
1901 ###AC_ARG_ENABLE(dev-random,
1902 ###[ --disable-dev-random disable the use of the random device (enabled by default)],
1903 ###set(try_dev_random $enableval, try_dev_random=yes))
1905 ###ac_msg_result($try_dev_random)
1907 ###case "{$target}" in
1909 ### set(NAME_DEV_RANDOM "/dev/srandom")
1912 # Win32 does not have /dev/random, they have their own method...
1914 ### *-*-mingw*|*-*-cygwin*)
1915 ### set(ac_cv_have_dev_random no)
1918 # Everywhere else, it's /dev/random
1921 ### set(NAME_DEV_RANDOM "/dev/random")
1925 ###ac_define_unquoted(NAME_DEV_RANDOM, "$NAME_DEV_RANDOM", [Name of /dev/random])
1927 # Now check if the device actually exists
1929 ###if test "x$try_dev_random" = "xyes"; then
1930 ### AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
1931 ### [if test -r "$NAME_DEV_RANDOM" ; then
1932 ### set(ac_cv_have_dev_random yes; else ac_cv_have_dev_random=no; fi]))
1933 ### if test "x$ac_cv_have_dev_random" = "xyes"; then
1934 ### ac_define(HAVE_CRYPT_RNG, 1, [Have /dev/random])
1937 ### ac_msg_checking(for random device)
1938 ### set(ac_cv_have_dev_random no)
1939 ### ac_msg_result(has been disabled)
1942 ###if test "x$platform_win32" = "xyes"; then
1943 ### ac_define(HAVE_CRYPT_RNG)
1946 ###if test "x$ac_cv_have_dev_random" = "xno" \
1947 ### && test "x$platform_win32" = "xno"; then
1950 ###*** A system-provided entropy source was not found on this system.
1951 ###*** Because of this, the System.Security.Cryptography random number generator
1952 ###*** will throw a NotImplemented exception.
1954 ###*** If you are seeing this message, and you know your system DOES have an
1955 ###*** entropy collection in place, please contact <crichton@gimp.org> and
1956 ###*** provide information about the system and how to access the random device.
1958 ###*** Otherwise you can install either egd or prngd and set the environment
1959 ###*** variable MONO_EGD_SOCKET to point to the daemon's socket to use that.
1963 ###ac_msg_checking([if inter-process shared handles are requested])
1964 ###AC_ARG_ENABLE(shared-handles, [ --disable-shared-handles disable inter-process shared handles], set(try_shared_handles $enableval, try_shared_handles=yes))
1965 ###ac_msg_result($try_shared_handles)
1966 ###if test "x$try_shared_handles" != "xyes"; then
1967 ### ac_define(DISABLE_SHARED_HANDLES, 1, [Disable inter-process shared handles])
1968 ### AC_SUBST(DISABLE_SHARED_HANDLES)
1971 ###if test x$gc = xsgen; then
1972 ### if test x$with_tls != x__thread; then
1973 ### ac_msg_error([The SGEN garbage collector depends on a working __thread implementation, and either --with-set(thread pthread was passed to configure, or the configure test for __thread failed.]))
1977 ###AC_ARG_ENABLE(nunit-tests, [ --enable-nunit-tests Run the nunit tests of the class library on 'make check'])
1978 ###AM_CONDITIONAL(ENABLE_NUNIT_TESTS, [test x$enable_nunit_tests = xyes])
1980 ac_msg_checking("if big-arrays are to be enabled")
1981 set(big-arrays no CACHE STRING "Enable the allocation and indexing of arrays greater than Int32.MaxValue]")
1982 set(enable_big_arrays ${big-arrays})
1983 ###if test "x$enable_big_arrays" = "xyes" ; then
1984 ### if test "x$ac_cv_sizeof_void_p" = "x8"; then
1985 ### ac_define(MONO_BIG_ARRAYS,1,[Enable the allocation and indexing of arrays greater than Int32.MaxValue])
1987 ### ac_msg_error([The allocation and indexing of arrays greater than Int32.MaxValue is not supported on this platform.])
1990 ###ac_msg_result($enable_big_arrays)
1996 set(dtrace ${has_dtrace} CACHE BOOL "Enable DTrace probes")
1997 set(enable_dtrace ${dtrace})
1999 ###if test "x$enable_dtrace" = "xyes"; then
2000 ### if test "x$has_dtrace" = "xno"; then
2001 ### ac_msg_error([DTrace probes are not supported on this platform.])
2003 ### AC_PATH_PROG(DTRACE, [dtrace], [no], [$PATH:/usr/sbin])
2004 ### if test "x$DTRACE" = "xno"; then
2005 ### ac_msg_result([dtrace utility not found, dtrace support disabled.])
2006 ### set(enable_dtrace no)
2011 ###if test "x$enable_dtrace" = "xyes"; then
2012 ### ac_define(ENABLE_DTRACE, 1, [Enable DTrace probes])
2013 ### set(DTRACEFLAGS )
2014 ### if test "x$ac_cv_sizeof_void_p" = "x8"; then
2016 ### powerpc-*-darwin*)
2017 ### set(DTRACEFLAGS "-arch ppc64")
2020 ### set(DTRACEFLAGS "-arch x86_64")
2023 ### set(DTRACEFLAGS -64)
2028 ### powerpc-*-darwin*)
2029 ### set(DTRACEFLAGS "-arch ppc")
2032 ### set(DTRACEFLAGS "-arch i386")
2035 ### set(DTRACEFLAGS -32)
2039 ### AC_SUBST(DTRACEFLAGS)
2042 ### set(dtrace_g yes)
2045 ### ac_check_headers([sys/sdt.h])
2047 ###AM_CONDITIONAL(ENABLE_DTRACE, [test x$enable_dtrace = xyes])
2048 ###AM_CONDITIONAL(DTRACE_G_REQUIRED, [test x$dtrace_g = xyes])
2054 set(llvm no CACHE BOOL "Enable the experimental LLVM back-end")
2055 set(enable_llvm ${llvm})
2057 ###if test "x$enable_llvm" = "xyes"; then
2058 ### AC_PATH_PROG(LLVM_CONFIG, llvm-config, no)
2059 ### if test "x$LLVM_CONFIG" = "xno"; then
2060 ### ac_msg_error([llvm-config not found.])
2063 ### set(LLVM_CXXFLAGS `$LLVM_CONFIG --cflags`)
2064 ### set(LLVM_LDFLAGS `$LLVM_CONFIG --ldflags`)
2065 ### set(LLVM_LIBS `$LLVM_CONFIG --libs core engine`)
2066 ### set(LLVM_LIBS "$LLVM_LDFLAGS $LLVM_LIBS -lstdc++")
2068 ### AC_SUBST(LLVM_CXXFLAGS)
2069 ### AC_SUBST(LLVM_LIBS)
2070 ### ac_define(ENABLE_LLVM, 1, [Enable the LLVM back end])
2074 set(ENABLE_LLVM yes)
2078 # Architecture-specific checks
2080 set(TARGET "unknown")
2081 set(ACCESS_UNALIGNED "yes")
2083 set(JIT_SUPPORTED no)
2084 set(INTERP_SUPPORTED no)
2085 set(LIBC "libc.so.6")
2086 set(INTL "libc.so.6")
2087 set(SQLITE "libsqlite.so.0")
2088 set(SQLITE3 "libsqlite3.so.0")
2089 set(X11 "libX11.so")
2091 set(sizeof_register "SIZEOF_VOID_P")
2093 set(jit_wanted false)
2094 set(interp_wanted false)
2096 if(host MATCHES "(x86_64-.*-.*)|(amd64-.*-.*)")
2098 set(arch_target amd64)
2099 set(JIT_SUPPORTED yes)
2100 set(jit_wanted true)
2102 message(FATAL_ERROR "Host ${host} not yet supported by the cmake build.")
2105 # FIXME: Define the others as well
2106 if (${TARGET} STREQUAL "X86")
2107 ac_define(TARGET_X86 1 [...])
2108 elseif (${TARGET} STREQUAL "AMD64")
2109 ac_define(TARGET_AMD64 1 [...])
2110 elseif (${TARGET} STREQUAL "ARM")
2111 ac_define(TARGET_ARM 1 [...])
2115 # mips-sgi-irix5.* | mips-sgi-irix6.*)
2117 # set(ACCESS_UNALIGNED "no")
2120 ### set(TARGET MIPS;)
2121 ### set(arch_target mips;)
2122 ### set(ACCESS_UNALIGNED "no")
2123 ### set(JIT_SUPPORTED yes)
2124 ### set(jit_wanted true)
2126 ### ac_msg_checking(for mips n32)
2127 ### AC_TRY_COMPILE([], [
2129 ### #if _MIPS_SIM != _ABIN32
2130 ### #error Not mips n32
2134 ### ac_msg_result(yes)
2135 ### set(sizeof_register 8)
2137 ### ac_msg_result(no)
2141 ### set(TARGET X86;)
2142 ### set(arch_target x86;)
2143 ### set(JIT_SUPPORTED yes)
2144 ### set(jit_wanted true)
2145 ### case $host_os in
2147 ### set(LIBC "libc.so")
2148 ### set(INTL "libintl.so")
2149 ### if test "x$ac_cv_sizeof_void_p" = "x8"; then
2150 ### set(TARGET AMD64)
2151 ### set(arch_target amd64)
2154 ### # On solaris 10 x86, gcc prints a warning saying 'visibility attribute not supported on this configuration; ignored', but linking fails. A test case:
2155 ### # int astruct __attribute__ ((visibility ("hidden")));
2158 ### # void *p = &astruct;
2160 ### # gcc -fPIC --shared -o libfoo.so foo.c
2162 ### # foo.c:6: warning: visibility attribute not supported in this configuration; ignored
2163 ### # ld: fatal: relocation error: R_386_GOTOFF: file /var/tmp//ccxYR96k.o: symbol astruct: relocation must bind locally
2164 ### set(have_visibility_hidden no)
2169 ### set(TARGET IA64)
2170 ### set(arch_target ia64)
2171 ### set(ACCESS_UNALIGNED "no")
2172 ### set(JIT_SUPPORTED yes)
2173 ### set(jit_wanted true)
2174 ### set(LIBC "libc.so.6.1")
2175 ### set(INTL "libc.so.6.1")
2176 ### AC_CHECK_LIB(unwind, _U_dyn_register, [], [ac_msg_error(library libunwind not found)])
2177 ### set(libmono_ldflags "-lunwind")
2180 ### if test "x$ac_cv_sizeof_void_p" = "x8"; then
2181 ### set(TARGET SPARC64)
2183 ### set(TARGET SPARC)
2185 ### set(arch_target sparc;)
2186 ### set(JIT_SUPPORTED yes)
2187 ### set(ACCESS_UNALIGNED "no")
2188 ### case $host_os in
2191 ### set(LIBC "libc.so")
2192 ### set(INTL "libintl.so")
2194 ### set(jit_wanted true)
2195 ### if test x"$GCC" = xyes; then
2196 ### # We don't support v8 cpus
2197 ### set(CFLAGS "$CFLAGS -Wno-cast-align -mcpu=v9")
2199 ### if test x"$AR" = xfalse; then
2200 ### ac_msg_error([The required utility 'ar' is not found in your PATH. Usually it can be found in /usr/ccs/bin.])
2203 ### alpha*-*-linux* | alpha*-*-osf*)
2204 ### set(TARGET ALPHA;)
2205 ### set(ACCESS_UNALIGNED "no")
2206 ### set(JIT_SUPPORTED yes)
2207 ### set(jit_wanted true)
2208 ### set(arch_target alpha;)
2209 ### set(CFLAGS "$CFLAGS -mieee -O0")
2210 ### case $host_os in
2212 ### set(LIBC "libc.so.6.1")
2213 ### set(INTL "libc.so.6.1")
2216 ### *-*-mingw*|*-*-cygwin*)
2217 ### # When this is enabled, it leads to very strange crashes at runtime (gcc-3.4.4)
2218 ### set(have_visibility_hidden no)
2219 ### set(INTL "intl")
2221 ### hppa2.0w-hp-hpux11.00 | hppa64-hp-hpux11.00)
2222 ### set(TARGET HPPA;)
2223 ### set(arch_target hppa; )
2224 ### set(LIBC "libc.sl")
2225 ### set(ACCESS_UNALIGNED "no")
2226 ### set(INTERP_SUPPORTED yes)
2227 ### set(interp_wanted true)
2230 ### set(TARGET HPPA;)
2231 ### ac_define(MONO_ARCH_REGPARMS,1,[Architecture uses registers for Parameters])
2232 ### set(arch_target hppa; )
2233 ### set(ACCESS_UNALIGNED "no")
2234 ### set(JIT_SUPPORTED yes)
2235 ### set(jit_wanted true)
2237 ### macppc-*-openbsd* | powerpc*-*-linux* | powerpc-*-openbsd* | \
2238 ### powerpc-*-sysv* | powerpc-*-darwin* | powerpc-*-netbsd* )
2239 ### if test "x$ac_cv_sizeof_void_p" = "x8"; then
2240 ### set(TARGET POWERPC64;)
2241 ### set(CPPFLAGS "$CPPFLAGS -D__mono_ppc__ -D__mono_ppc64__")
2242 ### set(CFLAGS "$CFLAGS -mminimal-toc")
2244 ### set(TARGET POWERPC;)
2245 ### set(CPPFLAGS "$CPPFLAGS -D__mono_ppc__")
2247 ### ac_define(MONO_ARCH_REGPARMS,1,[Architecture uses registers for Parameters])
2248 ### set(arch_target ppc;)
2249 ### set(JIT_SUPPORTED yes)
2250 ### set(jit_wanted true)
2253 ### set(TARGET ARM;)
2254 ### set(arch_target arm;)
2255 ### set(ACCESS_UNALIGNED "no")
2256 ### set(JIT_SUPPORTED yes)
2257 ### set(CPPFLAGS "$CPPFLAGS -DARM_FPU_NONE=1")
2258 ### set(jit_wanted true)
2261 ### set(TARGET ARM;)
2262 ### set(arch_target arm;)
2263 ### set(ACCESS_UNALIGNED "no")
2264 ### set(JIT_SUPPORTED yes)
2265 ### set(jit_wanted true)
2268 ### set(TARGET S390;)
2269 ### ac_define(MONO_ARCH_REGPARMS,1,[Architecture uses registers for Parameters])
2270 ### set(arch_target s390;)
2271 ### set(ACCESS_UNALIGNED "no")
2272 ### set(JIT_SUPPORTED yes)
2273 ### set(jit_wanted true)
2274 ### # Required CFLAGS for s390[x]. USE_STRING_INLINES is automatic with gcc 4.1
2275 ### set(CFLAGS "$CFLAGS -mbackchain -D__USE_STRING_INLINES")
2278 ### set(TARGET S390x;)
2279 ### ac_define(MONO_ARCH_REGPARMS,1,[Architecture uses registers for Parameters])
2280 ### set(arch_target s390x;)
2281 ### set(ACCESS_UNALIGNED "no")
2282 ### set(JIT_SUPPORTED yes)
2283 ### set(jit_wanted true)
2284 ### set(CFLAGS "$CFLAGS -mbackchain -D__USE_STRING_INLINES")
2288 if (${sizeof_register} STREQUAL "4")
2289 ac_define(SIZEOF_REGISTER 4 "size of machine integer registers")
2290 elseif (${sizeof_register} STREQUAL "8")
2291 ac_define(SIZEOF_REGISTER 8 "size of machine integer registers")
2293 ac_define(SIZEOF_REGISTER SIZEOF_VOID_P "size of machine integer registers")
2296 ###if (${have_visibility_hidden" = "xyes"; then
2297 ### ac_define(HAVE_VISIBILITY_HIDDEN, 1, [Support for the visibility ("hidden") attribute])
2300 ###set(jit, [ --with-set(jit yes,no If you want to build scripts that default to the JIT (defaults to no)],[)
2301 ### if test x$withval = xyes; then
2302 ### set(jit_wanted true)
2304 ### set(jit_wanted false)
2308 ###set(interp, [ --with-set(interp yes,no If you want to build scripts that default to the interpreter (defaults to no)],[)
2309 ### if test x$withval = xyes; then
2310 ### set(interp_wanted true)
2312 ### set(interp_wanted false)
2320 set(jit_status "Building and using the JIT")
2323 set(jit_status "Building the JIT, defaulting to the interpreter")
2325 message(FATAL_ERROR "No JIT or interpreter support available or selected.")
2330 set(jit_status "interpreter")
2332 message(FATAL_ERROR "No JIT or interpreter support available or selected.")
2335 set(USE_JIT ${USEJIT})
2337 set(libsuffix ".so")
2341 ### set(libsuffix ".dylib")
2342 ### set(LIBC "libc.dylib")
2343 ### set(INTL "libintl.dylib")
2344 ### set(SQLITE "libsqlite.0.dylib")
2345 ### set(SQLITE3 "libsqlite3.0.dylib")
2346 ### set(X11 "libX11.dylib")
2349 ### set(LIBC "libc.so.12")
2350 ### set(INTL "libintl.so.0")
2353 ### set(LIBC "libc.so")
2354 ### set(INTL "libintl.so")
2357 ### set(LIBC "libc.so")
2358 ### set(INTL "libintl.so")
2362 ### ac_msg_checking(for the soname of libX11.so)
2363 ### for i in $x_libraries /usr/lib /usr/lib64; do
2364 ### for r in 4 5 6; do
2365 ### if test -f $i/libX11.so.$r; then
2366 ### set(X11 libX11.so.$r)
2367 ### ac_msg_result($X11)
2372 ### if (${X11" = "xlibX11.so"; then
2373 ### AC_MSG_WARN([Could not find X development libs. Do you have the -devel package installed? WinForms may not work...]);
2379 ###AC_SUBST(libsuffix)
2381 ac_check_headers(valgrind/memcheck.h)
2382 if(${TARGET} STREQUAL "AMD64" OR ${TARGET} STREQUAL "X86")
2383 if(with_tls STREQUAL __thread)
2385 # On some linux distributions, TLS works in executables, but linking
2386 # against a shared library containing TLS fails with:
2387 # undefined reference to `__tls_get_addr'
2389 ### rm -f conftest.c conftest.so conftest
2390 ### echo "static __thread int foo; void main () { foo = 5; }" > conftest.c
2391 ### $CC -fPIC --shared -o conftest.so conftest.c > /dev/null 2>&1
2392 ### $CC -o conftest conftest.so > /dev/null 2>&1
2393 ### if test ! -f conftest; then
2394 ### AC_MSG_WARN([Disabling usage of __thread.]);
2395 ### set(with_tls pthread)
2397 ### rm -f conftest.c conftest.so conftest
2401 set(mono_debugger_supported no)
2402 if(${TARGET} STREQUAL "AMD64" OR ${TARGET} STREQUAL "X86")
2404 if (host MATCHES ".*-.*-.*linux.*")
2405 set(mono_debugger_supported yes)
2410 ac_msg_checking("if the Mono Debugger is supported on this platform")
2411 if(mono_debugger_supported)
2412 ac_define(MONO_DEBUGGER_SUPPORTED 1 "The Mono Debugger is supported on this platform")
2414 ac_msg_result(${mono_debugger_supported})
2415 if(mono_debugger_supported)
2416 set(MONO_DEBUGGER_SUPPORTED yes)
2419 if (with_tls STREQUAL "__thread")
2420 ac_define(HAVE_KW_THREAD 1 "Have __thread keyword")
2421 ac_define(USE_COMPILER_TLS 1 "Use __thread for TLS access")
2422 # Pass the information to libgc
2423 ### set(CPPFLAGS "$CPPFLAGS -DUSE_COMPILER_TLS")
2424 ### ac_msg_checking(if the tls_model attribute is supported)
2425 ### AC_TRY_COMPILE([static __thread int foo __attribute__((tls_model("initial-exec")));], [
2427 ### ac_msg_result(yes)
2428 ### ac_define(HAVE_TLS_MODEL_ATTR, 1, [tld_model available])
2430 ### ac_msg_result(no)
2435 ###if test ${TARGET} = ARM && test x$cross_compiling = xno && test x$enable_mcs_build != xno; then
2436 # ******************************************
2437 # *** Check to see what FPU is available ***
2438 # ******************************************
2439 ### ac_msg_checking(which FPU to use)
2441 ### AC_TRY_COMPILE([], [
2442 ### __asm__ ("ldfd f0, [r0]");
2443 ### ], set(fpu FPA, fpu=NONE))
2445 ### ac_msg_result($fpu)
2446 ### set(CPPFLAGS "$CPPFLAGS -DARM_FPU_$fpu=1")
2450 if(${TARGET} STREQUAL "unknown")
2451 set(CPPFLAGS ${CPPFLAGS} -DNO_PORT)
2452 ac_msg_warn("mono has not been ported to ${host}: some things may not work.")
2455 if(NOT ACCESS_UNALIGNED)
2456 set(CPPFLAGS ${CPPFLAGS} -DNO_UNALIGNED_ACCESS)
2461 ### # Pass CPPFLAGS to libgc configure
2462 ### # We should use a separate variable for this to avoid passing useless and
2463 ### # potentially problematic defines to libgc (like -set(D_FILE_OFFSET_BITS 64))
2464 ### # This should be executed late so we pick up the final version of CPPFLAGS
2465 ### # The problem with this approach, is that during a reconfigure, the main
2466 ### # configure scripts gets invoked with these arguments, so we use separate
2467 ### # variables understood by libgc's configure to pass CPPFLAGS and CFLAGS.
2468 ### set(LIBGC_CPPFLAGS $CPPFLAGS)
2469 ### if test x$TARGET = xSPARC -o x$TARGET = xSPARC64; then
2470 ### set(LIBGC_CPPFLAGS `echo $LIBGC_CPPFLAGS | sed -e 's/-D_FILE_OFFSET_BITS=64//g'`)
2472 ### set(ac_configure_args "$ac_configure_args --disable-embed-check --with-libgc-threads=$libgc_threads $libgc_configure_args \"CPPFLAGS_FOR_LIBGC=$LIBGC_CPPFLAGS\" \"CFLAGS_FOR_LIBGC=$CFLAGS_FOR_LIBGC\"")
2473 ### AC_CONFIG_SUBDIRS(libgc)
2477 set(preview yes CACHE BOOL "If you want to install the 2.0 FX preview (defaults to yes)")
2478 set(PREVIEW ${preview})
2479 set(moonlight yes CACHE BOOL "If you want to build the Moonlight 2.1 assemblies (defaults to yes)")
2480 set(MOONLIGHT ${moonlight})
2482 set(oprofile no CACHE STRING "<oprofile install dir> or 'no' to disable oprofile support (defaults to no)")
2483 if (NOT oprofile STREQUAL no)
2484 ### if test x$with_oprofile != xno; then
2485 ### set(oprofile_include $with_oprofile/include)
2486 ### if test ! -f $oprofile_include/opagent.h; then
2487 ### ac_msg_error([oprofile include file not found at $oprofile_include/opagent.h])
2489 ### set(OPROFILE yes)
2490 ### set(OPROFILE_CFLAGS "-I$oprofile_include")
2491 ### set(OPROFILE_LIBS "-L$with_oprofile/lib/oprofile -lopagent")
2492 ### ac_define(HAVE_OPROFILE,1,[Have oprofile support])
2497 set(MALLOC_MEMPOOLS no)
2498 set(malloc_mempools no CACHE STRING "Use malloc for each single mempool allocation (only for runtime debugging, defaults to no)")
2499 ### if test x$with_malloc_mempools = xyes; then
2500 ### set(MALLOC_MEMPOOLS yes)
2501 ### ac_define(USE_MALLOC_FOR_MEMPOOLS,1,[Use malloc for each single mempool allocation])
2506 set(DISABLE_MCS_DOCS no)
2507 set(mcs_docs yes CACHE STRING "If you want to build the documentation under mcs (defaults to yes)")
2509 set(DISABLE_MCS_DOCS yes)
2512 set(HAVE_OPROFILE yes)
2514 ###AC_SUBST(OPROFILE_CFLAGS)
2515 ###AC_SUBST(OPROFILE_LIBS)
2517 ###set(libmono_ldflags "$libmono_ldflags $LIBS")
2520 set(INSTALL_2_0 yes)
2523 set(INSTALL_2_1 yes)
2526 ###AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
2527 ###AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
2528 # Define a variable for the target
2532 set(INTERP_SUPPORTED yes)
2534 if (gc STREQUAL "included")
2535 set(INCLUDED_LIBGC yes)
2541 ###AC_SUBST(SQLITE3)
2543 ac_define_unquoted(ARCHITECTURE "${arch_target}" "The architecture this is running on")
2544 ###AC_SUBST(arch_target)
2546 ###AC_SUBST(CPPFLAGS)
2547 ###AC_SUBST(LDFLAGS)
2549 set(mono_build_root ${CMAKE_BINARY_DIR})
2552 set(mono_runtime mono/mini/mono)
2554 set(mono_runtime mono/interpreter/mint)
2557 set(mono_cfg_root ${mono_build_root}/runtime)
2559 ###if test x$platform_win32 = xyes; then
2560 ### if (${cross_compiling" = "xno"; then
2561 ### set(mono_cfg_dir `cygpath -w -a $mono_cfg_root`\\etc)
2563 ### set(mono_cfg_dir `echo $mono_cfg_root | tr '/' '\\\'`\\etc)
2566 set(mono_cfg_dir ${mono_cfg_root}/etc)
2569 function(ac_config_files file)
2570 configure_file("${file}.in" ${file} @ONLY)
2572 ac_config_files("po/mcs/Makefile.in")
2574 ac_config_files("runtime/mono-wrapper")
2575 ac_config_files("runtime/monodis-wrapper")
2576 execute_process (COMMAND chmod a+x runtime/mono-wrapper runtime/monodis-wrapper)
2578 ###AC_CONFIG_COMMANDS([runtime/etc/mono/1.0/machine.config],
2579 ###[ set(depth ../../../..)
2581 ### [[\\/$]]* | ?:[[\\/]]* ) set(reldir $srcdir ;;)
2582 ### .) set(reldir $depth ;;)
2583 ### *) set(reldir $depth/$srcdir ;;)
2585 ### $ac_aux_dir/install-sh -d runtime/etc/mono/1.0
2586 ### cd runtime/etc/mono/1.0
2587 ### rm -f machine.config
2588 ### $LN_S $reldir/data/net_1_1/machine.config machine.config
2590 ###],[set(LN_S '$LN_S']))
2592 ###AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/machine.config],
2593 ###[ set(depth ../../../..)
2595 ### [[\\/$]]* | ?:[[\\/]]* ) set(reldir $srcdir ;;)
2596 ### .) set(reldir $depth ;;)
2597 ### *) set(reldir $depth/$srcdir ;;)
2599 ### $ac_aux_dir/install-sh -d runtime/etc/mono/2.0
2600 ### cd runtime/etc/mono/2.0
2601 ### rm -f machine.config
2602 ### $LN_S $reldir/data/net_2_0/machine.config machine.config
2604 ###],[set(LN_S '$LN_S']))
2606 ###AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/web.config],
2607 ###[ set(depth ../../../..)
2609 ### [[\\/$]]* | ?:[[\\/]]* ) set(reldir $srcdir ;;)
2610 ### .) set(reldir $depth ;;)
2611 ### *) set(reldir $depth/$srcdir ;;)
2613 ### $ac_aux_dir/install-sh -d runtime/etc/mono/2.0
2614 ### cd runtime/etc/mono/2.0
2615 ### rm -f web.config
2616 ### $LN_S $reldir/data/net_2_0/web.config web.config
2618 ###],[set(LN_S '$LN_S']))
2620 ###AC_CONFIG_COMMANDS([runtime/etc/mono/browscap.ini],
2621 ###[ set(depth ../../..)
2623 ### [[\\/$]]* | ?:[[\\/]]* ) set(reldir $srcdir ;;)
2624 ### .) set(reldir $depth ;;)
2625 ### *) set(reldir $depth/$srcdir ;;)
2627 ### $ac_aux_dir/install-sh -d runtime/etc/mono/
2628 ### cd runtime/etc/mono/
2629 ### rm -f browscap.ini
2630 ### $LN_S $reldir/data/browscap.ini browscap.ini
2632 ###],[set(LN_S '$LN_S']))
2634 ###AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/Browsers/Compat.browser],
2635 ###[ set(depth ../../../../..)
2637 ### [[\\/$]]* | ?:[[\\/]]* ) set(reldir $srcdir ;;)
2638 ### .) set(reldir $depth ;;)
2639 ### *) set(reldir $depth/$srcdir ;;)
2641 ### $ac_aux_dir/install-sh -d runtime/etc/mono/2.0/Browsers/
2642 ### cd runtime/etc/mono/2.0/Browsers
2643 ### rm -f Compat.browser
2644 ### $LN_S $reldir/data/net_2_0/Browsers/Compat.browser Compat.browser
2646 ###],[set(LN_S '$LN_S']))
2648 ###if test x$enable_quiet_build = xyes; then
2649 ### AC_CONFIG_COMMANDS([quiet], [for i in `find mono libgc support -name Makefile.in | sed -e 's/Makefile.in/Makefile/g'`; do if test -f $i; then $srcdir/scripts/patch-quiet.sh $i; fi; done], [set(shell $SHELL]))
2650 ### AC_CONFIG_COMMANDS([quiet-libtool], [sed -e 's/$echo "copying selected/$show "copying selected/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool; sed -e 's/$ECHO "copying selected/# "copying selected/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool])
2654 autoheader("config.h" autoheader_vars)
2656 set(SUBDIRS po ${libgc_dir} ${eglib_dir} mono ${ikvm_native_dir} support data runtime scripts man samples web msvc docs)
2658 foreach(dir ${SUBDIRS})
2659 add_subdirectory(${dir})
2663 ###mono-uninstalled.pc
2664 ###scripts/mono-find-provides
2665 ###scripts/mono-find-requires
2667 ###mono/utils/Makefile
2668 ###mono/metadata/Makefile
2669 ###mono/dis/Makefile
2670 ###mono/cil/Makefile
2671 ###mono/arch/Makefile
2672 ###mono/arch/x86/Makefile
2673 ###mono/arch/amd64/Makefile
2674 ###mono/arch/hppa/Makefile
2675 ###mono/arch/ppc/Makefile
2676 ###mono/arch/sparc/Makefile
2677 ###mono/arch/s390/Makefile
2678 ###mono/arch/s390x/Makefile
2679 ###mono/arch/arm/Makefile
2680 ###mono/arch/alpha/Makefile
2681 ###mono/arch/ia64/Makefile
2682 ###mono/arch/mips/Makefile
2683 ###mono/interpreter/Makefile
2684 ###mono/tests/Makefile
2685 ###mono/tests/tests-config
2686 ###mono/tests/assemblyresolve/Makefile
2687 ###mono/tests/cas/Makefile
2688 ###mono/tests/cas/assembly/Makefile
2689 ###mono/tests/cas/demand/Makefile
2690 ###mono/tests/cas/inheritance/Makefile
2691 ###mono/tests/cas/linkdemand/Makefile
2692 ###mono/tests/cas/threads/Makefile
2693 ###mono/benchmark/Makefile
2694 ###mono/monograph/Makefile
2695 ###mono/io-layer/Makefile
2696 ###mono/mini/Makefile
2697 ###mono/profiler/Makefile
2698 ###ikvm-native/Makefile
2704 ###data/net_1_1/Makefile
2705 ###data/net_2_0/Makefile
2706 ###data/net_2_0/Browsers/Makefile
2709 ###data/mono-cairo.pc
2710 ###data/mono-nunit.pc
2711 ###data/mono-options.pc
2712 ###data/mono-lineeditor.pc
2719 ###data/system.web.extensions_1.0.pc
2720 ###data/system.web.extensions.design_1.0.pc
2721 ###data/system.web.mvc.pc
2726 ###tools/locale-builder/Makefile
2732 ###if test x$platform_win32 = xyes; then
2733 ### # Get rid of 'cyg' prefixes in library names
2734 ### sed -e "s/\/cyg\//\/\//" libtool > libtool.new; mv libtool.new libtool; chmod 755 libtool
2735 ### # libtool seems to inherit -mno-cygwin from our CFLAGS, and uses it to compile its executable
2736 ### # wrapper scripts which use exec(). gcc has no problem compiling+linking this, but the resulting
2737 ### # executable doesn't work...
2738 ### sed -e "s,-mno-cygwin,,g" libtool > libtool.new; mv libtool.new libtool; chmod 755 libtool
2743 ### NONE) set(prefix $ac_default_prefix ;;)
2745 ### case $exec_prefix in
2746 ### NONE) set(exec_prefix '${prefix}' ;;)
2749 ### test -w $srcdir/$mcsdir/build || chmod +w $srcdir/$mcsdir/build
2752 ### # If we are cross compiling, we don't build in the mcs/ tree. Let us not clobber
2753 ### # any existing config.make. This allows people to share the same source tree
2754 ### # with different build directories, one native and one cross
2756 ### if test x$cross_compiling = xno && test x$enable_mcs_build != xno; then
2757 ### echo "set(prefix $prefix" > $srcdir/$mcsdir/build/config.make)
2758 ### echo "set(exec_prefix $exec_prefix" >> $srcdir/$mcsdir/build/config.make)
2759 ### echo "set(sysconfdir $sysconfdir" >> $srcdir/$mcsdir/build/config.make)
2760 ### echo 'set(mono_libdir ${exec_prefix}/lib' >> $srcdir/$mcsdir/build/config.make)
2761 ### echo 'MCS_FLAGS = $(PLATFORM_DEBUG_FLAGS)' >> $srcdir/$mcsdir/build/config.make
2762 ### echo 'IL_FLAGS = /debug' >> $srcdir/$mcsdir/build/config.make
2763 ### echo "RUNTIME = $mono_build_root/runtime/mono-wrapper" >> $srcdir/$mcsdir/build/config.make
2764 ### echo "ILDISASM = $mono_build_root/runtime/monodis-wrapper" >> $srcdir/$mcsdir/build/config.make
2765 ### case $INSTALL in
2766 ### [[\\/$]]* | ?:[[\\/]]* ) set(mcs_INSTALL $INSTALL ;;)
2767 ### *) set(mcs_INSTALL $mono_build_root/$INSTALL ;;)
2770 ### echo "INSTALL = $mcs_INSTALL" >> $srcdir/$mcsdir/build/config.make
2773 ### [set(myver $($AWK 'BEGIN {)
2774 ### split (ENVIRON["VERSION"] ".0.0.0", vsplit, ".")
2775 ### if(length(vsplit [1]) > 4) {
2776 ### split (substr(ENVIRON["VERSION"], 0, 4) "." substr(ENVIRON["VERSION"], 5) ".0.0", vsplit, ".")
2778 ### print vsplit [1] "." vsplit [2] "." vsplit [3] "." vsplit [4]
2781 ### echo "MONO_VERSION = $myver" >> $srcdir/$mcsdir/build/config.make
2784 ### if test x$platform_darwin = xyes; then
2785 ### echo "PLATFORM = darwin" >> $srcdir/$mcsdir/build/config.make
2788 ### if test x$TARGET = xAMD64 -a x$platform_win32 = xno -a "x$AOT_SUPPORTED" = "xyes"; then
2789 ### echo "ENABLE_AOT = 1" >> $srcdir/$mcsdir/build/config.make
2792 ### # if we have an olive folder, override the default settings
2793 ### if test -d $olivedir; then
2795 ### test -w $srcdir/$olivedir/build || chmod +w $srcdir/$olivedir/build
2797 ### if test x$cross_compiling = xno && test x$enable_olive_build != xno; then
2798 ### echo "set(prefix $prefix" > $srcdir/$olivedir/build/config.make)
2799 ### echo "set(exec_prefix $exec_prefix" >> $srcdir/$olivedir/build/config.make)
2800 ### echo 'set(mono_libdir ${exec_prefix}/lib' >> $srcdir/$olivedir/build/config.make)
2801 ### echo 'MCS_FLAGS = $(PLATFORM_DEBUG_FLAGS)' >> $srcdir/$olivedir/build/config.make
2802 ### echo "RUNTIME = $mono_build_root/runtime/mono-wrapper" >> $srcdir/$olivedir/build/config.make
2803 ### echo "MONO_VERSION = $myver" >> $srcdir/$olivedir/build/config.make
2804 ### if test x$with_moonlight = xyes; then
2805 ### echo "WITH_MOONLIGHT = yes" >> $srcdir/$olivedir/build/config.make
2810 ### if test x$DISABLE_MCS_DOCS = xyes; then
2811 ### echo "DISABLE_MCS_DOCS = yes" >> $srcdir/$mcsdir/build/config.make
2815 if(NOT libgdiplus_loc)
2816 set(libgdiplus_msg "assumed to be installed")
2818 set(libgdiplus_msg ${libgdiplus_loc})
2823 mcs source: ${mcs_topdir}
2824 olive source: ${olive_topdir}
2828 SIGALTSTACK: ${with_sigaltstack}
2829 Engine: ${jit_status}
2830 2.0 Beta: ${PREVIEW}
2831 2.1 Alpha: ${MOONLIGHT}
2832 JNI support: ${jdk_headers_found}
2833 libgdiplus: ${libgdiplus_msg}
2835 oprofile: ${OPROFILE}
2836 BigArrays: ${enable_big_arrays}
2837 DTrace: ${enable_dtrace}
2838 Parallel Mark: ${enable_parallel_mark}
2839 LLVM Back End: ${enable_llvm}
2844 if(NOT with_static_mono)
2845 if(NOT platform_win32)
2846 ac_msg_warn("Turning off static Mono is a risk, you might run into unexpected bugs")
2850 if(gc STREQUAL sgen)
2853 IMPORTANT: You have selected an experimental, work-in-progress
2854 IMPORTANT: GC engine. This GC engine is currently not supported
2855 IMPORTANT: and is not yet ready for use.
2857 IMPORTANT: There are known problems with it, use at your own risk.
2865 IMPORTANT: The LLVM Back End is experimental and does not work yet.
2872 ### -rm -fr $(mcslib)/monolite-*
2873 ### -mkdir -p $(mcslib)
2874 ### test ! -d $(monolite) || test ! -d $(monolite).old || rm -fr $(monolite).old
2875 ### test ! -d $(monolite) || mv -f $(monolite) $(monolite).old
2876 ### cd $(mcslib) && { (wget -O- $(monolite_url) || curl $(monolite_url)) | gzip -d | tar xf - ; }
2877 ### cd $(mcslib) && mv -f monolite-* monolite
2880 #### Keep in sync with SUBDIRS
2881 ##### 'tools' is not normally built
2882 ###DIST_SUBDIRS = po libgc $(eglib_dir) mono ikvm-native support data runtime scripts man samples web tools msvc docs
2884 ###EXTRA_DIST= nls.m4 po.m4 progtest.m4 mono-uninstalled.pc.in build-mingw32.sh LICENSE mkinstalldirs
2886 ###DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
2888 #### Distribute the 'mcs' tree too
2890 ### test -d $(distdir)/mcs || mkdir $(distdir)/mcs
2891 ### d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) PROFILE=net_1_1 distdir=$$d dist-recursive
2892 ### d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) PROFILE=net_2_0 distdir=$$d dist-recursive
2894 ###pkgconfigdir = $(libdir)/pkgconfig
2895 ###noinst_DATA = mono-uninstalled.pc
2896 ###DISTCLEANFILES= mono-uninstalled.pc
2898 ###.PHONY: get-monolite-latest mcs-do-compiler-tests compiler-tests bootstrap-world
2900 #### building with monolite
2901 set(mcslib ${mcs_topdir}/class/lib)
2902 set(monolite ${mcslib}/monolite)
2903 set(monolite_url http://mono.ximian.com/daily/monolite-latest.tar.gz)
2904 add_custom_target(get-monolite-latest
2905 COMMAND -rm -fr ${mcslib}/monolite-*
2906 COMMAND -mkdir -p ${mcslib}
2907 COMMAND test ! -d ${monolite} || test ! -d ${monolite}.old || rm -fr ${monolite}.old
2908 COMMAND test ! -d ${monolite} || mv -f ${monolite} ${monolite}.old
2909 COMMAND cd ${mcslib} && { (wget -O- ${monolite_url} || curl ${monolite_url}) | gzip -d | tar xf - \; }
2910 COMMAND cd ${mcslib} && mv -f monolite-* monolite
2913 ###compiler-tests: mcs-do-clean
2915 ### $(MAKE) mcs-do-compiler-tests
2917 ###compiler-tests-net_2_0:
2918 ### -rm -f $(mcs_topdir)/build/common/Consts.cs.save
2919 ### -mv -f $(mcs_topdir)/build/common/Consts.cs $(mcs_topdir)/build/common/Consts.cs.save
2920 ### cd $(mcs_topdir) && $(MAKE) PROFILE=net_2_0_bootstrap clean
2921 ### cd $(mcs_topdir) && $(MAKE) PROFILE=net_2_0 clean
2922 ### -mv -f $(mcs_topdir)/build/common/Consts.cs.save $(mcs_topdir)/build/common/Consts.cs
2924 ### $(MAKE) build_profiles=net_2_0 mcs-do-compiler-tests
2926 ###bootstrap-world: compiler-tests
2929 ###bootstrap-world-net_2_0: compiler-tests-net_2_0
2932 #### internal targets
2934 ### cd runtime && $(MAKE) clean-local
2935 ### cd mono/tests && $(MAKE) clean
2936 ###mcs-do-compiler-tests:
2937 ### cd runtime && $(MAKE) test_select='TEST_SUBDIRS="tests errors"' check-local
2938 ### cd mono/tests && $(MAKE) check
2941 ### wget http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip
2942 ### wget http://www.go-mono.com/archive/glib-2.0.4-20020703.zip
2943 ### wget http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip
2944 ### wget http://www.go-mono.com/archive/libiconv-1.7.zip
2945 ### wget http://www.go-mono.com/archive/libiconv-dev-1.7.zip
2946 ### wget http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip
2947 ### unzip -n -d / pkgconfig-0.11-20020310.zip
2948 ### unzip -n -d / glib-2.0.4-20020703.zip
2949 ### unzip -n -d / glib-dev-2.0.4-20020703.zip
2950 ### unzip -n -d / libiconv-1.7.zip
2951 ### unzip -n -d / libiconv-dev-1.7.zip
2952 ### unzip -n -d / libintl-0.10.40-20020101.zip
2955 ### makensis /DMILESTONE=$(VERSION) /DSOURCE_INSTALL_DIR=$(SOURCE_INSTALL_DIR) /DBUILDNUM=$(BUILDNUM) monowiz.win32.nsi
2958 ### @echo "*** 'make bootstrap' is obsolete. Just run 'make' to perform a combined mono+mcs build"
2962 ### find mono -name Makefile -exec scripts/patch-quiet.sh {} \;
2963 ### find libgc -name Makefile -exec scripts/patch-quiet.sh {} \;
2966 ### (cd $(mcs_topdir)/build/csproj && gmcs genproj.cs) && (cd runtime; make V=1 extra_targets=csproj-local)