diff --git a/configure.ac b/configure.ac index fd8a7169..ecb71eca 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ AC_PROG_LIBTOOL # Checks for header files. # AC_HEADER_STDC -AC_CHECK_HEADERS([ctype.h endian.h netinet/in.h stdint.h stdlib.h string.h strings.h sys/endian.h sys/socket.h sys/time.h termios.h unistd.h]) +AC_CHECK_HEADERS([ctype.h endian.h netinet/in.h stdint.h stdlib.h string.h strings.h sys/byteorder.h sys/endian.h sys/socket.h sys/time.h termios.h unistd.h]) # Type checks. # diff --git a/fko/fko_common.h b/fko/fko_common.h index 940555e9..eaffa7cb 100644 --- a/fko/fko_common.h +++ b/fko/fko_common.h @@ -63,6 +63,15 @@ #elif HAVE_SYS_ENDIAN_H /* FreeBSD has a sys/endian.h */ #include #define BYTEORDER _BYTE_ORDER +#elif HAVE_SYS_BYTEORDER_H /* Solaris (v10 at least) seems to have this */ + #include + #if defined(_BIG_ENDIAN) + #define BYTEORDER 4321 + #elif defined(_LITTLE_ENDIAN) + #define BYTEORDER 1234 + #else + #error unable to determine BYTEORDER + #endif #endif /* Convenient macros for wrapping sections in 'extern "C" {' constructs.