mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-11 15:40:53 +00:00
build: allow disabling the GTK interface with --disable-gtk
For some systems, such as embedded Linux including ARM, we might want to just compile libsysprof/sysprof-cli without the GTK user interface. This allows for that. You can copy the capture files to your visualization host to render the results.
This commit is contained in:
34
configure.ac
34
configure.ac
@ -82,20 +82,39 @@ VAPIGEN_CHECK
|
|||||||
dnl ***********************************************************************
|
dnl ***********************************************************************
|
||||||
dnl Check for required packages
|
dnl Check for required packages
|
||||||
dnl ***********************************************************************
|
dnl ***********************************************************************
|
||||||
PKG_CHECK_MODULES(SYSPROF, [gio-2.0 >= 2.44
|
m4_define([glib_required_version], [2.44.0])
|
||||||
gio-unix-2.0 >= 2.44
|
m4_define([gtk_required_version], [3.16.0])
|
||||||
|
m4_define([systemd_required_version], [222])
|
||||||
|
|
||||||
|
PKG_CHECK_MODULES(SYSPROF, [gio-2.0 >= glib_required_version
|
||||||
|
gio-unix-2.0 >= glib_required_version
|
||||||
polkit-gobject-1])
|
polkit-gobject-1])
|
||||||
PKG_CHECK_MODULES(SYSPROF_UI, [gio-2.0 >= 2.44
|
PKG_CHECK_MODULES(SYSPROF_UI, [gio-2.0 >= glib_required_version
|
||||||
gtk+-3.0 >= 3.16
|
gtk+-3.0 >= gtk_required_version
|
||||||
polkit-gobject-1])
|
polkit-gobject-1],
|
||||||
PKG_CHECK_MODULES(SYSTEMD, [libsystemd >= 222],
|
[have_uilibs=yes],
|
||||||
|
[have_uilibs=no])
|
||||||
|
PKG_CHECK_MODULES(SYSTEMD, [libsystemd >= systemd_required_version],
|
||||||
[have_systemd=yes],
|
[have_systemd=yes],
|
||||||
[have_systemd=no])
|
[have_systemd=no])
|
||||||
|
|
||||||
|
|
||||||
# we require systemd for sysprofd
|
# we require systemd for sysprofd
|
||||||
AM_CONDITIONAL(ENABLE_SYSPROFD, [test x$have_systemd = xyes])
|
AM_CONDITIONAL(ENABLE_SYSPROFD, [test x$have_systemd = xyes])
|
||||||
|
|
||||||
|
# we might be building sysprof-cli without the UI
|
||||||
|
AC_ARG_ENABLE([gtk],
|
||||||
|
[AS_HELP_STRING([--enable-gtk=@<:@yes/no/auto@:>@],
|
||||||
|
[Build GTK user interface.])],
|
||||||
|
[enable_gtk=$enableval],
|
||||||
|
[enable_gtk=auto])
|
||||||
|
AS_IF([test "$enable_gtk" != no],[
|
||||||
|
AS_IF([test "$enable_gtk" = "yes" && test "$have_uilibs" = "no"],[
|
||||||
|
AC_MSG_ERROR([--enable-gtk requires gtk+-3.0 >= gtk_required_version])
|
||||||
|
])
|
||||||
|
enable_gtk=$have_uilibs
|
||||||
|
])
|
||||||
|
AM_CONDITIONAL(ENABLE_GTK, test "$enable_gtk" = "yes")
|
||||||
|
|
||||||
|
|
||||||
# where to place systemd units if necessary
|
# where to place systemd units if necessary
|
||||||
AC_ARG_WITH([systemdsystemunitdir],
|
AC_ARG_WITH([systemdsystemunitdir],
|
||||||
@ -196,5 +215,6 @@ echo ""
|
|||||||
echo " Debug Directory ...................... : ${debugdir}"
|
echo " Debug Directory ...................... : ${debugdir}"
|
||||||
echo ""
|
echo ""
|
||||||
echo " Sysprofd ............................. : ${have_systemd}"
|
echo " Sysprofd ............................. : ${have_systemd}"
|
||||||
|
echo " Sysprof GTK Interface ............... : ${enable_gtk}"
|
||||||
echo " Systemd System Units ................. : ${with_systemdsystemunitdir}"
|
echo " Systemd System Units ................. : ${with_systemdsystemunitdir}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
@ -116,6 +116,8 @@ libsysprof_@API_VERSION@_la_LDFLAGS = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
|
||||||
|
if ENABLE_GTK
|
||||||
|
|
||||||
# This is our GTK library containing the widgets suitable for viewing
|
# This is our GTK library containing the widgets suitable for viewing
|
||||||
# and manipulating the various profiler API in libsysprof. This is
|
# and manipulating the various profiler API in libsysprof. This is
|
||||||
# meant to be used by IDEs and the sysprof gui.
|
# meant to be used by IDEs and the sysprof gui.
|
||||||
@ -181,5 +183,7 @@ glib_resources_h = sp-resources.h
|
|||||||
glib_resources_namespace = sp
|
glib_resources_namespace = sp
|
||||||
include $(top_srcdir)/gresources.mk
|
include $(top_srcdir)/gresources.mk
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
-include $(top_srcdir)/git.mk
|
-include $(top_srcdir)/git.mk
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
if ENABLE_GTK
|
||||||
|
|
||||||
bin_PROGRAMS = sysprof
|
bin_PROGRAMS = sysprof
|
||||||
|
|
||||||
sysprof_CFLAGS = \
|
sysprof_CFLAGS = \
|
||||||
@ -37,4 +39,6 @@ glib_resources_h = sp-resources.h
|
|||||||
glib_resources_namespace = sysprof
|
glib_resources_namespace = sysprof
|
||||||
include $(top_srcdir)/gresources.mk
|
include $(top_srcdir)/gresources.mk
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
-include $(top_srcdir)/git.mk
|
-include $(top_srcdir)/git.mk
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
TESTS =
|
TESTS =
|
||||||
|
TEST_PROGS =
|
||||||
|
|
||||||
test_cflags = \
|
test_cflags = \
|
||||||
$(SYSPROF_CFLAGS) \
|
$(SYSPROF_CFLAGS) \
|
||||||
@ -9,11 +10,18 @@ test_libs = \
|
|||||||
$(SYSPROF_LIBS) \
|
$(SYSPROF_LIBS) \
|
||||||
$(top_builddir)/lib/libsysprof-@API_VERSION@.la
|
$(top_builddir)/lib/libsysprof-@API_VERSION@.la
|
||||||
|
|
||||||
|
TESTS += test-capture
|
||||||
|
test_capture_SOURCES = test-capture.c
|
||||||
|
test_capture_CFLAGS = $(test_cflags)
|
||||||
|
test_capture_LDADD = $(test_libs)
|
||||||
|
|
||||||
|
|
||||||
|
if ENABLE_GTK
|
||||||
|
|
||||||
test_ui_cflags = \
|
test_ui_cflags = \
|
||||||
$(SYSPROF_UI_CFLAGS) \
|
$(SYSPROF_UI_CFLAGS) \
|
||||||
-I$(top_srcdir)/lib \
|
-I$(top_srcdir)/lib \
|
||||||
-I$(top_builddir)/lib
|
-I$(top_builddir)/lib
|
||||||
|
|
||||||
test_ui_libs = \
|
test_ui_libs = \
|
||||||
$(SYSPROF_UI_LIBS) \
|
$(SYSPROF_UI_LIBS) \
|
||||||
$(top_builddir)/lib/libsysprof-@API_VERSION@.la \
|
$(top_builddir)/lib/libsysprof-@API_VERSION@.la \
|
||||||
@ -21,14 +29,12 @@ test_ui_libs = \
|
|||||||
|
|
||||||
|
|
||||||
TESTS += test-model-filter
|
TESTS += test-model-filter
|
||||||
|
TEST_PROGS += test-model-filter
|
||||||
test_model_filter_SOURCES = test-model-filter.c
|
test_model_filter_SOURCES = test-model-filter.c
|
||||||
test_model_filter_CFLAGS = $(test_ui_cflags)
|
test_model_filter_CFLAGS = $(test_ui_cflags)
|
||||||
test_model_filter_LDADD = $(test_ui_libs)
|
test_model_filter_LDADD = $(test_ui_libs)
|
||||||
|
|
||||||
TESTS += test-capture
|
endif
|
||||||
test_capture_SOURCES = test-capture.c
|
|
||||||
test_capture_CFLAGS = $(test_cflags)
|
|
||||||
test_capture_LDADD = $(test_libs)
|
|
||||||
|
|
||||||
TEST_ENVIRONMENT = \
|
TEST_ENVIRONMENT = \
|
||||||
G_TEST_SRCDIR="$(abs_srcdir)" \
|
G_TEST_SRCDIR="$(abs_srcdir)" \
|
||||||
@ -38,7 +44,6 @@ TEST_ENVIRONMENT = \
|
|||||||
MALLOC_CHECK_=2 \
|
MALLOC_CHECK_=2 \
|
||||||
MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256))
|
MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256))
|
||||||
|
|
||||||
TEST_PROGS = test-model-filter
|
|
||||||
LOG_COMPILER = $(top_srcdir)/tap-test
|
LOG_COMPILER = $(top_srcdir)/tap-test
|
||||||
|
|
||||||
noinst_PROGRAMS = $(TESTS)
|
noinst_PROGRAMS = $(TESTS)
|
||||||
|
|||||||
Reference in New Issue
Block a user