summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-09-20 19:14:40 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-09-20 19:14:40 +0000
commit90c1f3c1580d8e699c2788262a614a930a33e13e (patch)
tree09968cd3f44ade6baeb2a31617942b3eaaf49118 /configure
parent6011d413604df8224b91ca9f9b3d50663b60e117 (diff)
downloadskalibs-90c1f3c1580d8e699c2788262a614a930a33e13e.tar.xz
Better endianness test, because BSD
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure17
1 files changed, 16 insertions, 1 deletions
diff --git a/configure b/configure
index a8ee590..7a5e371 100755
--- 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