Makefile.inc.am 3.3 KB
Newer Older
1 2
# vim: filetype=automake

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
LOG_PROTOCOL_GENERATED = \
	logging/log_protocol.h \
	logging/log_protocol.c \
	$(NULL)

LOG_DAEMON_GENERATED = \
	logging/log_daemon_dispatch_stubs.h
	$(NULL)

DRIVER_SOURCES += \
	$(LOG_PROTOCOL_GENERATED) \
	logging/log_manager.c \
	logging/log_manager.h \
	$(NULL)

LOG_DAEMON_SOURCES = \
	logging/log_daemon.h \
	logging/log_daemon.c \
	logging/log_daemon_config.h \
	logging/log_daemon_config.c \
	logging/log_daemon_dispatch.c \
	logging/log_daemon_dispatch.h \
	logging/log_handler.c \
	logging/log_handler.h \
	$(NULL)

LOG_PROTOCOL = $(srcdir)/logging/log_protocol.x

EXTRA_DIST += \
	$(LOG_PROTOCOL) \
	$(LOG_PROTOCOL_GENERATED) \
	$(LOG_DAEMON_GENERATED) \
	$(LOG_DAEMON_SOURCES) \
        logging/virtlogd.aug \
        logging/virtlogd.conf \
        logging/test_virtlogd.aug.in \
	$(NULL)
BUILT_SOURCES += \
	$(LOG_PROTOCOL_GENERATED) \
	$(LOG_DAEMON_GENERATED) \
	$(NULL)
MAINTAINERCLEANFILES += \
	$(LOG_PROTOCOL_GENERATED) \
	$(LOG_DAEMON_GENERATED) \
	$(NULL)

PODFILES += logging/virtlogd.pod
MANINFILES += virtlogd.8.in
SYSCONF_FILES += logging/virtlogd.sysconf

53
VIRTLOGD_UNIT_FILES_IN = \
54 55 56 57 58
	logging/virtlogd.service.in \
	logging/virtlogd.socket.in \
	logging/virtlogd-admin.socket.in \
	$(NULL)

59 60 61
SYSTEMD_UNIT_FILES += $(notdir $(VIRTLOGD_UNIT_FILES_IN:%.in=%))
SYSTEMD_UNIT_FILES_IN += $(VIRTLOGD_UNIT_FILES_IN)

62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
if WITH_LIBVIRTD
sbin_PROGRAMS += virtlogd

man8_MANS += virtlogd.8

virtlogd_SOURCES = \
		$(LOG_DAEMON_SOURCES) \
		$(LOG_PROTOCOL_GENERATED) \
		$(LOG_DAEMON_GENERATED) \
		$(NULL)
virtlogd_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(XDR_CFLAGS) \
		$(NULL)
virtlogd_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NO_UNDEFINED_LDFLAGS) \
		$(NULL)
virtlogd_LDADD = \
		libvirt_driver_admin.la \
84
		libvirt.la \
D
Daniel P. Berrangé 已提交
85
		$(GLIB_LIBS) \
86 87 88 89 90 91 92
		../gnulib/lib/libgnu.la \
		$(CYGWIN_EXTRA_LIBADD) \
		$(NULL)
if WITH_DTRACE_PROBES
virtlogd_LDADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

93 94 95 96 97 98
if WITH_SASL
virtlogd_CFLAGS += \
	$(SASL_CFLAGS) \
	$(NULL)
endif WITH_SASL

99 100 101
conf_DATA += logging/virtlogd.conf

augeas_DATA += logging/virtlogd.aug
102
augeastest_DATA += logging/test_virtlogd.aug
103

104
logging/test_virtlogd.aug: logging/test_virtlogd.aug.in \
105
		logging/virtlogd.conf $(AUG_GENTEST)
106
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/logging/virtlogd.conf $< > $@
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126

endif WITH_LIBVIRTD

logging/log_daemon_dispatch_stubs.h: $(LOG_PROTOCOL) \
		$(srcdir)/rpc/gendispatch.pl Makefile.am
	$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	    virLogManagerProtocol VIR_LOG_MANAGER_PROTOCOL \
	    $(LOG_PROTOCOL) > $(srcdir)/logging/log_daemon_dispatch_stubs.h

virtlogd.8.in: logging/virtlogd.pod
	$(AM_V_GEN)$(POD2MAN) --section=8 $< $@-t1 && \
	if grep 'POD ERROR' $@-t1; then rm $@-t1; exit 1; fi && \
	sed \
		-e 's|SYSCONFDIR|\@sysconfdir\@|g' \
		-e 's|LOCALSTATEDIR|\@localstatedir\@|g' \
		< $@-t1 > $@-t2 && \
	rm -f $@-t1 && \
	mv $@-t2 $@

virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status
127
	$(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@
128 129

virtlogd.socket: logging/virtlogd.socket.in $(top_builddir)/config.status
130
	$(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@
131 132 133

virtlogd-admin.socket: logging/virtlogd-admin.socket.in \
                       $(top_builddir)/config.status
134
	$(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@