From: Viktor Szakats Date: Sun, 6 Oct 2024 00:54:25 +0000 (+0200) Subject: cmake: detect `HAVE_NETINET_IN6_H`, `HAVE_CLOSESOCKET_CAMEL`, `HAVE_PROTO_BSDSOCKET_H` X-Git-Tag: curl-8_11_0~218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e888069f5a7a6a6343d2cb4068cd29c127d52b45;p=thirdparty%2Fcurl.git cmake: detect `HAVE_NETINET_IN6_H`, `HAVE_CLOSESOCKET_CAMEL`, `HAVE_PROTO_BSDSOCKET_H` To sync with `./configure`. - `HAVE_NETINET_IN6_H` is needed by HPE NonStop NSE and NSX systems. Follow-up to 76ebd54175bad02b29769d797adf72fdf3df119f #2155 - `HAVE_CLOSESOCKET_CAMEL`, `HAVE_PROTO_BSDSOCKET_H` are for AmigaOS. (Note: `./configure` tries to detect these for all targets, cmake does it only for AmigaOS, to not inflate configure time.) Closes #15172 --- diff --git a/CMake/Platforms/WindowsCache.cmake b/CMake/Platforms/WindowsCache.cmake index 668bba215a..6f350ac82a 100644 --- a/CMake/Platforms/WindowsCache.cmake +++ b/CMake/Platforms/WindowsCache.cmake @@ -124,6 +124,7 @@ set(HAVE_IFADDRS_H 0) set(HAVE_IO_H 1) set(HAVE_NETDB_H 0) set(HAVE_NETINET_IN_H 0) +set(HAVE_NETINET_IN6_H 0) set(HAVE_NETINET_TCP_H 0) set(HAVE_NETINET_UDP_H 0) set(HAVE_NET_IF_H 0) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e2ae7a1b9..4d83574ed8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1422,6 +1422,7 @@ check_include_file_concat("locale.h" HAVE_LOCALE_H) check_include_file_concat("net/if.h" HAVE_NET_IF_H) check_include_file_concat("netdb.h" HAVE_NETDB_H) check_include_file_concat("netinet/in.h" HAVE_NETINET_IN_H) +check_include_file_concat("netinet/in6.h" HAVE_NETINET_IN6_H) check_include_file_concat("netinet/tcp.h" HAVE_NETINET_TCP_H) check_include_file_concat("netinet/udp.h" HAVE_NETINET_UDP_H) check_include_file("linux/tcp.h" HAVE_LINUX_TCP_H) @@ -1437,6 +1438,10 @@ check_include_file_concat("termios.h" HAVE_TERMIOS_H) check_include_file_concat("unistd.h" HAVE_UNISTD_H) check_include_file_concat("utime.h" HAVE_UTIME_H) +if(CMAKE_SYSTEM_NAME MATCHES "AmigaOS") + check_include_file_concat("proto/bsdsocket.h" HAVE_PROTO_BSDSOCKET_H) +endif() + check_type_size("size_t" SIZEOF_SIZE_T) check_type_size("ssize_t" SIZEOF_SSIZE_T) check_type_size("long long" SIZEOF_LONG_LONG) @@ -1528,6 +1533,10 @@ if(WIN32 OR CYGWIN) check_function_exists("_setmode" HAVE__SETMODE) endif() +if(CMAKE_SYSTEM_NAME MATCHES "AmigaOS") + check_symbol_exists("CloseSocket" "${CURL_INCLUDES}" HAVE_CLOSESOCKET_CAMEL) +endif() + if(NOT _ssl_enabled) check_symbol_exists("arc4random" "${CURL_INCLUDES};stdlib.h" HAVE_ARC4RANDOM) endif() diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake index e69fc50073..e6eef6f525 100644 --- a/lib/curl_config.h.cmake +++ b/lib/curl_config.h.cmake @@ -219,6 +219,9 @@ /* Define to 1 if you have the `closesocket' function. */ #cmakedefine HAVE_CLOSESOCKET 1 +/* Define to 1 if you have the `CloseSocket' function. */ +#cmakedefine HAVE_CLOSESOCKET_CAMEL 1 + /* Define to 1 if you have the header file. */ #cmakedefine HAVE_DIRENT_H 1 @@ -409,6 +412,9 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NETINET_IN_H 1 +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NETINET_IN6_H 1 + /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NETINET_TCP_H 1 @@ -511,6 +517,9 @@ /* Define to 1 if you have the `socket' function. */ #cmakedefine HAVE_SOCKET 1 +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_PROTO_BSDSOCKET_H 1 + /* Define to 1 if you have the socketpair function. */ #cmakedefine HAVE_SOCKETPAIR 1