Browse Source

meson/configure: detect endian.h instead of trying to guess when it's available

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>
tags/18.1-branchpoint
Eric Engestrom 7 years ago
parent
commit
cbee1bfb34
5 changed files with 7 additions and 2 deletions
  1. 1
    0
      Android.common.mk
  2. 1
    0
      configure.ac
  3. 1
    1
      meson.build
  4. 3
    0
      scons/gallium.py
  5. 1
    1
      src/util/u_endian.h

+ 1
- 0
Android.common.mk View 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 \

+ 1
- 0
configure.ac View 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"])

+ 1
- 1
meson.build View 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

+ 3
- 0
scons/gallium.py View File

@@ -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']


+ 1
- 1
src/util/u_endian.h View 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

Loading…
Cancel
Save