From 364d6c18f717aef221e62a6e7ffeeaf902a588d2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 22 Jun 2026 21:17:24 +0200 Subject: [PATCH] cmake: add pre-fills for DragonFly BSD and MidnightBSD Based on CI runs: DragonFlyBSD: https://github.com/curl/curl/actions/runs/27978506617/job/82802332910 (autotools) MidnightBSD: https://github.com/curl/curl/actions/runs/27977103321/job/82797523470 (cmake) Also readd DragonFly BSD to GHA/non-native, but keep it commented. Closes #22138 --- .github/workflows/non-native.yml | 6 +++++- CMake/unix-cache.cmake | 31 +++++++++++++++++++++++++------ 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/.github/workflows/non-native.yml b/.github/workflows/non-native.yml index 50ebe3768c..420c976d9c 100644 --- a/.github/workflows/non-native.yml +++ b/.github/workflows/non-native.yml @@ -54,6 +54,8 @@ jobs: strategy: matrix: include: + # { os: 'dragonflybsd', version: '6.4.2', build: 'autotools', arch: 'x86_64', cc: 'gcc' , desc: 'openssl !runtests', + # options: '--with-openssl' } - { os: 'freebsd' , version: '15.0', build: 'autotools', arch: 'x86_64', cc: 'clang', desc: 'openssl', options: '--with-openssl --with-gssapi' } - { os: 'freebsd' , version: '15.0', build: 'cmake' , arch: 'x86_64', cc: 'clang', desc: 'openssl !unity !runtests !examples', @@ -83,7 +85,9 @@ jobs: - name: 'install prereqs' run: | - if [ "${MATRIX_OS}" = 'freebsd' ]; then + if [ "${MATRIX_OS}" = 'dragonflybsd' ]; then + sudo pkg install -y autoconf automake libtool perl5 pkgconf brotli openldap26-client libidn2 libnghttp2 + elif [ "${MATRIX_OS}" = 'freebsd' ]; then # https://ports.freebsd.org/ if [ "${MATRIX_BUILD}" = 'cmake' ]; then tools='cmake-core ninja perl5' diff --git a/CMake/unix-cache.cmake b/CMake/unix-cache.cmake index e69ea5f608..78816499ca 100644 --- a/CMake/unix-cache.cmake +++ b/CMake/unix-cache.cmake @@ -21,7 +21,7 @@ # SPDX-License-Identifier: curl # ########################################################################### -# Based on CI runs for Cygwin/MSYS2, Linux, macOS, FreeBSD, NetBSD, OpenBSD +# Based on CI runs for Cygwin/MSYS2, Linux, macOS/iOS, DragonFly BSD, FreeBSD, MidnightBSD, NetBSD, OpenBSD if(NOT UNIX) message(FATAL_ERROR "This file should be included on Unix platforms only") endif() @@ -30,7 +30,9 @@ if(APPLE OR CYGWIN) set(HAVE_ACCEPT4 0) elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR + CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR + CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") set(HAVE_ACCEPT4 1) @@ -58,10 +60,12 @@ set(HAVE_DECL_FSEEKO 1) set(HAVE_DIRENT_H 1) if(APPLE OR CYGWIN OR + CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") set(HAVE_EVENTFD 0) elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR + CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD") set(HAVE_EVENTFD 1) endif() @@ -70,7 +74,8 @@ if(ANDROID AND ANDROID_PLATFORM_LEVEL GREATER_EQUAL 34) endif() if((APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.9) OR CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR # v6+ - CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") # v11.2+ + CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR # v11.2+ + CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD") # v1.3+ set(HAVE_MEMSET_S 1) elseif(NOT APPLE) set(HAVE_MEMSET_S 0) @@ -86,7 +91,9 @@ if(APPLE) set(HAVE_FSETXATTR 1) set(HAVE_FSETXATTR_5 0) set(HAVE_FSETXATTR_6 1) -elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR +elseif(CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR + CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR + CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") set(HAVE_FSETXATTR 0) set(HAVE_FSETXATTR_5 0) @@ -103,7 +110,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") set(HAVE_GETADDRINFO_THREADSAFE 0) elseif(CYGWIN OR CMAKE_SYSTEM_NAME STREQUAL "Linux" OR + CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR + CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD") set(HAVE_GETADDRINFO_THREADSAFE 1) endif() @@ -114,14 +123,18 @@ if(APPLE OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") set(HAVE_GETHOSTBYNAME_R 0) elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR - CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR + CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR + CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD") set(HAVE_GETHOSTBYNAME_R 1) endif() set(HAVE_GETHOSTBYNAME_R_3 0) set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0) set(HAVE_GETHOSTBYNAME_R_5 0) set(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0) -if(CMAKE_SYSTEM_NAME STREQUAL "Linux") +if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR + CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR + CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD") set(HAVE_GETHOSTBYNAME_R_6 1) set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 1) else() @@ -137,7 +150,9 @@ endif() if(APPLE OR CYGWIN OR CMAKE_SYSTEM_NAME STREQUAL "Linux" OR + CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR + CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") set(HAVE_GETPASS_R 0) elseif(CMAKE_SYSTEM_NAME STREQUAL "NetBSD") @@ -207,6 +222,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR BSD OR CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR + CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR CMAKE_SYSTEM_NAME STREQUAL "SunOS") @@ -227,7 +243,8 @@ set(HAVE_SCHED_YIELD 1) set(HAVE_SELECT 1) set(HAVE_SEND 1) if(APPLE OR - CYGWIN) + CYGWIN OR + CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD") set(HAVE_SENDMMSG 0) else() set(HAVE_SENDMMSG 1) @@ -265,10 +282,12 @@ if(ANDROID OR CMAKE_SYSTEM_NAME STREQUAL "iOS") endif() if(APPLE OR CYGWIN OR + CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") set(HAVE_SYS_EVENTFD_H 0) elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR + CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD") set(HAVE_SYS_EVENTFD_H 1) endif()