Skip to content

Commit

Permalink
Port FreeBSD libfetch
Browse files Browse the repository at this point in the history
For keylocation=https:// support.
Some lingering libcurl left in there, but is
not currently used.

Signed-off-by: Jorgen Lundman <lundman@lundman.net>
  • Loading branch information
lundman committed Mar 8, 2024
1 parent d281aa0 commit 02859e3
Show file tree
Hide file tree
Showing 13 changed files with 7,121 additions and 2 deletions.
24 changes: 22 additions & 2 deletions lib/libzfs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@ find_library(CRYPTO_STATIC_TEST
REQUIRED
)

target_include_directories(libzfs PRIVATE "${CMAKE_SOURCE_DIR}/lib/libzfs")
target_link_libraries(libzfs PUBLIC libpthread zlib libzutil libshare libzfs_core libnvpair libuutil)
# Optionally, if there is a "lib/curl*" directory
# for example, "lib/curl-8.6.0_4-win64-mingw" we also enable
# LIBFETCH_IS_LIBCURL define, and link in
# "lib/curl-8.6.0_4-win64-mingw/lib/libcurl"
# https://curl.se/windows/
#file( GLOB curl_paths "${CMAKE_SOURCE_DIR}/lib/curl*" )
#list(LENGTH curl_paths paths_len)
#if(paths_len GREATER 0)
# list(GET curl_paths 0 curl_path)
# message("Good News Everyone: Found lib/curl: ${curl_path}")
# add_definitions(-DLIBFETCH_IS_LIBCURL -DCURL_STATICLIB -DCURL_DISABLE_LDAP)
# include_directories(AFTER "${curl_path}/include")
# target_link_libraries(libzfs PRIVATE
# "${curl_path}/lib/libcurl.a"
# "${curl_path}/lib/libssh2.a"
# "${curl_path}/lib/libpsl.a"
# "${curl_path}/lib/libnghttp2.a")
#endif()


target_include_directories(libzfs PRIVATE "${CMAKE_SOURCE_DIR}/lib/libzfs" "${CMAKE_SOURCE_DIR}/lib/os/windows/libfetch")
target_link_libraries(libzfs PUBLIC libpthread zlib libzutil libshare libzfs_core libnvpair libuutil libfetch)
target_link_libraries(libzfs PRIVATE Crypt32.lib ${CRYPTO_STATIC_TEST})
1 change: 1 addition & 0 deletions lib/os/windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ add_subdirectory(libpthread)
add_subdirectory(libkstat)
add_subdirectory(libuuid)
add_subdirectory(libregex)
add_subdirectory(libfetch)
25 changes: 25 additions & 0 deletions lib/os/windows/libfetch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

use_clang()

add_definitions(-DWITH_SSL)

add_library(libfetch
common.c
fetch.c
# ftp.c
file.c
http.c
)

find_library(SSL_STATIC_TEST
NAMES
libssl64MTd
NAMES_PER_DIR
HINTS
"C:/Program Files/OpenSSL-Win64/lib/VC/static"
PATH_SUFFIXES
lib
REQUIRED
)

target_link_libraries(libfetch PRIVATE Crypt32.lib ${SSL_STATIC_TEST})
Loading

0 comments on commit 02859e3

Please sign in to comment.