summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2019-08-27 15:54:42 -0400
committerAdam Jackson <ajax@redhat.com>2019-08-27 17:38:59 -0400
commit7d0e660e0e2808e098ab9d4de843e9b31c64af21 (patch)
tree58929e75456b962b36f89f1db69b5f5b75ea4126
parente0e051a3920e3e2731d35807e00d30ba9ef7f122 (diff)
meson: Add dtrace support
-rw-r--r--dix/meson.build14
-rw-r--r--include/meson.build13
-rw-r--r--meson.build5
-rw-r--r--meson_options.txt3
-rw-r--r--os/meson.build1
5 files changed, 34 insertions, 2 deletions
diff --git a/dix/meson.build b/dix/meson.build
index 0ed4f8210..ddc5cc392 100644
--- a/dix/meson.build
+++ b/dix/meson.build
@@ -33,10 +33,22 @@ srcs_dix = [
'window.c',
]
+dtrace_src = []
+if with_dtrace
+ dtrace_object = generator(dtrace,
+ output: '@BASENAME@.o',
+ arguments: ['-G', '-s', '@INPUT@', '-o', '@OUTPUT@']
+ )
+
+ dtrace_src += dtrace_object.process(dtrace_tmpl)
+endif
+
+dtrace_dep = declare_dependency(sources: [dtrace_src, dtrace_hdr])
+
libxserver_dix = static_library('libxserver_dix',
srcs_dix,
include_directories: inc,
- dependencies: common_dep,
+ dependencies: [ dtrace_dep, common_dep, ]
)
libxserver_main = static_library('libxserver_main',
diff --git a/include/meson.build b/include/meson.build
index 3c72e5bbb..bb89493e1 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -31,7 +31,7 @@ cc.compiles('''
''',
name: 'CLOCK_MONOTONIC'))
-#conf_data.set('XSERVER_DTRACE', '1') # XXX
+conf_data.set('XSERVER_DTRACE', with_dtrace)
if host_machine.endian() == 'little'
conf_data.set('X_BYTE_ORDER', 'X_LITTLE_ENDIAN')
@@ -402,6 +402,17 @@ configure_file(output : 'xwayland-config.h',
input : 'xwayland-config.h.meson.in',
configuration : xwayland_data)
+dtrace_hdr = []
+dtrace_tmpl = files('Xserver.d')
+if with_dtrace
+ dtrace_header = generator(dtrace,
+ output: '@BASENAME@-dtrace.h',
+ arguments: ['-h', '-s', '@INPUT@', '-o', '@OUTPUT@']
+ )
+
+ dtrace_hdr += dtrace_header.process(dtrace_tmpl)
+endif
+
if build_xorg
install_data(
[
diff --git a/meson.build b/meson.build
index def32e9b9..00a7e3c86 100644
--- a/meson.build
+++ b/meson.build
@@ -175,6 +175,11 @@ else
build_systemd_logind = get_option('systemd_logind') == 'true'
endif
+with_dtrace = get_option('dtrace')
+if with_dtrace
+ dtrace = find_program('dtrace', required: true)
+endif
+
build_xorg = false
if (host_machine.system() != 'darwin' and
host_machine.system() != 'windows')
diff --git a/meson_options.txt b/meson_options.txt
index 7d3bbe535..94a782a92 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -50,6 +50,9 @@ option('vendor_name', type: 'string', value: 'The X.Org Foundation')
option('vendor_name_short', type: 'string', value: 'X.Org')
option('vendor_web', type: 'string', value: 'http://wiki.x.org')
+option('dtrace', type: 'boolean', value: false,
+ description: 'Enable dtrace hooks')
+
option('listen_tcp', type: 'boolean', value: false,
description: 'Listen on TCP by default')
option('listen_unix', type: 'boolean', value: true,
diff --git a/os/meson.build b/os/meson.build
index 39440a7c3..337306bcd 100644
--- a/os/meson.build
+++ b/os/meson.build
@@ -91,6 +91,7 @@ libxserver_os = static_library('libxserver_os',
srcs_os,
include_directories: inc,
dependencies: [
+ dtrace_dep,
common_dep,
dl_dep,
sha1_dep,