Skip to content

Commit

Permalink
Merge pull request #847 from infrastation/some_haiku_support
Browse files Browse the repository at this point in the history
some Haiku support
  • Loading branch information
fklassen authored Jun 3, 2024
2 parents b6270b0 + 1819eb7 commit 0d86947
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
37 changes: 33 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -609,32 +609,61 @@ else
fi

dnl Check for inet_aton and inet_pton
dnl On Haiku these functions are in libnetwork.
AC_CHECK_FUNC(inet_aton,
AC_DEFINE([HAVE_INET_ATON], [1], [Do we have inet_aton?])
inet_aton=yes,
inet_aton=no)
[
AC_CHECK_LIB(network, inet_aton,
AC_DEFINE([HAVE_INET_ATON], [1], [Do we have inet_aton?])
use_libnetwork=yes,
[inet_aton=no]
)
]
)
AC_CHECK_FUNC(inet_pton,
AC_DEFINE([HAVE_INET_PTON], [1], [Do we have inet_pton?])
inet_pton=yes,
inet_pton=no)
[
AC_CHECK_LIB(network, inet_pton,
AC_DEFINE([HAVE_INET_PTON], [1], [Do we have inet_pton?])
use_libnetwork=yes,
[inet_pton=no]
)
]
)
AC_CHECK_FUNC(inet_ntop,
AC_DEFINE([HAVE_INET_NTOP], [1], [Do we have inet_ntop?])
inet_ntop=yes,
inet_ntop=no)
[
AC_CHECK_LIB(network, inet_ntop,
AC_DEFINE([HAVE_INET_NTOP], [1], [Do we have inet_ntop?])
use_libnetwork=yes,
[inet_ntop=no]
)
]
)

if test "$inet_ntop" = "no" -a "$inet_pton" = "no" ; then
AC_MSG_ERROR([We need either inet_ntop or inet_pton])
fi

if test "$use_libnetwork" = "yes" ; then
LIBS="-lnetwork $LIBS"
fi

AC_CHECK_FUNC(inet_addr,
AC_DEFINE([HAVE_INET_ADDR], [1], [Do we have inet_addr?])
inet_addr=yes,
inet_addr=no)

if test x$inet_addr = no ; then
if test x$inet_addr = xno ; then
AC_MSG_ERROR([We need inet_addr. See bug 26])
fi

dnl On Haiku fts_*() functions are in libbsd.
AC_CHECK_FUNC(fts_read,,[AC_CHECK_LIB(bsd, fts_read)])

dnl #####################################################
dnl Checks for tuntap device support
dnl #####################################################
Expand Down
2 changes: 1 addition & 1 deletion src/common/sendpacket.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#ifdef __NetBSD__
#include <net/if_ether.h>
#else
#elif ! defined(__HAIKU__)
#include <netinet/if_ether.h>
#endif

Expand Down

0 comments on commit 0d86947

Please sign in to comment.