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 if ENABLE_AUTOIPD 19 if HAVE_LIBDAEMON 20 21 pkgsysconfdir=$(sysconfdir)/avahi 22 23 AM_CFLAGS= \ 24 -I$(top_srcdir) 25 26 # This cool debug trap works on i386/gcc only 27 AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")' \ 28 -DAVAHI_RUNTIME_DIR=\"$(avahi_runtime_dir)/\" \ 29 -DAVAHI_IPCONF_SCRIPT=\"$(pkgsysconfdir)/avahi-autoipd.action\" \ 30 -DAVAHI_IPDATA_DIR=\"$(localstatedir)/lib/avahi-autoipd\" 31 32 sbin_PROGRAMS = avahi-autoipd 33 34 avahi_autoipd_SOURCES = \ 35 main.c main.h \ 36 ../avahi-daemon/setproctitle.c ../avahi-daemon/setproctitle.h \ 37 iface.h \ 38 ../avahi-common/avahi-malloc.h ../avahi-common/avahi-malloc.c \ 39 ../avahi-common/timeval.h ../avahi-common/timeval.c 40 41 avahi_autoipd_CFLAGS = $(AM_CFLAGS) $(LIBDAEMON_CFLAGS) 42 avahi_autoipd_LDADD = $(AM_LDADD) $(LIBDAEMON_LIBS) 43 44 if TARGET_FREEBSD 45 avahi_autoipd_SOURCES += iface-bsd.c 46 avahi_autoipd_LDADD += -lpcap 47 else 48 avahi_autoipd_SOURCES += iface-linux.c 49 endif 50 51 nodist_pkgsysconf_SCRIPTS = avahi-autoipd.action 52 53 if TARGET_FREEBSD 54 avahi-autoipd.action: avahi-autoipd.action.bsd 55 $(AM_V_GEN)cp $< $@ 56 else 57 avahi-autoipd.action: avahi-autoipd.action.linux 58 $(AM_V_GEN)cp $< $@ 59 endif 60 61 if TARGET_DEBIAN 62 63 noinst_SCRIPTS = dhclient-enter-hook dhclient-exit-hook 64 65 dhclient-enter-hook: dhclient-enter-hook.in 66 $(AM_V_GEN)sed -e 's,@sbindir\@,$(sbindir),g' $< > $@ && \ 67 chmod +x $@ 68 69 dhclient-exit-hook: dhclient-exit-hook.in 70 $(AM_V_GEN)sed -e 's,@sbindir\@,$(sbindir),g' $< > $@ && \ 71 chmod +x $@ 72 73 BUILD = dhclient-exit-hook dhclient-enter-hook 74 75 dhcliententerdir = $(sysconfdir)/dhcp/dhclient-enter-hooks.d 76 dhclientexitdir = $(sysconfdir)/dhcp/dhclient-exit-hooks.d 77 78 install-exec-hook: dhclient-exit-hook dhclient-enter-hook 79 $(MKDIR_P) $(DESTDIR)$(dhcliententerdir) $(DESTDIR)$(dhclientexitdir) 80 $(INSTALL) dhclient-enter-hook $(DESTDIR)$(dhcliententerdir)/avahi-autoipd 81 $(INSTALL) dhclient-exit-hook $(DESTDIR)$(dhclientexitdir)/avahi-autoipd 82 83 uninstall-hook: 84 rm -f $(DESTDIR)$(dhcliententerdir)/avahi-autoipd $(DESTDIR)$(dhclientexitdir)/avahi-autoipd 85 86 endif 87 88 89 endif 90 endif 91 92 EXTRA_DIST = dhclient-enter-hook.in dhclient-exit-hook.in avahi-autoipd.action.linux avahi-autoipd.action.bsd 93 94 CLEANFILES = dhclient-enter-hook dhclient-exit-hook avahi-autoipd.action 95