From: vcoxvco <62189056+vcoxvco@users.noreply.github.com> Date: Sun, 13 Oct 2024 00:44:32 +0000 (+0200) Subject: configure.ac,CMakeLists.txt: Add libbsd on Haiku for readpassphrase (#2352) X-Git-Tag: v3.8.0~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2c512a59fea1087b89e4252add056359a83bedf;p=thirdparty%2Flibarchive.git configure.ac,CMakeLists.txt: Add libbsd on Haiku for readpassphrase (#2352) Followup from #2346 Add libbsd to make/cmake configuration for linking readpassphrase on Haiku. Maybe there is a better way to do this for cmake, I'm not that familiar with it. Co-authored-by: vco --- diff --git a/CMakeLists.txt b/CMakeLists.txt index d683f70d9..a7b74dcb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -881,6 +881,14 @@ IF(NOT OPENSSL_FOUND) ENDIF(LIBMD_FOUND) ENDIF(NOT OPENSSL_FOUND) +# libbsd for readpassphrase on Haiku +IF("${CMAKE_SYSTEM_NAME}" MATCHES "Haiku") + MESSAGE(STATUS "Adding libbsd for Haiku") + SET(CMAKE_REQUIRED_LIBRARIES "bsd") + FIND_LIBRARY(LIBBSD_LIBRARY NAMES bsd) + LIST(APPEND ADDITIONAL_LIBS ${LIBBSD_LIBRARY}) +ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES "Haiku") + # # How to prove that CRYPTO functions, which have several names on various # platforms, just see if archive_digest.c can compile and link against diff --git a/configure.ac b/configure.ac index a2c4b7bf0..e794758b1 100644 --- a/configure.ac +++ b/configure.ac @@ -108,6 +108,11 @@ case "$host_os" in esac AC_SUBST(PLATFORMCPPFLAGS) +dnl Linking on Haiku needs libbsd because of readpassphrase +case "$host_os" in + haiku*) LIBS="-lbsd $LIBS" ;; +esac + # Checks for programs. AC_PROG_CC AM_PROG_CC_C_O