File: Build

package info (click to toggle)
dtrace 2.0.5-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 24,408 kB
  • sloc: ansic: 61,247; sh: 17,997; asm: 1,717; lex: 947; awk: 754; yacc: 695; perl: 37; sed: 17; makefile: 15
file content (80 lines) | stat: -rw-r--r-- 3,291 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Oracle Linux DTrace.
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.

# Temporarily suppress dtprobed builds before configury is done: we don't know
# which fuse is safe to even look up with pkg-config without ugly messages.
ifdef CONFIGURED
CMDS += dtprobed

# Support FUSE 2 as well as FUSE 3: use if explicitly requested or if
# FUSE 3 is not found.
ifdef WANTS_LIBFUSE2
LIBFUSE := fuse
else
ifndef HAVE_LIBFUSE3
LIBFUSE := fuse
else
LIBFUSE := fuse3
endif
endif

dtprobed_DIR := $(current-dir)
dtprobed_TARGET = dtprobed
dtprobed_CPPFLAGS := -I. -Idtprobed -Ilibproc -Ilibcommon -Ilibport
dtprobed_CFLAGS := $(shell pkg-config --cflags $(LIBFUSE))
dtprobed_LIBS := -lcommon -lproc -lcommon -lport -lelf $(shell pkg-config --libs $(LIBFUSE))
dtprobed_DEPS := libproc.a libcommon.a libport.a
dtprobed_SOURCES := dtprobed.c dof_stash.c seccomp-assistance.c
dtprobed_LIBSOURCES := libproc libcommon

ifndef HAVE_FUSE_LOG
dtprobed_SOURCES += rpl_fuse_log.c
endif

dtprobed.c_CFLAGS := -Wno-pedantic
seccomp-assistance.c_CFLAGS := -fno-lto
endif

install-dtprobed-autostart::
ifneq ($(WITH_SYSTEMD),)
	mkdir -p $(INSTSYSTEMDUNITDIR) $(INSTSYSTEMDPRESETDIR)
	$(call describe-install-target,$(INSTSYSTEMDUNITDIR),dtprobed.service)
	sed 's,@SBINDIR@,$(SBINDIR),' < $(dtprobed_DIR)dtprobed.service.in > $(objdir)/dtprobed.service
	install -m 644 $(objdir)/dtprobed.service $(INSTSYSTEMDUNITDIR)
	$(call describe-install-target,$(INSTSYSTEMDUNITDIR),dtrace-usdt.target)
	install -m 644 $(dtprobed_DIR)dtrace-usdt.target $(INSTSYSTEMDUNITDIR)
	$(call describe-install-target,$(INSTSYSTEMDPRESETDIR),50-dtprobed.preset)
	install -m 644 $(dtprobed_DIR)50-dtprobed.preset $(INSTSYSTEMDPRESETDIR)
	if [[ -z $RPM_BUILD_ROOT ]]; then \
		systemctl enable dtprobed.service dtrace-usdt.target; \
	fi
endif

install::
	mkdir -p $(INSTSBINDIR)
	$(call describe-install-target,$(INSTSBINDIR),dtprobed)
	install -m 755 $(objdir)/dtprobed $(INSTSBINDIR)
	mkdir -p $(INSTMANDIR)/man8
	$(call describe-install-target,$(INSTMANDIR),dtprobed.8)
	install -m 644 $(dtprobed_DIR)/dtprobed.8 $(INSTMANDIR)/man8
	mkdir -p $(INSTUDEVDIR)
	$(call describe-install-target,$(INSTUDEVDIR),60-dtprobed.rules)
	install -m 644 $(dtprobed_DIR)60-dtprobed.rules $(INSTUDEVDIR)
	if [[ "$(SYSTEMDUNITDIR)" = /usr/lib/systemd/system ]] || \
	   [[ "$(SYSTEMDUNITDIR)" = /usr/local/lib/systemd/system ]] || \
	   [[ -n "$(filter SYSTEMDUNITDIR,$(CONFIGURED_VARS))" ]] ; then \
		$(MAKE) install-dtprobed-autostart; \
	else \
		echo " === WARNING WARNING WARNING === " >&2; \
		echo "systemd service files for dtprobed not installed." >&2; \
		echo "USDT probes (and the testsuite) will not work unless this is" >&2; \
		echo "done.  Try make install-dtprobed-autostart, but this may not" >&2; \
		echo "be enough: you may need to manually move the systemd service" >&2; \
		echo "files somewhere udev and systemd will find them." >&2; \
		echo "If there is already a running dtprobed, it may or may not work" >&2; \
		echo "in conjunction with this DTrace." >&2; \
		echo "Configure with --systemd-unit-dir to override this decision." >&2; \
		echo " === WARNING WARNING WARNING === " >&2; \
	fi