]> git.meshlink.io Git - catta/blob - avahi-daemon/Makefile.am
04843fb9c9b53e994a0669541f102a9335faa1a0
[catta] / avahi-daemon / Makefile.am
1 # This file is part of avahi.
2 #
3 # avahi is free software; you can redistribute it and/or modify it
4 # under the terms of the GNU Lesser General Public License as
5 # published by the Free Software Foundation; either version 2 of the
6 # License, or (at your option) any later version.
7 #
8 # avahi is distributed in the hope that it will be useful, but WITHOUT
9 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
11 # License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with avahi; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
16 # USA.
17
18 AM_CFLAGS=-I$(top_srcdir)
19
20 # This cool debug trap works on i386/gcc only
21 AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
22
23 if HAVE_LIBDAEMON
24 if HAVE_XML
25
26 pkgsysconfdir=$(sysconfdir)/avahi
27 servicedir=$(pkgsysconfdir)/services
28 introspectiondir=$(datadir)/dbus-1/interfaces
29
30 AM_CFLAGS+= \
31         -DAVAHI_DAEMON_RUNTIME_DIR=\"$(avahi_runtime_dir)/avahi-daemon/\" \
32         -DAVAHI_SOCKET=\"$(avahi_socket)\" \
33         -DAVAHI_SERVICE_DIR=\"$(servicedir)\" \
34         -DAVAHI_CONFIG_FILE=\"$(pkgsysconfdir)/avahi-daemon.conf\" \
35         -DAVAHI_HOSTS_FILE=\"$(pkgsysconfdir)/hosts\" \
36         -DAVAHI_DBUS_INTROSPECTION_DIR=\"$(introspectiondir)\" \
37         -DAVAHI_CONFIG_DIR=\"$(pkgsysconfdir)\"
38
39 sbin_PROGRAMS = \
40         avahi-daemon
41
42 if ENABLE_TESTS
43 noinst_PROGRAMS = \
44         ini-file-parser-test
45 endif
46
47 avahi_daemon_SOURCES = \
48         main.c main.h \
49         simple-protocol.c simple-protocol.h \
50         static-services.c static-services.h \
51         static-hosts.c static-hosts.h \
52         ini-file-parser.c ini-file-parser.h \
53         setproctitle.c setproctitle.h \
54         sd-daemon.h sd-daemon.c \
55         ../avahi-client/check-nss.c
56
57 avahi_daemon_CFLAGS = $(AM_CFLAGS) $(LIBDAEMON_CFLAGS) $(XML_CFLAGS)
58 avahi_daemon_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la ../avahi-core/libavahi-core.la $(LIBDAEMON_LIBS) $(XML_LIBS)
59
60 ini_file_parser_test_SOURCES = \
61         ini-file-parser.c ini-file-parser.h \
62         ini-file-parser-test.c
63
64 ini_file_parser_test_CFLAGS = $(AM_CFLAGS)
65 ini_file_parser_test_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la ../avahi-core/libavahi-core.la
66
67 pkgsysconf_DATA = \
68         avahi-daemon.conf \
69         hosts
70
71 dist_service_DATA = \
72         ssh.service \
73         sftp-ssh.service
74
75 dist_pkgdata_DATA = \
76         avahi-service.dtd
77
78 if ENABLE_CHROOT
79
80 avahi_daemon_SOURCES += \
81         chroot.c chroot.h \
82         caps.c caps.h
83
84 avahi_daemon_LDADD += -lcap
85
86 endif
87
88 if HAVE_DLOPEN
89 avahi_daemon_LDADD += -ldl
90 endif
91
92 if HAVE_DBUS
93
94 dbusservicedir=$(DBUS_SYS_DIR)
95
96 avahi_daemon_SOURCES += \
97         dbus-protocol.c dbus-protocol.h \
98         dbus-util.c dbus-util.h \
99         dbus-internal.h \
100         dbus-async-address-resolver.c \
101         dbus-async-host-name-resolver.c \
102         dbus-async-service-resolver.c \
103         dbus-domain-browser.c \
104         dbus-entry-group.c \
105         dbus-service-browser.c \
106         dbus-service-type-browser.c \
107         dbus-sync-address-resolver.c \
108         dbus-sync-host-name-resolver.c \
109         dbus-sync-service-resolver.c \
110         dbus-record-browser.c  \
111         ../avahi-common/dbus.c ../avahi-common/dbus.h \
112         ../avahi-common/dbus-watch-glue.c ../avahi-common/dbus-watch-glue.h
113
114 avahi_daemon_LDADD += \
115         $(DBUS_LIBS)
116
117 avahi_daemon_CFLAGS += $(DBUS_CFLAGS) -DDBUS_SYSTEM_BUS_DEFAULT_ADDRESS=\"$(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)\"
118
119 dist_dbusservice_DATA = avahi-dbus.conf
120
121 dist_introspection_DATA = \
122         org.freedesktop.Avahi.Server.xml \
123         org.freedesktop.Avahi.EntryGroup.xml \
124         org.freedesktop.Avahi.DomainBrowser.xml \
125         org.freedesktop.Avahi.ServiceTypeBrowser.xml \
126         org.freedesktop.Avahi.ServiceBrowser.xml \
127         org.freedesktop.Avahi.ServiceResolver.xml \
128         org.freedesktop.Avahi.AddressResolver.xml \
129         org.freedesktop.Avahi.HostNameResolver.xml \
130         org.freedesktop.Avahi.RecordBrowser.xml
131
132 endif
133 endif
134 endif
135
136 EXTRA_DIST = \
137         avahi-daemon.conf \
138         example.service \
139         hosts \
140         example.service \
141         introspect.dtd \
142         introspect.xsl
143
144 xmllint:
145         xmllint --noout --valid example.service
146         for F in $(introspection_DATA) ; do \
147                 xmllint --noout --valid $$F ; \
148         done
149
150 install-data-local:
151         test -z "$(localstatedir)/run" || $(mkdir_p) "$(DESTDIR)$(localstatedir)/run"
152
153 update-systemd:
154         curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c
155         curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h > sd-daemon.h