From f46ea74586c8590b135c099083a818eae22ee308 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 14 Oct 2024 18:16:57 -0700 Subject: [PATCH] build: verify #include works before deciding to use it This check is necessary for Solaris & illumos, where 32-bit libelf is incompatible with large-file mode, which meson forces to be enabled, but 64-bit libelf works fine. Signed-off-by: Alan Coopersmith --- gio/meson.build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gio/meson.build b/gio/meson.build index 447ddd6b2..a56c210a0 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -969,6 +969,9 @@ else have_libelf = have_libelf and cc.has_function('elf_getshdrstrndx', dependencies : libelf) have_libelf = have_libelf and cc.has_function('elf_getshdrnum', dependencies : libelf) have_libelf = have_libelf and cc.has_header('libelf.h') + # This check is necessary for Solaris & illumos, where 32-bit libelf + # is incompatible with large-file mode, which meson forces to be enabled + have_libelf = have_libelf and cc.compiles('#include ', name: 'libelf.h') endif if have_libelf