From 8078ecc60affdb110bf5b9c83bf51fea2985ed10 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 19 Jul 2023 12:13:27 -0700 Subject: [PATCH] build: fix some various build options --- meson.build | 14 ++++---------- src/libsysprof-profile/meson.build | 7 +++++-- src/libsysprof-profile/sysprof-instrument.c | 7 ++++++- src/libsysprof-profile/sysprof-recording.c | 1 - src/sysprofd/meson.build | 3 ++- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/meson.build b/meson.build index cc1eed01..03ca9055 100644 --- a/meson.build +++ b/meson.build @@ -37,14 +37,14 @@ podir = join_paths(meson.current_source_dir(), 'po') need_gtk = get_option('gtk') need_glib = (need_gtk or get_option('examples') or - get_option('libsysprof') or get_option('sysprofd') != 'none' or - get_option('agent')) + get_option('agent') or + get_option('tests')) # Determine what libraries to build need_libsysprof_capture = true -need_libsysprof_profile = get_option('libsysprof') or get_option('agent') -need_libsysprof_analyze = get_option('libsysprof') or get_option('agent') +need_libsysprof_profile = get_option('gtk') or get_option('agent') +need_libsysprof_analyze = get_option('gtk') or get_option('agent') dex_req = '0.3' glib_req = '2.76.0' @@ -92,12 +92,6 @@ if get_option('default_library') != 'static' endif endif -debugdir = get_option('debugdir') -if debugdir == '' - debugdir = join_paths(get_option('prefix'), get_option('libdir'), 'debug') -endif -config_h.set_quoted('DEBUGDIR', debugdir) - config_h.set('HAVE_EXECINFO_H', cc.has_header('execinfo.h')) config_h.set('HAVE_REALLOCARRAY', cc.has_function('reallocarray')) config_h.set('HAVE_STRLCPY', cc.has_function('strlcpy')) diff --git a/src/libsysprof-profile/meson.build b/src/libsysprof-profile/meson.build index 4b4bfc15..9fad9874 100644 --- a/src/libsysprof-profile/meson.build +++ b/src/libsysprof-profile/meson.build @@ -26,9 +26,12 @@ libsysprof_profile_private_sources = [ 'sysprof-perf-event-stream.c', 'sysprof-journald-source.c', 'sysprof-podman.c', - 'sysprof-polkit.c', ] +if polkit_dep.found() + libsysprof_profile_private_sources += ['sysprof-polkit.c'] +endif + libsysprof_profile_public_headers = [ 'sysprof-profile.h', @@ -65,8 +68,8 @@ libsysprof_profile_deps = [ required: host_machine.system() != 'windows'), dependency('json-glib-1.0'), dependency('libdex-1', version: dex_req_version), - dependency('polkit-gobject-1', version: polkit_req_version), libsystemd_dep, + polkit_dep, liblinereader_static_dep, libsysprof_analyze_dep, diff --git a/src/libsysprof-profile/sysprof-instrument.c b/src/libsysprof-profile/sysprof-instrument.c index 9c0b33a1..e3254c90 100644 --- a/src/libsysprof-profile/sysprof-instrument.c +++ b/src/libsysprof-profile/sysprof-instrument.c @@ -21,7 +21,10 @@ #include "config.h" #include "sysprof-instrument-private.h" -#include "sysprof-polkit-private.h" + +#if HAVE_POLKIT +# include "sysprof-polkit-private.h" +#endif G_DEFINE_ABSTRACT_TYPE (SysprofInstrument, sysprof_instrument, G_TYPE_OBJECT) @@ -193,6 +196,7 @@ _sysprof_instruments_acquire_policy (GPtrArray *instruments, */ if ((required_policy = _sysprof_instruments_list_required_policy (instruments))) { +#if HAVE_POLKIT for (guint i = 0; required_policy[i]; i++) { if (!dex_await_boolean (_sysprof_polkit_authorize (connection, @@ -201,6 +205,7 @@ _sysprof_instruments_acquire_policy (GPtrArray *instruments, TRUE), &error)) return dex_future_new_for_error (g_steal_pointer (&error)); } +#endif } return dex_future_new_for_boolean (TRUE); diff --git a/src/libsysprof-profile/sysprof-recording.c b/src/libsysprof-profile/sysprof-recording.c index e9132935..e99a64d6 100644 --- a/src/libsysprof-profile/sysprof-recording.c +++ b/src/libsysprof-profile/sysprof-recording.c @@ -27,7 +27,6 @@ #include "sysprof-diagnostic-private.h" #include "sysprof-instrument-private.h" -#include "sysprof-polkit-private.h" #include "sysprof-recording-private.h" typedef enum _SysprofRecordingCommand diff --git a/src/sysprofd/meson.build b/src/sysprofd/meson.build index e921c57b..b46eae4e 100644 --- a/src/sysprofd/meson.build +++ b/src/sysprofd/meson.build @@ -26,7 +26,8 @@ sysprofd_deps = [ dependency('glib-2.0', version: glib_req_version), dependency('gio-2.0', version: glib_req_version), dependency('gio-unix-2.0', version: glib_req_version), - dependency('polkit-gobject-1', version: polkit_req_version), + polkit_dep, + libsysprof_capture_dep, ]