]> The Tcpdump Group git mirrors - libpcap/commitdiff
On Haiku, add a check for libbsd which has getpass
authorFrançois Revol <[email protected]>
Fri, 8 Jul 2022 23:07:53 +0000 (01:07 +0200)
committerGuy Harris <[email protected]>
Thu, 14 Jul 2022 05:13:10 +0000 (22:13 -0700)
(cherry picked from commit 1d24bb8f71c7d1e78090aa317190c4647422ed3c)

CMakeLists.txt
configure.ac

index 588672549ab4e0fbcbd481def660696a7435cc54..6278f534a9d841e2608b3816b1a972b16bd2b39e 100644 (file)
@@ -580,6 +580,15 @@ else(WIN32)
             set(PCAP_LINK_LIBRARIES str ${PCAP_LINK_LIBRARIES})
         endif(LIBSTR_HAS_PUTMSG)
     endif(NOT STDLIBS_HAVE_PUTMSG)
             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)
 
 #
 endif(WIN32)
 
 #
index 7ee31b6fca512c2ce86d46737ef2773311af4f29..ff59388b890064405d8cdfbb8134460500904b99 100644 (file)
@@ -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 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
 
        ;;
 esac