summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/FindMFC.cmake2
-rw-r--r--Source/cmFileLockUnix.cxx4
-rw-r--r--Source/cmFileLockWin32.cxx3
-rw-r--r--Utilities/cmcurl/CMakeLists.txt10
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_util.c8
-rw-r--r--Utilities/cmliblzma/CMakeLists.txt10
-rw-r--r--Utilities/cmliblzma/config.h.in8
7 files changed, 38 insertions, 7 deletions
diff --git a/Modules/FindMFC.cmake b/Modules/FindMFC.cmake
index 261ebdb..3547628 100644
--- a/Modules/FindMFC.cmake
+++ b/Modules/FindMFC.cmake
@@ -36,7 +36,7 @@ if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW)
endif()
if(MFC_ATTEMPT_TRY_COMPILE)
- if("MFC_HAVE_MFC" MATCHES "^MFC_HAVE_MFC$")
+ if(NOT DEFINED MFC_HAVE_MFC)
set(CHECK_INCLUDE_FILE_VAR "afxwin.h")
configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx)
diff --git a/Source/cmFileLockUnix.cxx b/Source/cmFileLockUnix.cxx
index fc18a64..36a2d72 100644
--- a/Source/cmFileLockUnix.cxx
+++ b/Source/cmFileLockUnix.cxx
@@ -15,6 +15,7 @@
#include <errno.h> // errno
#include <stdio.h> // SEEK_SET
#include <fcntl.h>
+#include <unistd.h>
#include "cmSystemTools.h"
cmFileLock::cmFileLock(): File(-1)
@@ -31,6 +32,9 @@ cmFileLockResult cmFileLock::Release()
this->Filename = "";
+ ::close(this->File);
+ this->File = -1;
+
if (lockResult == 0)
{
return cmFileLockResult::MakeOk();
diff --git a/Source/cmFileLockWin32.cxx b/Source/cmFileLockWin32.cxx
index 4691689..dc65948 100644
--- a/Source/cmFileLockWin32.cxx
+++ b/Source/cmFileLockWin32.cxx
@@ -38,6 +38,9 @@ cmFileLockResult cmFileLock::Release()
this->Filename = "";
+ CloseHandle(this->File);
+ this->File = INVALID_HANDLE_VALUE;
+
if (unlockResult)
{
return cmFileLockResult::MakeOk();
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index 08bdff5..32e4561 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -524,12 +524,18 @@ check_include_file("features.h" HAVE_FEATURES_H)
if(NOT UNIX)
check_include_file_concat("ws2tcpip.h" HAVE_WS2TCPIP_H)
check_include_file_concat("winsock2.h" HAVE_WINSOCK2_H)
-endif(NOT UNIX)
+else()
+ set(HAVE_WS2TCPIP_H 0)
+ set(HAVE_WINSOCK2_H 0)
+endif()
check_include_file_concat("stdio.h" HAVE_STDIO_H)
if(NOT UNIX)
check_include_file_concat("windows.h" HAVE_WINDOWS_H)
check_include_file_concat("winsock.h" HAVE_WINSOCK_H)
-endif(NOT UNIX)
+else()
+ set(HAVE_WINDOWS_H 0)
+ set(HAVE_WINSOCK_H 0)
+endif()
check_include_file_concat("inttypes.h" HAVE_INTTYPES_H)
check_include_file_concat("sys/filio.h" HAVE_SYS_FILIO_H)
diff --git a/Utilities/cmlibarchive/libarchive/archive_util.c b/Utilities/cmlibarchive/libarchive/archive_util.c
index 96b88d8..d136498 100644
--- a/Utilities/cmlibarchive/libarchive/archive_util.c
+++ b/Utilities/cmlibarchive/libarchive/archive_util.c
@@ -249,6 +249,8 @@ __archive_errx(int retvalue, const char *msg)
int
__archive_mktemp(const char *tmpdir)
{
+ static const wchar_t *prefix = L"libarchive_";
+ static const wchar_t *suffix = L"XXXXXXXXXX";
static const wchar_t num[] = {
L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7',
L'8', L'9', L'A', L'B', L'C', L'D', L'E', L'F',
@@ -323,10 +325,10 @@ __archive_mktemp(const char *tmpdir)
/*
* Create a temporary file.
*/
- archive_wstrcat(&temp_name, L"libarchive_");
- xp = temp_name.s + archive_strlen(&temp_name);
- archive_wstrcat(&temp_name, L"XXXXXXXXXX");
+ archive_wstrcat(&temp_name, prefix);
+ archive_wstrcat(&temp_name, suffix);
ep = temp_name.s + archive_strlen(&temp_name);
+ xp = ep - wcslen(suffix);
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT)) {
diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt
index d991438..8920536 100644
--- a/Utilities/cmliblzma/CMakeLists.txt
+++ b/Utilities/cmliblzma/CMakeLists.txt
@@ -211,4 +211,14 @@ ENDIF()
ADD_LIBRARY(cmliblzma ${LZMA_SRCS})
+IF(CMAKE_C_COMPILER_ID STREQUAL "XL")
+ # Disable the XL compiler optimizer because it causes crashes
+ # and other bad behavior in liblzma code.
+ SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-qnooptimize")
+ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
+ CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
+ # Disable the old GNU compiler optimizer.
+ SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-O0")
+ENDIF()
+
INSTALL(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmliblzma)
diff --git a/Utilities/cmliblzma/config.h.in b/Utilities/cmliblzma/config.h.in
index 017c435..9c53150 100644
--- a/Utilities/cmliblzma/config.h.in
+++ b/Utilities/cmliblzma/config.h.in
@@ -280,4 +280,10 @@ typedef uint64_t uintmax_t;
/* Define to 1 if the system supports fast unaligned access to 16-bit and
32-bit integers. */
-#define TUKLIB_FAST_UNALIGNED_ACCESS 1
+#if defined(__i386) || defined(__i386__) || defined(_M_IX86) \
+ || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) \
+ || defined(__amd64) || defined(__amd64__) \
+ || defined(__powerpc) || defined(__powerpc__) \
+ || defined(__ppc) || defined(__ppc__) || defined(__POWERPC__)
+# define TUKLIB_FAST_UNALIGNED_ACCESS 1
+#endif