]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
configure.ac,CMakeLists.txt: Add libbsd on Haiku for readpassphrase (#2352)
authorvcoxvco <62189056+vcoxvco@users.noreply.github.com>
Sun, 13 Oct 2024 00:44:32 +0000 (02:44 +0200)
committerGitHub <noreply@github.com>
Sun, 13 Oct 2024 00:44:32 +0000 (17:44 -0700)
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 <god@universe.sys>
CMakeLists.txt
configure.ac

index d683f70d9545e89b9f25d2e5c31774655869f052..a7b74dcb71bd0b8512da6fc6bed2b78d3edaca30 100644 (file)
@@ -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
index a2c4b7bf08a2da0fb5ea983f71529c30f7a6b373..e794758b12c330d70ec1f76073088ca8ed79b6a8 100644 (file)
@@ -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