[sysprof] build: fix build on macOS
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] build: fix build on macOS
- Date: Tue, 4 Jun 2019 21:36:10 +0000 (UTC)
commit 807bff91529de197337c69b4a4adec18bc519709
Author: Christian Hergert <chergert redhat com>
Date: Tue Jun 4 14:35:48 2019 -0700
build: fix build on macOS
src/libsysprof-ui/sysprof-cpu-aid.c | 2 ++
src/libsysprof-ui/sysprof-memory-aid.c | 2 ++
src/libsysprof-ui/sysprof-recording-state-view.c | 1 -
src/libsysprof/binfile.c | 2 ++
src/libsysprof/meson.build | 2 +-
src/libsysprof/sysprof-backport-autocleanups.h | 12 +++++++-----
src/libsysprof/sysprof-capture-symbol-resolver.c | 1 -
src/libsysprof/sysprof-helpers.c | 2 --
src/libsysprof/sysprof-local-profiler.c | 2 +-
9 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/src/libsysprof-ui/sysprof-cpu-aid.c b/src/libsysprof-ui/sysprof-cpu-aid.c
index 2639bcd..22cd05e 100644
--- a/src/libsysprof-ui/sysprof-cpu-aid.c
+++ b/src/libsysprof-ui/sysprof-cpu-aid.c
@@ -52,6 +52,7 @@ static void
sysprof_cpu_aid_prepare (SysprofAid *self,
SysprofProfiler *profiler)
{
+#ifdef __linux__
g_autoptr(SysprofSource) source = NULL;
g_assert (SYSPROF_IS_CPU_AID (self));
@@ -59,6 +60,7 @@ sysprof_cpu_aid_prepare (SysprofAid *self,
source = sysprof_hostinfo_source_new ();
sysprof_profiler_add_source (profiler, source);
+#endif
}
static void
diff --git a/src/libsysprof-ui/sysprof-memory-aid.c b/src/libsysprof-ui/sysprof-memory-aid.c
index 9c97ae0..7280dc3 100644
--- a/src/libsysprof-ui/sysprof-memory-aid.c
+++ b/src/libsysprof-ui/sysprof-memory-aid.c
@@ -52,6 +52,7 @@ static void
sysprof_memory_aid_prepare (SysprofAid *self,
SysprofProfiler *profiler)
{
+#ifdef __linux__
g_autoptr(SysprofSource) source = NULL;
g_assert (SYSPROF_IS_MEMORY_AID (self));
@@ -59,6 +60,7 @@ sysprof_memory_aid_prepare (SysprofAid *self,
source = sysprof_memory_source_new ();
sysprof_profiler_add_source (profiler, source);
+#endif
}
static void
diff --git a/src/libsysprof-ui/sysprof-recording-state-view.c
b/src/libsysprof-ui/sysprof-recording-state-view.c
index a5eb8c9..dafecf1 100644
--- a/src/libsysprof-ui/sysprof-recording-state-view.c
+++ b/src/libsysprof-ui/sysprof-recording-state-view.c
@@ -53,7 +53,6 @@ sysprof_recording_state_view_notify_elapsed (SysprofRecordingStateView *self,
SysprofProfiler *profiler)
{
SysprofRecordingStateViewPrivate *priv = sysprof_recording_state_view_get_instance_private (self);
- g_autofree gchar *str = NULL;
SysprofCaptureWriter *writer;
gint64 elapsed;
diff --git a/src/libsysprof/binfile.c b/src/libsysprof/binfile.c
index 80fd4fa..81f3e49 100644
--- a/src/libsysprof/binfile.c
+++ b/src/libsysprof/binfile.c
@@ -272,6 +272,7 @@ get_lines (const char *format,
...)
G_GNUC_PRINTF (1, 2);
+#ifdef __linux__
static char **
get_lines (const char *format,
...)
@@ -296,6 +297,7 @@ get_lines (const char *format,
return result;
}
+#endif
static const uint8_t *
get_vdso_bytes (size_t *length)
diff --git a/src/libsysprof/meson.build b/src/libsysprof/meson.build
index 56f5186..32f4552 100644
--- a/src/libsysprof/meson.build
+++ b/src/libsysprof/meson.build
@@ -92,7 +92,7 @@ endif
if host_machine.system() == 'darwin'
libsysprof_deps += [ dependency('libelf') ]
- libsysprof_c_args = [ '-DNT_GNU_BUILD_ID=3', '-DELF_NOTE_GNU="GNU"', '-D__LIBELF_INTERNAL__' ]
+ libsysprof_c_args += [ '-DNT_GNU_BUILD_ID=3', '-DELF_NOTE_GNU="GNU"', '-D__LIBELF_INTERNAL__' ]
endif
if host_machine.system() != 'darwin'
diff --git a/src/libsysprof/sysprof-backport-autocleanups.h b/src/libsysprof/sysprof-backport-autocleanups.h
index bba89ca..7b24024 100644
--- a/src/libsysprof/sysprof-backport-autocleanups.h
+++ b/src/libsysprof/sysprof-backport-autocleanups.h
@@ -4,12 +4,14 @@
#include <glib.h>
-#ifndef HAVE_POLKIT_AUTOPTR
-# include <polkit/polkit.h>
+#ifdef HAVE_POLKIT
+# ifndef HAVE_POLKIT_AUTOPTR
+# include <polkit/polkit.h>
- G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthority, g_object_unref)
- G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthorizationResult, g_object_unref)
- G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitSubject, g_object_unref)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthority, g_object_unref)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthorizationResult, g_object_unref)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitSubject, g_object_unref)
+# endif
#endif
#if !GLIB_CHECK_VERSION(2, 56, 0)
diff --git a/src/libsysprof/sysprof-capture-symbol-resolver.c
b/src/libsysprof/sysprof-capture-symbol-resolver.c
index 36ec335..8986c6b 100644
--- a/src/libsysprof/sysprof-capture-symbol-resolver.c
+++ b/src/libsysprof/sysprof-capture-symbol-resolver.c
@@ -90,7 +90,6 @@ sysprof_capture_symbol_resolver_load (SysprofSymbolResolver *resolver,
SysprofCaptureReader *reader)
{
SysprofCaptureSymbolResolver *self = (SysprofCaptureSymbolResolver *)resolver;
- g_autoptr(GError) error = NULL;
gint byte_order;
gint fd;
diff --git a/src/libsysprof/sysprof-helpers.c b/src/libsysprof/sysprof-helpers.c
index 3a371af..a98245b 100644
--- a/src/libsysprof/sysprof-helpers.c
+++ b/src/libsysprof/sysprof-helpers.c
@@ -23,7 +23,6 @@
#include "config.h"
#include <gio/gunixfdlist.h>
-#include <polkit/polkit.h>
#include "sysprof-helpers.h"
#include "sysprof-polkit-private.h"
@@ -549,7 +548,6 @@ sysprof_helpers_authorize_async (SysprofHelpers *self,
gpointer user_data)
{
g_autoptr(GTask) task = NULL;
- g_autoptr(PolkitSubject) subject = NULL;
GDBusConnection *bus;
g_return_if_fail (SYSPROF_IS_HELPERS (self));
diff --git a/src/libsysprof/sysprof-local-profiler.c b/src/libsysprof/sysprof-local-profiler.c
index c278634..8ffe5f7 100644
--- a/src/libsysprof/sysprof-local-profiler.c
+++ b/src/libsysprof/sysprof-local-profiler.c
@@ -407,9 +407,9 @@ sysprof_local_profiler_class_init (SysprofLocalProfilerClass *klass)
g_object_class_override_property (object_class, PROP_WHOLE_SYSTEM, "whole-system");
g_type_ensure (SYSPROF_TYPE_GJS_SOURCE);
+#ifdef __linux__
g_type_ensure (SYSPROF_TYPE_HOSTINFO_SOURCE);
g_type_ensure (SYSPROF_TYPE_PROC_SOURCE);
-#ifdef __linux__
g_type_ensure (SYSPROF_TYPE_PERF_SOURCE);
#endif
g_type_ensure (SYSPROF_TYPE_PROXY_SOURCE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]