meson/configure: detect endian.h instead of trying to guess when it's available
authorEric Engestrom <eric.engestrom@imgtec.com>
Wed, 21 Mar 2018 17:04:06 +0000 (17:04 +0000)
committerEric Engestrom <eric.engestrom@imgtec.com>
Fri, 23 Mar 2018 11:44:21 +0000 (11:44 +0000)
Cc: Maxin B. John <maxin.john@gmail.com>
Cc: Khem Raj <raj.khem@gmail.com>
Cc: Rob Herring <robh@kernel.org>
Suggested-by: Jon Turney <jon.turney@dronecode.org.uk>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Cc: <mesa-stable@lists.freedesktop.org>
Android.common.mk
configure.ac
meson.build
scons/gallium.py
src/util/u_endian.h

index 52dc7bff3be5af1f97b673ad3f7308660d1d96ba..e8aed48c31ab1704cbcf6db216669c18639c409f 100644 (file)
@@ -70,6 +70,7 @@ LOCAL_CFLAGS += \
        -DHAVE_DLADDR \
        -DHAVE_DL_ITERATE_PHDR \
        -DHAVE_LINUX_FUTEX_H \
+       -DHAVE_ENDIAN_H \
        -DHAVE_ZLIB \
        -DMAJOR_IN_SYSMACROS \
        -fvisibility=hidden \
index 29d3c3457a7cdaefc36aed4a8b4793e1699facd7..36c56da787e4fab5a355b8954d72b3dee4f84366 100644 (file)
@@ -865,6 +865,7 @@ fi
 AC_HEADER_MAJOR
 AC_CHECK_HEADER([xlocale.h], [DEFINES="$DEFINES -DHAVE_XLOCALE_H"])
 AC_CHECK_HEADER([sys/sysctl.h], [DEFINES="$DEFINES -DHAVE_SYS_SYSCTL_H"])
+AC_CHECK_HEADER([endian.h], [DEFINES="$DEFINES -DHAVE_ENDIAN_H"])
 AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
 AC_CHECK_FUNC([mkostemp], [DEFINES="$DEFINES -DHAVE_MKOSTEMP"])
 AC_CHECK_FUNC([timespec_get], [DEFINES="$DEFINES -DHAVE_TIMESPEC_GET"])
index 871b0d8d22f5ca4ae3ccb7af10a504de86495eaf..041d2bfc70d47abdf990cf1486b83686ebe34175 100644 (file)
@@ -916,7 +916,7 @@ elif cc.has_header_symbol('sys/mkdev.h', 'major')
   pre_args += '-DMAJOR_IN_MKDEV'
 endif
 
-foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h']
+foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h']
   if cc.compiles('#include <@0@>'.format(h), name : '@0@ works'.format(h))
     pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
   endif
index 75200b89c1fe6d7519807ed0bc38e9118e00131e..6cb20efcbf4b8c997f6020f2cb0d6650d288bcd5 100755 (executable)
@@ -354,6 +354,9 @@ def generate(env):
         if check_header(env, 'xlocale.h'):
             cppdefines += ['HAVE_XLOCALE_H']
 
+        if check_header(env, 'endian.h'):
+            cppdefines += ['HAVE_ENDIAN_H']
+
         if check_functions(env, ['strtod_l', 'strtof_l']):
             cppdefines += ['HAVE_STRTOD_L']
 
index 22d011ec0086ee77e11cdaa7c3249f16a86d348f..e11b381588dbc960e8c36600086f26931f43c68a 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef U_ENDIAN_H
 #define U_ENDIAN_H
 
-#if defined(__GLIBC__) || defined(ANDROID) || defined(__CYGWIN__)
+#ifdef HAVE_ENDIAN_H
 #include <endian.h>
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN