]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: add `iphlpapi` lib for libssh on Windows
authorViktor Szakats <commit@vsz.me>
Tue, 20 Aug 2024 21:10:31 +0000 (23:10 +0200)
committerViktor Szakats <commit@vsz.me>
Wed, 21 Aug 2024 08:07:13 +0000 (10:07 +0200)
vcpkg doesn't need it because it fixes this with a libssh patch.
All other Windows builds need it.

(autotools build not tested.)

Closes #14618

CMake/FindLibssh.cmake
configure.ac

index a9cb0f5ac7c071d4a3a0ba8eb83111f438d78d24..e9c55f15971644671516a6c22a972d0f828cf683 100644 (file)
@@ -87,3 +87,7 @@ else()
 
   mark_as_advanced(LIBSSH_INCLUDE_DIR LIBSSH_LIBRARY)
 endif()
+
+if(LIBSSH_FOUND AND WIN32)
+  list(APPEND LIBSSH_LIBRARIES "iphlpapi")  # for if_nametoindex
+endif()
index da636b446b989079c236e7494aceeb6f7e7aa143..a6fe3e955e2e6799b7b5fb90a02c2b77dd47a271 100644 (file)
@@ -2348,6 +2348,10 @@ elif test X"$OPT_LIBSSH" != Xno; then
   fi
 
   if test "$LIBSSH_ENABLED" = "1"; then
+    if test "$curl_cv_native_windows" = "yes"; then
+      dnl for if_nametoindex
+      LIBS="-liphlpapi $LIBS"
+    fi
     if test -n "$DIR_SSH"; then
        dnl when the libssh shared libs were found in a path that the run-time
        dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH