From 55d13ff6f418ecc7a7a9e5af9cad0a2bd9eb6845 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Thu, 4 Jul 2024 16:59:29 +0200 Subject: [PATCH 1/4] ci/freebsd: use ubuntu-latest --- .github/workflows/freebsd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index 6e56cb400..26411337e 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -10,7 +10,7 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 20 env: From d493669a9139d8f51cdb03601e0a0b2fbee2a2f8 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Thu, 4 Jul 2024 17:15:51 +0200 Subject: [PATCH 2/4] disable resolv on FreeBSD --- cmake/re-config.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/re-config.cmake b/cmake/re-config.cmake index 426a79db4..bbd647b1f 100644 --- a/cmake/re-config.cmake +++ b/cmake/re-config.cmake @@ -50,7 +50,9 @@ if(HAVE_UNISTD_H) list(APPEND RE_DEFINITIONS HAVE_UNISTD_H) endif() -if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") +if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + set(HAVE_RESOLV) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") check_symbol_exists(res_init resolv.h HAVE_RESOLV) else() check_symbol_exists(res_ninit resolv.h HAVE_RESOLV) From a33988ef429c620e7679c759020d0516d488c49d Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Thu, 4 Jul 2024 17:34:28 +0200 Subject: [PATCH 3/4] refactor FreeBSD resolv res_init is provided by libc --- cmake/re-config.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/re-config.cmake b/cmake/re-config.cmake index bbd647b1f..fc8b6114c 100644 --- a/cmake/re-config.cmake +++ b/cmake/re-config.cmake @@ -50,14 +50,14 @@ if(HAVE_UNISTD_H) list(APPEND RE_DEFINITIONS HAVE_UNISTD_H) endif() -if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") - set(HAVE_RESOLV) -elseif(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") +if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") check_symbol_exists(res_init resolv.h HAVE_RESOLV) else() check_symbol_exists(res_ninit resolv.h HAVE_RESOLV) endif() -if(HAVE_RESOLV) +if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + list(APPEND RE_DEFINITIONS HAVE_RESOLV) +elseif(HAVE_RESOLV) set(RESOLV_LIBRARY resolv) list(APPEND RE_DEFINITIONS HAVE_RESOLV) else() From 1639d060246ea162a992f061dea0826034c7bcd3 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Thu, 4 Jul 2024 17:39:00 +0200 Subject: [PATCH 4/4] wip --- cmake/re-config.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/re-config.cmake b/cmake/re-config.cmake index fc8b6114c..c45216800 100644 --- a/cmake/re-config.cmake +++ b/cmake/re-config.cmake @@ -55,8 +55,9 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") else() check_symbol_exists(res_ninit resolv.h HAVE_RESOLV) endif() -if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") +if(HAVE_RESOLV AND ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") list(APPEND RE_DEFINITIONS HAVE_RESOLV) + set(RESOLV_LIBRARY) # Provided by libc elseif(HAVE_RESOLV) set(RESOLV_LIBRARY resolv) list(APPEND RE_DEFINITIONS HAVE_RESOLV)