]> 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)
committerMartin Matuska <martin@matuska.de>
Sun, 13 Oct 2024 07:37:35 +0000 (09:37 +0200)
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>
(cherry picked from commit e2c512a59fea1087b89e4252add056359a83bedf)

CMakeLists.txt
configure.ac

index e23338e4df21ac7b34f1c1a9b07686a11bdb56f2..bfe68acd507b371590c05bd85b0da2030d9f5707 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 6f75413d48246df3796029f0f904405ae44582e0..fe66708f86b1ae3018a10f60020b247fa54bb742 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