From 2cadc890ce99959e410e66c57f9bc147cbc5e644 Mon Sep 17 00:00:00 2001 From: illusory-dream <37270118+illusory-dream@users.noreply.github.com> Date: Sat, 26 Feb 2022 02:07:00 +0800 Subject: winbuild: add parameter WITH_SSH For building with libssh Closes #8514 --- winbuild/Makefile.vc | 14 +++++++++++++- winbuild/MakefileBuild.vc | 29 ++++++++++++++++++++++++++++- winbuild/README.md | 1 + 3 files changed, 42 insertions(+), 2 deletions(-) (limited to 'winbuild') diff --git a/winbuild/Makefile.vc b/winbuild/Makefile.vc index 098561333..54da51e10 100644 --- a/winbuild/Makefile.vc +++ b/winbuild/Makefile.vc @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1999 - 2020, Daniel Stenberg, , et al. +# Copyright (C) 1999 - 2022, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -178,6 +178,14 @@ USE_SSH2 = true SSH2 = static !ENDIF +!IF "$(WITH_SSH)"=="dll" +USE_SSH = true +SSH = dll +!ELSEIF "$(WITH_SSH)"=="static" +USE_SSH = true +SSH = static +!ENDIF + CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-vc$(VC)-$(MACHINE) !IF "$(DEBUG)"=="yes" @@ -212,6 +220,10 @@ CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-zlib-$(ZLIB) CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssh2-$(SSH2) !ENDIF +!IF "$(USE_SSH)"=="true" +CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssh-$(SSH) +!ENDIF + !IF "$(USE_IPV6)"=="true" CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ipv6 !ENDIF diff --git a/winbuild/MakefileBuild.vc b/winbuild/MakefileBuild.vc index fa26d7f16..c4b8fc94b 100644 --- a/winbuild/MakefileBuild.vc +++ b/winbuild/MakefileBuild.vc @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1999 - 2021, Daniel Stenberg, , et al. +# Copyright (C) 1999 - 2022, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -288,6 +288,27 @@ SSH2_CFLAGS = $(SSH2_CFLAGS) /I$(SSH2_INC_DIR) !ENDIF +!IFDEF SSH_PATH +SSH_INC_DIR= $(SSH_PATH)\include +SSH_LIB_DIR= $(SSH_PATH)\lib +SSH_LFLAGS = $(SSH_LFLAGS) "/LIBPATH:$(SSH_LIB_DIR)" +!ELSE +SSH_LIB_DIR= $(DEVEL_LIB) +SSH_INC_DIR= $(DEVEL_INCLUDE) +!ENDIF + +!IF "$(WITH_SSH)"=="dll" || "$(WITH_SSH)"=="static" +SSH_LIBS = ssh.lib +USE_SSH = true +SSH = $(WITH_SSH) +!ENDIF + +!IFDEF USE_SSH +SSH_CFLAGS = /DHAVE_LIBSSH /DHAVE_LIBSSH_LIBSSH_H /DLIBSSH_WIN32 /DLIBSSH_LIBRARY /DUSE_LIBSSH /DCURL_USE_LIBSSH +SSH_CFLAGS = $(SSH_CFLAGS) /I$(SSH_INC_DIR) +!ENDIF + + !IFNDEF USE_IDN USE_IDN = true !ELSEIF "$(USE_IDN)"=="yes" @@ -449,6 +470,11 @@ CFLAGS = $(CFLAGS) $(SSH2_CFLAGS) LFLAGS = $(LFLAGS) $(SSH2_LFLAGS) $(SSH2_LIBS) !ENDIF +!IF "$(USE_SSH)"=="true" +CFLAGS = $(CFLAGS) $(SSH_CFLAGS) +LFLAGS = $(LFLAGS) $(SSH_LFLAGS) $(SSH_LIBS) +!ENDIF + !IF "$(USE_IDN)"=="true" CFLAGS = $(CFLAGS) $(IDN_CFLAGS) !ENDIF @@ -521,6 +547,7 @@ $(TARGET): $(LIB_OBJS) $(LIB_DIROBJ) $(DIRDIST) @echo Using NGHTTP2: $(USE_NGHTTP2) @echo Using c-ares: $(USE_CARES) @echo Using SSH2: $(USE_SSH2) + @echo Using SSH: $(USE_SSH) @echo Using ZLIB: $(USE_ZLIB) @echo Using IDN: $(USE_IDN) @echo Using IPv6: $(USE_IPV6) diff --git a/winbuild/README.md b/winbuild/README.md index 3684a382d..7bbbc5c6c 100644 --- a/winbuild/README.md +++ b/winbuild/README.md @@ -83,6 +83,7 @@ where `` is one or many of: - `WITH_MBEDTLS=` - Enable mbedTLS support, DLL or static - `WITH_CARES=` - Enable c-ares support, DLL or static - `WITH_ZLIB=` - Enable zlib support, DLL or static + - `WITH_SSH=` - Enable libSSH support, DLL or static - `WITH_SSH2=` - Enable libSSH2 support, DLL or static - `WITH_PREFIX=` - Where to install the build - `ENABLE_SSPI=` - Enable SSPI support, defaults to yes -- cgit v1.2.1