--- configure.ac.orig 2009-08-27 17:37:12.000000000 +0200 +++ configure.ac 2009-09-29 20:32:39.000000000 +0200 @@ -476,7 +476,7 @@ AC_CHECK_HEADERS([fcntl.h limits.h sys/t [AC_MSG_ERROR([Required header file(s) are missing.])]) # If any of these headers are missing, things should still work correctly: -AC_CHECK_HEADERS([sys/param.h sys/sysctl.h byteswap.h], +AC_CHECK_HEADERS([sys/param.h sys/sysctl.h byteswap.h sys/endian.h], [], [], [ #ifdef HAVE_SYS_PARAM_H # include @@ -504,6 +504,25 @@ main(void) ])dnl fi +if test x$ac_cv_header_sys_endian_h = xyes ; then + m4_foreach([FUNC], [bswap16,bswap32,bswap64], [ + AC_MSG_CHECKING([if FUNC is available]) + AC_LINK_IFELSE([AC_LANG_SOURCE([ +#include +int +main(void) +{ + FUNC[](42); + return 0; +} + ])], [ + AC_DEFINE(HAVE_[]m4_toupper(FUNC), [1], + [Define to 1 if] FUNC [is available.]) + AC_MSG_RESULT([yes]) + ], [AC_MSG_RESULT([no])]) + + ])dnl +fi ############################################################################### # Checks for typedefs, structures, and compiler characteristics.