]> git.meshlink.io Git - catta/blobdiff - avahi-daemon/Makefile.am
build-sys: fix MKDIR_P for recent automake
[catta] / avahi-daemon / Makefile.am
index 6e0ac84848be998229f1e5134550bbd2b023f1de..b6b5a77f3f3a82e0012167ee2046787d7a08c213 100644 (file)
@@ -1,7 +1,5 @@
-# $Id$
-#
 # This file is part of avahi.
-# 
+#
 # avahi is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as
 # published by the Free Software Foundation; either version 2 of the
@@ -23,18 +21,19 @@ AM_CFLAGS=-I$(top_srcdir)
 AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
 
 if HAVE_LIBDAEMON
-if HAVE_EXPAT
+if HAVE_XML
 
 pkgsysconfdir=$(sysconfdir)/avahi
 servicedir=$(pkgsysconfdir)/services
-introspectiondir=$(pkgdatadir)/introspection
-dbusservicedir=$(DBUS_SYS_DIR)
+introspectiondir=$(datadir)/dbus-1/interfaces
+dbussystemservicesdir=$(datadir)/dbus-1/system-services
 
 AM_CFLAGS+= \
        -DAVAHI_DAEMON_RUNTIME_DIR=\"$(avahi_runtime_dir)/avahi-daemon/\" \
        -DAVAHI_SOCKET=\"$(avahi_socket)\" \
        -DAVAHI_SERVICE_DIR=\"$(servicedir)\" \
        -DAVAHI_CONFIG_FILE=\"$(pkgsysconfdir)/avahi-daemon.conf\" \
+       -DAVAHI_HOSTS_FILE=\"$(pkgsysconfdir)/hosts\" \
        -DAVAHI_DBUS_INTROSPECTION_DIR=\"$(introspectiondir)\" \
        -DAVAHI_CONFIG_DIR=\"$(pkgsysconfdir)\"
 
@@ -50,28 +49,51 @@ avahi_daemon_SOURCES = \
        main.c main.h \
        simple-protocol.c simple-protocol.h \
        static-services.c static-services.h \
+       static-hosts.c static-hosts.h \
        ini-file-parser.c ini-file-parser.h \
-       setproctitle.c setproctitle.h
+       setproctitle.c setproctitle.h \
+       sd-daemon.h sd-daemon.c \
+       ../avahi-client/check-nss.c
 
-avahi_daemon_CFLAGS = $(AM_CFLAGS) $(LIBDAEMON_CFLAGS)
-avahi_daemon_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la ../avahi-core/libavahi-core.la $(LIBDAEMON_LIBS) -lexpat
+avahi_daemon_CFLAGS = $(AM_CFLAGS) $(LIBDAEMON_CFLAGS) $(XML_CFLAGS)
+avahi_daemon_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la ../avahi-core/libavahi-core.la $(LIBDAEMON_LIBS) $(XML_LIBS)
 
 ini_file_parser_test_SOURCES = \
        ini-file-parser.c ini-file-parser.h \
        ini-file-parser-test.c
 
 ini_file_parser_test_CFLAGS = $(AM_CFLAGS)
-ini_file_parser_test_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la ../avahi-core/libavahi-core.la 
+ini_file_parser_test_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la ../avahi-core/libavahi-core.la
 
 pkgsysconf_DATA = \
-       avahi-daemon.conf
+       avahi-daemon.conf \
+       hosts
 
-service_DATA = \
-       ssh.service
+dist_service_DATA = \
+       ssh.service \
+       sftp-ssh.service
 
-pkgdata_DATA = \
+dist_pkgdata_DATA = \
        avahi-service.dtd
 
