diff --git a/configure.ac b/configure.ac index 528a7a9..a765fc7 100644 --- a/configure.ac +++ b/configure.ac @@ -104,6 +104,7 @@ AS_IF([test x"$with_skalibs" != xno], AC_CHECK_HEADERS([arpa/inet.h curses.h fcntl.h langinfo.h limits.h locale.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/resource.h sys/socket.h sys/time.h term.h termios.h unistd.h wchar.h wctype.h], [], [AC_MSG_ERROR([Missing required header file.])]) AC_CHECK_HEADERS([pty.h util.h]) +AC_CHECK_HEADERS([endian.h sys/endian.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL @@ -159,7 +160,11 @@ AC_CHECK_DECL([htobe64], [Define if OSSwapHostToBigInt64 and friends exist.])], [AC_MSG_ERROR([Unable to find byte swapping functions])], [[#include ]])], - [[#include ]]) + [[#if defined(HAVE_ENDIAN_H) +#include +#elif defined(HAVE_SYS_ENDIAN_H) +#include +#endif]]) AC_CHECK_DECL([IP_MTU_DISCOVER], [AC_DEFINE([HAVE_IP_MTU_DISCOVER], [1], diff --git a/src/crypto/byteorder.h b/src/crypto/byteorder.h index f0c7f06..549ff4d 100644 --- a/src/crypto/byteorder.h +++ b/src/crypto/byteorder.h @@ -22,7 +22,11 @@ #include "config.h" #ifdef HAVE_HTOBE64 -# include +# if defined(HAVE_ENDIAN_H) +# include +# elif defined(HAVE_SYS_ENDIAN_H) +# include +# endif #elif HAVE_OSX_SWAP # include # define htobe64 OSSwapHostToBigInt64