diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index 8726b3d617a8c..38f339d17c852 100644 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -17,6 +17,86 @@ include(CheckCompilerVersion) include(CheckProblematicConfigurations) include(HandleLLVMStdlib) +if (ANDROID OR CYGWIN OR CMAKE_SYSTEM_NAME MATCHES "AIX|DragonFly|FreeBSD|Haiku|Linux|NetBSD|OpenBSD|SunOS") + set(HAVE_DLFCN_H 1) + set(HAVE_MACH_MACH_H 0) + set(HAVE_MALLOC_MALLOC_H 0) + set(HAVE_PTHREAD_H 1) + set(HAVE_SIGNAL_H 1) + set(HAVE_SYS_IOCTL_H 1) + set(HAVE_SYS_MMAN_H 1) + set(HAVE_SYS_PARAM_H 1) + set(HAVE_SYS_RESOURCE_H 1) + set(HAVE_SYS_STAT_H 1) + set(HAVE_SYS_TIME_H 1) + set(HAVE_SYSEXITS_H 1) + set(HAVE_TERMIOS_H 1) + set(HAVE_UNISTD_H 1) +elseif (APPLE) + set(HAVE_DLFCN_H 1) + set(HAVE_MACH_MACH_H 1) + set(HAVE_MALLOC_MALLOC_H 1) + set(HAVE_PTHREAD_H 1) + set(HAVE_SIGNAL_H 1) + set(HAVE_SYS_IOCTL_H 1) + set(HAVE_SYS_MMAN_H 1) + set(HAVE_SYS_PARAM_H 1) + set(HAVE_SYS_RESOURCE_H 1) + set(HAVE_SYS_STAT_H 1) + set(HAVE_SYS_TIME_H 1) + set(HAVE_SYSEXITS_H 1) + set(HAVE_TERMIOS_H 1) + set(HAVE_UNISTD_H 1) +elseif (PURE_WINDOWS) + set(HAVE_DLFCN_H 0) + set(HAVE_MACH_MACH_H 0) + set(HAVE_MALLOC_MALLOC_H 0) + set(HAVE_PTHREAD_H 0) + set(HAVE_SIGNAL_H 1) + set(HAVE_SYS_IOCTL_H 0) + set(HAVE_SYS_MMAN_H 0) + set(HAVE_SYS_PARAM_H 0) + set(HAVE_SYS_RESOURCE_H 0) + set(HAVE_SYS_STAT_H 1) + set(HAVE_SYS_TIME_H 0) + set(HAVE_SYSEXITS_H 0) + set(HAVE_TERMIOS_H 0) + set(HAVE_UNISTD_H 0) +elseif (ZOS) + # Confirmed in + # https://github.com/llvm/llvm-project/pull/104706#issuecomment-2297109613 + set(HAVE_DLFCN_H 1) + set(HAVE_MACH_MACH_H 0) + set(HAVE_MALLOC_MALLOC_H 0) + set(HAVE_PTHREAD_H 1) + set(HAVE_SIGNAL_H 1) + set(HAVE_SYS_IOCTL_H 1) + set(HAVE_SYS_MMAN_H 1) + set(HAVE_SYS_PARAM_H 0) + set(HAVE_SYS_RESOURCE_H 1) + set(HAVE_SYS_STAT_H 1) + set(HAVE_SYS_TIME_H 1) + set(HAVE_SYSEXITS_H 0) + set(HAVE_TERMIOS_H 1) + set(HAVE_UNISTD_H 1) +else() + # Other platforms that we don't promise support for. + check_include_file(dlfcn.h HAVE_DLFCN_H) + check_include_file(mach/mach.h HAVE_MACH_MACH_H) + check_include_file(malloc/malloc.h HAVE_MALLOC_MALLOC_H) + check_include_file(pthread.h HAVE_PTHREAD_H) + check_include_file(signal.h HAVE_SIGNAL_H) + check_include_file(sys/ioctl.h HAVE_SYS_IOCTL_H) + check_include_file(sys/mman.h HAVE_SYS_MMAN_H) + check_include_file(sys/param.h HAVE_SYS_PARAM_H) + check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H) + check_include_file(sys/stat.h HAVE_SYS_STAT_H) + check_include_file(sys/time.h HAVE_SYS_TIME_H) + check_include_file(sysexits.h HAVE_SYSEXITS_H) + check_include_file(termios.h HAVE_TERMIOS_H) + check_include_file(unistd.h HAVE_UNISTD_H) +endif() + if( UNIX AND NOT (APPLE OR BEOS OR HAIKU) ) # Used by check_symbol_exists: list(APPEND CMAKE_REQUIRED_LIBRARIES "m") @@ -58,19 +138,6 @@ if(LLVM_USING_GLIBC) endif() # include checks -check_include_file(dlfcn.h HAVE_DLFCN_H) -check_include_file(malloc/malloc.h HAVE_MALLOC_MALLOC_H) -if( NOT PURE_WINDOWS ) - check_include_file(pthread.h HAVE_PTHREAD_H) -endif() -check_include_file(signal.h HAVE_SIGNAL_H) -check_include_file(sys/ioctl.h HAVE_SYS_IOCTL_H) -check_include_file(sys/mman.h HAVE_SYS_MMAN_H) -check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H) -check_include_file(sys/time.h HAVE_SYS_TIME_H) -check_include_file(sysexits.h HAVE_SYSEXITS_H) -check_include_file(termios.h HAVE_TERMIOS_H) -check_include_file(unistd.h HAVE_UNISTD_H) check_include_file(valgrind/valgrind.h HAVE_VALGRIND_VALGRIND_H) check_symbol_exists(FE_ALL_EXCEPT "fenv.h" HAVE_DECL_FE_ALL_EXCEPT) check_symbol_exists(FE_INEXACT "fenv.h" HAVE_DECL_FE_INEXACT) @@ -86,7 +153,6 @@ check_c_source_compiles(" int main(void) { return 0; }" HAVE_BUILTIN_THREAD_POINTER) -check_include_file(mach/mach.h HAVE_MACH_MACH_H) check_include_file(CrashReporterClient.h HAVE_CRASHREPORTERCLIENT_H) if(APPLE) check_c_source_compiles("