+%.service: %.service.in
+       $(AM_V_GEN)sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
+
+%.socket: %.socket.in
+       $(AM_V_GEN)sed -e 's,@sbindir\@,$(sbindir),g' \
+               -e 's,@avahi_runtime_dir\@,$(avahi_runtime_dir),g' $< > $@
+
+if HAVE_SYSTEMD
+systemdsystemunit_DATA = \
+       avahi-daemon.service \
+       avahi-daemon.socket
+
+dist_dbussystemservices_DATA = \
+       org.freedesktop.Avahi.service
+endif
+
+CLEANFILES = $(systemdsystemunit_DATA)
+
 if ENABLE_CHROOT
 
 avahi_daemon_SOURCES += \
@@ -82,8 +104,14 @@ avahi_daemon_LDADD += -lcap
 
 endif
 
+if HAVE_DLOPEN
+avahi_daemon_LDADD += -ldl
+endif
+
 if HAVE_DBUS
 
+dbusservicedir=$(DBUS_SYS_DIR)
+
 avahi_daemon_SOURCES += \
        dbus-protocol.c dbus-protocol.h \
        dbus-util.c dbus-util.h \
@@ -97,50 +125,52 @@ avahi_daemon_SOURCES += \
        dbus-service-type-browser.c \
        dbus-sync-address-resolver.c \
        dbus-sync-host-name-resolver.c \
-       dbus-sync-service-resolver.c    
+       dbus-sync-service-resolver.c \
+       dbus-record-browser.c  \
+       ../avahi-common/dbus.c ../avahi-common/dbus.h \
+       ../avahi-common/dbus-watch-glue.c ../avahi-common/dbus-watch-glue.h
 
 avahi_daemon_LDADD += \
-       ../avahi-common/libdbus-common.la \
        $(DBUS_LIBS)
 
-avahi_daemon_CFLAGS += $(DBUS_CFLAGS)
+avahi_daemon_CFLAGS += $(DBUS_CFLAGS) -DDBUS_SYSTEM_BUS_DEFAULT_ADDRESS=\"$(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)\"
 
-dbusservice_DATA = avahi-dbus.conf
+dist_dbusservice_DATA = avahi-dbus.conf
 
-introspection_DATA = \
-       Server.introspect \
-       EntryGroup.introspect \
-       DomainBrowser.introspect \
-       ServiceTypeBrowser.introspect \
-       ServiceBrowser.introspect \
-       ServiceResolver.introspect \
-       AddressResolver.introspect \
-       HostNameResolver.introspect
+dist_introspection_DATA = \
+       org.freedesktop.Avahi.Server.xml \
+       org.freedesktop.Avahi.EntryGroup.xml \
+       org.freedesktop.Avahi.DomainBrowser.xml \
+       org.freedesktop.Avahi.ServiceTypeBrowser.xml \
+       org.freedesktop.Avahi.ServiceBrowser.xml \
+       org.freedesktop.Avahi.ServiceResolver.xml \
+       org.freedesktop.Avahi.AddressResolver.xml \
+       org.freedesktop.Avahi.HostNameResolver.xml \
+       org.freedesktop.Avahi.RecordBrowser.xml
 
 endif
 endif
 endif
 
 EXTRA_DIST = \
-       avahi-service.dtd \
        avahi-daemon.conf \
        example.service \
-       avahi-dbus.conf \
-       Server.introspect \
-       EntryGroup.introspect \
-       DomainBrowser.introspect \
-       ServiceTypeBrowser.introspect \
-       ServiceBrowser.introspect \
-       ServiceResolver.introspect \
-       AddressResolver.introspect \
-       HostNameResolver.introspect \
-       ssh.service \
+       hosts \
        example.service \
        introspect.dtd \
-       introspect.xsl
+       introspect.xsl \
+       avahi-daemon.service.in \
+       avahi-daemon.socket.in
 
 xmllint:
        xmllint --noout --valid example.service
        for F in $(introspection_DATA) ; do \
                xmllint --noout --valid $$F ; \
        done
+
+install-data-local:
+       test -z "$(localstatedir)/run" || $(MKDIR_P) "$(DESTDIR)$(localstatedir)/run"
+
+update-systemd:
+       curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c
+       curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h > sd-daemon.h