From 6c4f3dcd7bd02ed74e2daa323bb0c4bed62cd671 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 3 Jun 2020 06:36:49 -0400 Subject: Utilities: Update hard-coded try_compile results for third-party libraries The integer size checks have been replaced with KWIML so their hard-coded results are no longer needed. Tell `TEST_BIG_ENDIAN` to use `unsigned short` as the 16-bit integer. UNIX device APIs do not exist on Windows. FreeBSD libmd does not exist on Windows. Fix typo in existing `HAVE_READPASSPHRASE_H` setting. --- Utilities/cmThirdPartyChecks.cmake | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Utilities/cmThirdPartyChecks.cmake b/Utilities/cmThirdPartyChecks.cmake index 0b57940..4ccfdfc 100644 --- a/Utilities/cmThirdPartyChecks.cmake +++ b/Utilities/cmThirdPartyChecks.cmake @@ -19,9 +19,10 @@ set(HAVE_STRFTIME 1) set(HAVE_STRING_H 1) set(HAVE_STRRCHR 1) set(HAVE_WCHAR_H 1) -set(SIZEOF_INT 4) -set(SIZEOF_LONG_LONG 8) -set(SIZEOF_SHORT 2) + +# Used by TEST_BIG_ENDIAN. +set(CMAKE_SIZEOF_UNSIGNED_SHORT 2) +set(HAVE_CMAKE_SIZEOF_UNSIGNED_SHORT 1) if(WIN32) # Results for builds targeting Windows platforms. @@ -151,7 +152,7 @@ if(WIN32) set(HAVE_READLINK 0) set(HAVE_READLINKAT 0) set(HAVE_READPASSPHRASE 0) - set(HAVE_READPASSPHRASE 0) + set(HAVE_READPASSPHRASE_H 0) set(HAVE_REGEX_H 0) set(HAVE_RSA_H 0) set(HAVE_SELECT 0) @@ -260,6 +261,13 @@ if(WIN32) # curl and expat: stdlib.h, stdarg.h, string.h, float.h set(STDC_HEADERS 1) + # UNIX device APIs do not exist on Windows. + set(MAJOR_IN_MKDEV 0) + set(MAJOR_IN_SYSMACROS 0) + + # FreeBSD libmd does not exist on Windows. + set(LIBMD_FOUND 0) + # libarchive looks for external hash implementations. set(ARCHIVE_CRYPTO_MD5_LIBC 0) set(ARCHIVE_CRYPTO_MD5_LIBMD 0) -- cgit v0.12 From f408cc2c40f0ea853875611417ad499a382515ea Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 3 Jun 2020 06:43:09 -0400 Subject: expat: Remove unused try_compile checks --- Utilities/cmexpat/ConfigureChecks.cmake | 11 ----------- Utilities/cmexpat/expat_config.h.cmake | 6 ------ 2 files changed, 17 deletions(-) diff --git a/Utilities/cmexpat/ConfigureChecks.cmake b/Utilities/cmexpat/ConfigureChecks.cmake index d85e48c..4da252c 100644 --- a/Utilities/cmexpat/ConfigureChecks.cmake +++ b/Utilities/cmexpat/ConfigureChecks.cmake @@ -44,14 +44,6 @@ else(WORDS_BIGENDIAN) set(BYTEORDER 1234) endif(WORDS_BIGENDIAN) -if(HAVE_SYS_TYPES_H) - check_symbol_exists("off_t" "sys/types.h" OFF_T) - check_symbol_exists("size_t" "sys/types.h" SIZE_T) -else(HAVE_SYS_TYPES_H) - set(OFF_T "long") - set(SIZE_T "unsigned") -endif(HAVE_SYS_TYPES_H) - check_c_source_compiles(" #include /* for NULL */ #include /* for syscall */ @@ -61,6 +53,3 @@ check_c_source_compiles(" return 0; }" HAVE_SYSCALL_GETRANDOM) - -check_c_compiler_flag("-fno-strict-aliasing" FLAG_NO_STRICT_ALIASING) -check_c_compiler_flag("-fvisibility=hidden" FLAG_VISIBILITY) diff --git a/Utilities/cmexpat/expat_config.h.cmake b/Utilities/cmexpat/expat_config.h.cmake index 795b607..e91861e 100644 --- a/Utilities/cmexpat/expat_config.h.cmake +++ b/Utilities/cmexpat/expat_config.h.cmake @@ -86,9 +86,3 @@ #ifdef _MSC_VER # define __func__ __FUNCTION__ #endif - -/* Define to `long' if does not define. */ -#cmakedefine off_t @OFF_T@ - -/* Define to `unsigned' if does not define. */ -#cmakedefine size_t @SIZE_T@ -- cgit v0.12 From bf60ac24ae154b2e54dd298e8215611f7b4dcf4c Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 3 Jun 2020 07:04:13 -0400 Subject: Source: Assume elf.h does not exist on Windows --- Source/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 22d8032..1b6bb00 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -8,7 +8,9 @@ set(CMAKE_CXX_EXTENSIONS FALSE) include(CheckIncludeFile) # Check if we can build support for ELF parsing. -if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") +if(WIN32) + set(HAVE_ELF_H 0) +elseif(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") CHECK_INCLUDE_FILES("stdint.h;elf_abi.h" HAVE_ELF_H) else() CHECK_INCLUDE_FILE("elf.h" HAVE_ELF_H) -- cgit v0.12 From d350d4668aff6f0a077c25109cefe4250ce22a4c Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 3 Jun 2020 07:12:25 -0400 Subject: libarchive: Hard-code try_compile results for bundled dependencies --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15dbcd3..7658820 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -438,6 +438,13 @@ macro (CMAKE_BUILD_UTILITIES) else() set(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities) set(CMAKE_ZLIB_LIBRARIES cmzlib) + set(WITHOUT_ZLIB_DLL "") + set(WITHOUT_ZLIB_DLL_WITH_LIB cmzlib) + set(ZLIB_DLL "") + set(ZLIB_DLL_WITH_LIB cmzlib) + set(ZLIB_WINAPI "") + set(ZLIB_WINAPI_COMPILED 0) + set(ZLIB_WINAPI_WITH_LIB cmzlib) add_subdirectory(Utilities/cmzlib) CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty") endif() @@ -514,6 +521,11 @@ macro (CMAKE_BUILD_UTILITIES) set(BZIP2_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2") set(BZIP2_LIBRARIES cmbzip2) + set(BZIP2_NEED_PREFIX "") + set(USE_BZIP2_DLL "") + set(USE_BZIP2_DLL_WITH_LIB cmbzip2) + set(USE_BZIP2_STATIC "") + set(USE_BZIP2_STATIC_WITH_LIB cmbzip2) add_subdirectory(Utilities/cmbzip2) CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty") endif() -- cgit v0.12 From 2bc89f1a0310ad96b1188dd54081ef7281e54601 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 3 Jun 2020 07:39:45 -0400 Subject: cmSystemTools: Hard-code try_compile results for Windows All Windows platforms offer `environ` in `stdlib.h` and do not have `unsetenv`. --- CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7658820..07ba2e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -711,10 +711,15 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake) endif() - # no clue why we are testing for this here - include(CheckSymbolExists) - CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV) - CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE) + # Checks for cmSystemTools. + if(WIN32) + set(HAVE_UNSETENV 0) + set(HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE 1) + else() + include(CheckSymbolExists) + CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV) + CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE) + endif() endif() # CMAKE_TESTS_CDASH_SERVER: CDash server used by CMake/Tests. -- cgit v0.12 From 92c4316d81d4bfbec87a9f03080a576fa2718696 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 3 Jun 2020 07:44:41 -0400 Subject: KWSys: Hard-code try_compile results on Windows Several of KWSys's checks have the same result on all Windows platforms supported when building CMake. --- CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 07ba2e3..f62c666 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -356,6 +356,21 @@ macro (CMAKE_BUILD_UTILITIES) if(CMake_NO_CXX_STANDARD) set(KWSYS_CXX_STANDARD "") endif() + if(WIN32) + # FIXME: Teach KWSys to hard-code these checks on Windows. + set(KWSYS_C_HAS_CLOCK_GETTIME_MONOTONIC_COMPILED 0) + set(KWSYS_C_HAS_PTRDIFF_T_COMPILED 1) + set(KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H_COMPILED 1) + set(KWSYS_CXX_HAS_RLIMIT64_COMPILED 0) + set(KWSYS_CXX_HAS_SETENV_COMPILED 0) + set(KWSYS_CXX_HAS_UNSETENV_COMPILED 0) + set(KWSYS_CXX_HAS_UTIMENSAT_COMPILED 0) + set(KWSYS_CXX_HAS_UTIMES_COMPILED 0) + set(KWSYS_CXX_STAT_HAS_ST_MTIM_COMPILED 0) + set(KWSYS_CXX_STAT_HAS_ST_MTIMESPEC_COMPILED 0) + set(KWSYS_STL_HAS_WSTRING_COMPILED 1) + set(KWSYS_SYS_HAS_IFADDRS_H 0) + endif() add_subdirectory(Source/kwsys) set(kwsys_folder "Utilities/KWSys") CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${kwsys_folder}") -- cgit v0.12 From d20bf471c8143a8e8a40ad57200a14554aa26cd5 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 3 Jun 2020 11:52:49 -0400 Subject: liblzma: Map fixed-size integer types from KWIML as typedefs Refactoring in commit 12e7bfcbf4 (liblzma: Use KWIML to get fixed-size integer types, 2020-05-25) accidentally changed the method of defining `int#_t` types from `typedef` to `#define`. Change it back to `typedef`. Reported-by: Rolf Eike Beer --- Utilities/cmliblzma/config.h.in | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Utilities/cmliblzma/config.h.in b/Utilities/cmliblzma/config.h.in index 8e4dc93..20916ca 100644 --- a/Utilities/cmliblzma/config.h.in +++ b/Utilities/cmliblzma/config.h.in @@ -6,31 +6,31 @@ #include #ifndef KWIML_INT_HAVE_INT64_T -# define int64_t KWIML_INT_int64_t +typedef KWIML_INT_int64_t int64_t; #endif #ifndef KWIML_INT_HAVE_INT32_T -# define int32_t KWIML_INT_int32_t +typedef KWIML_INT_int32_t int32_t; #endif #ifndef KWIML_INT_HAVE_INT16_T -# define int16_t KWIML_INT_int16_t +typedef KWIML_INT_int16_t int16_t; #endif #ifndef KWIML_INT_HAVE_INT8_T -# define int8_t KWIML_INT_int8_t +typedef KWIML_INT_int8_t int8_t; #endif #ifndef KWIML_INT_HAVE_UINT64_T -# define uint64_t KWIML_INT_uint64_t +typedef KWIML_INT_uint64_t uint64_t; #endif #ifndef KWIML_INT_HAVE_UINT32_T -# define uint32_t KWIML_INT_uint32_t +typedef KWIML_INT_uint32_t uint32_t; #endif #ifndef KWIML_INT_HAVE_UINT16_T -# define uint16_t KWIML_INT_uint16_t +typedef KWIML_INT_uint16_t uint16_t; #endif #ifndef KWIML_INT_HAVE_UINT8_T -# define uint8_t KWIML_INT_uint8_t +typedef KWIML_INT_uint8_t uint8_t; #endif #ifndef KWIML_INT_HAVE_UINTPTR_T -# define uintptr_t KWIML_INT_uintptr_t +typedef KWIML_INT_uintptr_t uintptr_t; #endif #cmakedefine WORDS_BIGENDIAN 1 -- cgit v0.12 From 9f3923893ceff962d733bba839457a4c75d045f0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 3 Jun 2020 11:54:37 -0400 Subject: libarchive: Map fixed-size integer types from KWIML as typedefs Refactoring in commit ade3b16e63 (libarchive: Use KWIML to get fixed-size integer types, 2020-06-01) accidentally changed the method of defining `int#_t` types from `typedef` to `#define`. Change it back to `typedef`. Reported-by: Rolf Eike Beer --- Utilities/cmlibarchive/build/cmake/config.h.in | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Utilities/cmlibarchive/build/cmake/config.h.in b/Utilities/cmlibarchive/build/cmake/config.h.in index e889781..f38601f 100644 --- a/Utilities/cmlibarchive/build/cmake/config.h.in +++ b/Utilities/cmlibarchive/build/cmake/config.h.in @@ -1118,34 +1118,34 @@ #include #ifndef KWIML_INT_HAVE_INT64_T -# define int64_t KWIML_INT_int64_t +typedef KWIML_INT_int64_t int64_t; #endif #ifndef KWIML_INT_HAVE_INT32_T -# define int32_t KWIML_INT_int32_t +typedef KWIML_INT_int32_t int32_t; #endif #ifndef KWIML_INT_HAVE_INT16_T -# define int16_t KWIML_INT_int16_t +typedef KWIML_INT_int16_t int16_t; #endif #ifndef KWIML_INT_HAVE_INT8_T -# define int8_t KWIML_INT_int8_t +typedef KWIML_INT_int8_t int8_t; #endif #ifndef KWIML_INT_HAVE_INTPTR_T -# define intptr_t KWIML_INT_intptr_t +typedef KWIML_INT_intptr_t intptr_t; #endif #ifndef KWIML_INT_HAVE_UINT64_T -# define uint64_t KWIML_INT_uint64_t +typedef KWIML_INT_uint64_t uint64_t; #endif #ifndef KWIML_INT_HAVE_UINT32_T -# define uint32_t KWIML_INT_uint32_t +typedef KWIML_INT_uint32_t uint32_t; #endif #ifndef KWIML_INT_HAVE_UINT16_T -# define uint16_t KWIML_INT_uint16_t +typedef KWIML_INT_uint16_t uint16_t; #endif #ifndef KWIML_INT_HAVE_UINT8_T -# define uint8_t KWIML_INT_uint8_t +typedef KWIML_INT_uint8_t uint8_t; #endif #ifndef KWIML_INT_HAVE_UINTPTR_T -# define uintptr_t KWIML_INT_uintptr_t +typedef KWIML_INT_uintptr_t uintptr_t; #endif /* Define to 1 if you have the header file. */ -- cgit v0.12