Skip to content

Commit

Permalink
修复windows上curl TLCP无法使用的问题
Browse files Browse the repository at this point in the history
windows上使用nmake构建,和Linux构建脚本不一样,增加NTLS相关编译选项
  • Loading branch information
dongbeiouba committed Dec 27, 2024
1 parent 297ddcc commit 1f187d5
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
wget "https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/${VERSION}.tar.gz"
tar zxf "${VERSION}.tar.gz"
pushd "Tongsuo-${VERSION}"
./config --prefix=${GITHUB_WORKSPACE}/tongsuo no-shared enable-ntls --release
./config --prefix=${GITHUB_WORKSPACE}/tongsuo no-shared enable-ntls enable-ssl-trace --release
make -s -j4
make install_sw
popd
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
pushd "Tongsuo-%TONGSUO_VERSION%"
mkdir _build
pushd _build
perl ..\Configure no-makedepend no-shared VC-WIN64A --prefix=%TONGSUO_HOME%
perl ..\Configure no-makedepend no-shared enable-ntls enable-ssl-trace VC-WIN64A --prefix=%TONGSUO_HOME% --release
nmake /S
nmake install_sw
popd
Expand All @@ -119,7 +119,9 @@ jobs:
git apply tongsuo.diff
./buildconf.bat
cd winbuild
nmake /f Makefile.vc mode=static WITH_SSL=static SSL_PATH=${env:TONGSUO_HOME} RTLIBCFG=static
nmake /f Makefile.vc mode=static WITH_SSL=static SSL_PATH=${env:TONGSUO_HOME} RTLIBCFG=static ENABLE_NTLS=yes
cd ..
builds\libcurl-vc-x64-release-static-ssl-static-ipv6-sspi\bin\curl.exe --help tls | findstr tlcp
- name: upload artifact
uses: actions/upload-release-asset@v1
env:
Expand Down
55 changes: 55 additions & 0 deletions tongsuo.patch
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,19 @@ index b880f3dc6..771409dfa 100644
0)

/* evaluates to true if option takes a curl_write_callback argument */
diff --git a/lib/config-win32.h b/lib/config-win32.h
index 6d110eb76..1a323ee1f 100644
--- a/lib/config-win32.h
+++ b/lib/config-win32.h
@@ -640,4 +640,8 @@ Vista
# define ENABLE_IPV6 1
#endif

+#ifdef USE_NTLS
+# define HAVE_NTLS 1
+#endif
+
#endif /* HEADER_CURL_CONFIG_WIN32_H */
diff --git a/lib/easyoptions.c b/lib/easyoptions.c
index e69c658b0..aded8dff5 100644
--- a/lib/easyoptions.c
Expand Down Expand Up @@ -1085,3 +1098,45 @@ index c09e979d0..6ad4e9e8b 100755
);


diff --git a/winbuild/Makefile.vc b/winbuild/Makefile.vc
index 44d9604ba..17f70bfaf 100644
--- a/winbuild/Makefile.vc
+++ b/winbuild/Makefile.vc
@@ -124,6 +124,14 @@ USE_UNICODE = true
USE_UNICODE = false
!ENDIF

+!IFNDEF ENABLE_NTLS
+USE_NTLS = false
+!ELSEIF "$(ENABLE_NTLS)"=="yes"
+USE_NTLS = true
+!ELSEIF "$(ENABLE_NTLS)"=="no"
+USE_NTLS = false
+!ENDIF
+
CONFIG_NAME_LIB = libcurl

!IF "$(WITH_SSL)"=="dll"
@@ -294,6 +302,7 @@ $(MODE):
@SET USE_SSPI=$(USE_SSPI)
@SET USE_SCHANNEL=$(USE_SCHANNEL)
@SET USE_UNICODE=$(USE_UNICODE)
+ @SET USE_NTLS=$(USE_NTLS)
# compatibility bit
@SET WITH_NGHTTP2=$(WITH_NGHTTP2)

diff --git a/winbuild/MakefileBuild.vc b/winbuild/MakefileBuild.vc
index 9b165537a..634d91921 100644
--- a/winbuild/MakefileBuild.vc
+++ b/winbuild/MakefileBuild.vc
@@ -141,6 +141,10 @@ SSL_CFLAGS = $(SSL_CFLAGS) /DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG
!ENDIF
!ENDIF

+!IF "$(USE_NTLS)"=="true"
+SSL_CFLAGS = $(SSL_CFLAGS) /DUSE_NTLS
+CURL_CFLAGS = $(CURL_CFLAGS) /DUSE_NTLS
+!ENDIF

!IFDEF NGHTTP2_PATH
NGHTTP2_INC_DIR = $(NGHTTP2_PATH)\include

0 comments on commit 1f187d5

Please sign in to comment.