diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2019-09-20 19:14:40 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2019-09-20 19:14:40 +0000 |
commit | 90c1f3c1580d8e699c2788262a614a930a33e13e (patch) | |
tree | 09968cd3f44ade6baeb2a31617942b3eaaf49118 | |
parent | 6011d413604df8224b91ca9f9b3d50663b60e117 (diff) | |
download | skalibs-90c1f3c1580d8e699c2788262a614a930a33e13e.tar.xz |
Better endianness test, because BSD
-rwxr-xr-x | configure | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -184,11 +184,24 @@ tryendianness () { if iscached endianness ; then return ; fi for i in endian.h sys/endian.h machine/endian.h ; do cat > "$tmpc" <<EOF +#undef _POSIX_C_SOURCE +#undef _XOPEN_SOURCE +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE +#endif #include <$i> int a = 1 ; EOF if trybasic "$tmpc" ; then cat > "$tmpc" <<EOF +#undef _POSIX_C_SOURCE +#undef _XOPEN_SOURCE #ifndef _BSD_SOURCE #define _BSD_SOURCE #endif @@ -203,10 +216,12 @@ int a = LITTLE_ENDIAN ; int b = BIG_ENDIAN ; int c = BYTE_ORDER ; EOF - trybasic "$tmpc" || exit 5 + trybasic "$tmpc" || continue for j in little big pdp ; do k=`echo $j | tr a-z A-Z` cat > "$tmpc" <<EOF +#undef _POSIX_C_SOURCE +#undef _XOPEN_SOURCE #ifndef _BSD_SOURCE #define _BSD_SOURCE #endif |