From: François Revol Date: Fri, 8 Jul 2022 23:07:53 +0000 (+0200) Subject: On Haiku, add a check for libbsd which has getpass X-Git-Tag: libpcap-1.10.2~118 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/8e9c7223dc63b2e7b5f9df83529f1b396a8bdc64?ds=sidebyside On Haiku, add a check for libbsd which has getpass (cherry picked from commit 1d24bb8f71c7d1e78090aa317190c4647422ed3c) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 58867254..6278f534 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -580,6 +580,15 @@ else(WIN32) set(PCAP_LINK_LIBRARIES str ${PCAP_LINK_LIBRARIES}) endif(LIBSTR_HAS_PUTMSG) endif(NOT STDLIBS_HAVE_PUTMSG) + + # Haiku has getpass in libbsd + check_function_exists(getpass STDLIBS_HAVE_GETPASS) + if(NOT STDLIBS_HAVE_GETPASS) + check_library_exists(bsd getpass "" LIBBSD_HAS_GETPASS) + if(LIBBSD_HAS_GETPASS) + set(PCAP_LINK_LIBRARIES bsd ${PCAP_LINK_LIBRARIES}) + endif(LIBBSD_HAS_GETPASS) + endif(NOT STDLIBS_HAVE_GETPASS) endif(WIN32) # diff --git a/configure.ac b/configure.ac index 7ee31b6f..ff59388b 100644 --- a/configure.ac +++ b/configure.ac @@ -70,6 +70,10 @@ haiku*) # Haiku needs _BSD_SOURCE for the _IO* macros because it doesn't use them. # CFLAGS="$CFLAGS -D_BSD_SOURCE" + # + # Haiku has getpass in libbsd. + # + AC_CHECK_LIB(bsd, getpass) ;; esac