]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: src: build dtrace files
authorPavel Hrdina <phrdina@redhat.com>
Mon, 27 Jul 2020 06:16:48 +0000 (08:16 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:04 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
src/Makefile.am
src/meson.build

index 8b679f610b93617f6506b848cd16ab6975d93347..c71124cf1994b9dc5649f8c2e4f021670f86bb0f 100644 (file)
@@ -405,27 +405,9 @@ libvirt_la_BUILT_LIBADD += libvirt_probes.lo
 libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
 nodist_libvirt_la_SOURCES = libvirt_probes.h
 
-BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp
+BUILT_SOURCES += libvirt_functions.stp
 
-
-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 \
@@ -439,11 +421,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
index 83e22d5d43bba0645b1f7c9e12028b0f6a3b1217..bc90ea31a06e4e78594e3f4b1fc1839e06e554aa 100644 (file)
@@ -34,3 +34,45 @@ 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, python3_prog.path(), dtrace2systemtap_prog.path(),
+      bindir, sbindir, libdir, '@INPUT@'
+    ],
+    capture: true,
+    install: true,
+    install_dir: systemtap_dir,
+  )
+endif