[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v9 6/9] meson.build: add HAVE_GLIB_WITH_ALIGNED_ALLOC flag
From: |
Manos Pitsidianakis |
Subject: |
[PATCH v9 6/9] meson.build: add HAVE_GLIB_WITH_ALIGNED_ALLOC flag |
Date: |
Tue, 27 Aug 2024 14:23:15 +0300 |
Rust crates, introduced from the next commit onwards, use the glib
allocator API and need to know whether g_aligned_alloc etc are
available.
This commit adds a define in config_host_data that depends on glib
version >= 2.72.
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
---
meson.build | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/meson.build b/meson.build
index 05446acbc6..7f05466d12 100644
--- a/meson.build
+++ b/meson.build
@@ -979,6 +979,9 @@ glib = declare_dependency(dependencies: [glib_pc, gmodule],
# TODO: remove this check and the corresponding workaround (qtree) when
# the minimum supported glib is >= 2.75.3
glib_has_gslice = glib.version().version_compare('<2.75.3')
+# Check whether glib has the aligned_alloc family of functions.
+# <https://docs.gtk.org/glib/func.aligned_alloc.html>
+glib_has_aligned_alloc = glib.version().version_compare('>=2.72.0')
# override glib dep to include the above refinements
meson.override_dependency('glib-2.0', glib)
@@ -2508,6 +2511,7 @@ config_host_data.set('CONFIG_TIMERFD',
cc.has_function('timerfd_create'))
config_host_data.set('HAVE_COPY_FILE_RANGE',
cc.has_function('copy_file_range'))
config_host_data.set('HAVE_GETIFADDRS', cc.has_function('getifaddrs'))
config_host_data.set('HAVE_GLIB_WITH_SLICE_ALLOCATOR', glib_has_gslice)
+config_host_data.set('HAVE_GLIB_WITH_ALIGNED_ALLOC', glib_has_aligned_alloc)
config_host_data.set('HAVE_OPENPTY', cc.has_function('openpty', dependencies:
util))
config_host_data.set('HAVE_STRCHRNUL', cc.has_function('strchrnul'))
config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix:
'#include <stdlib.h>'))
--
2.45.2
- [PATCH v9 0/9] Add Rust build support, ARM PL011 device impl, Manos Pitsidianakis, 2024/08/27
- [PATCH v9 1/9] Require meson version 1.5.0, Manos Pitsidianakis, 2024/08/27
- [PATCH v9 2/9] build-sys: Add rust feature option, Manos Pitsidianakis, 2024/08/27
- [PATCH v9 3/9] configure, meson: detect Rust toolchain, Manos Pitsidianakis, 2024/08/27
- [PATCH v9 4/9] rust: add bindgen step as a meson dependency, Manos Pitsidianakis, 2024/08/27
- [PATCH v9 6/9] meson.build: add HAVE_GLIB_WITH_ALIGNED_ALLOC flag,
Manos Pitsidianakis <=
- [PATCH v9 5/9] .gitattributes: add Rust diff and merge attributes, Manos Pitsidianakis, 2024/08/27
- [PATCH v9 7/9] rust: add crate to expose bindings and interfaces, Manos Pitsidianakis, 2024/08/27
- [PATCH v9 8/9] rust: add utility procedural macro crate, Manos Pitsidianakis, 2024/08/27
- [PATCH v9 9/9] rust: add PL011 device model, Manos Pitsidianakis, 2024/08/27