skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

commit 90c1f3c1580d8e699c2788262a614a930a33e13e
parent 6011d413604df8224b91ca9f9b3d50663b60e117
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date:   Fri, 20 Sep 2019 19:14:40 +0000

 Better endianness test, because BSD

Diffstat:
Mconfigure | 17++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/configure b/configure @@ -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