diff --git a/configure.ac b/configure.ac index cca7da7e4..903a8cbc0 100644 --- a/configure.ac +++ b/configure.ac @@ -279,6 +279,7 @@ AC_CHECK_HEADERS([\ dnl Functions. AC_CHECK_FUNCS([\ + be32toh \ fsync \ futimens \ getxattr \ diff --git a/src/inspect-apps.c b/src/inspect-apps.c index 135adf7df..747985eee 100644 --- a/src/inspect-apps.c +++ b/src/inspect-apps.c @@ -32,6 +32,18 @@ #include #endif +/* be32toh is usually a macro definend in , but it might be + * a function in some system so check both, and if neither is defined + * then define be32toh for RHEL 5. + */ +#if !defined(HAVE_BE32TOH) && !defined(be32toh) +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define be32toh(x) __bswap_32 (x) +#else +#define be32toh(x) (x) +#endif +#endif + #include #include "xstrtol.h"