* Update cmake build.
* .
* Auto detect ENABLE_NETCORE.
include(CheckIncludeFile)
include(CheckFunctionExists)
include(TestBigEndian)
+include (FindPkgConfig)
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
set(VERSION "")
execute_process(
- COMMAND grep ^MONO_CORLIB_VERSION= configure.ac
+ COMMAND grep ^MONO_CORLIB_VERSION= ${CMAKE_SOURCE_DIR}/configure.ac
COMMAND cut -d = -f 2
OUTPUT_VARIABLE CORLIB_VERSION_OUT
)
string(STRIP "${CORLIB_VERSION_OUT}" MONO_CORLIB_VERSION_BASE)
set(MONO_CORLIB_VERSION "\"${MONO_CORLIB_VERSION_BASE}\"")
+if(EXISTS "${CMAKE_SOURCE_DIR}/mono.proj")
+ set(ENABLE_NETCORE 1)
+endif()
+
if (ENABLE_NETCORE)
set(DISABLE_REMOTING 1)
set(DISABLE_REFLECTION_EMIT_SAVE 1)
set(DISABLE_PERFCOUNTERS 1)
set(DISABLE_ATTACH 1)
set(DISABLE_DLLMAP 1)
+ set(DISABLE_CONFIG 1)
+ set(DISABLE_CFGDIR_CONFIG 1)
else()
message(FATAL_ERROR "Building without -DENABLE_NETCORE=1 is not supported.")
endif()
set(PTHREAD_POINTER_ID 1)
set(USE_MACH_SEMA 1)
else()
- message(FATAL ERROR "")
+ message(FATAL_ERROR "")
endif()
######################################
set(CORETARGETS "-p:TargetsUnix=true -p:TargetsOSX=true")
set(NETCORE_HOST_PLATFORM "macos")
else()
- message(FATAL ERROR "")
+ message(FATAL_ERROR "")
endif()
######################################
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(HOST_AMD64 1)
else()
- message(FATAL ERROR "")
+ message(FATAL_ERROR "")
endif()
######################################
set(RID_SUFFIX "x64")
set(COREARCH "x64")
else()
- message(FATAL ERROR "")
+ message(FATAL_ERROR "")
+endif()
+
+######################################
+# ICU CHECKS
+######################################
+set(ICU_SHIM_PATH "../../../libraries/Native/Unix/System.Globalization.Native")
+if(TARGET_OSX)
+ # FIXME: Handle errors
+ # Defines ICU_INCLUDEDIR/ICU_LIBDIR
+ set(ENV{PKG_CONFIG_PATH} "{$PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig")
+ pkg_check_modules(ICU icu-uc)
+ set(OSX_ICU_LIBRARY_PATH /usr/lib/libicucore.dylib)
+ set(ICU_FLAGS "-DTARGET_UNIX -DU_DISABLE_RENAMING -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option -Wno-deprecated-declarations")
+ set(HAVE_SYS_ICU 1)
+else()
+ message(FATAL_ERROR "")
endif()
######################################
sched_getaffinity sched_setaffinity getpwnam_r getpwuid_r readlink chmod lstat getdtablesize ftruncate msync
gethostname getpeername utime utimes openlog closelog atexit popen strerror_r inet_pton inet_aton
pthread_getname_np pthread_setname_np pthread_cond_timedwait_relative_np pthread_kill
- pthread_attr_setstacksize pthread_get_stackaddr_np
+ pthread_attr_setstacksize pthread_get_stackaddr_np pthread_jit_write_protect_np
shm_open poll getfsstat mremap posix_fadvise vsnprintf sendfile statfs statvfs setpgid system
fork execv execve waitpid localtime_r mkdtemp getrandom execvp strlcpy stpcpy strtok_r rewinddir
vasprintf strndup getpwuid_r getprotobyname getprotobyname_r getaddrinfo mach_absolute_time
check_symbol_exists(IPV6_PKTINFO "netdb.h" HAVE_IPV6_PKTINFO)
check_symbol_exists(IP_DONTFRAGMENT "Ws2ipdef.h" HAVE_IP_DONTFRAGMENT)
check_symbol_exists(IP_MTU_DISCOVER "linux/in.h" HAVE_IP_MTU_DISCOVER)
+check_symbol_exists(sys_signame "signal.h" HAVE_SYSSIGNAME)
ac_check_type("struct sockaddr_in6" sockaddr_in6 "netinet/in.h")
ac_check_type("struct timeval" timeval "sys/time.h;sys/types.h;utime.h")
ac_check_type("socklen_t" socklen_t "sys/types.h;sys/socket.h")
ac_check_type("struct ip_mreqn" ip_mreqn "netinet/in.h")
ac_check_type("struct ip_mreq" ip_mreq "netinet/in.h")
+ac_check_type("clockid_t" clockid_t "sys/types.h")
check_struct_has_member("struct kinfo_proc" kp_proc "sys/types.h;sys/param.h;sys/sysctl.h;sys/proc.h" HAVE_STRUCT_KINFO_PROC_KP_PROC)
check_struct_has_member("struct sockaddr_in" sin_len "netinet/in.h" HAVE_SOCKADDR_IN_SIN_LEN)
#option (ENABLE_CHECKED_BUILD_PRIVATE_TYPES "Enable private types checked build")
#option (ENABLE_CHECKED_BUILD_CRASH_REPORTING "Enable private types checked build")
#option (HAVE_BTLS "BoringTls is supported")
+#option (ENABLE_JIT_DUMP "Enable jit dump support on Linux")
+#option (DISABLE_CRASH_REPORTING)
+#option (ENABLE_CXX)
+#option (STATIC_ICU)
option (DISABLE_GAC "Disable GAC")
option (DISABLE_DLLMAP "Disables use of DllMaps in MonoVM")
option (DISABLE_THREADS "Disable Threads")
+option (DISABLE_CONFIG "Disable .config file support")
+option (DISABLE_CFGDIR_CONFIG "Disable config directories")
+option (DISABLE_SGEN_TOGGLEREF "Disable toggleref support in SGEN")
+option (DISABLE_SGEN_BINARY_PROTOCOL "Disable binary protocol logging in SGEN")
+option (DISABLE_PROCESSES "Disable process support")
+option (DISABLE_EVENTPIPE "Disable EventPipe support")
+option (ENABLE_PERFTRACING "Enables support for eventpipe library")
if (strcmp (new_scope, "QCall") == 0) {
piinfo->addr = mono_lookup_pinvoke_qcall_internal (method, status_out);
+ if (!piinfo->addr) {
+ mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_DLLIMPORT,
+ "Unable to find qcall for '%s'.",
+ new_import);
+ status_out->err_code = LOOKUP_PINVOKE_ERR_NO_SYM;
+ status_out->err_arg = g_strdup (new_import);
+ }
return piinfo->addr;
}
include_directories(
${PROJECT_BINARY_DIR}/
${PROJECT_BINARY_DIR}/../..
+ ${PROJECT_BINARY_DIR}/../../mono/eglib
+ ${CMAKE_SOURCE_DIR}/
${PROJECT_SOURCE_DIR}/../
${PROJECT_SOURCE_DIR}/../eglib
${PROJECT_SOURCE_DIR}/../sgen)
lock-free-alloc.h
lock-free-array-queue.c
lock-free-array-queue.h
+ lifo-semaphore.c
+ lifo-semaphore.h
mono-linked-list-set.c
mono-linked-list-set.h
mono-threads.c
mono-threads-haiku.c
mono-threads-aix.c
mono-threads-wasm.c
+ mono-threads-sunos.c
mono-threads.h
mono-threads-debug.h
mono-threads-api.h
bsearch.h
bsearch.c
mono-signal-handler.h
+ mono-signal-handler.c
mono-conc-hashtable.h
mono-conc-hashtable.c
json.h
class.c
class-getters.h
class-init.h
+ class-init-internals.h
class-init.c
class-internals.h
class-inlines.h
class-private-definition.h
class-accessors.c
+ class-setup-vtable.c
cominterop.c
cominterop.h
console-io.h
coree.c
coree.h
coree-internals.h
- culture-info.h
- culture-info-tables.h
debug-helpers.c
debug-mono-symfile.h
debug-mono-symfile.c
icall-internals.h
icall-def.h
icall-table.h
+ icall-eventpipe.c
image.c
image-internals.h
jit-info.c
loader.c
- locales.c
- locales.h
lock-tracer.c
lock-tracer.h
marshal.c
native-library.h
native-library.c
native-library-qcall.c
- qcalllist.h
+ qcall-def.h
loaded-images-internals.h
loaded-images.c
loaded-images-netcore.c
addprefix (sgen_sources ../sgen/ "${sgen_sources_base}")
set_source_files_properties (${sgen_sources} PROPERTIES COMPILE_DEFINITIONS "HAVE_SGEN_GC")
+# ICU
+if(HAVE_SYS_ICU)
+set (icu_shim_sources_base
+ pal_calendarData.c
+ pal_casing.c
+ pal_collation.c
+ pal_idna.c
+ pal_locale.c
+ pal_localeNumberData.c
+ pal_localeStringData.c
+ pal_normalization.c
+ pal_timeZoneInfo.c
+ entrypoints.c
+ pal_icushim.c)
+addprefix (icu_shim_sources "${ICU_SHIM_PATH}" "${icu_shim_sources_base}")
+set_source_files_properties (${icu_shim_sources} PROPERTIES COMPILE_DEFINITIONS OSX_ICU_LIBRARY_PATH="${OSX_ICU_LIBRARY_PATH}")
+set_source_files_properties (${icu_shim_sources} PROPERTIES COMPILE_FLAGS "-I${ICU_INCLUDEDIR} -I${CMAKE_SOURCE_DIR}/../libraries/Native/Unix/System.Globalization.Native/ -I${CMAKE_SOURCE_DIR}/../libraries/Native/Unix/Common/ ${ICU_FLAGS}")
+set(ICU_LIBS "icucore")
+set(ICU_LDFLAGS "-L${ICU_LIBDIR}")
+endif()
+
#
# MINI
#
mini-cross-helpers.c
arch-stubs.c
llvm-runtime.h
+ llvm-intrinsics.h
type-checking.c
lldb.h
lldb.c
interp/interp.h
interp/interp-internals.h
interp/interp.c
+ interp/interp-intrins.h
+ interp/interp-intrins.c
interp/mintops.h
interp/mintops.c
interp/transform.c)
set (mini_sources "${CMAKE_CURRENT_BINARY_DIR}/buildver-sgen.h;main-core.c;${mini_common_sources};${arch_sources};${os_sources};${interp_sources};${llvm_sources};${debugger_sources};${llvm_runtime_sources}")
-add_library(monosgen-objects OBJECT "${eglib_sources};${metadata_sources};${utils_sources};${sgen_sources};${mini_sources}")
+add_library(monosgen-objects OBJECT "${eglib_sources};${metadata_sources};${utils_sources};${sgen_sources};${icu_shim_sources};${mini_sources}")
add_library (monosgen-static STATIC $<TARGET_OBJECTS:monosgen-objects>)
add_library (monosgen SHARED $<TARGET_OBJECTS:monosgen-objects>)
set_target_properties(monosgen PROPERTIES OUTPUT_NAME monosgen-2.0)
set_target_properties(monosgen PROPERTIES LIBRARY_OUTPUT_DIRECTORY .libs)
+# FIXME: Always rebuilds, creates non-deterministic builds
# FIXME: Use the previous format
-string(TIMESTAMP BUILD_DATE)
+#string(TIMESTAMP BUILD_DATE)
+#add_custom_command (
+# OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/buildver-sgen.h
+# COMMAND echo "const char *build_date = \"${BUILD_DATE}\";" > ${CMAKE_CURRENT_BINARY_DIR}/buildver-sgen.h
+# VERBATIM
+#)
add_custom_command (
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/buildver-sgen.h
- COMMAND echo "const char *build_date = \"${BUILD_DATE}\";" > ${CMAKE_CURRENT_BINARY_DIR}/buildver-sgen.h
+ COMMAND echo "const char *build_date = \"\";" > ${CMAKE_CURRENT_BINARY_DIR}/buildver-sgen.h
VERBATIM
)
)
add_executable (mono-sgen "main-sgen.c")
-target_link_libraries (mono-sgen monosgen-static "-framework CoreFoundation" "-framework Foundation" "iconv" ${LLVM_LIBS})
-target_link_libraries (monosgen "-framework CoreFoundation" "-framework Foundation" "iconv" ${LLVM_LIBS})
+target_link_libraries (mono-sgen monosgen-static "-framework CoreFoundation" "-framework Foundation" "iconv" ${LLVM_LIBS} ${ICU_LIBS})
+target_link_libraries (monosgen "-framework CoreFoundation" "-framework Foundation" "iconv" ${LLVM_LIBS} ${ICU_LIBS})
+set_target_properties (mono-sgen monosgen PROPERTIES LINK_FLAGS ${ICU_LDFLAGS})