]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: use the `BSD` variable
authorViktor Szakats <commit@vsz.me>
Tue, 22 Oct 2024 15:32:28 +0000 (17:32 +0200)
committerViktor Szakats <commit@vsz.me>
Tue, 22 Oct 2024 18:20:41 +0000 (20:20 +0200)
- use `BSD` in addition to backwards-compatible method.
- add `BSD` to the configuration log and `buildinfo.txt` if detected.
- add `BSD` tag to `buildinfo.txt` also via `./configure`.

The `BSD` variable is supported by CMake 3.25.0 and upper.

Ref: https://cmake.org/cmake/help/latest/variable/BSD.html

Closes #15367

CMake/OtherTests.cmake
CMakeLists.txt
acinclude.m4

index 736d539c87efad056f92b17ab832dc91348a959f..2e5b62f6e3f590579102973d1f15dd33989e8629 100644 (file)
@@ -90,7 +90,7 @@ elseif(APPLE OR
        CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
        CMAKE_SYSTEM_NAME STREQUAL "SunOS")
   set(HAVE_GETADDRINFO_THREADSAFE TRUE)
-elseif(CMAKE_SYSTEM_NAME MATCHES "BSD")
+elseif(BSD OR CMAKE_SYSTEM_NAME MATCHES "BSD")
   set(HAVE_GETADDRINFO_THREADSAFE FALSE)
 endif()
 
index 795fbb2a98bc8d7b8e091861bed33db31f15e8d5..f78ee8467976ba7a95456134b2038e547764df15 100644 (file)
@@ -99,6 +99,9 @@ endif()
 if(UNIX)
   set(_target_flags "${_target_flags} UNIX")
 endif()
+if(BSD)
+  set(_target_flags "${_target_flags} BSD")
+endif()
 if(WIN32)
   set(_target_flags "${_target_flags} WIN32")
 endif()
index 9afc1774dae429e977869dcde867993e51ccbf47..0c17ba5ec57aad3ecaee627bcf3fb093764f8c26 100644 (file)
@@ -1552,6 +1552,10 @@ AC_DEFUN([CURL_PREPARE_BUILDINFO], [
       *-*-*bsd*|*-*-aix*|*-*-hpux*|*-*-interix*|*-*-irix*|*-*-linux*|*-*-solaris*|*-*-sunos*|*-apple-*|*-*-cygwin*|*-*-msys*)
         curl_pflags="${curl_pflags} UNIX";;
     esac
+    case $host in
+      *-*-*bsd*)
+        curl_pflags="${curl_pflags} BSD";;
+    esac
   fi
   if test "$curl_cv_cygwin" = 'yes'; then
     curl_pflags="${curl_pflags} CYGWIN"