[Ttssh2-commit] [8561] openssl の patch を当てるようにした

scmno****@osdn***** scmno****@osdn*****
2020年 2月 25日 (火) 01:39:07 JST


Revision: 8561
          https://osdn.net/projects/ttssh2/scm/svn/commits/8561
Author:   zmatsuo
Date:     2020-02-25 01:39:06 +0900 (Tue, 25 Feb 2020)
Log Message:
-----------
openssl の patch を当てるようにした

- cmake で libs をビルドするとき、従来はパッチせずにビルドしていた
- check_patch.bat の内容と同等
  - libs/openssl11.cmake でパッチする
  - vs2005.patch を追加 (check_patch.bat で perl で処理している内容)
  - opensslのビルドオプジョンを bat と同等にした

Modified Paths:
--------------
    trunk/libs/openssl11.cmake

Added Paths:
-----------
    trunk/libs/openssl_patch/vs2005.patch

-------------- next part --------------
Modified: trunk/libs/openssl11.cmake
===================================================================
--- trunk/libs/openssl11.cmake	2020-02-21 16:34:37 UTC (rev 8560)
+++ trunk/libs/openssl11.cmake	2020-02-24 16:39:06 UTC (rev 8561)
@@ -129,6 +129,44 @@
     WORKING_DIRECTORY ${EXTRACT_DIR}
     )
 
+  # patch
+  find_program(
+    PATCH patch
+    HINTS ${CMAKE_CURRENT_SOURCE_DIR}/openssl_patch
+    )
+  set(PATCH_OPT --binary --backup -p1)
+  message(PATCH=${PATCH})
+  execute_process(
+    COMMAND ${PATCH} ${PATCH_OPT}
+    INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/openssl_patch/vs2005.patch
+    WORKING_DIRECTORY ${EXTRACT_DIR}/${SRC_DIR_BASE}
+    )
+  execute_process(
+    COMMAND ${PATCH} ${PATCH_OPT}
+    INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/openssl_patch/ws2_32_dll_patch.txt
+    WORKING_DIRECTORY ${EXTRACT_DIR}/${SRC_DIR_BASE}
+    )
+  execute_process(
+    COMMAND ${PATCH} ${PATCH_OPT}
+    INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/openssl_patch/atomic_api.txt
+    WORKING_DIRECTORY ${EXTRACT_DIR}/${SRC_DIR_BASE}
+    )
+  execute_process(
+    COMMAND ${PATCH} ${PATCH_OPT}
+    INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/openssl_patch/CryptAcquireContextW2.txt
+    WORKING_DIRECTORY ${EXTRACT_DIR}/${SRC_DIR_BASE}
+    )
+  execute_process(
+    COMMAND ${PATCH} ${PATCH_OPT}
+    INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/openssl_patch/atomic_api_win95.txt
+    WORKING_DIRECTORY ${EXTRACT_DIR}/${SRC_DIR_BASE}
+    )
+  execute_process(
+    COMMAND ${PATCH} ${PATCH_OPT}
+    INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/openssl_patch/CryptAcquireContextW_win95.txt
+    WORKING_DIRECTORY ${EXTRACT_DIR}/${SRC_DIR_BASE}
+    )
+
 endif()
 
 ########################################
@@ -242,7 +280,7 @@
       )
   endif()
   file(APPEND "${SRC_DIR}/build_cmake.bat"
-    "perl Configure no-asm no-async no-shared ${CONFIG_TARGET} --prefix=${INSTALL_DIR_N} --openssldir=${INSTALL_DIR_N}\\SSL\n"
+    "perl Configure no-asm no-async no-shared no-capieng -no-dso -no-engine ${CONFIG_TARGET} -D_WIN32_WINNT=0x0501 --prefix=${INSTALL_DIR_N} --openssldir=${INSTALL_DIR_N}\\SSL\n"
     "nmake -f makefile install\n"
     )
   set(BUILD_CMAKE_BAT "${SRC_DIR}/build_cmake.bat")
@@ -299,7 +337,7 @@
     set(CONFIG_NAME "mingw")
   endif()
   execute_process(
-    COMMAND ${CMAKE_COMMAND} -E env "PATH=/usr/bin:/bin" ${PERL} ./Configure no-async no-shared ${CONFIG_NAME} --prefix=${INSTALL_DIR} --openssldir=${INSTALL_DIR_N}/SSL
+    COMMAND ${CMAKE_COMMAND} -E env "PATH=/usr/bin:/bin" ${PERL} ./Configure no-asm no-async no-shared no-capieng -no-dso -no-engine ${CONFIG_NAME} -D_WIN32_WINNT=0x0501 --prefix=${INSTALL_DIR} --openssldir=${INSTALL_DIR}/SSL
     WORKING_DIRECTORY ${SRC_DIR}
     RESULT_VARIABLE rv
     )

Added: trunk/libs/openssl_patch/vs2005.patch
===================================================================
--- trunk/libs/openssl_patch/vs2005.patch	                        (rev 0)
+++ trunk/libs/openssl_patch/vs2005.patch	2020-02-24 16:39:06 UTC (rev 8561)
@@ -0,0 +1,36 @@
+--- openssl_org\Configurations\10-main.conf.orig 2019-09-10 22:13:07.000000000 +0900
++++ openssl\Configurations\10-main.conf	2020-02-23 23:50:51.000000000 +0900
+***************
+*** 1216,1222 ****
+          template         => 1,
+          CC               => "cl",
+          CPP              => '$(CC) /EP /C',
+!         CFLAGS           => "/W3 /wd4090 /nologo",
+          LDFLAGS          => add("/debug"),
+          coutflag         => "/Fo",
+          defines          => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
+--- 1216,1222 ----
+          template         => 1,
+          CC               => "cl",
+          CPP              => '$(CC) /EP /C',
+!         CFLAGS           => "/W1 /wd4090 /nologo",
+          LDFLAGS          => add("/debug"),
+          coutflag         => "/Fo",
+          defines          => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
+***************
+*** 1313,1319 ****
+      "VC-WIN32" => {
+          inherit_from     => [ "VC-noCE-common", asm("x86_asm"),
+                                sub { $disabled{shared} ? () : "uplink_common" } ],
+!         CFLAGS           => add("/WX"),
+          AS               => sub { vc_win32_info()->{AS} },
+          ASFLAGS          => sub { vc_win32_info()->{ASFLAGS} },
+          asoutflag        => sub { vc_win32_info()->{asoutflag} },
+--- 1313,1319 ----
+      "VC-WIN32" => {
+          inherit_from     => [ "VC-noCE-common", asm("x86_asm"),
+                                sub { $disabled{shared} ? () : "uplink_common" } ],
+!         CFLAGS           => add(""),
+          AS               => sub { vc_win32_info()->{AS} },
+          ASFLAGS          => sub { vc_win32_info()->{ASFLAGS} },
+          asoutflag        => sub { vc_win32_info()->{asoutflag} },


Ttssh2-commit メーリングリストの案内