pipe: use meson's config.h to get PIPE_ARCH_<ENDIANESS>_ENDIAN

v2: - Add root build dir and src to include path (Gert)
    - fix gallium includes (Gert)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Rohan Garg <rohan.garg@collabora.com>
macos/master
Leo 5 years ago committed by Gert Wollny
parent c6f20d8e02
commit 5b87079d9d
  1. 2
      meson.build
  2. 53
      src/gallium/include/pipe/p_config.h
  3. 6
      src/gallium/meson.build

@ -224,7 +224,7 @@ pkg_config = configure_file(input : 'virglrenderer.pc.in',
install_data(pkg_config,
install_dir: get_option('libdir') + '/pkgconfig')
inc_configuration = include_directories('.')
inc_configuration = include_directories(['.', 'src'])
with_fuzzer = get_option('fuzzer')
with_tests = get_option('tests')

@ -47,6 +47,14 @@
#define P_CONFIG_H_
#include <limits.h>
/*
* This has PIPE_ARCH_<ENDIANESS>_ENDIAN defines acquired
* via meson and in the future might have other defines
* if they are found to be easier done on meson than in
* preprocessor macros
*/
#include "config.h"
/*
* Compiler
*/
@ -126,51 +134,6 @@
#define PIPE_ARCH_AARCH64
#endif
/*
* Endian detection.
*/
#ifdef __GLIBC__
#include <endian.h>
#if __BYTE_ORDER == __LITTLE_ENDIAN
# define PIPE_ARCH_LITTLE_ENDIAN
#elif __BYTE_ORDER == __BIG_ENDIAN
# define PIPE_ARCH_BIG_ENDIAN
#endif
#elif defined(__APPLE__)
#include <machine/endian.h>
#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
# define PIPE_ARCH_LITTLE_ENDIAN
#elif __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN
# define PIPE_ARCH_BIG_ENDIAN
#endif
#elif defined(__sun)
#include <sys/isa_defs.h>
#if defined(_LITTLE_ENDIAN)
# define PIPE_ARCH_LITTLE_ENDIAN
#elif defined(_BIG_ENDIAN)
# define PIPE_ARCH_BIG_ENDIAN
#endif
#else
#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ARM) || defined(PIPE_ARCH_AARCH64)
#define PIPE_ARCH_LITTLE_ENDIAN
#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390)
#define PIPE_ARCH_BIG_ENDIAN
#endif
#endif
#if !defined(PIPE_ARCH_LITTLE_ENDIAN) && !defined(PIPE_ARCH_BIG_ENDIAN)
#error Unknown Endianness
#endif
/*
* Auto-detect the operating system family.
*

@ -108,7 +108,7 @@ sources_libgallium = [
'auxiliary/os/os_misc.c',
]
inc_gallium = include_directories('include', 'auxiliary', 'auxiliary/util', )
inc_gallium = include_directories('include', 'auxiliary', 'auxiliary/util')
u_format_table_c = custom_target(
'u_format_table.c',
@ -123,11 +123,11 @@ libgallium = static_library(
'gallium',
[sources_libgallium, u_format_table_c],
include_directories : [
inc_gallium, include_directories('..')
inc_gallium, inc_configuration
],
)
gallium_dep = declare_dependency(
link_with: libgallium,
include_directories: inc_gallium
include_directories: [inc_gallium, inc_configuration]
)

Loading…
Cancel
Save