mirror of
https://github.com/X11Libre/xf86-video-amdgpu.git
synced 2026-03-24 01:24:31 +00:00
configure.ac: drop broken inclusion of <sys/endian.h>
It's breaking with Xservers SDK's functions and not needed at all, since the Xserver SDK already providing platform independent functions for this. (actually we only need bswap_32() anyways) Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
2aee7058c0
commit
e88756767f
50
configure.ac
50
configure.ac
@@ -147,56 +147,6 @@ CPPFLAGS="$SAVE_CPPFLAGS"
|
|||||||
# if <byteswap.h> is found, assume it's the correct version
|
# if <byteswap.h> is found, assume it's the correct version
|
||||||
AC_CHECK_HEADERS([byteswap.h])
|
AC_CHECK_HEADERS([byteswap.h])
|
||||||
|
|
||||||
# if <sys/endian.h> is found, have to check which version
|
|
||||||
AC_CHECK_HEADER([sys/endian.h], [HAVE_SYS_ENDIAN_H="yes"], [HAVE_SYS_ENDIAN_H="no"])
|
|
||||||
|
|
||||||
if test "x$HAVE_SYS_ENDIAN_H" = "xyes" ; then
|
|
||||||
AC_MSG_CHECKING([for __swap16 variant of <sys/endian.h> byteswapping macros])
|
|
||||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/endian.h>
|
|
||||||
], [
|
|
||||||
int a = 1, b;
|
|
||||||
b = __swap16(a);
|
|
||||||
])
|
|
||||||
], [SYS_ENDIAN__SWAP='yes'], [SYS_ENDIAN__SWAP='no'])
|
|
||||||
AC_MSG_RESULT([$SYS_ENDIAN__SWAP])
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([for bswap16 variant of <sys/endian.h> byteswapping macros])
|
|
||||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/endian.h>
|
|
||||||
], [
|
|
||||||
int a = 1, b;
|
|
||||||
b = bswap16(a);
|
|
||||||
])
|
|
||||||
], [SYS_ENDIAN_BSWAP='yes'], [SYS_ENDIAN_BSWAP='no'])
|
|
||||||
AC_MSG_RESULT([$SYS_ENDIAN_BSWAP])
|
|
||||||
|
|
||||||
if test "$SYS_ENDIAN_BSWAP" = "yes" ; then
|
|
||||||
USE_SYS_ENDIAN_H=yes
|
|
||||||
BSWAP=bswap
|
|
||||||
else
|
|
||||||
if test "$SYS_ENDIAN__SWAP" = "yes" ; then
|
|
||||||
USE_SYS_ENDIAN_H=yes
|
|
||||||
BSWAP=__swap
|
|
||||||
else
|
|
||||||
USE_SYS_ENDIAN_H=no
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$USE_SYS_ENDIAN_H" = "yes" ; then
|
|
||||||
AC_DEFINE([USE_SYS_ENDIAN_H], 1,
|
|
||||||
[Define to use byteswap macros from <sys/endian.h>])
|
|
||||||
AC_DEFINE_UNQUOTED([bswap_16], ${BSWAP}16,
|
|
||||||
[Define to 16-bit byteswap macro])
|
|
||||||
AC_DEFINE_UNQUOTED([bswap_32], ${BSWAP}32,
|
|
||||||
[Define to 32-bit byteswap macro])
|
|
||||||
AC_DEFINE_UNQUOTED([bswap_64], ${BSWAP}64,
|
|
||||||
[Define to 64-bit byteswap macro])
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_SUBST([moduledir])
|
AC_SUBST([moduledir])
|
||||||
|
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
|
|||||||
@@ -95,34 +95,12 @@ struct _SyncFence;
|
|||||||
#define MIN(a,b) ((a)>(b)?(b):(a))
|
#define MIN(a,b) ((a)>(b)?(b):(a))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_BYTESWAP_H
|
|
||||||
#include <byteswap.h>
|
|
||||||
#elif defined(USE_SYS_ENDIAN_H)
|
|
||||||
#include <sys/endian.h>
|
|
||||||
#else
|
|
||||||
#define bswap_16(value) \
|
|
||||||
((((value) & 0xff) << 8) | ((value) >> 8))
|
|
||||||
|
|
||||||
#define bswap_32(value) \
|
|
||||||
(((uint32_t)bswap_16((uint16_t)((value) & 0xffff)) << 16) | \
|
|
||||||
(uint32_t)bswap_16((uint16_t)((value) >> 16)))
|
|
||||||
|
|
||||||
#define bswap_64(value) \
|
|
||||||
(((uint64_t)bswap_32((uint32_t)((value) & 0xffffffff)) \
|
|
||||||
<< 32) | \
|
|
||||||
(uint64_t)bswap_32((uint32_t)((value) >> 32)))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if X_BYTE_ORDER == X_BIG_ENDIAN
|
#if X_BYTE_ORDER == X_BIG_ENDIAN
|
||||||
#define le32_to_cpu(x) bswap_32(x)
|
#include "misc.h"
|
||||||
#define le16_to_cpu(x) bswap_16(x)
|
/* these are defined in the Xserver SDK headers (misc.h) */
|
||||||
#define cpu_to_le32(x) bswap_32(x)
|
#define cpu_to_le32(x) bswap_32(x)
|
||||||
#define cpu_to_le16(x) bswap_16(x)
|
|
||||||
#else
|
#else
|
||||||
#define le32_to_cpu(x) (x)
|
|
||||||
#define le16_to_cpu(x) (x)
|
|
||||||
#define cpu_to_le32(x) (x)
|
#define cpu_to_le32(x) (x)
|
||||||
#define cpu_to_le16(x) (x)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Provide substitutes for gcc's __FUNCTION__ on other compilers */
|
/* Provide substitutes for gcc's __FUNCTION__ on other compilers */
|
||||||
|
|||||||
Reference in New Issue
Block a user