1 cmake_minimum_required(VERSION 2.6.4)
3 # To keep this in sync with the autoconf based system:
4 # git log -n --format=oneline CMakeLists.txt
5 # git diff <commit displayed by previous line>..HEAD configure.in Makefile.am
7 # FIXME: Sanitize the variables, no need for the duplicate am conditionals
8 # - It would be nice to rename 'CMakeFiles' to something like '.cmake'
9 # - It would be nice to have a per-target VERBOSE setting
10 # - or a way to change the setting name to 'V' and the output to CC <src>
11 # to be similar to the current build output
12 # - Add a cache to the manual checks
14 # We use lowercase commands as advocated by the kde cmake coding style
16 include(CheckIncludeFile)
17 include(CheckCSourceCompiles)
19 # Implementation of AC_CHECK_HEADERS
20 # In addition, it also records the list of variables in the variable
21 # 'autoheader_vars', and for each variable, a documentation string in the
23 function(ac_check_headers headers)
24 foreach (header ${ARGV})
25 string(TOUPPER ${header} header_var)
26 string(REPLACE "." "_" header_var ${header_var})
27 string(REPLACE "/" "_" header_var ${header_var})
28 set(header_var "HAVE_${header_var}")
29 check_include_file (${header} ${header_var})
30 set("${header_var}_doc" "Define to 1 if you have the <${header}> header file." PARENT_SCOPE)
32 set("${header_var}_defined" "1" PARENT_SCOPE)
34 set("${header_var}_val" "1" PARENT_SCOPE)
35 set (autoheader_vars ${autoheader_vars} ${header_var})
37 set (autoheader_vars ${autoheader_vars} PARENT_SCOPE)
40 function(ac_check_funcs funcs)
41 foreach (func ${ARGV})
42 string(TOUPPER ${func} var)
43 set(var "HAVE_${var}")
45 check_function_exists (${func} ${var})
46 set("${var}_doc" "Define to 1 if you have the '${func}' function." PARENT_SCOPE)
48 set("${var}_defined" "1" PARENT_SCOPE)
49 set(${var} yes PARENT_SCOPE)
51 set("${var}_val" "1" PARENT_SCOPE)
52 set (autoheader_vars ${autoheader_vars} ${var})
54 set (autoheader_vars ${autoheader_vars} PARENT_SCOPE)
57 # Implementation of AC_DEFINE
58 function(ac_define varname value doc)
59 if (${varname} MATCHES ",")
60 message(FATAL_ERROR ",")
62 set("${varname}_doc" ${doc} PARENT_SCOPE)
63 set("${varname}_defined" 1 PARENT_SCOPE)
64 set("${varname}_val" ${value} PARENT_SCOPE)
65 set (autoheader_vars ${autoheader_vars} ${varname} PARENT_SCOPE)
68 # Implementation of AC_DEFINE_UNQUOTED
69 function(ac_define_unquoted varname value doc)
70 if (${varname} MATCHES ",")
71 message(FATAL_ERROR ",")
73 set("${varname}_doc" ${doc} PARENT_SCOPE)
74 set("${varname}_defined" 1 PARENT_SCOPE)
75 set("${varname}_val" \"${value}\" PARENT_SCOPE)
76 set (autoheader_vars ${autoheader_vars} ${varname} PARENT_SCOPE)
79 Include(CheckTypeSize)
81 # Implementation of AC_CHECK_SIZEOF
82 # FIXME: cross compiling
83 function(ac_check_sizeof type)
84 check_type_size(${type} size)
85 if (HAVE_size STREQUAL "TRUE")
87 message(FATAL_ERROR "Type ${type} not found.")
89 string(TOUPPER "SIZEOF_${type}" varname)
90 string(REPLACE " " "_" varname ${varname})
91 string(REPLACE "*" "P" varname ${varname})
93 set("${varname}_doc" "The size of '${type}' as computed by sizeof" PARENT_SCOPE)
94 set("${varname}_defined" 1 PARENT_SCOPE)
95 set("${varname}_val" ${size} PARENT_SCOPE)
96 set (autoheader_vars ${autoheader_vars} ${varname} PARENT_SCOPE)
99 # Implementation of autoheader
100 function(AUTOHEADER filename variables)
101 set(tmp_filename "${filename}.tmp")
102 file(WRITE ${tmp_filename} "")
103 foreach(var ${${variables}})
104 file(APPEND ${tmp_filename} "\n/* ${${var}_doc} */\n")
105 if(${${var}_defined})
106 file(APPEND ${tmp_filename} "#define ${var} ${${var}_val}\n")
108 file(APPEND ${tmp_filename} "/* #undef ${var} */\n")
111 # FIXME: This is unix specific
112 execute_process(COMMAND diff ${filename} ${filename}.tmp RESULT_VARIABLE diff_res OUTPUT_QUIET)
113 if (NOT diff_res STREQUAL 0)
114 message(STATUS "generating ${filename}.")
115 execute_process(COMMAND mv ${filename}.tmp ${filename})
117 message(STATUS "${filename} is unchanged.")
121 function(ac_msg_checking)
122 message(STATUS "checking ${ARGV}...")
123 set(last_msg_checking ${ARGV} PARENT_SCOPE)
126 function(ac_msg_result)
127 message(STATUS "checking ${last_msg_checking}... ${ARGV}")
130 function(ac_msg_error)
131 message(FATAL_ERROR "${ARGV}")
134 function(ac_msg_warn)
135 message(STATUS "WARNING: ${ARGV}")
138 # The lines commented out using ### are the stuff from configure.in which still
139 # need to be ported to cmake
142 ac_define_unquoted(VERSION ${VERSION} "Version number of package")
147 #### In case of cygwin, override LN_S, irrespective of what it determines.
148 #### The build uses cygwin, but the actual runtime doesn't.
150 ###*cygwin* ) set(LN_S 'cp -p';;)
156 # These variables are the CPPFLAGS/CFLAGS passed to libgc's configure
157 # libgc should inherit the original CFLAGS/CPPFLAGS passed to configure, i.e. -O0
159 set(CPPFLAGS_FOR_LIBGC ${CPPFLAGS})
160 set(CFLAGS_FOR_LIBGC ${CFLAGS})
163 # These are the flags that need to be stored in the mono.pc file for
164 # compiling code that will embed Mono
166 set(libmono_cflags "")
167 set(libmono_ldflags "")
169 ###AC_SUBST(libmono_cflags)
170 ###AC_SUBST(libmono_ldflags)
172 #### Variable to have relocatable .pc files (lib, or lib64)
173 ###set(reloc_libdir `basename ${libdir}`)
174 ###AC_SUBST(reloc_libdir)
176 # if linker handles the version script
177 set(no_version_script no)
179 # Set to yes if Unix sockets cannot be created in an anonymous namespace
180 set(need_link_unlink no)
186 # Obtain the GNU style target
187 # From GetTargetTriple.cmake in LLVM
188 function( get_target_triple var )
190 set( ${var} "i686-pc-win32" PARENT_SCOPE )
192 set(config_guess config.guess)
193 execute_process(COMMAND sh ${config_guess}
194 RESULT_VARIABLE TT_RV
195 OUTPUT_VARIABLE TT_OUT
196 OUTPUT_STRIP_TRAILING_WHITESPACE)
197 if( NOT TT_RV EQUAL 0 )
198 message(FATAL_ERROR "Failed to execute ${config_guess}")
199 endif( NOT TT_RV EQUAL 0 )
200 set( ${var} ${TT_OUT} PARENT_SCOPE )
202 endfunction( get_target_triple var )
204 get_target_triple(host)
206 message(STATUS "checking host platform characteristics...")
208 set(libgc_threads no)
210 set(parallel_mark yes)
212 if(host MATCHES .*-.*-linux.*)
213 set(platform_win32 no)
214 set(CPPFLAGS "${CPPFLAGS} -DHAVE_CONFIG_H -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP")
215 set(libmono_cflags "-D_REENTRANT")
216 set(libmono_ldflags "-lpthread")
218 set(libgc_threads pthreads)
219 set(AOT_SUPPORTED "yes")
220 set(use_sigposix yes)
222 message(FATAL_ERROR "The cmake build doesn't yet support host '${host}'.")
225 #### Thread configuration inspired by sleepycat's db
227 ### *-*-mingw*|*-*-cygwin*)
228 ### set(platform_win32 yes)
229 ### AC_DEFINE(PLATFORM_WIN32,1,[Host Platform is Win32])
230 ### AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32])
231 ### ac_define(DISABLE_PORTABILITY,1,[Disable the io-portability layer])
232 ### ac_define(PLATFORM_NO_SYMLINKS,1,[This platform does not support symlinks])
233 ### if test "x$cross_compiling" = "xno"; then
234 ### set(CC "gcc -mno-cygwin -g")
235 ### # So libgc configure gets -mno-cygwin
238 ### set(HOST_CC "gcc")
239 ### # Windows 2000 is required that includes Internet Explorer 5.01
240 ### set(CPPFLAGS "$CPPFLAGS -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024")
241 ### set(libmono_cflags "-mno-cygwin -mms-bitfields -mwindows")
242 ### set(libmono_ldflags "-mno-cygwin -mms-bitfields -mwindows")
244 ### set(libgc_threads win32)
245 ### set(gc_default included)
246 ### set(with_sigaltstack no)
248 ### # This forces libgc to use the DllMain based thread registration code on win32
249 ### set(libgc_configure_args "$libgc_configure_args --enable-win32-dllmain=yes")
252 ### set(platform_win32 no)
253 ### set(CPPFLAGS "$CPPFLAGS -D_REENTRANT -DGC_NETBSD_THREADS -D_GNU_SOURCE")
254 ### set(libmono_cflags "-D_REENTRANT")
255 ### set(LDFLAGS "$LDFLAGS -pthread")
256 ### set(CPPFLAGS "$CPPFLAGS -DPLATFORM_BSD")
257 ### set(libmono_ldflags "-pthread")
258 ### set(need_link_unlink yes)
259 ### set(libdl "-ldl")
260 ### set(libgc_threads pthreads)
261 ### set(with_sigaltstack no)
262 ### set(use_sigposix yes)
265 ### set(platform_win32 no)
266 ### if test "x$PTHREAD_CFLAGS" = "x"; then
267 ### set(CPPFLAGS "$CPPFLAGS -DGC_FREEBSD_THREADS")
268 ### set(libmono_cflags )
270 ### set(CPPFLAGS "$CPPFLAGS $PTHREAD_CFLAGS -DGC_FREEBSD_THREADS")
271 ### set(libmono_cflags "$PTHREAD_CFLAGS")
273 ### if test "x$PTHREAD_LIBS" = "x"; then
274 ### set(LDFLAGS "$LDFLAGS -pthread")
275 ### set(libmono_ldflags "-pthread")
277 ### set(LDFLAGS "$LDFLAGS $PTHREAD_LIBS")
278 ### set(libmono_ldflags "$PTHREAD_LIBS")
280 ### set(CPPFLAGS "$CPPFLAGS -DPLATFORM_BSD")
281 ### set(need_link_unlink yes)
282 ### ac_define(PTHREAD_POINTER_ID, 1, [pthread is a pointer])
284 ### set(libgc_threads pthreads)
285 ### # This doesn't seem to work as of 7.0 on amd64
286 ### set(with_sigaltstack no)
287 #### TLS is only partially implemented on -CURRENT (compiler support
288 #### but NOT library support)
290 ### set(with_tls pthread)
291 ### set(use_sigposix yes)
294 ### set(platform_win32 no)
295 ### set(CPPFLAGS "$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS -DPLATFORM_BSD")
296 ### set(libmono_cflags "-D_THREAD_SAFE")
297 ### set(LDFLAGS "$LDFLAGS -pthread")
298 ### set(libmono_ldflags "-pthread")
299 ### set(need_link_unlink yes)
300 ### ac_define(PTHREAD_POINTER_ID)
302 ### set(libgc_threads pthreads)
303 ### set(use_sigposix yes)
306 ### set(platform_win32 no)
307 ### set(CPPFLAGS "$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP")
308 ### set(libmono_cflags "-D_REENTRANT")
309 ### set(libmono_ldflags "-lpthread")
310 ### set(libdl "-ldl")
311 ### set(libgc_threads pthreads)
312 ### set(AOT_SUPPORTED "yes")
313 ### set(use_sigposix yes)
316 ### set(platform_win32 no)
317 ### set(CPPFLAGS "$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT")
318 ### # +ESdbgasm only valid on bundled cc on RISC
319 ### # silently ignored for ia64
320 ### if test $GCC != "yes"; then
321 ### set(CFLAGS "$CFLAGS +ESdbgasm")
322 ### # Arrange for run-time dereferencing of null
323 ### # pointers to produce a SIGSEGV signal.
324 ### set(LDFLAGS "$LDFLAGS -z")
326 ### set(CFLAGS "$CFLAGS +ESdbgasm")
327 ### set(LDFLAGS "$LDFLAGS -z")
328 ### set(libmono_cflags "-D_REENTRANT")
329 ### set(libmono_ldflags "-lpthread")
330 ### set(libgc_threads pthreads)
331 ### set(need_link_unlink yes)
332 ### set(use_sigposix yes)
335 ### set(platform_win32 no)
336 ### set(CPPFLAGS "$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_MMAP -DUSE_MUNMAP -DPLATFORM_SOLARIS")
337 ### set(need_link_unlink yes)
338 ### set(libmono_cflags "-D_REENTRANT")
339 ### set(libgc_threads pthreads)
340 ### # This doesn't seem to work on solaris/x86, but the configure test runs
341 ### set(with_tls pthread)
342 ### set(has_dtrace yes)
343 ### set(use_sigposix yes)
346 ### set(parallel_mark "Disabled_Currently_Hangs_On_MacOSX")
347 ### set(platform_win32 no)
348 ### set(platform_darwin yes)
349 ### set(CPPFLAGS "$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP")
350 ### set(CPPFLAGS "$CPPFLAGS -DGetCurrentProcess=MonoGetCurrentProcess -DGetCurrentThread=MonoGetCurrentThread -DCreateEvent=MonoCreateEvent")
351 ### set(libmono_cflags "-D_THREAD_SAFE")
352 ### set(LDFLAGS "$LDFLAGS -pthread")
353 ### set(libmono_ldflags "-pthread")
354 ### set(need_link_unlink yes)
355 ### ac_define(PTHREAD_POINTER_ID)
356 ### ac_define(USE_MACH_SEMA, 1, [...])
357 ### set(no_version_script yes)
359 ### set(libgc_threads pthreads)
360 ### set(has_dtrace yes)
361 ### if test "x$cross_compiling" = "xyes"; then
362 ### set(has_broken_apple_cpp yes)
366 ### AC_MSG_WARN([*** Please add $host to configure.in checks!])
367 ### set(platform_win32 no)
368 ### set(libdl "-ldl")
373 ###if test x$need_link_unlink = xyes; then
374 ### ac_define(NEED_LINK_UNLINK, 1, [Define if Unix sockets cannot be created in an anonymous namespace])
379 set(PLATFORM_SIGPOSIX 1)
382 set(PLATFORM_WIN32 yes)
384 if(${target_os} MATCHES "*linux*")
385 set(PLATFORM_LINUX yes)
388 set(PLATFORM_DARWIN yes)
391 include(CMakeDetermineASM-ATTCompiler)
393 find_program(BISON NAMES bison)
395 if(BISON STREQUAL "BISON-NOTFOUND")
396 message(FATAL_ERROR "You need to install bison")
398 message(STATUS "Found bison: ${BISON}")
403 #### We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
404 ###: ${set(CCAS '$(CC)'})
405 #### Set ASFLAGS if not already set.
406 ###: ${set(CCASFLAGS '$(CFLAGS)'})
408 ###AC_SUBST(CCASFLAGS)
410 #### may require a specific autoconf version
411 #### AC_PROG_CC_FOR_BUILD
412 #### CC_FOR_BUILD not automatically detected
413 ###set(CC_FOR_BUILD $CC)
414 ###set(CFLAGS_FOR_BUILD $CFLAGS)
415 ###set(BUILD_EXEEXT )
416 ###if test "x$cross_compiling" = "xyes"; then
417 ### set(CC_FOR_BUILD cc)
418 ### set(CFLAGS_FOR_BUILD )
419 ### set(BUILD_EXEEXT "")
421 ###AC_SUBST(CC_FOR_BUILD)
422 ###AC_SUBST(CFLAGS_FOR_BUILD)
424 ###AC_SUBST(BUILD_EXEEXT)
426 ###AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
427 ###AM_CONDITIONAL(USE_BATCH_FILES, [test x$platform_win32 = xyes -a x$cross_compiling = xyes])
429 #### Set STDC_HEADERS
431 ###AC_LIBTOOL_WIN32_DLL
432 #### This causes monodis to not link correctly
433 ####AC_DISABLE_FAST_INSTALL
434 ###set(export_ldflags `(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`)
435 ###AC_SUBST(export_ldflags)
437 #### Test whenever ld supports -version-script
440 ###if test "x$lt_cv_prog_gnu_ld" = "xno"; then
441 ### set(no_version_script yes)
444 ###AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
447 ac_check_headers(unistd.h stdint.h sys/types.h)
448 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)
449 ac_check_headers(sys/user.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h)
451 ac_check_headers(zlib.h)
452 set(have_zlib ${HAVE_ZLIB_H})
455 check_c_source_compiles("
458 #if defined(ZLIB_VERNUM) && (ZLIB_VERNUM >= 0x1230)
461 #error No good zlib found
465 ac_msg_result("Using system zlib")
466 set(zlib_msg "system zlib")
469 ac_msg_result("Using embedded zlib")
471 set(zlib_msg "bundled zlib")
478 ac_define(HAVE_ZLIB 1 "Have system zlib")
480 # for mono/metadata/debug-symfile.c
481 ac_check_headers(elf.h)
484 ac_check_headers(poll.h)
485 ac_check_headers(sys/poll.h)
486 ac_check_headers(sys/wait.h)
487 ac_check_headers(grp.h)
488 ac_check_headers(syslog.h)
491 ac_check_headers(wchar.h)
492 ac_check_headers(ieeefp.h)
494 # Check whenever using GCC
495 include(CheckCSourceCompiles)
496 include(CheckCCompilerFlag)
497 check_c_source_compiles("
506 ac_msg_checking("for isinf")
508 check_c_source_compiles("
516 ac_define(HAVE_ISINF 1 "isinf available")
517 set(HAVE_ISINF 1 CACHE BOOL "Have the isinf function")
523 # not 64 bit clean in cross-compile
524 ac_check_sizeof("void *" 4)
529 set(WARN "-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings")
530 # The runtime code does not respect ANSI C strict aliasing rules
531 set(CFLAGS "${CFLAGS} -fno-strict-aliasing")
532 CHECK_C_COMPILER_FLAG("-Wdeclaration-after-statement" HAS_WDECL_AFTER_STATEMENT)
533 if(HAS_WDECL_AFTER_STATEMENT)
534 set(WARN "${WARN} -Wdeclaration-after-statement")
537 # The Sun Forte compiler complains about inline functions that access static variables
538 # so disable all inlining.
541 ### set(CFLAGS "$CFLAGS -Dinline=")
547 set(CFLAGS "${CFLAGS} -g ${WARN}")
549 ###set(CFLAGS_FOR_LIBGC "$CFLAGS_FOR_LIBGC -g")
552 set(srcdir ${CMAKE_SOURCE_DIR})
553 set(top_srcdir ${CMAKE_SOURCE_DIR})
554 set(abs_top_srcdir ${top_srcdir})
557 set(top_builddir ${CMAKE_BINARY_DIR})
559 # Where's the 'mcs' source tree?
560 if(EXISTS ${srcdir}/mcs)
567 # A sanity check to catch cases where the package was unpacked
568 # with an ancient tar program (Solaris)
570 set(solaris-tar-check yes CACHE BOOL "Enable/disable solaris tar check")
572 if(solaris-tar-check)
573 ac_msg_checking("integrity of package")
574 if(EXISTS ${srcdir}/${mcsdir}/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs)
577 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")
578 ac_msg_error(${errorm})
582 set(mcs_topdir ${top_srcdir}/${mcsdir})
583 set(mcs_topdir_from_srcdir ${top_builddir}/${mcsdir})
585 ##### Maybe should also disable if mcsdir is invalid. Let's punt the issue for now.
586 ###AM_CONDITIONAL(BUILD_MCS, [test x$cross_compiling = xno && test x$enable_mcs_build != xno])
588 ###AC_SUBST([mcs_topdir])
589 ###AC_SUBST([mcs_topdir_from_srcdir])
591 #### Where's the 'olive' source tree?
592 ###if test -d $srcdir/olive; then
593 ### set(olivedir olive)
595 ### set(olivedir ../olive)
598 ###if test -d $srcdir/$olivedir; then
599 ###set(olive_topdir '$(top_srcdir)/'$olivedir)
602 #### gettext: prepare the translation directories.
603 #### we do not configure the full gettext, as we consume it dynamically from C#
606 ###if test "x$USE_NLS" = "xyes"; then
607 ### AC_CHECK_PROG(HAVE_MSGFMT, msgfmt,yes,no)
609 ### if test "x$HAVE_MSGFMT" = "xno"; then
610 ### ac_msg_error([msgfmt not found. You need to install the 'gettext' package, or pass --enable-set(nls no to configure.]))
614 set(libgdiplus installed CACHE STRING "=installed|sibling|<path> Override the libgdiplus used for System.Drawing tests (defaults to installed)")
615 set(with_libgdiplus ${libgdiplus})
617 ###case $with_libgdiplus in
618 ###no|installed) set(libgdiplus_loc ;;)
619 ###yes|sibling) set(libgdiplus_loc `cd ../libgdiplus && pwd`/src/libgdiplus.la ;;)
620 ###/*) set(libgdiplus_loc $with_libgdiplus ;;)
621 ###*) set(libgdiplus_loc `pwd`/$with_libgdiplus ;;)
623 ###AC_SUBST([libgdiplus_loc])
626 ###set(pkg_config_path )
627 ###set(crosspkgdir, [ --with-set(crosspkgdir /path/to/pkg-config/dir Change pkg-config dir to custom dir],)
628 ### if test x$with_crosspkgdir = "x"; then
629 ### if test -s $PKG_CONFIG_PATH; then
630 ### set(pkg_config_path $PKG_CONFIG_PATH)
633 ### set(pkg_config_path $with_crosspkgdir)
634 ### set(PKG_CONFIG_PATH $pkg_config_path)
635 ### export PKG_CONFIG_PATH
640 ### [ --with-set(glib embedded|system Choose glib API: system or embedded (default to system)],)
641 ### [], [set(with_glib system]))
646 include(FindPkgConfig)
649 set(with_glib "system")
650 if (${with_glib} STREQUAL "system")
651 ### if test "x$cross_compiling" = "xyes"; then
652 ### set(pkg_config_path "$PKG_CONFIG_PATH")
653 ### unset PKG_CONFIG_PATH
655 PKG_CHECK_MODULES(GLIB2 REQUIRED glib-2.0 gthread-2.0)
656 set(BUILD_GLIB_CFLAGS ${GLIB2_CFLAGS})
657 set(BUILD_GLIB_LIBS ${GLIB2_LIBRARIES})
659 ### if test "x$cross_compiling" = "xyes"; then
660 ### set(PKG_CONFIG_PATH $pkg_config_path)
661 ### export PKG_CONFIG_PATH
664 ## Versions of dependencies
665 set(GLIB_REQUIRED_VERSION 2.4.0)
667 PKG_CHECK_MODULES(GLIB2 REQUIRED glib-2.0 >= ${GLIB_REQUIRED_VERSION} gthread-2.0)
668 set(GLIB_CFLAGS ${GLIB2_CFLAGS})
669 set(GLIB_LIBS ${GLIB2_LIBRARIES})
670 PKG_CHECK_MODULES(GMODULE REQUIRED gmodule-2.0)
671 set(GMODULE_CFLAGS ${GMODULE_CFLAGS})
672 set(GMODULE_LIBS ${GMODULE_LIBRARIES})
675 ###case $with_glib in
677 ### set(GLIB_CFLAGS '-I$(top_srcdir)/eglib/src -I$(top_builddir)/eglib/src')
678 ### set(GLIB_LIBS '-L$(top_builddir)/eglib/src -leglib -lm')
679 ### set(BUILD_GLIB_CFLAGS "$GLIB_CFLAGS")
680 ### set(BUILD_GLIB_LIBS "$GLIB_LIBS")
681 ### set(GMODULE_CFLAGS "$GLIB_CFLAGS")
682 ### set(GMODULE_LIBS "$GLIB_LIBS")
683 ### set(eglib_dir eglib)
684 ### AC_CONFIG_SUBDIRS(eglib)
687 ### ac_msg_error([Invalid argument to --with-glib.])
689 if(with_glib STREQUAL "embedded")
693 ###AC_SUBST(GLIB_CFLAGS)
694 ###AC_SUBST(GLIB_LIBS)
695 ###AC_SUBST(GMODULE_CFLAGS)
696 ###AC_SUBST(GMODULE_LIBS)
697 ###AC_SUBST(BUILD_GLIB_CFLAGS)
698 ###AC_SUBST(BUILD_GLIB_LIBS)
699 ###AC_SUBST(eglib_dir)
701 ###if test x$cross_compiling$platform_win32 = xnoyes; then
702 ### ac_msg_checking(for cygwin glib2-dev package)
703 ### if [ cygcheck --f /usr/lib/libglib-2.0.dll.a | grep -q glib2-devel ]; then
704 ### ac_msg_result(found)
705 ### 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.])
707 ### ac_msg_result(not found, ok)
710 ### ac_msg_checking(for broken gwin32.h)
711 ### set(glib_include `$PKG_CONFIG --cflags-only-I glib-2.0 | sed -e 's/ -I.*//g' | sed -e 's/-I//g'`)
712 ### if test -f $glib_include/glib/gwin32.h; then
713 ### if [ grep ftruncate $glib_include/glib/gwin32.h | grep -q define ]; then
714 ### ac_msg_result(failed)
715 ### set(hashmark '#')
716 ### 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.])
719 ### ac_msg_result(ok)
722 # Enable support for fast thread-local storage
723 # Some systems have broken support, so we allow to disable it.
724 set(tls __thread CACHE STRING "Select Thread Local Storage implementation. Possible values are '__thread_' and 'pthread' (defaults to __thread)")
727 # Enable support for using sigaltstack for SIGSEGV and stack overflow handling
728 # This does not work on some platforms (bug #55253)
729 set(sigaltstack yes CACHE BOOL "Enable/disable support for sigaltstack (defaults to yes)")
730 set(with_sigaltstack ${sigaltstack})
732 set(static_mono yes CACHE BOOL "Link mono statically to libmono (faster) (defaults to yes)")
733 set(with_static_mono ${static_mono})
735 ###if test "x$enable_static" = "xno"; then
736 ### set(with_static_mono no)
739 ###if test "x$platform_win32" = "xyes"; then
740 ### # Boehm GC requires the runtime to be in its own dll
741 ### set(with_static_mono no)
747 set(enable_mcs_build yes)
748 ###AC_ARG_ENABLE(mcs-build, [ --disable-mcs-build disable the build of the mcs directory], set(try_mcs_build $enableval, enable_mcs_build=yes))
750 ###set(xen_opt, [ --with-set(xen_opt yes,no Enable Xen-specific behaviour (defaults to yes)],[],[with_xen_opt=yes]))
751 ###if test "x$with_xen_opt" = "xyes"; then
752 ### ac_define(MONO_XEN_OPT, 1, [Xen-specific behaviour])
753 ### set(ORIG_CFLAGS $CFLAGS)
754 ### set(CFLAGS "$CFLAGS -mno-tls-direct-seg-refs")
755 ### ac_msg_checking(for -mno-tls-direct-seg-refs option to gcc)
756 ### AC_TRY_COMPILE([], [
759 ### ac_msg_result(yes)
760 ### # Pass it to libgc as well
761 ### set(CFLAGS_FOR_LIBGC "$CFLAGS_FOR_LIBGC -mno-tls-direct-seg-refs")
763 ### ac_msg_result(no)
764 ### set(CFLAGS $ORIG_CFLAGS)
768 set (quiet-build yes CACHE BOOL "Enable quiet runtime build (on by default)")
770 set(DISABLED_FEATURES none)
772 ###AC_ARG_ENABLE(minimal, [ --enable-set(minimal LIST drop support for LIST subsystems.)
773 ### LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug,
774 ### reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd.],
776 ### for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
777 ### eval "mono_feature_disable_$set(feature 'yes'")
778 ### AC_MSG_NOTICE([Disabled support for feature: $feature])
780 ### set(DISABLED_FEATURES $enable_minimal)
781 ### set(disabled "Disabled: $enable_minimal")
784 ac_define_unquoted(DISABLED_FEATURES "${DISABLED_FEATURES}" "String of disabled features")
786 ###if test "x$mono_feature_disable_aot" = "xyes"; then
787 ### AC_DEFINE(DISABLE_AOT_COMPILER, 1, [Disable AOT Compiler])
788 ### AC_MSG_NOTICE([Disabled AOT compiler])
791 ###if test "x$mono_feature_disable_profiler" = "xyes"; then
792 ### ac_define(DISABLE_PROFILER, 1, [Disable default profiler support])
794 ###AM_CONDITIONAL(DISABLE_PROFILER, test x$mono_feature_disable_profiler = xyes)
796 ###if test "x$mono_feature_disable_decimal" = "xyes"; then
797 ### ac_define(DISABLE_DECIMAL, 1, [Disable System.Decimal support])
800 ###if test "x$mono_feature_disable_pinvoke" = "xyes"; then
801 ### ac_define(DISABLE_PINVOKE, 1, [Disable P/Invoke support])
804 ###if test "x$mono_feature_disable_debug" = "xyes"; then
805 ### ac_define(DISABLE_DEBUG, 1, [Disable runtime debugging support])
808 ###if test "x$mono_feature_disable_reflection_emit" = "xyes"; then
809 ### ac_define(DISABLE_REFLECTION_EMIT, 1, [Disable reflection emit support])
810 ### set(mono_feature_disable_reflection_emit_save yes)
813 ###if test "x$mono_feature_disable_reflection_emit_save" = "xyes"; then
814 ### ac_define(DISABLE_REFLECTION_EMIT_SAVE, 1, [Disable assembly saving support in reflection emit])
817 ###if test "x$mono_feature_disable_large_code" = "xyes"; then
818 ### ac_define(DISABLE_LARGE_CODE, 1, [Disable support for huge assemblies])
821 ###if test "x$mono_feature_disable_logging" = "xyes"; then
822 ### ac_define(DISABLE_LOGGING, 1, [Disable support debug logging])
825 ###if test "x$mono_feature_disable_com" = "xyes"; then
826 ### ac_define(DISABLE_COM, 1, [Disable COM support])
829 ###if test "x$mono_feature_disable_ssa" = "xyes"; then
830 ### ac_define(DISABLE_SSA, 1, [Disable advanced SSA JIT optimizations])
833 ###if test "x$mono_feature_disable_generics" = "xyes"; then
834 ### ac_define(DISABLE_GENERICS, 1, [Disable generics support])
837 ###if test "x$mono_feature_disable_attach" = "xyes"; then
838 ### ac_define(DISABLE_ATTACH, 1, [Disable agent attach support])
841 ###if test "x$mono_feature_disable_jit" = "xyes"; then
842 ### ac_define(DISABLE_JIT, 1, [Disable the JIT, only full-aot mode will be supported by the runtime.])
845 ###AM_CONDITIONAL(DISABLE_JIT, test x$mono_feature_disable_jit = xyes)
847 ###if test "x$mono_feature_disable_simd" = "xyes"; then
848 ### ac_define(DISABLE_SIMD, 1, [Disable SIMD intrinsics related optimizations.])
851 ###ac_msg_checking(for visibility __attribute__)
852 ###AC_TRY_COMPILE([], [
853 ### void __attribute__ ((visibility ("hidden"))) doit (void) {}
854 ### void main () { doit (); }
856 ### set(have_visibility_hidden yes)
857 ### ac_msg_result(yes)
859 ### set(have_visibility_hidden no)
860 ### ac_msg_result(no)
870 set(use_included_gc no)
871 set(libgc_configure_args)
872 set(gc_default included)
874 set(gc ${gc_default} CACHE STRING "The GC library to use (defaults to included)")
878 set(enable_parallel_mark yes)
879 ###AC_ARG_ENABLE(parallel-mark, [ --enable-parallel-mark Enables GC Parallel Marking], set(enable_parallel_mark $enableval, enable_parallel_mark=$parallel_mark))
880 ###if test x$enable_parallel_mark = xyes; then
881 ### set(libgc_configure_args "$libgc_configure_args --enable-parallel-mark")
886 set(LIBGC_STATIC_LIBS )
889 if (gc STREQUAL included)
892 set(use_included_gc yes)
895 set(LIBGC_CFLAGS '-I${top_srcdir}/libgc/include')
896 set(LIBGC_LIBS '${top_builddir}/libgc/libmonogc.la')
897 set(LIBGC_STATIC_LIBS '${top_builddir}/libgc/libmonogc-static.la')
899 ac_define(HAVE_BOEHM_GC 1 "Have Boehm GC")
900 ### AC_SUBST(HAVE_BOEHM_GC)
902 ac_define(HAVE_GC_H 1 "Have gc.h")
903 ac_define(USE_INCLUDED_LIBGC 1 "Use included libgc")
905 # The included libgc contains GCJ support
906 ac_define(HAVE_GC_GCJ_MALLOC 1 "Have GC_gcj_malloc")
907 ac_define(HAVE_GC_ENABLE 1 "Have GC_enable")
908 if (enable_parallel_mark STREQUAL yes)
909 ac_define_unquoted(USED_GC_NAME "Included Boehm (with typed GC and Parallel Mark)" "GC description")
911 ac_define_unquoted(USED_GC_NAME "Included Boehm (with typed GC)" "GC description")
916 ### xboehm|xbohem|xyes)
917 ### ac_check_headers(gc.h gc/gc.h, set(gc_headers yes))
918 ### AC_CHECK_LIB(gc, GC_malloc, set(found_boehm "yes",,$libdl))
920 ### if test "x$found_boehm" != "xyes"; then
921 ### ac_msg_error("GC requested but libgc not found! Install libgc or run configure with --with-set(gc none."))
923 ### if test "x$gc_headers" != "xyes"; then
924 ### ac_msg_error("GC requested but header files not found! You may need to install them by hand.")
927 ### ac_define(HAVE_BOEHM_GC, 1, [Have Boehm GC])
928 ### AC_SUBST(HAVE_BOEHM_GC)
929 ### set(LIBGC_LIBS "-lgc $libdl")
930 ### set(LIBGC_STATIC_LIBS "$LIBGC_LIBS")
932 ### # ac_check_funcs does not work for some reason...
933 ### AC_CHECK_LIB(gc, GC_gcj_malloc, set(found_gcj_malloc "yes",,$libdl))
934 ### if test "x$found_gcj_malloc" = "xyes"; then
935 ### ac_define(HAVE_GC_GCJ_MALLOC, 1, [Have GC_gcj_malloc])
936 ### ac_define_unquoted(USED_GC_NAME, "System Boehm (with typed GC)", [GC description])
938 ### ac_define_unquoted(USED_GC_NAME, "System Boehm (no typed GC)", [GC description])
940 ### AC_CHECK_LIB(gc, GC_enable, set(found_gc_enable "yes",,$libdl))
941 ### if test "x$found_gc_enable" = "xyes"; then
942 ### ac_define(HAVE_GC_ENABLE, 1, [Have 'GC_enable'])
947 ### set(found_boehm yes)
948 ### set(gc_headers yes)
949 ### set(use_included_gc yes)
950 ### set(libgc_dir libgc)
952 ### set(LIBGC_CFLAGS '-I$(top_srcdir)/libgc/include')
953 ### set(LIBGC_LIBS '$(top_builddir)/libgc/libmonogc.la')
954 ### set(LIBGC_STATIC_LIBS '$(top_builddir)/libgc/libmonogc-static.la')
956 ### ac_define(HAVE_BOEHM_GC, 1, [Have Boehm GC])
957 ### AC_SUBST(HAVE_BOEHM_GC)
959 ### ac_define(HAVE_GC_H, 1, [Have gc.h])
960 ### ac_define(USE_INCLUDED_LIBGC, 1, [Use included libgc])
962 ### # The included libgc contains GCJ support
963 ### ac_define(HAVE_GC_GCJ_MALLOC, 1, [Have GC_gcj_malloc])
964 ### ac_define(HAVE_GC_ENABLE, 1, [Have GC_enable])
965 ### if test x$enable_parallel_mark = xyes; then
966 ### ac_define_unquoted(USED_GC_NAME, "Included Boehm (with typed GC and Parallel Mark)", [GC description])
968 ### ac_define_unquoted(USED_GC_NAME, "Included Boehm (with typed GC)", [GC description])
973 ### set(found_boehm no)
974 ### set(gc_headers no)
975 ### set(use_included_gc no)
976 ### ac_define(HAVE_SGEN_GC,1,[Using the simple generational GC.])
977 ### ac_define(HAVE_MOVING_COLLECTOR,1,[The GC can move objects.])
978 ### ac_define(HAVE_WRITE_BARRIERS,1,[The GC needs write barriers.])
979 ### ac_define_unquoted(USED_GC_NAME, "Simple generational", [GC description])
983 ### AC_MSG_WARN("Compiling mono without GC.")
984 ### ac_define_unquoted(USED_GC_NAME, "none", [GC description])
985 ### ac_define(HAVE_NULL_GC,1,[No GC support.])
988 ### ac_msg_error([Invalid argument to --with-gc.])
992 ###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]))
993 ###if test "x$large_heap" = "xyes"; then
995 ### set(CPPFLAGS "$CPPFLAGS -DLARGE_CONFIG")
998 ###AM_CONDITIONAL(INCLUDED_LIBGC, test x$use_included_gc = xyes)
999 ###AC_SUBST(LIBGC_CFLAGS)
1000 ###AC_SUBST(LIBGC_LIBS)
1001 ###AC_SUBST(LIBGC_STATIC_LIBS)
1002 ###AC_SUBST(libgc_dir)
1005 # End of libgc checks
1008 include(CheckFunctionExists)
1009 include(CheckLibraryExists)
1011 if(platform_win32 STREQUAL no)
1014 # hires monotonic clock support
1015 ### AC_SEARCH_LIBS(clock_gettime, rt)
1017 check_function_exists (dlopen dlopen_found)
1021 check_library_exists (-ldl dlopen "" libdl_found)
1029 if (dl_support STREQUAL no)
1031 ### AC_MSG_WARN([No dynamic loading support available])
1033 set(LIBS ${LIBS} ${DL_LIB})
1034 ac_define(HAVE_DL_LOADER 1 "dlopen-based dynamic loader available")
1036 ### # from glib's configure.in
1037 ### AC_CACHE_CHECK([for preceeding underscore in symbols],
1038 ### mono_cv_uscore,[
1039 ### AC_TRY_RUN([#include <dlfcn.h>
1040 ### int mono_underscore_test (void) { return 42; }
1042 ### void *f1 = (void*)0, *f2 = (void*)0, *handle;
1043 ### handle = dlopen ((void*)0, 0);
1045 ### f1 = dlsym (handle, "mono_underscore_test");
1046 ### f2 = dlsym (handle, "_mono_underscore_test");
1047 ### } return (!f2 || f1);
1049 ### [set(mono_cv_uscore yes],)
1050 ### [set(mono_cv_uscore no],)
1053 ### if test "x$mono_cv_uscore" = "xyes"; then
1054 ### set(MONO_DL_NEED_USCORE 1)
1056 ### set(MONO_DL_NEED_USCORE 0)
1058 ### AC_SUBST(MONO_DL_NEED_USCORE)
1059 ### AC_CHECK_FUNC(dlerror)
1062 # ******************************************************************
1063 # *** Checks for the IKVM JNI interface library ***
1064 # ******************************************************************
1065 set(ikvm-native yes CACHE BOOL "Build the IKVM JNI interface library (defaults to yes)")
1066 set(with_ikvm_native ${ikvm-native})
1067 set(ikvm_native_dir )
1068 if(with_ikvm_native)
1069 set(ikvm_native_dir ikvm-native)
1070 set(jdk_headers_found "IKVM Native")
1073 ac_check_headers(execinfo.h)
1075 ac_check_funcs(getgrgid_r)
1076 ac_check_funcs(getgrnam_r)
1077 ac_check_funcs(getpwnam_r)
1078 ac_check_funcs(getpwuid_r)
1079 ac_check_funcs(getresuid)
1080 ac_check_funcs(setresuid)
1081 ac_check_funcs(kqueue)
1082 ac_check_funcs(backtrace_symbols)
1083 ac_check_funcs(mkstemp)
1084 ac_check_funcs(mmap)
1085 ac_check_funcs(madvise)
1086 ac_check_funcs(getrusage)
1087 ac_check_funcs(getpriority)
1088 ac_check_funcs(setpriority)
1090 ac_check_funcs(sched_setaffinity)
1092 # ******************************************************************
1093 # *** Check for large file support ***
1094 # *** (If we were using autoconf 2.50 we'd use AC_SYS_LARGEFILE) ***
1095 # ******************************************************************
1097 # Check that off_t can represent 2**63 - 1 correctly, working around
1098 # potential compiler bugs. Defines LARGE_FILE_SUPPORT, adds $1 to
1099 # CPPFLAGS and sets $large_offt to yes if the test succeeds
1100 ### set(large_offt no)
1101 ### AC_DEFUN([LARGE_FILES], [
1102 ### set(large_CPPFLAGS $CPPFLAGS)
1103 ### set(CPPFLAGS "$CPPFLAGS $1")
1105 ### #include <sys/types.h>
1107 ### #define BIG_OFF_T (((off_t)1<<62)-1+((off_t)1<<62))
1109 ### int main(void) {
1110 ### int set(big_off_t ((BIG_OFF_T%2147483629==721) &&)
1111 ### (BIG_OFF_T%set(2147483647 =1));)
1119 ### ac_msg_result(ok)
1120 ### ac_define(HAVE_LARGE_FILE_SUPPORT, 1, [Have large file support])
1121 ### set(large_CPPFLAGS "$large_CPPFLAGS $1")
1122 ### set(large_offt yes)
1124 ### ac_msg_result(no)
1126 ### set(CPPFLAGS $large_CPPFLAGS)
1129 ### ac_msg_checking(if off_t is 64 bits wide)
1131 ### if test $large_offt = no; then
1132 ### ac_msg_checking(if set(_FILE_OFFSET_BITS 64 gives 64 bit off_t))
1133 ### LARGE_FILES("-set(D_FILE_OFFSET_BITS 64"))
1135 ### if test $large_offt = no; then
1136 ### AC_MSG_WARN([No 64 bit file size support available])
1139 # *****************************
1140 # *** Checks for libsocket ***
1141 # *****************************
1142 ### AC_CHECK_LIB(socket, socket, set(LIBS "$LIBS -lsocket"))
1144 # *******************************
1145 # *** Checks for MSG_NOSIGNAL ***
1146 # *******************************
1147 ### ac_msg_checking(for MSG_NOSIGNAL)
1148 ### AC_TRY_COMPILE([#include <sys/socket.h>], [
1149 ### int f = MSG_NOSIGNAL;
1151 ### # Yes, we have it...
1152 ### ac_msg_result(yes)
1153 ### ac_define(HAVE_MSG_NOSIGNAL, 1, [Have MSG_NOSIGNAL])
1155 ### # We'll have to use signals
1156 ### ac_msg_result(no)
1159 # *****************************
1160 # *** Checks for SOL_IP ***
1161 # *****************************
1162 ### ac_msg_checking(for SOL_IP)
1163 ### AC_TRY_COMPILE([#include <netdb.h>], [
1164 ### int level = SOL_IP;
1166 ### # Yes, we have it...
1167 ### ac_msg_result(yes)
1168 ### ac_define(HAVE_SOL_IP, 1, [Have SOL_IP])
1170 ### # We'll have to use getprotobyname
1171 ### ac_msg_result(no)
1174 # *****************************
1175 # *** Checks for SOL_IPV6 ***
1176 # *****************************
1177 ### ac_msg_checking(for SOL_IPV6)
1178 ### AC_TRY_COMPILE([#include <netdb.h>], [
1179 ### int level = SOL_IPV6;
1181 ### # Yes, we have it...
1182 ### ac_msg_result(yes)
1183 ### ac_define(HAVE_SOL_IPV6, 1, [Have SOL_IPV6])
1185 ### # We'll have to use getprotobyname
1186 ### ac_msg_result(no)
1189 # *****************************
1190 # *** Checks for SOL_TCP ***
1191 # *****************************
1192 ### ac_msg_checking(for SOL_TCP)
1193 ### AC_TRY_COMPILE([#include <netdb.h>], [
1194 ### int level = SOL_TCP;
1196 ### # Yes, we have it...
1197 ### ac_msg_result(yes)
1198 ### ac_define(HAVE_SOL_TCP, 1, [Have SOL_TCP])
1200 ### # We'll have to use getprotobyname
1201 ### ac_msg_result(no)
1204 # *****************************
1205 # *** Checks for IP_PKTINFO ***
1206 # *****************************
1207 ### ac_msg_checking(for IP_PKTINFO)
1208 ### AC_TRY_COMPILE([#include <netdb.h>], [
1209 ### int level = IP_PKTINFO;
1211 ### # Yes, we have it...
1212 ### ac_msg_result(yes)
1213 ### ac_define(HAVE_IP_PKTINFO, 1, [Have IP_PKTINFO])
1215 ### ac_msg_result(no)
1218 # *****************************
1219 # *** Checks for IPV6_PKTINFO ***
1220 # *****************************
1221 ### ac_msg_checking(for IPV6_PKTINFO)
1222 ### AC_TRY_COMPILE([#include <netdb.h>], [
1223 ### int level = IPV6_PKTINFO;
1225 ### # Yes, we have it...
1226 ### ac_msg_result(yes)
1227 ### ac_define(HAVE_IPV6_PKTINFO, 1, [Have IPV6_PKTINFO])
1229 ### ac_msg_result(no)
1232 # **********************************
1233 # *** Checks for IP_DONTFRAGMENT ***
1234 # **********************************
1235 ### ac_msg_checking(for IP_DONTFRAGMENT)
1236 ### AC_TRY_COMPILE([#include <netdb.h>], [
1237 ### int level = IP_DONTFRAGMENT;
1239 ### # Yes, we have it...
1240 ### ac_msg_result(yes)
1241 ### ac_define(HAVE_IP_DONTFRAGMENT, 1, [Have IP_DONTFRAGMENT])
1243 ### ac_msg_result(no)
1246 # **********************************
1247 # *** Checks for IP_MTU_DISCOVER ***
1248 # **********************************
1249 ### ac_msg_checking(for IP_MTU_DISCOVER)
1250 ### AC_TRY_COMPILE([#include <netdb.h>], [
1251 ### int level = IP_MTU_DISCOVER;
1253 ### # Yes, we have it...
1254 ### ac_msg_result(yes)
1255 ### ac_define(HAVE_IP_MTU_DISCOVER, 1, [Have IP_MTU_DISCOVER])
1257 ### ac_msg_result(no)
1260 ### # *********************************
1261 # *** Check for struct ip_mreqn ***
1262 # *********************************
1263 ### ac_msg_checking(for struct ip_mreqn)
1264 ### AC_TRY_COMPILE([#include <netinet/in.h>], [
1265 ### struct ip_mreqn mreq;
1266 ### mreq.imr_address.s_addr = 0;
1268 ### # Yes, we have it...
1269 ### ac_msg_result(yes)
1270 ### ac_define(HAVE_STRUCT_IP_MREQN, 1, [Have struct ip_mreqn])
1272 ### # We'll just have to try and use struct ip_mreq
1273 ### ac_msg_result(no)
1274 ### ac_msg_checking(for struct ip_mreq)
1275 ### AC_TRY_COMPILE([#include <netinet/in.h>], [
1276 ### struct ip_mreq mreq;
1277 ### mreq.imr_interface.s_addr = 0;
1279 ### # Yes, we have it...
1280 ### ac_msg_result(yes)
1281 ### ac_define(HAVE_STRUCT_IP_MREQ, 1, [Have struct ip_mreq])
1283 ### # No multicast support
1284 ### ac_msg_result(no)
1288 # **********************************
1289 # *** Check for gethostbyname2_r ***
1290 # **********************************
1291 ### ac_msg_checking(for gethostbyname2_r)
1292 ### AC_TRY_LINK([#include <netdb.h>], [
1293 ### gethostbyname2_r(NULL,0,NULL,NULL,0,NULL,NULL);
1295 ### # Yes, we have it...
1296 ### ac_msg_result(yes)
1297 ### ac_define(HAVE_GETHOSTBYNAME2_R, 1, [Have gethostbyname2_r])
1299 ### ac_msg_result(no)
1302 # *****************************
1303 # *** Checks for libnsl ***
1304 # *****************************
1305 ### AC_CHECK_FUNC(gethostbyaddr, , AC_CHECK_LIB(nsl, gethostbyaddr, set(LIBS "$LIBS -lnsl")))
1307 ac_check_funcs(inet_pton inet_aton)
1309 # ***********************************************
1310 # *** Checks for size of sockaddr_un.sun_path ***
1311 # ***********************************************
1313 ac_msg_checking("size of sockaddr_un.sun_path")
1315 FILE(WRITE "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.c"
1317 #include <sys/types.h>
1322 struct sockaddr_un sock_un;
1323 printf(\"%d\\n\", sizeof(sock_un.sun_path));
1328 TRY_RUN(run_res run_compiled
1330 ${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.c
1331 RUN_OUTPUT_VARIABLE output)
1333 set(mono_cv_sizeof_sunpath 0)
1335 if (run_res EQUAL 0)
1336 string(REGEX MATCH "[0-9]+" mono_cv_sizeof_sunpath ${output})
1340 ac_msg_result(${mono_cv_sizeof_sunpath})
1341 ac_define(MONO_SIZEOF_SUNPATH ${mono_cv_sizeof_sunpath} "Sizeof sock_un.sun_path")
1343 # *************************************
1344 # *** Checks for zero length arrays ***
1345 # *************************************
1346 ### ac_msg_checking(whether $CC supports zero length arrays)
1347 ### AC_TRY_COMPILE([
1353 ### ac_msg_result(yes)
1354 ### ac_define_unquoted(MONO_ZERO_ARRAY_LENGTH, 0, [Length of zero length arrays])
1356 ### ac_msg_result(no)
1357 ### ac_define_unquoted(MONO_ZERO_ARRAY_LENGTH, 1, [Length of zero length arrays])
1360 # *****************************
1361 # *** Checks for libxnet ***
1362 # *****************************
1363 ### case "${host}" in
1365 ### ac_msg_checking(for Solaris XPG4 support)
1366 ### if test -f /usr/lib/libxnet.so; then
1367 ### set(CPPFLAGS "$CPPFLAGS -D_XOPEN_SOURCE=500")
1368 ### set(CPPFLAGS "$CPPFLAGS -D__EXTENSIONS__")
1369 ### set(CPPFLAGS "$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1")
1370 ### set(LIBS "$LIBS -lxnet")
1371 ### ac_msg_result(yes)
1373 ### ac_msg_result(no)
1376 ### if test "$GCC" = "yes"; then
1377 ### set(CFLAGS "$CFLAGS -Wno-char-subscripts")
1382 # *****************************
1383 # *** Checks for libpthread ***
1384 # *****************************
1385 # on FreeBSD -STABLE, the pthreads functions all reside in libc_r
1386 # and libpthread does not exist
1388 ### case "${host}" in
1390 ### AC_CHECK_LIB(pthread, main, set(LIBS "$LIBS -pthread"))
1393 ### AC_CHECK_LIB(pthread, main, set(LIBS "$LIBS -lpthread"))
1396 ac_check_headers(pthread.h)
1397 ### ac_check_funcs(pthread_mutex_timedlock)
1398 ### ac_check_funcs(pthread_getattr_np pthread_attr_get_np)
1399 ### ac_msg_checking(for PTHREAD_MUTEX_RECURSIVE)
1400 ### AC_TRY_COMPILE([ #include <pthread.h>], [
1401 ### pthread_mutexattr_t attr;
1402 ### pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
1404 ### ac_msg_result(ok)
1406 ### ac_msg_result(no)
1407 ### AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
1408 ### ac_define(USE_MONO_MUTEX, 1, [Use mono_mutex_t])
1410 ### ac_check_funcs(pthread_attr_setstacksize)
1411 ### ac_check_funcs(pthread_attr_getstack)
1412 ### ac_check_funcs(pthread_get_stacksize_np pthread_get_stackaddr_np)
1414 # ***********************************
1415 # *** Checks for working __thread ***
1416 # ***********************************
1417 ### ac_msg_checking(for working __thread)
1418 ### if test "x$with_tls" != "x__thread"; then
1419 ### ac_msg_result(disabled)
1422 ### #include <pthread.h>
1424 ### static int res1, res2;
1426 ### void thread_main (void *arg)
1431 ### res1 = (i == arg);
1433 ### res2 = (i == arg);
1437 ### pthread_t t1, t2;
1441 ### pthread_create (&t1, NULL, thread_main, 1);
1442 ### pthread_create (&t2, NULL, thread_main, 2);
1444 ### pthread_join (t1, NULL);
1445 ### pthread_join (t2, NULL);
1447 ### return !(res1 + res2 == 2);
1450 ### ac_msg_result(yes)
1452 ### ac_msg_result(no)
1453 ### set(with_tls pthread)
1457 # **************************************
1458 # *** Checks for working sigaltstack ***
1459 # **************************************
1460 ### ac_msg_checking(for working sigaltstack)
1461 ### if test "x$with_sigaltstack" != "xyes"; then
1462 ### ac_msg_result(disabled)
1465 ### #include <stdio.h>
1466 ### #include <stdlib.h>
1467 ### #include <unistd.h>
1468 ### #include <signal.h>
1469 ### #include <pthread.h>
1470 ### #include <sys/wait.h>
1471 ### #if defined(__FreeBSD__) || defined(__NetBSD__)
1472 ### #define SA_STACK SA_ONSTACK
1475 ### sigsegv_signal_handler (int _dummy, siginfo_t *info, void *context)
1481 ### loop (void *ignored)
1483 ### char *ptr = NULL;
1492 ### struct sigaction sa;
1493 ### struct sigaltstack sas;
1495 ### pthread_attr_t attr;
1497 ### sa.sa_sigaction = sigsegv_signal_handler;
1498 ### sigemptyset (&sa.sa_mask);
1499 ### sa.sa_flags = SA_SIGINFO | SA_ONSTACK;
1500 ### if (sigaction (SIGSEGV, &sa, NULL) == -1) {
1501 ### perror ("sigaction");
1505 ### sas.ss_sp = malloc (SIGSTKSZ);
1506 ### sas.ss_size = SIGSTKSZ;
1507 ### sas.ss_flags = 0;
1508 ### if (sigaltstack (&sas, NULL) == -1) {
1509 ### perror ("sigaltstack");
1513 ### pthread_attr_init (&attr);
1514 ### if (pthread_create(&id, &attr, loop, &attr) != 0) {
1515 ### printf ("pthread_create\n");
1530 ### if (son == -1) {
1539 ### for (i = 0; i < 3; ++i) {
1541 ### waitpid (son, &status, WNOHANG);
1542 ### if (WIFEXITED (status) && WEXITSTATUS (status) == 0)
1546 ### kill (son, SIGKILL);
1551 ### ac_msg_result(yes)
1552 ### ac_define(HAVE_WORKING_SIGALTSTACK, 1, [Have a working sigaltstack])
1554 ### set(with_sigaltstack no)
1555 ### ac_msg_result(no)
1559 # ********************************
1560 # *** Checks for semaphore lib ***
1561 # ********************************
1562 # 'Real Time' functions on Solaris
1563 # posix4 on Solaris 2.6
1564 # pthread (first!) on Linux
1565 ### AC_SEARCH_LIBS(sem_init, pthread rt posix4)
1566 check_library_exists(pthread shm_open "" HAVE_SHM_OPEN1)
1570 check_library_exists(rt shm_open "" HAVE_SHM_OPEN2)
1572 set(LIBS ${LIBS} -lrt)
1573 set(CMAKE_REQUIRED_LIBRARIES rt)
1574 ac_check_funcs(shm_open)
1575 set(CMAKE_REQUIRED_LIBRARIES)
1581 # ********************************
1582 # *** Checks for timezone stuff **
1583 # ********************************
1584 ### AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
1585 ### AC_TRY_COMPILE([
1586 ### #include <time.h>
1589 ### tm.tm_gmtoff = 1;
1590 ### ], set(ac_cv_struct_tm_gmtoff yes, ac_cv_struct_tm_gmtoff=no)))
1591 ### if test $ac_cv_struct_tm_gmtoff = yes; then
1592 ### ac_define(HAVE_TM_GMTOFF, 1, [Have tm_gmtoff])
1594 ### AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
1595 ### AC_TRY_COMPILE([
1596 ### #include <time.h>
1599 ### ], set(ac_cv_var_timezone yes, ac_cv_var_timezone=no)))
1600 ### if test $ac_cv_var_timezone = yes; then
1601 ### ac_define(HAVE_TIMEZONE, 1, [Have timezone variable])
1603 ### AC_ERROR(unable to find a way to determine timezone)
1607 # *********************************
1608 # *** Checks for math functions ***
1609 # *********************************
1610 set(LIBS ${LIBS} -lm)
1611 ### if test "x$has_broken_apple_cpp" != "xyes"; then
1612 ### ac_check_funcs(finite, , ac_msg_checking(for finite in math.h)
1613 ### AC_TRY_LINK([#include <math.h>],
1614 ### [ finite(0.0); ],
1615 ### ac_define(HAVE_FINITE, 1, [Have finite]) ac_msg_result(yes),
1616 ### ac_msg_result(no)))
1618 ### ac_check_funcs(isfinite, , ac_msg_checking(for isfinite in math.h)
1619 ### AC_TRY_LINK([#include <math.h>],
1620 ### [ isfinite(0.0); ],
1621 ### ac_define(HAVE_ISFINITE, 1, [Have isfinite]) ac_msg_result(yes),
1622 ### ac_msg_result(no)))
1624 # ****************************************************************
1625 # *** Checks for working poll() (macosx defines it but doesn't ***
1626 # *** have it in the library (duh)) ***
1627 # ****************************************************************
1628 ### ac_check_funcs(poll)
1630 # *************************
1631 # *** Check for signbit ***
1632 # *************************
1633 ### ac_msg_checking(for signbit)
1634 ### AC_TRY_LINK([#include <math.h>], [
1635 ### int s = signbit(1.0);
1637 ### ac_msg_result(yes)
1638 ### ac_define(HAVE_SIGNBIT, 1, [Have signbit])
1640 ### ac_msg_result(no)
1643 # **********************************
1645 # **********************************
1646 ac_check_headers(sys/epoll.h)
1648 ### ac_check_funcs(epoll_ctl, [set(haveepoll yes], ))
1649 ### if test "x$haveepoll" = "xyes" -a "x$ac_cv_header_sys_epoll_h" = "xyes" ; then
1650 ### ac_define(HAVE_EPOLL, 1, [epoll supported])
1653 # ******************************
1654 # *** Checks for SIOCGIFCONF ***
1655 # ******************************
1656 ac_check_headers(sys/ioctl.h)
1657 ac_check_headers(net/if.h)
1658 ### ac_msg_checking(for ifreq)
1659 ### AC_TRY_COMPILE([
1660 ### #include <stdio.h>
1661 ### #include <sys/ioctl.h>
1662 ### #include <net/if.h>
1664 ### struct ifconf ifc;
1665 ### struct ifreq *ifr;
1667 ### ifc.ifc_len = 0;
1668 ### ifc.ifc_buf = NULL;
1669 ### x = (void *) &ifr->ifr_addr;
1671 ### ac_msg_result(yes)
1672 ### ac_define(HAVE_SIOCGIFCONF, 1, [Can get interface list])
1674 ### ac_msg_result(no)
1676 # **********************************
1677 # *** Checks for sin_len ***
1678 # **********************************
1679 ### ac_msg_checking(for sockaddr_in.sin_len)
1680 ### AC_TRY_COMPILE([
1681 ### #include <netinet/in.h>
1683 ### struct sockaddr_in saddr;
1684 ### saddr.sin_len = sizeof (saddr);
1686 ### ac_msg_result(yes)
1687 ### ac_define(HAVE_SOCKADDR_IN_SIN_LEN, 1, [sockaddr_in has sin_len])
1689 ### ac_msg_result(no)
1691 # **********************************
1692 # *** Checks for sin6_len ***
1693 # **********************************
1694 ### ac_msg_checking(for sockaddr_in6.sin6_len)
1695 ### AC_TRY_COMPILE([
1696 ### #include <netinet/in.h>
1698 ### struct sockaddr_in6 saddr6;
1699 ### saddr6.sin6_len = sizeof (saddr6);
1701 ### ac_msg_result(yes)
1702 ### ac_define(HAVE_SOCKADDR_IN6_SIN_LEN, 1, [sockaddr_in6 has sin6_len])
1704 ### ac_msg_result(no)
1706 # **********************************
1707 # *** Checks for MonoPosixHelper ***
1708 # **********************************
1709 ac_check_headers(checklist.h)
1710 ac_check_headers(fstab.h)
1711 ac_check_headers(attr/xattr.h)
1712 ac_check_headers(sys/extattr.h)
1713 ac_check_headers(sys/sendfile.h)
1714 ac_check_headers(sys/statvfs.h)
1715 ac_check_headers(sys/statfs.h)
1716 ac_check_headers(sys/vfstab.h)
1717 ac_check_headers(sys/xattr.h)
1718 ac_check_headers(sys/mman.h)
1719 ac_check_headers(sys/param.h)
1720 ac_check_headers(sys/mount.h)
1721 ### ac_check_funcs(getdomainname)
1722 ### ac_check_funcs(setdomainname)
1723 ### ac_check_funcs(fgetgrent)
1724 ### ac_check_funcs(fgetpwent)
1725 ### ac_check_funcs(fgetpwent)
1726 ### ac_check_funcs(getfsstat)
1727 ### ac_check_funcs(lutimes)
1728 ### ac_check_funcs(mremap)
1729 ### ac_check_funcs(remap_file_pages)
1730 ### ac_check_funcs(posix_fadvise)
1731 ### ac_check_funcs(posix_fallocate)
1732 ### ac_check_funcs(posix_madvise)
1733 ### ac_check_funcs(vsnprintf)
1734 ### ac_check_funcs(sendfile)
1735 ### ac_check_funcs(sethostid)
1736 ### ac_check_funcs(statfs)
1737 ### ac_check_funcs(fstatfs)
1738 ### ac_check_funcs(statvfs)
1739 ### ac_check_funcs(fstatvfs)
1740 ### ac_check_funcs(stime)
1741 ### ac_check_funcs(strerror_r)
1742 ### ac_check_funcs(ttyname_r)
1743 ac_check_sizeof(size_t)
1744 ### AC_CHECK_TYPES([blksize_t], [ac_define(HAVE_BLKSIZE_T)], ,
1745 ### [#include <sys/types.h>
1746 ### #include <sys/stat.h>
1747 ### #include <unistd.h>])
1748 ### AC_CHECK_TYPES([blkcnt_t], [ac_define(HAVE_BLKCNT_T)], ,
1749 ### [#include <sys/types.h>
1750 ### #include <sys/stat.h>
1751 ### #include <unistd.h>])
1752 ### AC_CHECK_TYPES([suseconds_t], [ac_define(HAVE_SUSECONDS_T)], ,
1753 ### [#include <sys/time.h>])
1754 ### AC_CHECK_TYPES([struct flock], [ac_define(HAVE_STRUCT_FLOCK)], ,
1755 ### [#include <unistd.h>
1756 ### #include <fcntl.h>])
1757 ### AC_CHECK_TYPES([struct pollfd], [ac_define(HAVE_STRUCT_POLLFD)], ,
1758 ### [#include <sys/poll.h>])
1759 ### AC_CHECK_TYPES([struct stat], [ac_define(HAVE_STRUCT_STAT)], ,
1760 ### [#include <sys/types.h>
1761 ### #include <sys/stat.h>
1762 ### #include <unistd.h>])
1763 ### AC_CHECK_TYPES([struct timespec], [ac_define(HAVE_STRUCT_TIMESPEC)], ,
1764 ### [#include <time.h>])
1765 ### AC_CHECK_TYPES([struct timeval], [ac_define(HAVE_STRUCT_TIMEVAL)], ,
1766 ### [#include <sys/time.h>
1767 ### #include <sys/types.h>
1768 ### #include <utime.h>])
1769 ### AC_CHECK_TYPES([struct timezone], [ac_define(HAVE_STRUCT_TIMEZONE)], ,
1770 ### [#include <sys/time.h>])
1771 ### AC_CHECK_TYPES([struct utimbuf], [ac_define(HAVE_STRUCT_UTIMBUF)], ,
1772 ### [#include <sys/types.h>
1773 ### #include <utime.h>])
1774 ### AC_CHECK_MEMBERS(
1775 ### [struct dirent.d_off, struct dirent.d_reclen, struct dirent.d_type],,,
1776 ### [#include <sys/types.h>
1777 ### #include <dirent.h>])
1779 # Favour xattr through glibc, but use libattr if we have to
1780 ### AC_CHECK_FUNC(lsetxattr, ,
1781 ### AC_CHECK_LIB(attr, lsetxattr, set(XATTR_LIB "-lattr",))
1783 ### AC_SUBST(XATTR_LIB)
1785 # kinfo_proc.kp_proc works on darwin but fails on other simil-bsds
1786 ### AC_CHECK_MEMBERS(
1787 ### [struct kinfo_proc.kp_proc],,,
1788 ### [#include <sys/types.h>
1789 ### #include <sys/sysctl.h>
1790 ### #include <sys/proc.h>
1793 # *********************************
1794 # *** Checks for Windows compilation ***
1795 # *********************************
1796 ac_check_headers(sys/time.h)
1797 ac_check_headers(sys/param.h)
1798 ac_check_headers(dirent.h)
1800 # *********************************
1801 # *** Check for Console 2.0 I/O ***
1802 # *********************************
1803 ac_check_headers(curses.h)
1804 ac_check_headers(term.h)
1805 ### ac_check_headers([term.h], [], [],
1806 ### [#if HAVE_CURSES_H
1807 ### #include <curses.h>
1810 ac_check_headers(termios.h)
1812 # * This is provided in io-layer, but on windows it's only available
1814 ### ac_define(HAVE_GETPROCESSID, 1, [Define if GetProcessId is available])
1816 ### set(jdk_headers_found no)
1817 ### AC_CHECK_LIB(ws2_32, main, set(LIBS "$LIBS -lws2_32", AC_ERROR(bad mingw install?)))
1818 ### AC_CHECK_LIB(psapi, main, set(LIBS "$LIBS -lpsapi", AC_ERROR(bad mingw install?)))
1819 ### AC_CHECK_LIB(ole32, main, set(LIBS "$LIBS -lole32", AC_ERROR(bad mingw install?)))
1820 ### AC_CHECK_LIB(winmm, main, set(LIBS "$LIBS -lwinmm", AC_ERROR(bad mingw install?)))
1821 ### AC_CHECK_LIB(oleaut32, main, set(LIBS "$LIBS -loleaut32", AC_ERROR(bad mingw install?)))
1822 ### AC_CHECK_LIB(advapi32, main, set(LIBS "$LIBS -ladvapi32", AC_ERROR(bad mingw install?)))
1823 ### AC_CHECK_LIB(version, main, set(LIBS "$LIBS -lversion", AC_ERROR(bad mingw install?)))
1825 # *********************************
1826 # *** Check for struct ip_mreqn ***
1827 # *********************************
1828 ### ac_msg_checking(for struct ip_mreqn)
1829 ### AC_TRY_COMPILE([#include <ws2tcpip.h>], [
1830 ### struct ip_mreqn mreq;
1831 ### mreq.imr_address.s_addr = 0;
1833 ### # Yes, we have it...
1834 ### ac_msg_result(yes)
1835 ### ac_define(HAVE_STRUCT_IP_MREQN)
1837 ### # We'll just have to try and use struct ip_mreq
1838 ### ac_msg_result(no)
1839 ### ac_msg_checking(for struct ip_mreq)
1840 ### AC_TRY_COMPILE([#include <ws2tcpip.h>], [
1841 ### struct ip_mreq mreq;
1842 ### mreq.imr_interface.s_addr = 0;
1844 ### # Yes, we have it...
1845 ### ac_msg_result(yes)
1846 ### ac_define(HAVE_STRUCT_IP_MREQ)
1848 ### # No multicast support
1849 ### ac_msg_result(no)
1852 ### ac_check_funcs(GetProcessId)
1858 ac_msg_checking("for socklen_t")
1859 check_c_source_compiles("
1860 #include <sys/types.h>
1861 #include <sys/socket.h>
1866 ac_define(HAVE_SOCKLEN_T 1 "Have socklen_t")
1872 ###ac_msg_checking(for array element initalizer support)
1873 ###AC_TRY_COMPILE([#include <sys/socket.h>], [
1874 ### const int array[] = {[1] = 2,};
1876 # Yes, we have it...
1877 ### ac_msg_result(yes)
1878 ### ac_define(HAVE_ARRAY_ELEM_INIT,1,[Supports C99 array initialization])
1880 # We'll have to use signals
1881 ### ac_msg_result(no)
1884 ac_check_funcs(trunc)
1886 ac_msg_checking("for trunc in math.h")
1887 # Simply calling trunc (0.0) is no good since gcc will optimize the call away
1889 check_c_source_compiles("
1892 static void *p = &trunc;
1896 ac_define(HAVE_TRUNC 1 "")
1903 ###if test "x$ac_cv_truncl" != "xyes"; then
1904 ### AC_CHECK_LIB(sunmath, aintl, [ ac_define(HAVE_AINTL, 1, [Has the 'aintl' function]) set(LIBS "$LIBS -lsunmath"]))
1907 ac_check_funcs(round)
1908 ac_check_funcs(rint)
1910 # ****************************
1911 # *** Look for /dev/random ***
1912 # ****************************
1914 ###ac_msg_checking([if usage of random device is requested])
1915 ###AC_ARG_ENABLE(dev-random,
1916 ###[ --disable-dev-random disable the use of the random device (enabled by default)],
1917 ###set(try_dev_random $enableval, try_dev_random=yes))
1919 ###ac_msg_result($try_dev_random)
1921 ###case "{$target}" in
1923 ### set(NAME_DEV_RANDOM "/dev/srandom")
1926 # Win32 does not have /dev/random, they have their own method...
1928 ### *-*-mingw*|*-*-cygwin*)
1929 ### set(ac_cv_have_dev_random no)
1932 # Everywhere else, it's /dev/random
1935 ### set(NAME_DEV_RANDOM "/dev/random")
1939 ###ac_define_unquoted(NAME_DEV_RANDOM, "$NAME_DEV_RANDOM", [Name of /dev/random])
1941 # Now check if the device actually exists
1943 ###if test "x$try_dev_random" = "xyes"; then
1944 ### AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
1945 ### [if test -r "$NAME_DEV_RANDOM" ; then
1946 ### set(ac_cv_have_dev_random yes; else ac_cv_have_dev_random=no; fi]))
1947 ### if test "x$ac_cv_have_dev_random" = "xyes"; then
1948 ### ac_define(HAVE_CRYPT_RNG, 1, [Have /dev/random])
1951 ### ac_msg_checking(for random device)
1952 ### set(ac_cv_have_dev_random no)
1953 ### ac_msg_result(has been disabled)
1956 ###if test "x$platform_win32" = "xyes"; then
1957 ### ac_define(HAVE_CRYPT_RNG)
1960 ###if test "x$ac_cv_have_dev_random" = "xno" \
1961 ### && test "x$platform_win32" = "xno"; then
1964 ###*** A system-provided entropy source was not found on this system.
1965 ###*** Because of this, the System.Security.Cryptography random number generator
1966 ###*** will throw a NotImplemented exception.
1968 ###*** If you are seeing this message, and you know your system DOES have an
1969 ###*** entropy collection in place, please contact <crichton@gimp.org> and
1970 ###*** provide information about the system and how to access the random device.
1972 ###*** Otherwise you can install either egd or prngd and set the environment
1973 ###*** variable MONO_EGD_SOCKET to point to the daemon's socket to use that.
1977 ###ac_msg_checking([if inter-process shared handles are requested])
1978 ###AC_ARG_ENABLE(shared-handles, [ --disable-shared-handles disable inter-process shared handles], set(try_shared_handles $enableval, try_shared_handles=yes))
1979 ###ac_msg_result($try_shared_handles)
1980 ###if test "x$try_shared_handles" != "xyes"; then
1981 ### ac_define(DISABLE_SHARED_HANDLES, 1, [Disable inter-process shared handles])
1982 ### AC_SUBST(DISABLE_SHARED_HANDLES)
1985 ###if test x$gc = xsgen; then
1986 ### if test x$with_tls != x__thread; then
1987 ### 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.]))
1991 ###AC_ARG_ENABLE(nunit-tests, [ --enable-nunit-tests Run the nunit tests of the class library on 'make check'])
1992 ###AM_CONDITIONAL(ENABLE_NUNIT_TESTS, [test x$enable_nunit_tests = xyes])
1994 ac_msg_checking("if big-arrays are to be enabled")
1995 set(big-arrays no CACHE STRING "Enable the allocation and indexing of arrays greater than Int32.MaxValue]")
1996 set(enable_big_arrays ${big-arrays})
1997 ###if test "x$enable_big_arrays" = "xyes" ; then
1998 ### if test "x$ac_cv_sizeof_void_p" = "x8"; then
1999 ### ac_define(MONO_BIG_ARRAYS,1,[Enable the allocation and indexing of arrays greater than Int32.MaxValue])
2001 ### ac_msg_error([The allocation and indexing of arrays greater than Int32.MaxValue is not supported on this platform.])
2004 ###ac_msg_result($enable_big_arrays)
2010 set(dtrace ${has_dtrace} CACHE BOOL "Enable DTrace probes")
2011 set(enable_dtrace ${dtrace})
2013 ###if test "x$enable_dtrace" = "xyes"; then
2014 ### if test "x$has_dtrace" = "xno"; then
2015 ### ac_msg_error([DTrace probes are not supported on this platform.])
2017 ### AC_PATH_PROG(DTRACE, [dtrace], [no], [$PATH:/usr/sbin])
2018 ### if test "x$DTRACE" = "xno"; then
2019 ### ac_msg_result([dtrace utility not found, dtrace support disabled.])
2020 ### set(enable_dtrace no)
2025 ###if test "x$enable_dtrace" = "xyes"; then
2026 ### ac_define(ENABLE_DTRACE, 1, [Enable DTrace probes])
2027 ### set(DTRACEFLAGS )
2028 ### if test "x$ac_cv_sizeof_void_p" = "x8"; then
2030 ### powerpc-*-darwin*)
2031 ### set(DTRACEFLAGS "-arch ppc64")
2034 ### set(DTRACEFLAGS "-arch x86_64")
2037 ### set(DTRACEFLAGS -64)
2042 ### powerpc-*-darwin*)
2043 ### set(DTRACEFLAGS "-arch ppc")
2046 ### set(DTRACEFLAGS "-arch i386")
2049 ### set(DTRACEFLAGS -32)
2053 ### AC_SUBST(DTRACEFLAGS)
2056 ### set(dtrace_g yes)
2059 ### ac_check_headers([sys/sdt.h])
2061 ###AM_CONDITIONAL(ENABLE_DTRACE, [test x$enable_dtrace = xyes])
2062 ###AM_CONDITIONAL(DTRACE_G_REQUIRED, [test x$dtrace_g = xyes])
2068 set(llvm no CACHE BOOL "Enable the experimental LLVM back-end")
2069 set(enable_llvm ${llvm})
2071 ###if test "x$enable_llvm" = "xyes"; then
2072 ### AC_PATH_PROG(LLVM_CONFIG, llvm-config, no)
2073 ### if test "x$LLVM_CONFIG" = "xno"; then
2074 ### ac_msg_error([llvm-config not found.])
2077 ### set(LLVM_CXXFLAGS `$LLVM_CONFIG --cflags`)
2078 ### set(LLVM_LDFLAGS `$LLVM_CONFIG --ldflags`)
2079 ### LLVM_LIBS=`$LLVM_CONFIG --libs core bitwriter jit x86codegen`
2080 ### set(LLVM_LIBS "$LLVM_LDFLAGS $LLVM_LIBS -lstdc++")
2082 ### AC_SUBST(LLVM_CXXFLAGS)
2083 ### AC_SUBST(LLVM_LIBS)
2084 ### AC_SUBST(LLVM_LDFLAGS)
2085 ### ac_define(ENABLE_LLVM, 1, [Enable the LLVM back end])
2089 set(ENABLE_LLVM yes)
2093 # Architecture-specific checks
2095 set(TARGET "unknown")
2096 set(ACCESS_UNALIGNED "yes")
2098 set(JIT_SUPPORTED no)
2099 set(INTERP_SUPPORTED no)
2100 set(LIBC "libc.so.6")
2101 set(INTL "libc.so.6")
2102 set(SQLITE "libsqlite.so.0")
2103 set(SQLITE3 "libsqlite3.so.0")
2104 set(X11 "libX11.so")
2106 set(sizeof_register "SIZEOF_VOID_P")
2108 set(jit_wanted false)
2109 set(interp_wanted false)
2111 if(host MATCHES "(x86_64-.*-.*)|(amd64-.*-.*)")
2113 set(arch_target amd64)
2114 set(JIT_SUPPORTED yes)
2115 set(jit_wanted true)
2116 elseif(host MATCHES "arm.*-linux.*")
2118 set(arch_target arm)
2119 set(ACCESS_UNALIGNED no)
2120 set(JIT_SUPPORTED yes)
2121 set(jit_wanted true)
2122 elseif(host MATCHES "mips.*")
2124 set(arch_target mips)
2125 set(ACCESS_UNALIGNED no)
2126 set(JIT_SUPPORTED yes)
2127 set(jit_wanted true)
2128 ### ac_msg_checking(for mips n32)
2129 ### AC_TRY_COMPILE([], [
2131 ### #if _MIPS_SIM != _ABIN32
2132 ### #error Not mips n32
2136 ### ac_msg_result(yes)
2137 ### set(sizeof_register 8)
2139 ### ac_msg_result(no)
2143 message(FATAL_ERROR "Host ${host} not yet supported by the cmake build.")
2146 # FIXME: Define the others as well
2147 if (${TARGET} STREQUAL "X86")
2148 ac_define(TARGET_X86 1 [...])
2149 elseif (${TARGET} STREQUAL "AMD64")
2150 ac_define(TARGET_AMD64 1 [...])
2151 elseif (${TARGET} STREQUAL "ARM")
2152 ac_define(TARGET_ARM 1 [...])
2156 # mips-sgi-irix5.* | mips-sgi-irix6.*)
2158 # set(ACCESS_UNALIGNED "no")
2161 ### set(TARGET X86;)
2162 ### set(arch_target x86;)
2163 ### set(JIT_SUPPORTED yes)
2164 ### set(jit_wanted true)
2165 ### case $host_os in
2167 ### set(LIBC "libc.so")
2168 ### set(INTL "libintl.so")
2169 ### if test "x$ac_cv_sizeof_void_p" = "x8"; then
2170 ### set(TARGET AMD64)
2171 ### set(arch_target amd64)
2174 ### # On solaris 10 x86, gcc prints a warning saying 'visibility attribute not supported on this configuration; ignored', but linking fails. A test case:
2175 ### # int astruct __attribute__ ((visibility ("hidden")));
2178 ### # void *p = &astruct;
2180 ### # gcc -fPIC --shared -o libfoo.so foo.c
2182 ### # foo.c:6: warning: visibility attribute not supported in this configuration; ignored
2183 ### # ld: fatal: relocation error: R_386_GOTOFF: file /var/tmp//ccxYR96k.o: symbol astruct: relocation must bind locally
2184 ### set(have_visibility_hidden no)
2189 ### set(TARGET IA64)
2190 ### set(arch_target ia64)
2191 ### set(ACCESS_UNALIGNED "no")
2192 ### set(JIT_SUPPORTED yes)
2193 ### set(jit_wanted true)
2194 ### set(LIBC "libc.so.6.1")
2195 ### set(INTL "libc.so.6.1")
2196 ### AC_CHECK_LIB(unwind, _U_dyn_register, [], [ac_msg_error(library libunwind not found)])
2197 ### set(libmono_ldflags "-lunwind")
2200 ### if test "x$ac_cv_sizeof_void_p" = "x8"; then
2201 ### set(TARGET SPARC64)
2203 ### set(TARGET SPARC)
2205 ### set(arch_target sparc;)
2206 ### set(JIT_SUPPORTED yes)
2207 ### set(ACCESS_UNALIGNED "no")
2208 ### case $host_os in
2211 ### set(LIBC "libc.so")
2212 ### set(INTL "libintl.so")
2214 ### set(jit_wanted true)
2215 ### if test x"$GCC" = xyes; then
2216 ### # We don't support v8 cpus
2217 ### set(CFLAGS "$CFLAGS -Wno-cast-align -mcpu=v9")
2219 ### if test x"$AR" = xfalse; then
2220 ### ac_msg_error([The required utility 'ar' is not found in your PATH. Usually it can be found in /usr/ccs/bin.])
2223 ### alpha*-*-linux* | alpha*-*-osf*)
2224 ### set(TARGET ALPHA;)
2225 ### set(ACCESS_UNALIGNED "no")
2226 ### set(JIT_SUPPORTED yes)
2227 ### set(jit_wanted true)
2228 ### set(arch_target alpha;)
2229 ### set(CFLAGS "$CFLAGS -mieee -O0")
2230 ### case $host_os in
2232 ### set(LIBC "libc.so.6.1")
2233 ### set(INTL "libc.so.6.1")
2236 ### *-*-mingw*|*-*-cygwin*)
2237 ### # When this is enabled, it leads to very strange crashes at runtime (gcc-3.4.4)
2238 ### set(have_visibility_hidden no)
2239 ### set(INTL "intl")
2241 ### hppa2.0w-hp-hpux11.00 | hppa64-hp-hpux11.00)
2242 ### set(TARGET HPPA;)
2243 ### set(arch_target hppa; )
2244 ### set(LIBC "libc.sl")
2245 ### set(ACCESS_UNALIGNED "no")
2246 ### set(INTERP_SUPPORTED yes)
2247 ### set(interp_wanted true)
2250 ### set(TARGET HPPA;)
2251 ### ac_define(MONO_ARCH_REGPARMS,1,[Architecture uses registers for Parameters])
2252 ### set(arch_target hppa; )
2253 ### set(ACCESS_UNALIGNED "no")
2254 ### set(JIT_SUPPORTED yes)
2255 ### set(jit_wanted true)
2257 ### macppc-*-openbsd* | powerpc*-*-linux* | powerpc-*-openbsd* | \
2258 ### powerpc-*-sysv* | powerpc-*-darwin* | powerpc-*-netbsd* )
2259 ### if test "x$ac_cv_sizeof_void_p" = "x8"; then
2260 ### set(TARGET POWERPC64;)
2261 ### set(CPPFLAGS "$CPPFLAGS -D__mono_ppc__ -D__mono_ppc64__")
2262 ### set(CFLAGS "$CFLAGS -mminimal-toc")
2264 ### set(TARGET POWERPC;)
2265 ### set(CPPFLAGS "$CPPFLAGS -D__mono_ppc__")
2267 ### ac_define(MONO_ARCH_REGPARMS,1,[Architecture uses registers for Parameters])
2268 ### set(arch_target ppc;)
2269 ### set(JIT_SUPPORTED yes)
2270 ### set(jit_wanted true)
2273 ### set(TARGET ARM;)
2274 ### set(arch_target arm;)
2275 ### set(ACCESS_UNALIGNED "no")
2276 ### set(JIT_SUPPORTED yes)
2277 ### set(CPPFLAGS "$CPPFLAGS -DARM_FPU_NONE=1")
2278 ### set(jit_wanted true)
2281 ### set(TARGET S390;)
2282 ### ac_define(MONO_ARCH_REGPARMS,1,[Architecture uses registers for Parameters])
2283 ### set(arch_target s390;)
2284 ### set(ACCESS_UNALIGNED "no")
2285 ### set(JIT_SUPPORTED yes)
2286 ### set(jit_wanted true)
2287 ### # Required CFLAGS for s390[x]. USE_STRING_INLINES is automatic with gcc 4.1
2288 ### set(CFLAGS "$CFLAGS -mbackchain -D__USE_STRING_INLINES")
2291 ### set(TARGET S390x;)
2292 ### ac_define(MONO_ARCH_REGPARMS,1,[Architecture uses registers for Parameters])
2293 ### set(arch_target s390x;)
2294 ### set(ACCESS_UNALIGNED "no")
2295 ### set(JIT_SUPPORTED yes)
2296 ### set(jit_wanted true)
2297 ### set(CFLAGS "$CFLAGS -mbackchain -D__USE_STRING_INLINES")
2301 if (${sizeof_register} STREQUAL "4")
2302 ac_define(SIZEOF_REGISTER 4 "size of machine integer registers")
2303 elseif (${sizeof_register} STREQUAL "8")
2304 ac_define(SIZEOF_REGISTER 8 "size of machine integer registers")
2306 ac_define(SIZEOF_REGISTER SIZEOF_VOID_P "size of machine integer registers")
2309 ###if test "x$target_byte_order" = "xG_BIG_ENDIAN"; then
2310 ### AC_DEFINE(TARGET_BYTE_ORDER,G_BIG_ENDIAN,[byte order of target])
2311 ###elif test "x$target_byte_order" = "xG_LITTLE_ENDIAN"; then
2312 ### AC_DEFINE(TARGET_BYTE_ORDER,G_LITTLE_ENDIAN,[byte order of target])
2314 ### AC_DEFINE(TARGET_BYTE_ORDER,G_BYTE_ORDER,[byte order of target])
2317 ###if (${have_visibility_hidden" = "xyes"; then
2318 ### ac_define(HAVE_VISIBILITY_HIDDEN, 1, [Support for the visibility ("hidden") attribute])
2321 ###set(jit, [ --with-set(jit yes,no If you want to build scripts that default to the JIT (defaults to no)],[)
2322 ### if test x$withval = xyes; then
2323 ### set(jit_wanted true)
2325 ### set(jit_wanted false)
2329 ###set(interp, [ --with-set(interp yes,no If you want to build scripts that default to the interpreter (defaults to no)],[)
2330 ### if test x$withval = xyes; then
2331 ### set(interp_wanted true)
2333 ### set(interp_wanted false)
2341 set(jit_status "Building and using the JIT")
2344 set(jit_status "Building the JIT, defaulting to the interpreter")
2346 message(FATAL_ERROR "No JIT or interpreter support available or selected.")
2351 set(jit_status "interpreter")
2353 message(FATAL_ERROR "No JIT or interpreter support available or selected.")
2356 set(USE_JIT ${USEJIT})
2358 set(libsuffix ".so")
2362 ### set(libsuffix ".dylib")
2363 ### set(LIBC "libc.dylib")
2364 ### set(INTL "libintl.dylib")
2365 ### set(SQLITE "libsqlite.0.dylib")
2366 ### set(SQLITE3 "libsqlite3.0.dylib")
2367 ### set(X11 "libX11.dylib")
2370 ### set(LIBC "libc.so.12")
2371 ### set(INTL "libintl.so.0")
2374 ### set(LIBC "libc.so")
2375 ### set(INTL "libintl.so")
2378 ### set(LIBC "libc.so")
2379 ### set(INTL "libintl.so")
2383 ### ac_msg_checking(for the soname of libX11.so)
2384 ### for i in $x_libraries /usr/lib /usr/lib64; do
2385 ### for r in 4 5 6; do
2386 ### if test -f $i/libX11.so.$r; then
2387 ### set(X11 libX11.so.$r)
2388 ### ac_msg_result($X11)
2393 ### if (${X11" = "xlibX11.so"; then
2394 ### AC_MSG_WARN([Could not find X development libs. Do you have the -devel package installed? WinForms may not work...]);
2400 ###AC_SUBST(libsuffix)
2402 ac_check_headers(valgrind/memcheck.h)
2403 if(${TARGET} STREQUAL "AMD64" OR ${TARGET} STREQUAL "X86")
2404 if(with_tls STREQUAL __thread)
2406 # On some linux distributions, TLS works in executables, but linking
2407 # against a shared library containing TLS fails with:
2408 # undefined reference to `__tls_get_addr'
2410 ### rm -f conftest.c conftest.so conftest
2411 ### echo "static __thread int foo; void main () { foo = 5; }" > conftest.c
2412 ### $CC -fPIC --shared -o conftest.so conftest.c > /dev/null 2>&1
2413 ### $CC -o conftest conftest.so > /dev/null 2>&1
2414 ### if test ! -f conftest; then
2415 ### AC_MSG_WARN([Disabling usage of __thread.]);
2416 ### set(with_tls pthread)
2418 ### rm -f conftest.c conftest.so conftest
2422 set(mono_debugger_supported no)
2423 if(${TARGET} STREQUAL "AMD64" OR ${TARGET} STREQUAL "X86")
2425 if (host MATCHES ".*-.*-.*linux.*")
2426 set(mono_debugger_supported yes)
2428 if (host MATCHES ".*86-apple-darwin.*")
2429 set(mono_debugger_supported yes)
2434 ac_msg_checking("if the Mono Debugger is supported on this platform")
2435 if(mono_debugger_supported)
2436 ac_define(MONO_DEBUGGER_SUPPORTED 1 "The Mono Debugger is supported on this platform")
2438 ac_msg_result(${mono_debugger_supported})
2439 if(mono_debugger_supported)
2440 set(MONO_DEBUGGER_SUPPORTED yes)
2443 if (with_tls STREQUAL "__thread")
2444 ac_define(HAVE_KW_THREAD 1 "Have __thread keyword")
2445 ac_define(USE_COMPILER_TLS 1 "Use __thread for TLS access")
2446 # Pass the information to libgc
2447 set(CPPFLAGS "${CPPFLAGS} -DUSE_COMPILER_TLS")
2448 ### ac_msg_checking(if the tls_model attribute is supported)
2449 ### AC_TRY_COMPILE([static __thread int foo __attribute__((tls_model("initial-exec")));], [
2451 ### ac_msg_result(yes)
2452 ### ac_define(HAVE_TLS_MODEL_ATTR, 1, [tld_model available])
2454 ### ac_msg_result(no)
2460 # ******************************************
2461 # *** Check to see what FPU is available ***
2462 # ******************************************
2463 # FIXME: Don't do this if cross-compiling
2464 if(${TARGET} STREQUAL "ARM")
2465 ac_msg_checking("which FPU to use")
2466 set(CMAKE_REQUIRED_FLAGS "-mfloat-abi=softfp -mfpu=vfp")
2467 set(compiles_fpu_vfp)
2468 check_c_source_compiles("
2470 __asm__ (\"faddd d7, d6, d7\");
2473 set(compiles_fpu_fpa)
2474 set(cmake_required_flags)
2475 check_c_source_compiles("
2477 __asm__ (\"ldfd f0, [r0]\");
2480 if(compiles_fpu_vfp)
2482 elseif(compiles_fpu_fpa)
2487 ac_msg_result(${fpu})
2488 set(CPPFLAGS "${CPPFLAGS} -DARM_FPU_${fpu}=1")
2492 if(${TARGET} STREQUAL "unknown")
2493 set(CPPFLAGS ${CPPFLAGS} -DNO_PORT)
2494 ac_msg_warn("mono has not been ported to ${host}: some things may not work.")
2497 if(NOT ACCESS_UNALIGNED)
2498 set(CPPFLAGS "${CPPFLAGS} -DNO_UNALIGNED_ACCESS")
2503 ### # Pass CPPFLAGS to libgc configure
2504 ### # We should use a separate variable for this to avoid passing useless and
2505 ### # potentially problematic defines to libgc (like -set(D_FILE_OFFSET_BITS 64))
2506 ### # This should be executed late so we pick up the final version of CPPFLAGS
2507 ### # The problem with this approach, is that during a reconfigure, the main
2508 ### # configure scripts gets invoked with these arguments, so we use separate
2509 ### # variables understood by libgc's configure to pass CPPFLAGS and CFLAGS.
2510 ### set(LIBGC_CPPFLAGS $CPPFLAGS)
2511 ### if test x$TARGET = xSPARC -o x$TARGET = xSPARC64; then
2512 ### set(LIBGC_CPPFLAGS `echo $LIBGC_CPPFLAGS | sed -e 's/-D_FILE_OFFSET_BITS=64//g'`)
2514 ### 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\"")
2515 ### AC_CONFIG_SUBDIRS(libgc)
2519 set(with_moonlight yes CACHE BOOL "If you want to build the Moonlight 2.1 assemblies (defaults to yes)")
2520 set(with_profile4 no CACHE BOOL "If you want to install the 4.0 FX (defaults to no)")
2521 set(with_monotouch no CACHE BOOL "If you want to build the raw MonoTouch 2.1 assemblies (defaults to no)")
2522 set(with_oprofile no)
2523 set(with_oprofile no CACHE STRING "<oprofile install dir> or 'no' to disable oprofile support (defaults to no)")
2524 if (NOT with_oprofile STREQUAL no)
2525 ### if test x$with_oprofile != xno; then
2526 ### set(oprofile_include $with_oprofile/include)
2527 ### if test ! -f $oprofile_include/opagent.h; then
2528 ### ac_msg_error([oprofile include file not found at $oprofile_include/opagent.h])
2530 ### set(OPROFILE yes)
2531 ### set(OPROFILE_CFLAGS "-I$oprofile_include")
2532 ### set(OPROFILE_LIBS "-L$with_oprofile/lib/oprofile -lopagent")
2533 ### ac_define(HAVE_OPROFILE,1,[Have oprofile support])
2538 set(MALLOC_MEMPOOLS no)
2539 set(malloc_mempools no CACHE STRING "Use malloc for each single mempool allocation (only for runtime debugging, defaults to no)")
2540 ### if test x$with_malloc_mempools = xyes; then
2541 ### set(MALLOC_MEMPOOLS yes)
2542 ### ac_define(USE_MALLOC_FOR_MEMPOOLS,1,[Use malloc for each single mempool allocation])
2547 set(DISABLE_MCS_DOCS no)
2548 set(mcs_docs yes CACHE STRING "If you want to build the documentation under mcs (defaults to yes)")
2550 set(DISABLE_MCS_DOCS yes)
2553 set(HAVE_OPROFILE yes)
2555 ###AC_SUBST(OPROFILE_CFLAGS)
2556 ###AC_SUBST(OPROFILE_LIBS)
2559 foreach(lib ${LIBS})
2560 set(libs_list "${libs_list} ${lib}")
2562 set(libmono_ldflags "${libmono_ldflags} ${libs_list}")
2565 set(INSTALL_2_0 yes)
2568 set(INSTALL_2_1 yes)
2571 ###AM_CONDITIONAL(INSTALL_2_1, [test "x$with_moonlight" = xyes])
2572 ###AM_CONDITIONAL(INSTALL_4_0, [test "x$with_profile4" = xyes])
2573 ###AM_CONDITIONAL(INSTALL_MONOTOUCH, [test "x$with_monotouch" = xyes])
2575 ###AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
2576 ###AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
2577 # Define a variable for the target
2581 set(INTERP_SUPPORTED yes)
2583 if (gc STREQUAL "included")
2584 set(INCLUDED_LIBGC yes)
2590 ###AC_SUBST(SQLITE3)
2592 ac_define_unquoted(ARCHITECTURE "${arch_target}" "The architecture this is running on")
2593 ###AC_SUBST(arch_target)
2595 ###AC_SUBST(CPPFLAGS)
2596 ###AC_SUBST(LDFLAGS)
2598 set(mono_build_root ${CMAKE_BINARY_DIR})
2601 set(mono_runtime mono/mini/mono)
2603 set(mono_runtime mono/interpreter/mint)
2606 set(mono_cfg_root ${mono_build_root}/runtime)
2608 ###if test x$platform_win32 = xyes; then
2609 ### if (${cross_compiling" = "xno"; then
2610 ### set(mono_cfg_dir `cygpath -w -a $mono_cfg_root`\\etc)
2612 ### set(mono_cfg_dir `echo $mono_cfg_root | tr '/' '\\\'`\\etc)
2615 set(mono_cfg_dir ${mono_cfg_root}/etc)
2618 function(ac_config_files file)
2619 configure_file("${file}.in" ${file} @ONLY)
2621 ac_config_files("po/mcs/Makefile.in")
2623 ac_config_files("runtime/mono-wrapper")
2624 ac_config_files("runtime/monodis-wrapper")
2625 execute_process (COMMAND chmod a+x runtime/mono-wrapper runtime/monodis-wrapper)
2627 ###AC_CONFIG_COMMANDS([runtime/etc/mono/1.0/machine.config],
2628 ###[ set(depth ../../../..)
2630 ### [[\\/$]]* | ?:[[\\/]]* ) set(reldir $srcdir ;;)
2631 ### .) set(reldir $depth ;;)
2632 ### *) set(reldir $depth/$srcdir ;;)
2634 ### $ac_aux_dir/install-sh -d runtime/etc/mono/1.0
2635 ### cd runtime/etc/mono/1.0
2636 ### rm -f machine.config
2637 ### $LN_S $reldir/data/net_1_1/machine.config machine.config
2639 ###],[set(LN_S '$LN_S']))
2641 ###AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/machine.config],
2642 ###[ set(depth ../../../..)
2644 ### [[\\/$]]* | ?:[[\\/]]* ) set(reldir $srcdir ;;)
2645 ### .) set(reldir $depth ;;)
2646 ### *) set(reldir $depth/$srcdir ;;)
2648 ### $ac_aux_dir/install-sh -d runtime/etc/mono/2.0
2649 ### cd runtime/etc/mono/2.0
2650 ### rm -f machine.config
2651 ### $LN_S $reldir/data/net_2_0/machine.config machine.config
2653 ###],[set(LN_S '$LN_S']))
2655 ###AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/web.config],
2656 ###[ set(depth ../../../..)
2658 ### [[\\/$]]* | ?:[[\\/]]* ) set(reldir $srcdir ;;)
2659 ### .) set(reldir $depth ;;)
2660 ### *) set(reldir $depth/$srcdir ;;)
2662 ### $ac_aux_dir/install-sh -d runtime/etc/mono/2.0
2663 ### cd runtime/etc/mono/2.0
2664 ### rm -f web.config
2665 ### $LN_S $reldir/data/net_2_0/web.config web.config
2667 ###],[set(LN_S '$LN_S']))
2669 ###AC_CONFIG_COMMANDS([runtime/etc/mono/browscap.ini],
2670 ###[ set(depth ../../..)
2672 ### [[\\/$]]* | ?:[[\\/]]* ) set(reldir $srcdir ;;)
2673 ### .) set(reldir $depth ;;)
2674 ### *) set(reldir $depth/$srcdir ;;)
2676 ### $ac_aux_dir/install-sh -d runtime/etc/mono/
2677 ### cd runtime/etc/mono/
2678 ### rm -f browscap.ini
2679 ### $LN_S $reldir/data/browscap.ini browscap.ini
2681 ###],[set(LN_S '$LN_S']))
2683 ###AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/Browsers/Compat.browser],
2684 ###[ set(depth ../../../../..)
2686 ### [[\\/$]]* | ?:[[\\/]]* ) set(reldir $srcdir ;;)
2687 ### .) set(reldir $depth ;;)
2688 ### *) set(reldir $depth/$srcdir ;;)
2690 ### $ac_aux_dir/install-sh -d runtime/etc/mono/2.0/Browsers/
2691 ### cd runtime/etc/mono/2.0/Browsers
2692 ### rm -f Compat.browser
2693 ### $LN_S $reldir/data/net_2_0/Browsers/Compat.browser Compat.browser
2695 ###],[set(LN_S '$LN_S']))
2698 ###AC_CONFIG_COMMANDS([runtime/etc/mono/4.0/machine.config],
2699 ###[ depth=../../../..
2701 ### [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
2702 ### .) reldir=$depth ;;
2703 ### *) reldir=$depth/$srcdir ;;
2705 ### $ac_aux_dir/install-sh -d runtime/etc/mono/4.0
2706 ### cd runtime/etc/mono/4.0
2707 ### rm -f machine.config
2708 ### $LN_S $reldir/data/net_4_0/machine.config machine.config
2710 ###],[LN_S='$LN_S'])
2712 ###AC_CONFIG_COMMANDS([runtime/etc/mono/4.0/web.config],
2713 ###[ depth=../../../..
2715 ### [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
2716 ### .) reldir=$depth ;;
2717 ### *) reldir=$depth/$srcdir ;;
2719 ### $ac_aux_dir/install-sh -d runtime/etc/mono/4.0
2720 ### cd runtime/etc/mono/4.0
2721 ### rm -f web.config
2722 ### $LN_S $reldir/data/net_4_0/web.config web.config
2724 ###],[LN_S='$LN_S'])
2727 ###if test x$enable_quiet_build = xyes; then
2728 ### 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]))
2729 ### 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])
2732 if("${prefix}" STREQUAL "")
2733 set(prefix /usr/local)
2735 if("${exec_prefix}" STREQUAL "")
2736 set(exec_prefix "\${prefix}")
2737 set(exec_prefix_full "${prefix}")
2739 set(exec_prefix_full "${exec_prefix}")
2742 # FIXME: Make these overridable
2743 set(bindir "\${exec_prefix}/bin")
2744 set(bindir_full "${exec_prefix_full}/bin")
2745 set(sbindir "\${exec_prefix}/sbin")
2746 set(libexecdir "\${exec_prefix}/libexec")
2747 set(datarootdir "\${prefix}/share")
2748 set(datadir "\${datarootdir}")
2749 set(sysconfdir "\${prefix}/etc")
2750 set(sharedstatedir "\${prefix}/com")
2751 set(localstatedir "\${prefix}/var")
2752 set(includedir "\${prefix}/include")
2753 set(oldincludedir "/usr/include")
2754 set(docdir "\${datarootdir}/doc/\${PACKAGE}")
2755 set(infodir "\${datarootdir}/info")
2756 set(htmldir "\${docdir}")
2757 set(dvidir "\${docdir}")
2758 set(pdfdir "\${docdir}")
2759 set(psdir "\${docdir}")
2760 set(libdir "\${exec_prefix}/lib")
2761 set(localedir "\${datarootdir}/locale")
2762 set(mandir "\${datarootdir}/man")
2764 autoheader("config.h" autoheader_vars)
2766 set(SUBDIRS po ${libgc_dir} ${eglib_dir} mono ${ikvm_native_dir} support data runtime scripts man samples web msvc docs)
2768 foreach(dir ${SUBDIRS})
2769 add_subdirectory(${dir})
2772 # Implementation of AC_OUTPUT for cmake
2773 function(ac_output outputs)
2774 foreach (output ${ARGV})
2775 configure_file ("${output}.in" "${output}" @ONLY)
2781 scripts/mono-find-provides
2782 scripts/mono-find-requires
2783 mono/tests/tests-config
2788 data/mono-options.pc
2789 data/mono-lineeditor.pc
2796 data/system.web.extensions_1.0.pc
2797 data/system.web.extensions.design_1.0.pc
2798 data/system.web.mvc.pc
2804 ###mono-uninstalled.pc
2805 ###scripts/mono-find-provides
2806 ###scripts/mono-find-requires
2807 ###mono/dis/Makefile
2808 ###mono/cil/Makefile
2809 ###mono/arch/Makefile
2810 ###mono/arch/x86/Makefile
2811 ###mono/arch/amd64/Makefile
2812 ###mono/arch/hppa/Makefile
2813 ###mono/arch/ppc/Makefile
2814 ###mono/arch/sparc/Makefile
2815 ###mono/arch/s390/Makefile
2816 ###mono/arch/s390x/Makefile
2817 ###mono/arch/arm/Makefile
2818 ###mono/arch/alpha/Makefile
2819 ###mono/arch/ia64/Makefile
2820 ###mono/arch/mips/Makefile
2821 ###mono/interpreter/Makefile
2822 ###mono/tests/Makefile
2823 ###mono/tests/tests-config
2824 ###mono/tests/assemblyresolve/Makefile
2825 ###mono/tests/cas/Makefile
2826 ###mono/tests/cas/assembly/Makefile
2827 ###mono/tests/cas/demand/Makefile
2828 ###mono/tests/cas/inheritance/Makefile
2829 ###mono/tests/cas/linkdemand/Makefile
2830 ###mono/tests/cas/threads/Makefile
2831 ###mono/benchmark/Makefile
2832 ###mono/monograph/Makefile
2833 ###mono/profiler/Makefile
2834 ###ikvm-native/Makefile
2840 ###data/net_2_0/Makefile
2841 ###data/net_4_0/Makefile
2842 ###data/net_2_0/Browsers/Makefile
2845 ###data/mono-cairo.pc
2846 ###data/mono-nunit.pc
2847 ###data/mono-options.pc
2848 ###data/mono-lineeditor.pc
2855 ###data/system.web.extensions_1.0.pc
2856 ###data/system.web.extensions.design_1.0.pc
2857 ###data/system.web.mvc.pc
2862 ###tools/locale-builder/Makefile
2868 ###if test x$platform_win32 = xyes; then
2869 ### # Get rid of 'cyg' prefixes in library names
2870 ### sed -e "s/\/cyg\//\/\//" libtool > libtool.new; mv libtool.new libtool; chmod 755 libtool
2871 ### # libtool seems to inherit -mno-cygwin from our CFLAGS, and uses it to compile its executable
2872 ### # wrapper scripts which use exec(). gcc has no problem compiling+linking this, but the resulting
2873 ### # executable doesn't work...
2874 ### sed -e "s,-mno-cygwin,,g" libtool > libtool.new; mv libtool.new libtool; chmod 755 libtool
2878 set(mcs_INSTALL ${mono_build_root}/install-sh)
2880 ### case $INSTALL in
2881 ### [[\\/$]]* | ?:[[\\/]]* ) set(mcs_INSTALL $INSTALL ;;)
2882 ### *) set(mcs_INSTALL $mono_build_root/$INSTALL ;;)
2885 # Compute a 4 part version number into myver from ${mono_version}
2886 string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "\\1.\\2.\\3.\\4" myver "${mono_version}.0.0.0")
2888 set(config.make ${srcdir}/${mcsdir}/build/config.make)
2890 # If we are cross compiling, we don't build in the mcs/ tree. Let us not clobber
2891 # any existing config.make. This allows people to share the same source tree
2892 # with different build directories, one native and one cross
2894 if(NOT cross_compiling)
2895 set(not_cross_compiling yes)
2897 if(not_cross_compiling AND enable_mcs_build)
2898 file(WRITE ${config.make} "prefix=${prefix}
2899 exec_prefix=${exec_prefix}
2900 sysconfdir=${sysconfdir}
2901 mono_libdir=\${exec_prefix}/lib
2902 MCS_FLAGS=$(PLATFORM_DEBUG_FLAGS)
2904 RUNTIME=${mono_build_root}/runtime/mono-wrapper
2905 ILDISASM=${mono_build_root}/runtime/monodis-wrapper
2906 INSTALL=${mcs_INSTALL}
2907 MONO_VERSION=${myver}
2912 file(APPEND ${config.make} "PLATFORM=darwin\n")
2915 if (${TARGET} STREQUAL "AMD64" AND ${platform_win32} STREQUAL "no" AND AOT_SUPPORTED)
2916 file(APPEND ${config.make} "ENABLE_AOT=1\n")
2919 if (DISABLE_MCS_DOCS)
2920 file(APPEND ${config.make} "DISABLE_MCS_DOCS=yes\n")
2923 ### # if we have an olive folder, override the default settings
2924 ### if test -d $olivedir; then
2926 ### test -w $srcdir/$olivedir/build || chmod +w $srcdir/$olivedir/build
2928 ### if test x$cross_compiling = xno && test x$enable_olive_build != xno; then
2929 ### echo "set(prefix $prefix" > $srcdir/$olivedir/build/config.make)
2930 ### echo "set(exec_prefix $exec_prefix" >> $srcdir/$olivedir/build/config.make)
2931 ### echo 'set(mono_libdir ${exec_prefix}/lib' >> $srcdir/$olivedir/build/config.make)
2932 ### echo 'MCS_FLAGS = $(PLATFORM_DEBUG_FLAGS)' >> $srcdir/$olivedir/build/config.make
2933 ### echo "RUNTIME = $mono_build_root/runtime/mono-wrapper" >> $srcdir/$olivedir/build/config.make
2934 ### echo "MONO_VERSION = $myver" >> $srcdir/$olivedir/build/config.make
2935 ### if test x$with_moonlight = xyes; then
2936 ### echo "WITH_MOONLIGHT = yes" >> $srcdir/$olivedir/build/config.make
2941 if(NOT libgdiplus_loc)
2942 set(libgdiplus_msg "assumed to be installed")
2944 set(libgdiplus_msg ${libgdiplus_loc})
2949 mcs source: ${mcs_topdir}
2950 olive source: ${olive_topdir}
2954 SIGALTSTACK: ${with_sigaltstack}
2955 Engine: ${jit_status}
2956 Moon Profile: ${with_moonlight}
2957 4.0 Alpha: ${with_profile4}
2958 MonoTouch: ${with_monotouch}
2959 JNI support: ${jdk_headers_found}
2960 libgdiplus: ${libgdiplus_msg}
2962 oprofile: ${with_oprofile}
2963 BigArrays: ${enable_big_arrays}
2964 DTrace: ${enable_dtrace}
2965 Parallel Mark: ${enable_parallel_mark}
2966 LLVM Back End: ${enable_llvm}
2971 if(NOT with_static_mono)
2972 if(NOT platform_win32)
2973 ac_msg_warn("Turning off static Mono is a risk, you might run into unexpected bugs")
2977 if(gc STREQUAL sgen)
2980 IMPORTANT: You have selected an experimental, work-in-progress
2981 IMPORTANT: GC engine. This GC engine is currently not supported
2982 IMPORTANT: and is not yet ready for use.
2984 IMPORTANT: There are known problems with it, use at your own risk.
2992 IMPORTANT: The LLVM Back End is experimental and does not work yet.
2999 ### -rm -fr $(mcslib)/monolite-*
3000 ### -mkdir -p $(mcslib)
3001 ### test ! -d $(monolite) || test ! -d $(monolite).old || rm -fr $(monolite).old
3002 ### test ! -d $(monolite) || mv -f $(monolite) $(monolite).old
3003 ### cd $(mcslib) && { (wget -O- $(monolite_url) || curl $(monolite_url)) | gzip -d | tar xf - ; }
3004 ### cd $(mcslib) && mv -f monolite-* monolite
3007 #### Keep in sync with SUBDIRS
3008 ##### 'tools' is not normally built
3009 ###DIST_SUBDIRS = po libgc $(eglib_dir) mono ikvm-native support data runtime scripts man samples web tools msvc docs
3011 ###EXTRA_DIST= nls.m4 po.m4 progtest.m4 mono-uninstalled.pc.in build-mingw32.sh LICENSE mkinstalldirs
3013 ###DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
3015 #### Distribute the 'mcs' tree too
3017 ### test -d $(distdir)/mcs || mkdir $(distdir)/mcs
3018 ### d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
3020 ###pkgconfigdir = $(libdir)/pkgconfig
3021 ###noinst_DATA = mono-uninstalled.pc
3022 ###DISTCLEANFILES= mono-uninstalled.pc
3024 ###.PHONY: get-monolite-latest mcs-do-compiler-tests compiler-tests bootstrap-world
3026 #### building with monolite
3027 set(mcslib ${mcs_topdir}/class/lib)
3028 set(monolite ${mcslib}/monolite)
3029 set(monolite_url http://mono.ximian.com/daily/monolite-latest.tar.gz)
3030 add_custom_target(get-monolite-latest
3031 COMMAND -rm -fr ${mcslib}/monolite-*
3032 COMMAND -mkdir -p ${mcslib}
3033 COMMAND test ! -d ${monolite} || test ! -d ${monolite}.old || rm -fr ${monolite}.old
3034 COMMAND test ! -d ${monolite} || mv -f ${monolite} ${monolite}.old
3035 COMMAND cd ${mcslib} && { (wget -O- ${monolite_url} || curl ${monolite_url}) | gzip -d | tar xf - \; }
3036 COMMAND cd ${mcslib} && mv -f monolite-* monolite
3039 ###compiler-tests: mcs-do-clean
3041 ### $(MAKE) mcs-do-compiler-tests
3043 ###compiler-tests-net_2_0:
3044 ### -rm -f $(mcs_topdir)/build/common/Consts.cs.save
3045 ### -mv -f $(mcs_topdir)/build/common/Consts.cs $(mcs_topdir)/build/common/Consts.cs.save
3046 ### cd $(mcs_topdir) && $(MAKE) PROFILE=net_2_0_bootstrap clean
3047 ### cd $(mcs_topdir) && $(MAKE) PROFILE=net_2_0 clean
3048 ### -mv -f $(mcs_topdir)/build/common/Consts.cs.save $(mcs_topdir)/build/common/Consts.cs
3050 ### $(MAKE) build_profiles=net_2_0 mcs-do-compiler-tests
3052 ###bootstrap-world: compiler-tests
3055 ###bootstrap-world-net_2_0: compiler-tests-net_2_0
3058 #### internal targets
3060 ### cd runtime && $(MAKE) clean-local
3061 ### cd mono/tests && $(MAKE) clean
3062 ###mcs-do-compiler-tests:
3063 ### cd runtime && $(MAKE) test_select='TEST_SUBDIRS="tests errors"' check-local
3064 ### cd mono/tests && $(MAKE) check
3067 ### wget http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip
3068 ### wget http://www.go-mono.com/archive/glib-2.0.4-20020703.zip
3069 ### wget http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip
3070 ### wget http://www.go-mono.com/archive/libiconv-1.7.zip
3071 ### wget http://www.go-mono.com/archive/libiconv-dev-1.7.zip
3072 ### wget http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip
3073 ### unzip -n -d / pkgconfig-0.11-20020310.zip
3074 ### unzip -n -d / glib-2.0.4-20020703.zip
3075 ### unzip -n -d / glib-dev-2.0.4-20020703.zip
3076 ### unzip -n -d / libiconv-1.7.zip
3077 ### unzip -n -d / libiconv-dev-1.7.zip
3078 ### unzip -n -d / libintl-0.10.40-20020101.zip
3081 ### makensis /DMILESTONE=$(VERSION) /DSOURCE_INSTALL_DIR=$(SOURCE_INSTALL_DIR) /DBUILDNUM=$(BUILDNUM) monowiz.win32.nsi
3084 ### @echo "*** 'make bootstrap' is obsolete. Just run 'make' to perform a combined mono+mcs build"
3088 ### find mono -name Makefile -exec scripts/patch-quiet.sh {} \;
3089 ### find libgc -name Makefile -exec scripts/patch-quiet.sh {} \;
3092 ### (cd $(mcs_topdir)/build/csproj && gmcs genproj.cs) && (cd runtime; make V=1 extra_targets=csproj-local)