don't fail if BR2_USE_UPDATES tries to update non-checkout
[buildroot.git] / package / avahi / avahi.mk
blobab41ca87f04f49395296b21bf7df732ef0f17378
1 #############################################################
3 # avahi (zeroconf implementation)
5 #############################################################
7 # This program is free software; you can redistribute it
8 # and/or modify it under the terms of the GNU Lesser General
9 # Public License as published by the Free Software Foundation
10 # either version 2.1 of the License, or (at your option) any
11 # later version.
13 AVAHI_VERSION:=0.6.21
14 AVAHI_DIR:=$(BUILD_DIR)/avahi-$(AVAHI_VERSION)
15 AVAHI_SITE:=http://www.avahi.org/download/
16 AVAHI_SOURCE:=avahi-$(AVAHI_VERSION).tar.gz
17 AVAHI_CAT:=$(ZCAT)
19 AVAHI_TARGETS:=
21 ifeq ($(BR2_PACKAGE_AVAHI_AUTOIPD),y)
22 AVAHI_TARGETS+=$(TARGET_DIR)/usr/sbin/avahi-autoipd
23 endif
25 ifeq ($(BR2_PACKAGE_AVAHI_DAEMON),y)
26 AVAHI_TARGETS+=$(TARGET_DIR)/usr/sbin/avahi-daemon
27 AVAHI_DISABLE_EXPAT:=
28 # depend on the exact library file instead of expat so avahi isn't always
29 # considered out-of-date
30 AVAHI_EXPAT_DEP:=$(STAGING_DIR)/usr/lib/libexpat.so.1
31 else
32 AVAHI_DISABLE_EXPAT:=--disable-expat
33 AVAHI_EXPAT_DEP:=
34 endif
36 $(DL_DIR)/$(AVAHI_SOURCE):
37 $(WGET) -P $(DL_DIR) $(AVAHI_SITE)/$(AVAHI_SOURCE)
39 $(AVAHI_DIR)/.unpacked: $(DL_DIR)/$(AVAHI_SOURCE)
40 $(AVAHI_CAT) $(DL_DIR)/$(AVAHI_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
41 toolchain/patch-kernel.sh $(AVAHI_DIR) package/avahi/ \*.patch
42 touch $@
44 $(AVAHI_DIR)/.configured: $(AVAHI_DIR)/.unpacked $(AVAHI_EXPAT_DEP)
45 (cd $(AVAHI_DIR) && rm -rf config.cache && autoconf)
46 (cd $(AVAHI_DIR) && \
47 $(TARGET_CONFIGURE_OPTS) \
48 $(TARGET_CONFIGURE_ARGS) \
49 LIBDAEMON_CFLAGS="-I$(STAGING_DIR)/usr/include" \
50 LIBDAEMON_LIBS="-L$(STAGING_DIR)/lib -ldaemon" \
51 ac_cv_func_strtod=yes \
52 ac_fsusage_space=yes \
53 fu_cv_sys_stat_statfs2_bsize=yes \
54 ac_cv_func_closedir_void=no \
55 ac_cv_func_getloadavg=no \
56 ac_cv_lib_util_getloadavg=no \
57 ac_cv_lib_getloadavg_getloadavg=no \
58 ac_cv_func_getgroups=yes \
59 ac_cv_func_getgroups_works=yes \
60 ac_cv_func_chown_works=yes \
61 ac_cv_have_decl_euidaccess=no \
62 ac_cv_func_euidaccess=no \
63 ac_cv_have_decl_strnlen=yes \
64 ac_cv_func_strnlen_working=yes \
65 ac_cv_func_lstat_dereferences_slashed_symlink=yes \
66 ac_cv_func_lstat_empty_string_bug=no \
67 ac_cv_func_stat_empty_string_bug=no \
68 vb_cv_func_rename_trailing_slash_bug=no \
69 ac_cv_have_decl_nanosleep=yes \
70 jm_cv_func_nanosleep_works=yes \
71 gl_cv_func_working_utimes=yes \
72 ac_cv_func_utime_null=yes \
73 ac_cv_have_decl_strerror_r=yes \
74 ac_cv_func_strerror_r_char_p=no \
75 jm_cv_func_svid_putenv=yes \
76 ac_cv_func_getcwd_null=yes \
77 ac_cv_func_getdelim=yes \
78 ac_cv_func_mkstemp=yes \
79 utils_cv_func_mkstemp_limitations=no \
80 utils_cv_func_mkdir_trailing_slash_bug=no \
81 ac_cv_func_memcmp_working=yes \
82 ac_cv_have_decl_malloc=yes \
83 gl_cv_func_malloc_0_nonnull=yes \
84 ac_cv_func_malloc_0_nonnull=yes \
85 ac_cv_func_calloc_0_nonnull=yes \
86 ac_cv_func_realloc_0_nonnull=yes \
87 jm_cv_func_gettimeofday_clobber=no \
88 am_cv_func_working_getline=yes \
89 gl_cv_func_working_readdir=yes \
90 jm_ac_cv_func_link_follows_symlink=no \
91 utils_cv_localtime_cache=no \
92 ac_cv_struct_st_mtim_nsec=no \
93 gl_cv_func_tzset_clobber=no \
94 gl_cv_func_getcwd_null=yes \
95 gl_cv_func_getcwd_path_max=yes \
96 ac_cv_func_fnmatch_gnu=yes \
97 am_getline_needs_run_time_check=no \
98 am_cv_func_working_getline=yes \
99 gl_cv_func_mkdir_trailing_slash_bug=no \
100 gl_cv_func_mkstemp_limitations=no \
101 ac_cv_func_working_mktime=yes \
102 jm_cv_func_working_re_compile_pattern=yes \
103 ac_use_included_regex=no \
104 ./configure \
105 --target=$(GNU_TARGET_NAME) \
106 --host=$(REAL_GNU_TARGET_NAME) \
107 --build=$(GNU_HOST_NAME) \
108 --prefix=/usr \
109 --exec-prefix=/usr \
110 --bindir=/usr/bin \
111 --sbindir=/usr/sbin \
112 --libdir=/lib \
113 --libexecdir=/usr/lib \
114 --sysconfdir=/etc \
115 --datadir=/usr/share \
116 --localstatedir=/var \
117 --includedir=/usr/include \
118 --mandir=/usr/man \
119 --infodir=/usr/info \
120 $(DISABLE_NLS) \
121 $(DISABLE_LARGEFILE) \
122 --disable-glib \
123 --disable-qt3 \
124 --disable-qt4 \
125 --disable-gtk \
126 --disable-dbus \
127 $(AVAHI_DISABLE_EXPAT) \
128 --disable-gdbm \
129 --disable-python \
130 --disable-python-dbus \
131 --disable-pygtk \
132 --disable-mono \
133 --disable-monodoc \
134 --disable-stack-protector \
135 --with-distro=none \
136 --with-avahi-user=default \
137 --with-avahi-group=default \
138 --with-autoipd-user=default \
139 --with-autoipd-group=default \
141 touch $@
143 $(AVAHI_DIR)/.compiled: $(AVAHI_DIR)/.configured
144 $(MAKE) -C $(AVAHI_DIR)
145 touch $@
147 $(STAGING_DIR)/usr/sbin/avahi-autoipd: $(AVAHI_DIR)/.compiled
148 $(MAKE) DESTDIR=$(STAGING_DIR) -C $(AVAHI_DIR)/avahi-autoipd install
149 touch -c $@
151 $(TARGET_DIR)/usr/sbin/avahi-autoipd: $(STAGING_DIR)/usr/sbin/avahi-autoipd
152 cp $^ $@
153 mkdir -p $(TARGET_DIR)/etc/avahi
154 mkdir -p $(TARGET_DIR)/var/lib
155 ln -sf /tmp/avahi-autoipd $(TARGET_DIR)/var/lib/avahi-autoipd
156 cp -af $(STAGING_DIR)/etc/avahi/avahi-autoipd.action $(TARGET_DIR)/etc/avahi/
157 cp -af $(BASE_DIR)/package/avahi/busybox-udhcpc-default.script $(TARGET_DIR)/usr/share/udhcpc/default.script
158 cp -af $(BASE_DIR)/package/avahi/S05avahi-setup.sh $(TARGET_DIR)/etc/init.d/
159 chmod 0755 $(TARGET_DIR)/usr/share/udhcpc/default.script
160 $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@
162 $(STAGING_DIR)/usr/lib/libavahi-common.so: $(AVAHI_DIR)/.compiled
163 $(MAKE) DESTDIR=$(STAGING_DIR) -C $(AVAHI_DIR)/avahi-common install
164 touch -c $@
166 $(STAGING_DIR)/usr/lib/libavahi-core.so: $(AVAHI_DIR)/.compiled $(STAGING_DIR)/usr/lib/libavahi-common.so
167 $(MAKE) DESTDIR=$(STAGING_DIR) -C $(AVAHI_DIR)/avahi-core install
168 touch -c $@
170 $(STAGING_DIR)/usr/sbin/avahi-daemon: $(AVAHI_DIR)/.compiled $(STAGING_DIR)/usr/lib/libavahi-core.so $(STAGING_DIR)/usr/lib/libavahi-common.so
171 $(MAKE) DESTDIR=$(STAGING_DIR) -C $(AVAHI_DIR)/avahi-daemon install
172 touch -c $@
174 $(TARGET_DIR)/usr/sbin/avahi-daemon: $(STAGING_DIR)/usr/sbin/avahi-daemon
175 cp $^ $@
176 cp -dpf $(STAGING_DIR)/lib/libavahi-*.so* $(TARGET_DIR)/usr/lib/
177 mkdir -p $(TARGET_DIR)/etc/avahi/services
178 cp -af $(BASE_DIR)/package/avahi/S50avahi-daemon $(TARGET_DIR)/etc/init.d/
179 $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@
180 $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libavahi-*.so*
182 avahi: busybox libdaemon $(AVAHI_TARGETS)
184 avahi-source: $(DL_DIR)/$(AVAHI_SOURCE)
186 avahi-clean:
187 -$(MAKE) -C $(AVAHI_DIR) distclean
188 rm -rf $(TARGET_DIR)/etc/avahi
189 rm -f $(TARGET_DIR)/var/lib/avahi-autoipd
190 rm -f $(TARGET_DIR)/etc/init.d/S*avahi*
191 rm -f $(TARGET_DIR)/usr/sbin/avahi-*
193 avahi-dirclean:
194 rm -rf $(AVAHI_DIR)
196 #############################################################
198 # Toplevel Makefile options
200 #############################################################
201 ifeq ($(BR2_PACKAGE_AVAHI),y)
202 TARGETS+=avahi
203 endif