Signed-off-by: Pavel Hrdina <phrd...@redhat.com> --- src/Makefile.am | 24 +----------------------- src/meson.build | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 23 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 4eed047926d..4c0ef6283a0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -400,24 +400,7 @@ libvirt_la_BUILT_LIBADD += libvirt_probes.lo libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o nodist_libvirt_la_SOURCES = libvirt_probes.h -tapsetdir = $(datadir)/systemtap/tapset -tapset_DATA += libvirt_probes.stp libvirt_functions.stp - -%_probes.h: %_probes.d - $(AM_V_GEN)$(DTRACE) -o $@ -h -s $< - -.PRECIOUS: %_probes.o -%_probes.o: %_probes.d - $(AM_V_GEN)$(DTRACE) -o $@ -G -s $< - -%_probes.lo: %_probes.o - $(AM_V_GEN)printf %s\\n \ - '# $@ - a libtool object file' \ - '# Generated by libtool (GNU libtool) 2.4' \ - '# Actually generated by Makefile.am, in order to shut up libtool' \ - "pic_object='$<'" \ - "non_pic_object='$<'" \ - > $@ +tapset_DATA += libvirt_functions.stp # Keep this list synced with PROTOCOL_STRUCTS RPC_PROBE_FILES += $(srcdir)/rpc/virnetprotocol.x \ @@ -431,11 +414,6 @@ libvirt_functions.stp: $(RPC_PROBE_FILES) $(top_srcdir)/scripts/gensystemtap.py $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/gensystemtap.py \ $(RPC_PROBE_FILES) > $@ -%_probes.stp: %_probes.d $(top_srcdir)/scripts/dtrace2systemtap.py \ - $(top_builddir)/config.status - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/dtrace2systemtap.py \ - $(bindir) $(sbindir) $(libdir) $< > $@ - endif WITH_DTRACE_PROBES libvirt_qemu_la_SOURCES = libvirt-qemu.c diff --git a/src/meson.build b/src/meson.build index 453691dc902..9796d344b4a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -28,3 +28,42 @@ endif if conf.has('WITH_SECDRIVER_APPARMOR') secdriver_dep += apparmor_dep endif + + +# generate systemtap files + +systemtap_dir = datadir / 'systemtap' / 'tapset' + +dtrace_gen_headers = [] +dtrace_gen_objects = [] + +if conf.has('WITH_DTRACE_PROBES') + infile = 'libvirt_probes.d' + out_h = 'libvirt_probes.h' + out_o = 'libvirt_probes.o' + out_stp = 'libvirt_probes.stp' + + dtrace_gen_headers += custom_target( + out_h, + input: infile, + output: out_h, + command: [ dtrace_prog, '-o', '@OUTPUT@', '-h', '-s', '@INPUT@' ], + ) + + dtrace_gen_objects += custom_target( + out_o, + input: infile, + output: out_o, + command: [ dtrace_prog, '-o', '@OUTPUT@', '-G', '-s', '@INPUT@' ], + ) + + custom_target( + out_stp, + input: infile, + output: out_stp, + command: [ meson_python_prog, dtrace2systemtap_prog, bindir, sbindir, libdir, '@INPUT@' ], + capture: true, + install: true, + install_dir: systemtap_dir, + ) +endif -- 2.26.2