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