build: add check for asm/perf_regs.h

Related: #127
This commit is contained in:
Christian Hergert
2025-03-17 18:28:19 -07:00
parent 5dac046f2f
commit 745c5c28c4
3 changed files with 9 additions and 1 deletions

View File

@ -20,6 +20,8 @@
#mesondefine HAVE_PERF_CLOCKID
#mesondefine HAVE_PERF_REGS_H
#mesondefine HAVE_POLKIT
#mesondefine HAVE_POLKIT_AGENT

View File

@ -109,6 +109,10 @@ config_h.set10('HAVE_POLKIT_AGENT', polkit_agent_dep.found())
polkit_dep = dependency('polkit-gobject-1', version: polkit_req_version, required: false)
config_h.set10('HAVE_POLKIT', polkit_dep.found())
if cc.has_header('asm/perf_regs.h')
config_h.set10('HAVE_PERF_REGS_H', true)
endif
if need_libsysprof
libunwind_dep = dependency('libunwind-generic', required: true)
config_h.set('ENABLE_LIBUNWIND', libunwind_dep.found())

View File

@ -25,7 +25,9 @@
#include <sys/ioctl.h>
#include <sys/eventfd.h>
#include <asm/perf_regs.h>
#ifdef HAVE_PERF_REGS_H
# include <asm/perf_regs.h>
#endif
#include <glib/gstdio.h>