build: look for and use sys/endian.h

Some OSes have sys/endian.h instead of glibc's endian.h.
This commit is contained in:
Pino Toscano
2014-10-16 10:42:05 +02:00
parent b7d2226926
commit c1ad89170d
5 changed files with 15 additions and 0 deletions

View File

@@ -288,6 +288,7 @@ AC_CHECK_HEADERS([\
attr/xattr.h \
byteswap.h \
endian.h \
sys/endian.h \
errno.h \
linux/fs.h \
linux/raid/md_u.h \

View File

@@ -22,7 +22,12 @@
#include <stdlib.h>
#include <inttypes.h>
#include <string.h>
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#endif
#ifdef HAVE_SYS_ENDIAN_H
#include <sys/endian.h>
#endif
#include "guestfs_protocol.h"
#include "daemon.h"

View File

@@ -31,6 +31,9 @@
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#endif
#ifdef HAVE_SYS_ENDIAN_H
#include <sys/endian.h>
#endif
/* be32toh is usually a macro definend in <endian.h>, but it might be
* a function in some system so check both, and if neither is defined

View File

@@ -32,6 +32,9 @@
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#endif
#ifdef HAVE_SYS_ENDIAN_H
#include <sys/endian.h>
#endif
#include <pcre.h>

View File

@@ -31,6 +31,9 @@
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#endif
#ifdef HAVE_SYS_ENDIAN_H
#include <sys/endian.h>
#endif
#include "full-read.h"