]> git.meshlink.io Git - catta/blob - avahi-daemon/Makefile.am
fix avahi_netlink_new to allow multiple netlinks per process
[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 dbussystemservicesdir=$(datadir)/dbus-1/system-services
30
31 AM_CFLAGS+= \
32         -DAVAHI_DAEMON_RUNTIME_DIR=\"$(avahi_runtime_dir)/avahi-daemon/\" \
33         -DAVAHI_SOCKET=\"$(avahi_socket)\" \
34         -DAVAHI_SERVICE_DIR=\"$(servicedir)\" \
35         -DAVAHI_CONFIG_FILE=\"$(pkgsysconfdir)/avahi-daemon.conf\" \
36         -DAVAHI_HOSTS_FILE=\"$(pkgsysconfdir)/hosts\" \
37         -DAVAHI_DBUS_INTROSPECTION_DIR=\"$(introspectiondir)\" \
38         -DAVAHI_CONFIG_DIR=\"$(pkgsysconfdir)\"
39
40 sbin_PROGRAMS = \
41         avahi-daemon
42
43 if ENABLE_TESTS
44 noinst_PROGRAMS = \
45         ini-file-parser-test
46 endif
47
48 avahi_daemon_SOURCES = \
49         main.c main.h \
50         simple-protocol.c simple-protocol.h \
51         static-services.c static-services.h \
52         static-hosts.c static-hosts.h \
53         ini-file-parser.c ini-file-parser.h \
54         setproctitle.c setproctitle.h \
55         sd-daemon.h sd-daemon.c \
56         ../avahi-client/check-nss.c
57
58 avahi_daemon_CFLAGS = $(AM_CFLAGS) $(LIBDAEMON_CFLAGS) $(XML_CFLAGS)
59 avahi_daemon_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la ../avahi-core/libavahi-core.la $(LIBDAEMON_LIBS) $(XML_LIBS)
60
61 ini_file_parser_test_SOURCES = \
62         ini-file-parser.c ini-file-parser.h \
63         ini-file-parser-test.c
64
65 ini_file_parser_test_CFLAGS = $(AM_CFLAGS)
66 ini_file_parser_test_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la ../avahi-core/libavahi-core.la
67
68 pkgsysconf_DATA = \
69         avahi-daemon.conf \
70         hosts
71
72 dist_service_DATA = \
73         ssh.service \
74         sftp-ssh.service
75
76 dist_pkgdata_DATA = \
77         avahi-service.dtd
78
79 %.service: %.service.in
80         $(AM_V_GEN)sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
81
82 %.socket: %.socket.in
83         $(AM_V_GEN)sed -e 's,@sbindir\@,$(sbindir),g' \
84                 -e 's,@avahi_runtime_dir\@,$(avahi_runtime_dir),g' $< > $@
85
86 if HAVE_SYSTEMD
87 systemdsystemunit_DATA = \
88         avahi-daemon.service \
89         avahi-daemon.socket
90
91 dist_dbussystemservices_DATA = \
92         org.freedesktop.Avahi.service
93 endif
94
95 CLEANFILES = $(systemdsystemunit_DATA)
96
97 if ENABLE_CHROOT
98
99 avahi_daemon_SOURCES += \
100         chroot.c chroot.h \
101         caps.c caps.h
102
103 avahi_daemon_LDADD += -lcap
104
105 endif
106
107 if HAVE_DLOPEN
108 avahi_daemon_LDADD += -ldl
109 endif
110
111 if HAVE_DBUS
112
113 dbusservicedir=$(DBUS_SYS_DIR)
114
115 avahi_daemon_SOURCES += \
116         dbus-protocol.c dbus-protocol.h \
117         dbus-util.c dbus-util.h \
118         dbus-internal.h \
119         dbus-async-address-resolver.c \
120         dbus-async-host-name-resolver.c \
121         dbus-async-service-resolver.c \
122         dbus-domain-browser.c \
123         dbus-entry-group.c \
124         dbus-service-browser.c \
125         dbus-service-type-browser.c \
126         dbus-sync-address-resolver.c \
127         dbus-sync-host-name-resolver.c \
128         dbus-sync-service-resolver.c \
129         dbus-record-browser.c  \
130         ../avahi-common/dbus.c ../avahi-common/dbus.h \
131         ../avahi-common/dbus-watch-glue.c ../avahi-common/dbus-watch-glue.h
132
133 avahi_daemon_LDADD += \
134         $(DBUS_LIBS)
135
136 avahi_daemon_CFLAGS += $(DBUS_CFLAGS) -DDBUS_SYSTEM_BUS_DEFAULT_ADDRESS=\"$(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)\"
137
138 dist_dbusservice_DATA = avahi-dbus.conf
139
140 dist_introspection_DATA = \
141         org.freedesktop.Avahi.Server.xml \
142         org.freedesktop.Avahi.EntryGroup.xml \
143         org.freedesktop.Avahi.DomainBrowser.xml \
144         org.freedesktop.Avahi.ServiceTypeBrowser.xml \
145         org.freedesktop.Avahi.ServiceBrowser.xml \
146         org.freedesktop.Avahi.ServiceResolver.xml \
147         org.freedesktop.Avahi.AddressResolver.xml \
148         org.freedesktop.Avahi.HostNameResolver.xml \
149         org.freedesktop.Avahi.RecordBrowser.xml
150
151 endif
152 endif
153 endif
154
155 EXTRA_DIST = \
156         avahi-daemon.conf \
157         example.service \
158         hosts \
159         example.service \
160         introspect.dtd \
161         introspect.xsl \
162         avahi-daemon.service.in \
163         avahi-daemon.socket.in
164
165 xmllint:
166         xmllint --noout --valid example.service
167         for F in $(introspection_DATA) ; do \
168                 xmllint --noout --valid $$F ; \
169         done
170
171 install-data-local:
172         test -z "$(localstatedir)/run" || $(MKDIR_P) "$(DESTDIR)$(localstatedir)/run"
173
174 update-systemd:
175         curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c
176         curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h > sd-daemon.h