2 # Process this file with autoconf to produce a configure script.
6 # This file is part of avahi.
8 # avahi is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU Lesser General Public License as
10 # published by the Free Software Foundation; either version 2 of the
11 # License, or (at your option) any later version.
13 # avahi is distributed in the hope that it will be useful, but WITHOUT
14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 # License for more details.
18 # You should have received a copy of the GNU Lesser General Public
19 # License along with avahi; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 AC_INIT([avahi],[0.6.25],[avahi (at) lists (dot) freedesktop (dot) org])
25 AC_CONFIG_SRCDIR([avahi-core/server.c])
26 AC_CONFIG_HEADERS([config.h])
27 AM_INIT_AUTOMAKE([foreign 1.9 -Wall])
29 AC_SUBST(PACKAGE_URL, [http://avahi.org/])
31 AC_SUBST(LIBAVAHI_COMMON_VERSION_INFO, [8:1:5])
32 AC_SUBST(LIBAVAHI_CORE_VERSION_INFO, [6:1:0])
33 AC_SUBST(LIBAVAHI_CLIENT_VERSION_INFO, [5:5:2])
34 AC_SUBST(LIBAVAHI_GLIB_VERSION_INFO, [1:1:0])
35 AC_SUBST(LIBAVAHI_GOBJECT_VERSION_INFO, [0:1:0])
36 AC_SUBST(LIBAVAHI_QT3_VERSION_INFO, [1:2:0])
37 AC_SUBST(LIBAVAHI_QT4_VERSION_INFO, [1:2:0])
38 AC_SUBST(LIBAVAHI_UI_VERSION_INFO, [1:1:1])
40 # Do not touch these, since they we took this version-info from upstream HOWL/Bonjour
41 AC_SUBST(LIBAVAHI_COMPAT_LIBDNS_SD_VERSION_INFO, [1:0:0])
42 AC_SUBST(LIBAVAHI_COMPAT_HOWL_VERSION_INFO, [0:0:0])
43 AC_SUBST(HOWL_COMPAT_VERSION, [0.9.8])
45 if type -p stow > /dev/null && test -d /usr/local/stow ; then
46 AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
47 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
50 # Checks for programs.
58 AC_PROG_GCC_TRADITIONAL
63 AC_ARG_ENABLE([stack-protector],
64 [AS_HELP_STRING([--disable-stack-protector],
65 [Disable GCC's/libc's stack-smashing protection])],
66 [case "${enableval}" in
67 yes) enable_ssp=yes ;;
69 *) AC_MSG_ERROR([invalid value ${enableval} for --disable-stack-protector]) ;;
73 if test x"$enable_ssp" = x"yes" && test x"$GCC" != x"yes"; then
74 AC_MSG_NOTICE([Disabling stack-smashing protection because compiler is not GCC])
78 if test x"$enable_ssp" = x"yes"; then
79 # Check for broken ssp in libc: http://www.avahi.org/ticket/105
80 # libc's brokenness will get in the way regardless of whether -lssp is
81 # provided, but provide it anyway (otherwise non-libc ssp would wrongly
84 # Get -lssp if it exists
87 AC_MSG_CHECKING([whether stack-smashing protection is available])
88 ssp_old_cflags="$CFLAGS"
89 ssp_old_ldflags="$LDFLAGS"
90 CFLAGS="$CFLAGS -Werror -fstack-protector-all -fPIC"
91 LDFLAGS="$LDFLAGS -Wl,-z,defs"
92 cat confdefs.h > conftest.c
93 cat >>conftest.c <<_ACEOF
94 void test_broken_ssp(c)
97 char arr[[123]], *p; /* beware of possible double-braces if copying this */
98 for (p = arr; *c; ++p) {
106 if $CC -c $CFLAGS $CPPFLAGS -o conftest.o conftest.c >/dev/null 2>&1; then
108 AC_MSG_CHECKING([whether stack-smashing protection is buggy])
109 if $CC -o conftest.so $LDFLAGS -shared conftest.o $LIBS >/dev/null 2>&1; then
119 rm -f conftest.c conftest.o conftest.so
121 CFLAGS="$ssp_old_cflags"
122 LDFLAGS="$ssp_old_ldflags"
125 if test x"$enable_ssp" = x"yes"; then
126 # Do this the long way so we don't call GCC_STACK_PROTECT_LIB twice
130 GCC_STACK_PROTECT_CXX
132 # XXX: Update the enable_ssp value now for output later?
138 AC_CACHE_CHECK([whether the C++ compiler works], [avahi_cv_sys_cxx_works], [
140 AC_COMPILE_IFELSE([int main() { return 0; }], [avahi_cv_sys_cxx_works=yes],
141 [avahi_cv_sys_cxx_works=no])
144 [ if [ "x$avahi_cv_sys_cxx_works" = "xno" ]; then ]
145 AC_MSG_FAILURE([The C++ compiler does not work])
148 ACX_PTHREAD(,AC_MSG_ERROR([Missing POSIX Threads support]))
151 # Check for netlink.h
153 AC_CHECK_HEADER(linux/netlink.h,
155 AC_DEFINE([HAVE_NETLINK],[],[Support for Linux netlink])
157 #include <sys/socket.h>
158 #include <asm/types.h>
161 AM_CONDITIONAL(HAVE_NETLINK, [ test x"$HAVE_NETLINK" = xyes ])
164 # Check for net/route.h
166 AC_CHECK_HEADER(net/route.h,
168 AC_DEFINE([HAVE_PF_ROUTE],[],[Support for PF_ROUTE])
170 #include <sys/types.h>
171 #include <sys/socket.h>
174 AM_CONDITIONAL(HAVE_PF_ROUTE, [ test x"$HAVE_PF_ROUTE" = xyes ])
177 # Check for sys/filio.h; needed for FIONREAD on Solaris
179 AC_CHECK_HEADER(sys/filio.h,
181 AC_DEFINE([HAVE_SYS_FILIO_H],[],[Support for sys/filio.h])
185 AM_CONDITIONAL(HAVE_SYS_FILIO_H, [ test x"$HAVE_SYS_FILIO_H" = xyes ])
188 # Check for sys/sysctl.h; not present on Solaris
190 AC_CHECK_HEADER(sys/sysctl.h,
192 AC_DEFINE([HAVE_SYS_SYSCTL_H],[],[Support for sys/sysctl.h])
194 #include <sys/types.h>
195 #include <sys/socket.h>
196 #include <sys/param.h>
199 AM_CONDITIONAL(HAVE_SYS_SYSCTL_H, [ test x"$HAVE_SYS_SYSCTL_H" = xyes ])
202 # Check for lifconf struct; only present on Solaris
204 AC_MSG_CHECKING(for struct lifconf)
205 AC_CACHE_VAL(avahi_cv_has_struct_lifconf,
207 [#include <sys/socket.h>
209 ],[sizeof (struct lifconf);],
210 avahi_cv_has_struct_lifconf=yes,avahi_cv_has_struct_lifconf=no)])
211 AC_MSG_RESULT($avahi_cv_has_struct_lifconf)
212 if test $avahi_cv_has_struct_lifconf = yes; then
213 AC_DEFINE(HAVE_STRUCT_LIFCONF,1,[Define if there is a struct lifconf.])
217 # Check for struct ip_mreqn
219 AC_MSG_CHECKING(for struct ip_mreqn)
220 AC_TRY_COMPILE([#include <netinet/in.h>], [
221 struct ip_mreqn mreq;
222 mreq.imr_address.s_addr = 0;
226 AC_DEFINE([HAVE_STRUCT_IP_MREQN],[],[Support for struct ip_mreqn])
228 # We'll just have to try and use struct ip_mreq
230 AC_MSG_CHECKING(for struct ip_mreq)
231 AC_TRY_COMPILE([#include <netinet/in.h>], [
233 mreq.imr_interface.s_addr = 0;
237 AC_DEFINE([HAVE_STRUCT_IP_MREQ],[],[Support for struct ip_mreq])
239 # No multicast support
245 # Detecting the linux distribution for specific things like init scripts.
247 AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of lfs, debian, gentoo, archlinux, fedora, mandriva, darwin, netbsd, freebsd, slackware or none]))
248 if test "z$with_distro" = "z"; then
249 if test "$cross_compiling" = yes; then
250 AC_MSG_WARN([Target distribution cannot be reliably detected when cross-compiling. You should specify it with --with-distro (see $0 --help for recognized distros)])
252 AC_CHECK_FILE(/etc/lfs-release,with_distro="lfs")
253 AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
254 AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
255 AC_CHECK_FILE(/etc/arch-release,with_distro="archlinux")
256 AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
257 AC_CHECK_FILE(/etc/redhat-release,with_distro="fedora")
258 AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva")
259 AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
261 if test "z$with_distro" = "z"; then
262 with_distro=`uname -s`
265 with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
268 lfs|debian|gentoo|archlinux|suse|fedora|mandriva|darwin|freebsd|slackware|none)
271 AC_MSG_WARN([Your distribution (${with_distro}) is supported but no init script exist yet! (patches welcome)])
274 AC_MSG_ERROR([Linux distribution autodetection failed, you must specify the distribution to target using --with-distro=DISTRO, set DISTRO to none if your distribution is not supported.])
277 AC_MSG_ERROR([Your distribution (${with_distro}) is not yet supported, init scripts and D-Bus configuration will not be installed! (patches welcome), you can specify --with-distro=none to skip this check])
281 AM_CONDITIONAL(TARGET_LFS, test x"$with_distro" = xlfs)
282 AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
283 AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
284 AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
285 AM_CONDITIONAL(TARGET_ARCHLINUX, test x"$with_distro" = xarchlinux)
286 AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
287 AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
288 AM_CONDITIONAL(TARGET_DARWIN, test x"$with_distro" = xdarwin)
289 AM_CONDITIONAL(TARGET_NETBSD, test x"$with_distro" = xnetbsd)
290 AM_CONDITIONAL(TARGET_FREEBSD, test x"$with_distro" = xfreebsd)
291 AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
294 AC_LANG_CONFTEST([int main() {}])
295 $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
301 # If using GCC specify some additional parameters
302 if test "x$GCC" = "xyes" ; then
304 DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline"
306 if test "x$HAVE_NETLINK" = "xyes" ; then
307 # Test whether rtnetlink.h can be included when compiled with -std=c99
308 # some distributions (e.g. archlinux) have broken headers that dont
309 # define __u64 with -std=c99
310 AC_MSG_CHECKING([checking whether rtnetlink.h can be included with -std=c99])
313 AC_TRY_COMPILE([#include <linux/rtnetlink.h>], [],
314 use_stdc99=yes, use_stdc99=no)
316 if test x"$use_stdc99" = xyes; then
317 DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
325 DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
328 for flag in $DESIRED_FLAGS ; do
329 AC_MSG_CHECKING([whether $CC accepts $flag])
330 if test_gcc_flag $flag ; then
331 CFLAGS="$CFLAGS $flag"
339 # Checks for header files.
341 AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h netdb.h syslog.h])
344 # Checks for typedefs, structures, and compiler characteristics.
351 AC_SEARCH_LIBS([inet_ntop],[nsl])
352 AC_SEARCH_LIBS([recv],[socket])
353 AC_CHECK_DECL([CMSG_SPACE],,CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__", [[#include <sys/socket.h>]])
355 # Checks for library functions.
357 AC_FUNC_SELECT_ARGTYPES
358 # avahi_malloc actually returns NULL for avahi_malloc(0), so it does not matter
359 # whether libc's malloc does too. (Same for realloc.)
362 AC_CHECK_FUNCS([gethostname memchr memmove memset mkdir select socket strchr strcspn strdup strerror strrchr strspn strstr uname setresuid setreuid setresgid setregid strcasecmp gettimeofday putenv strncasecmp strlcpy gethostbyname seteuid setegid setproctitle getprogname])
369 AC_CHECK_DECLS(environ)
371 # check if gcc's -fvisibility is supported
372 CHECK_VISIBILITY_HIDDEN
375 AC_CHECK_HEADERS([sys/capability.h],,enable_chroot=no)
376 AC_CHECK_HEADERS([sys/prctl.h],,enable_chroot=no)
377 AC_CHECK_FUNCS([chroot],,enable_chroot=no)
379 AM_CONDITIONAL(ENABLE_CHROOT, test "x$enable_chroot" = "xyes")
381 if test "x$enable_chroot" = "xyes" ; then
382 AC_DEFINE([ENABLE_CHROOT], 1, [Enable chroot() usage])
385 AC_CHECK_LIB(dl, dlopen, [ AC_CHECK_HEADERS(dlfcn.h, HAVE_DLOPEN=yes, HAVE_DLOPEN=no) ], HAVE_DLOPEN=no)
386 if test "x$HAVE_DLOPEN" = "xyes" ; then
387 AC_DEFINE([HAVE_DLOPEN],1,[Have dlopen()])
389 AM_CONDITIONAL(HAVE_DLOPEN, test "x$HAVE_DLOPEN" = "xyes")
392 AC_CHECK_HEADERS([sys/inotify.h], [have_inotify=yes])
394 AM_CONDITIONAL(HAVE_INOTIFY, test "x$have_inotify" = "xyes")
396 if test "x$have_inotify" = "xyes" ; then
397 AC_DEFINE([HAVE_INOTIFY], 1, [Enable Linux inotify() usage])
401 AC_CHECK_FUNCS([kqueue],,have_kqueue=no)
403 AM_CONDITIONAL(HAVE_KQUEUE, test "x$have_kqueue" = "xyes")
405 if test "x$have_kqueue" = "xyes" ; then
406 AC_DEFINE([HAVE_KQUEUE], 1, [Enable BSD kqueue() usage])
409 IT_PROG_INTLTOOL([0.35.0])
410 GETTEXT_PACKAGE=avahi
411 AC_SUBST([GETTEXT_PACKAGE])
412 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
415 avahilocaledir='${prefix}/${DATADIRNAME}/locale'
416 AC_SUBST(avahilocaledir)
419 # Check for pkg-config manually first, as if its not installed the
420 # PKG_PROG_PKG_CONFIG macro won't be defined.
421 AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
423 if test x"$have_pkg_config" = "xno"; then
424 AC_MSG_ERROR(pkg-config is required to install this program)
433 AS_HELP_STRING([--disable-glib],[Disable use of GLib]),
434 [case "${enableval}" in
435 yes) HAVE_GLIB=yes ;;
437 *) AC_MSG_ERROR(bad value ${enableval} for --enable-glib) ;;
441 if test "x$HAVE_GLIB" = "xyes" ; then
442 PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ])
443 AC_SUBST(GLIB20_CFLAGS)
444 AC_SUBST(GLIB20_LIBS)
446 AM_CONDITIONAL(HAVE_GLIB, test "x$HAVE_GLIB" = "xyes")
449 # Check for GLIB's gobject 2.0
451 AC_ARG_ENABLE(gobject,
452 AS_HELP_STRING([--disable-gobject],[Disable use of GLib GObject]),
453 [case "${enableval}" in
454 yes) HAVE_GOBJECT=yes ;;
455 no) HAVE_GOBJECT=no ;;
456 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gobject) ;;
460 if test "x$HAVE_GOBJECT" = "xyes" ; then
461 PKG_CHECK_MODULES(GOBJECT, [ glib-2.0 >= 2.4.0 gobject-2.0 ])
462 AC_SUBST(GOBJECT_CFLAGS)
463 AC_SUBST(GOBJECT_LIBS)
465 AM_CONDITIONAL(HAVE_GOBJECT, test "x$HAVE_GOBJECT" = "xyes")
471 AS_HELP_STRING([--disable-qt3],[Disable building of Qt3 mainloop integration]),
472 [case "${enableval}" in
475 *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt3) ;;
479 if test "x$HAVE_QT3" = "xyes" ; then
480 PKG_CHECK_MODULES( QT3, [ qt-mt >= 3.0.0 ])
483 QT3_PREFIX="`$PKG_CONFIG --variable=prefix qt-mt`/bin"
484 AC_PATH_PROGS(MOC_QT3, [moc-qt3 moc], no, [$QT3_PREFIX])
485 if test "$MOC_QT3" = no; then
486 AC_MSG_ERROR([Could not find QT3 moc])
490 AM_CONDITIONAL(HAVE_QT3, test "x$HAVE_QT3" = "xyes")
496 AS_HELP_STRING([--disable-qt4],[Disable building of Qt4Core mainloop integration]),
497 [case "${enableval}" in
500 *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt4) ;;
504 if test "x$HAVE_QT4" = "xyes" ; then
505 PKG_CHECK_MODULES( QT4, [ QtCore >= 4.0.0 ])
508 QT4_PREFIX="`$PKG_CONFIG --variable=prefix QtCore`/bin"
509 AC_PATH_PROGS(MOC_QT4, [moc-qt4 moc], no, [$QT4_PREFIX])
510 if test "$MOC_QT4" = no; then
511 AC_MSG_ERROR([Could not find QT4 moc])
515 AM_CONDITIONAL(HAVE_QT4, test "x$HAVE_QT4" = "xyes")
521 AS_HELP_STRING([--disable-gtk],[Disable use of GTK+]),
522 [case "${enableval}" in
525 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk) ;;
529 if test "x$HAVE_GTK" = "xyes" ; then
531 PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.12.0 ])
532 AC_SUBST(GTK20_CFLAGS)
535 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
541 AS_HELP_STRING([--disable-dbus],[Disable use of D-Bus]),
542 [case "${enableval}" in
543 yes) HAVE_DBUS=yes ;;
545 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbus) ;;
549 AC_ARG_WITH(dbus-sys, AS_HELP_STRING([--with-dbus-sys=<dir>], [Path to D-Bus system.d directory]))
550 AC_ARG_WITH(dbus-system-socket, AS_HELP_STRING([--with-dbus-system-address=<address>], [Path to the D-Bus system socket, you probably want to put unix:path= at the start. Only needed for very old D-Bus releases]))
552 DBUS_VERSION="Disabled"
553 DBUS_SYS_DIR="Disabled"
554 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="Disabled"
555 if test "x$HAVE_DBUS" = "xyes" ; then
556 PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 0.34 ])
558 AC_DEFINE(HAVE_DBUS, 1, [Whether we have D-Bus or not])
560 DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion`
561 DBUS_VERSION_MAJOR=`echo $DBUS_VERSION | awk -F. '{print $1}'`
562 DBUS_VERSION_MINOR=`echo $DBUS_VERSION | awk -F. '{print $2}'`
563 DBUS_VERSION_MICRO=`echo $DBUS_VERSION | awk -F. '{print $3}'`
564 if test "z$DBUS_VERSION_MAJOR" = "z"; then
565 DBUS_VERSION_MAJOR="0"
567 if test "z$DBUS_VERSION_MINOR" = "z"; then
568 DBUS_VERSION_MINOR="0"
570 if test "z$DBUS_VERSION_MICRO" = "z"; then
571 DBUS_VERSION_MICRO="0"
574 if test "z$DBUS_VERSION_MAJOR" = "z0" -a "z$DBUS_VERSION_MINOR" = "z0" -a "z$DBUS_VERSION_MICRO" = "z0"; then
575 echo "Error: Couldn't determine the version of your D-Bus package."
576 echo " This is probably an error in this script, please report it"
577 echo " along with the following information:"
578 echo " Base D-Buss version ='$DBUS_VERSION'"
579 echo " DBUS_VERSION_MAJOR='$DBUS_VERSION_MAJOR'"
580 echo " DBUS_VERSION_MINOR='$DBUS_VERSION_MINOR'"
581 echo " DBUS_VERSION_MICRO='$DBUS_VERSION_MICRO'"
584 echo "Your D-Bus version is $DBUS_VERSION_MAJOR,$DBUS_VERSION_MINOR,$DBUS_VERSION_MICRO."
585 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MAJOR=$DBUS_VERSION_MAJOR"
586 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MINOR=$DBUS_VERSION_MINOR"
587 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MICRO=$DBUS_VERSION_MICRO"
590 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
591 AC_SUBST(DBUS_CFLAGS)
594 if ! test -z "$with_dbus_sys" ; then
595 DBUS_SYS_DIR="$with_dbus_sys"
597 DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
599 AC_SUBST(DBUS_SYS_DIR)
601 if ! test -z "$with_dbus_system_address" ; then
602 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="$with_dbus_system_address"
604 # This is ugly, but D-Bus doesn't export this address for us
605 # so we have to guess, pretty much all setups i've seen have
606 # it in /var/lib/dbus or /var/run/dbus, and its defaulted to
607 # /var/run upstream so we will try guess first then default
610 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=/var/run/dbus/system_bus_socket"
611 TRY_SOCKETS="/var/lib/dbus/system_bus_socket /var/run/dbus/system_bus_socket ${localstatedir}/run/dbus/system_bus_socket ${prefix}/var/run/dbus/system_bus_socket"
612 for sock in $TRY_SOCKETS; do
613 if test -S $sock; then
614 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$sock"
618 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
621 LIBS="$LIBS $DBUS_LIBS"
622 AC_CHECK_FUNCS([dbus_connection_close dbus_bus_get_private])
625 AM_CONDITIONAL(HAVE_DBUS, test "x$HAVE_DBUS" = "xyes")
630 AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[expat/bsdxml/none]],[XML library to use]))
635 AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false)
636 AC_CHECK_LIB(bsdxml, XML_ParserCreate, [ AC_CHECK_HEADERS(bsdxml.h, have_bsdxml=true, have_bsdxml=false) ], have_bsdxml=false)
638 if test "x$with_xml" = "xnone"; then
640 elif test "x$with_xml" = "xexpat"; then
642 if ! $have_expat ; then
643 AC_MSG_ERROR([*** libexpat requested, but not found ***])
645 elif test "x$with_xml" = "xbsdxml"; then
647 if ! $have_bsdxml ; then
648 AC_MSG_ERROR([*** libbsdxml requested, but not found ***])
650 elif test "x$with_xml" != "x"; then
651 AC_MSG_ERROR([*** unknown with-xml option ***])
653 if $have_expat ; then
655 elif $have_bsdxml ; then
658 AC_MSG_ERROR([*** neither libexpat not libbsdxml could be found ***])
664 XML_CFLAGS=-DUSE_EXPAT_H
669 XML_CFLAGS=-DUSE_BSDXML_H
675 if $use_expat || $use_bsdxml; then
679 AM_CONDITIONAL(HAVE_XML, test "x$HAVE_XML" = "xyes")
688 AS_HELP_STRING([--enable-dbm],[Enable use of DBM]),
689 [case "${enableval}" in
692 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbm) ;;
697 AS_HELP_STRING([--disable-gdbm],[Disable use of GDBM]),
698 [case "${enableval}" in
699 yes) HAVE_GDBM=yes ;;
701 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gdbm) ;;
705 if test "x$HAVE_GDBM" = "xyes" ; then
706 if test "x$HAVE_DBM" = "xyes" ; then
707 AC_MSG_ERROR([*** --enable-gdbm and --enable-dbm both specified ***])
709 AC_CHECK_LIB(gdbm, gdbm_open, [ AC_CHECK_HEADERS(gdbm.h, have_gdbm=true, have_gdbm=false) ], have_gdbm=false)
711 if ! $have_gdbm ; then
712 AC_MSG_ERROR([*** libgdbm not found ***])
714 AC_DEFINE([HAVE_GDBM],[],[Support for GDBM])
716 if test "x$HAVE_DBM" = "xyes" ; then
717 AC_CHECK_HEADERS(ndbm.h, have_dbm=true, have_dbm=false)
719 if ! $have_dbm ; then
720 AC_MSG_ERROR([*** dbm not found ***])
722 AC_DEFINE([HAVE_DBM],[],[Support for DBM])
725 AM_CONDITIONAL(HAVE_GDBM, test "x$HAVE_GDBM" = "xyes")
726 AM_CONDITIONAL(HAVE_DBM, test "x$HAVE_DBM" = "xyes")
731 AC_ARG_ENABLE(libdaemon,
732 AS_HELP_STRING([--disable-libdaemon],[Disable use of libdaemon]),
733 [case "${enableval}" in
734 yes) HAVE_LIBDAEMON=yes ;;
735 no) HAVE_LIBDAEMON=no ;;
736 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libdaemon) ;;
738 [HAVE_LIBDAEMON=yes])
740 if test "x$HAVE_LIBDAEMON" = "xyes" ; then
741 PKG_CHECK_MODULES(LIBDAEMON, [ libdaemon >= 0.11 ])
742 AC_SUBST(LIBDAEMON_CFLAGS)
743 AC_SUBST(LIBDAEMON_LIBS)
745 AM_CONDITIONAL(HAVE_LIBDAEMON, test "x$HAVE_LIBDAEMON" = "xyes")
750 AC_ARG_ENABLE(python,
751 AS_HELP_STRING([--disable-python], [Disable scripts that depends on python]),
752 [case "${enableval}" in
753 yes) HAVE_PYTHON=yes ;;
754 no) HAVE_PYTHON=no ;;
755 *) AC_MSG_ERROR([bad value ${enableval} for --enable-python]) ;;
756 esac],[HAVE_PYTHON=yes])
761 if test "x$HAVE_PYTHON" = "xyes" ; then
762 AM_PATH_PYTHON([2.4])
765 AS_HELP_STRING([--disable-pygtk],[Disable use of GTK in Python]),
766 [case "${enableval}" in
767 yes) HAVE_PYGTK=yes ;;
769 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pygtk) ;;
773 if test "x$HAVE_PYGTK" = "xyes" ; then
774 AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR(Could not find Python module gtk)])
778 if test "x$HAVE_DBUS" = "xyes" ; then
779 AC_ARG_ENABLE(python-dbus,
780 AS_HELP_STRING([--disable-python-dbus],[Disable use of D-Bus in Python]),
781 [case "${enableval}" in
782 yes) HAVE_PYTHON_DBUS=yes ;;
783 no) HAVE_PYTHON_DBUS=no ;;
784 *) AC_MSG_ERROR(bad value ${enableval} for --enable-python-dbus) ;;
786 [HAVE_PYTHON_DBUS=yes])
788 if test "x$HAVE_PYTHON_DBUS" = "xyes"; then
789 AM_CHECK_PYMOD(dbus,,,[AC_MSG_ERROR(Could not find Python module dbus)])
792 AM_CHECK_PYMOD(socket,,,[AC_MSG_ERROR(Could not find Python module socket)])
793 if test "x$HAVE_GDBM" = "xyes"; then
794 AM_CHECK_PYMOD(gdbm,,,[AC_MSG_ERROR(Could not find Python module gdbm)])
796 if test "x$HAVE_DBM" = "xyes"; then
797 AM_CHECK_PYMOD(dbm,,,[AC_MSG_ERROR(Could not find Python module dbm)])
801 AM_CONDITIONAL(HAVE_PYTHON, [test "x$HAVE_PYTHON" = "xyes" ])
802 AM_CONDITIONAL(HAVE_PYGTK, test "x$HAVE_PYGTK" = "xyes")
803 AM_CONDITIONAL(HAVE_PYTHON_DBUS, test "x$HAVE_PYTHON_DBUS" = "xyes")
806 # Check for mono stuff
809 if test "x$HAVE_DBUS" = "xyes" ; then
811 AS_HELP_STRING([--disable-mono],[Disable mono bindings]),
812 [case "${enableval}" in
813 yes) HAVE_MONO=yes ;;
815 *) AC_MSG_ERROR(bad value ${enableval} for --enable-mono) ;;
819 if test "x$HAVE_MONO" = "xyes" ; then
820 AC_PATH_PROG(MCS, mcs)
821 if test "x$MCS" = "x" ; then
822 AC_MSG_ERROR([Can not find "mcs" - The Mono C-Sharp Compiler) in your PATH])
825 AC_PATH_PROG(GACUTIL, gacutil)
826 if test "x$GACUTIL" = "x" ; then
827 AC_MSG_ERROR([Can not find "gacutil" in your PATH])
834 AM_CONDITIONAL(HAVE_MONO, test "x$HAVE_MONO" = "xyes")
837 # Check for monodoc stuff
840 AC_ARG_ENABLE(monodoc,
841 AS_HELP_STRING([--disable-monodoc],[Disable documentation for mono bindings]),
842 [case "${enableval}" in
843 yes) HAVE_MONODOC=yes ;;
844 no) HAVE_MONODOC=no ;;
845 *) AC_MSG_ERROR(bad value ${enableval} for --enable-monodoc) ;;
849 if test "x$HAVE_MONO" = "xyes" && test "x$HAVE_MONODOC" = "xyes" ; then
850 PKG_CHECK_MODULES(MONODOC, [monodoc >= 1.1.8])
851 MONODOC_DIR=`$PKG_CONFIG --variable=sourcesdir monodoc`
853 AC_PATH_PROG(MONODOCER, monodocer)
854 AC_PATH_PROG(MDASSEMBLER, mdassembler)
856 AC_SUBST(MONODOC_DIR)
858 AC_SUBST(MDASSEMBLER)
860 AM_CONDITIONAL(HAVE_MONODOC, test "x$HAVE_MONODOC" = "xyes")
865 AC_ARG_ENABLE(autoipd,
866 AS_HELP_STRING([--disable-autoipd],[Disable building of avahi-autoipd]),
867 [case "${enableval}" in
868 yes) ENABLE_AUTOIPD=yes ;;
869 no) ENABLE_AUTOIPD=no ;;
870 *) AC_MSG_ERROR(bad value ${enableval} for --disable-autoipd) ;;
872 [ENABLE_AUTOIPD=yes])
874 AM_CONDITIONAL(ENABLE_AUTOIPD, test "x$ENABLE_AUTOIPD" = "xyes")
877 # Defining users and groups
879 AC_ARG_WITH(avahi_user, AS_HELP_STRING([--with-avahi-user=<user>],[User for running avahi-daemon (avahi)]))
880 if test -z "$with_avahi_user" ; then
883 AVAHI_USER=$with_avahi_user
886 AC_DEFINE_UNQUOTED(AVAHI_USER,"$AVAHI_USER", [User for running the Avahi daemon])
888 AC_ARG_WITH(avahi_group,AS_HELP_STRING([--with-avahi-group=<group>],[Group for running avahi-daemon (avahi)]))
889 if test -z "$with_avahi_group" ; then
892 AVAHI_GROUP=$with_avahi_group
894 AC_SUBST(AVAHI_GROUP)
895 AC_DEFINE_UNQUOTED(AVAHI_GROUP,"$AVAHI_GROUP", [Group for Avahi])
897 AC_ARG_WITH(avahi_priv_access_group,AS_HELP_STRING([--with-avahi-priv-access-group=<group>],[Priviliged access group for Avahi clients (netdev)]))
898 if test -z "$with_avahi_priv_access_group" ; then
899 AVAHI_PRIV_ACCESS_GROUP=netdev
901 AVAHI_PRIV_ACCESS_GROUP=$with_avahi_priv_access_group
903 AC_SUBST(AVAHI_PRIV_ACCESS_GROUP)
904 AC_DEFINE_UNQUOTED(AVAHI_PRIV_ACCESS_GROUP,"$AVAHI_PRIV_ACCESS_GROUP", [Privileged access group for Avahi clients])
906 AC_ARG_WITH(autoipd_user, AS_HELP_STRING([--with-autoipd-user=<user>],[User for running the avahi-autoipd daemon (avahi-autoipd)]))
907 if test -z "$with_autoipd_user" ; then
908 AVAHI_AUTOIPD_USER=avahi-autoipd
910 AVAHI_AUTOIPD_USER=$with_autoipd_user
912 AC_SUBST(AVAHI_AUTOIPD_USER)
913 AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_USER,"$AVAHI_AUTOIPD_USER", [User for running the avahi-autoipd daemon])
915 AC_ARG_WITH(autoipd_group,AS_HELP_STRING([--with-autoipd-group=<group>],[Group for running the avahi-autoipd daemon (avahi-autoipd)]))
916 if test -z "$with_autoipd_group" ; then
917 AVAHI_AUTOIPD_GROUP=avahi-autoipd
919 AVAHI_AUTOIPD_GROUP=$with_autoipd_group
921 AC_SUBST(AVAHI_AUTOIPD_GROUP)
922 AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_GROUP,"$AVAHI_AUTOIPD_GROUP", [Group for running the avahi-autoipd daemon])
927 avahi_runtime_dir="${localstatedir}/run"
928 avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket"
929 AC_SUBST(avahi_runtime_dir)
930 AC_SUBST(avahi_socket)
933 # Avahi interfaces dir
935 if test "x$HAVE_PYTHON_DBUS" = "xyes" -o "x$HAVE_GTK" = "xyes"; then
936 interfacesdir="${datadir}/${PACKAGE}/interfaces/"
937 AC_SUBST(interfacesdir)
951 DX_INIT_DOXYGEN(avahi, doxygen.cfg, doxygen)
953 AC_ARG_ENABLE(core-docs,
954 AS_HELP_STRING([--enable-core-docs],[Enable building of documentation for avahi-core]),
955 [case "${enableval}" in
956 yes) ENABLE_CORE_DOCS=yes ;;
957 no) ENABLE_CORE_DOCS=no ;;
958 *) AC_MSG_ERROR([bad value ${enableval} for --enable-core-docs]) ;;
959 esac],[ENABLE_CORE_DOCS=no])
961 AM_CONDITIONAL([ENABLE_CORE_DOCS], [test "x$ENABLE_CORE_DOCS" = xyes])
964 # Build and Install man pages
966 AC_ARG_ENABLE(manpages,
967 AS_HELP_STRING([--disable-manpages],[Disable building and installation of man pages]),
968 [case "${enableval}" in
971 *) AC_MSG_ERROR([bad value ${enableval} for --disable-manpages]) ;;
972 esac],[manpages=yes])
974 if test x$manpages = xyes ; then
976 # XMLTOMAN manpage generation
978 AC_ARG_ENABLE(xmltoman,
979 AS_HELP_STRING([--disable-xmltoman],[Disable rebuilding of man pages with xmltoman]),
980 [case "${enableval}" in
983 *) AC_MSG_ERROR([bad value ${enableval} for --disable-xmltoman]) ;;
984 esac],[xmltoman=yes])
986 if test x$xmltoman = xyes ; then
987 AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no)
990 if test x$have_xmltoman = xno -o x$xmltoman = xno; then
991 if ! test -e man/avahi-daemon.8 ; then
992 AC_MSG_ERROR([*** xmltoman was not found or was disabled, it is required to build the manpages as they have not been pre-built, install xmltoman, pass --disable-manpages or dont pass --disable-xmltoman])
995 AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***])
999 AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes])
1000 AM_CONDITIONAL([BUILD_MANPAGES], [test "x$manpages" = xyes])
1003 # Conditionally compile test and example programs
1005 AC_ARG_ENABLE(tests,
1006 AS_HELP_STRING([--enable-tests],[Enable building of tests and examples]),
1007 [case "${enableval}" in
1008 yes) ENABLE_TESTS=yes ;;
1009 no) ENABLE_TESTS=no ;;
1010 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
1014 AM_CONDITIONAL([ENABLE_TESTS], [test "x$ENABLE_TESTS" = "xyes"])
1017 # Optionally enable libdns_sd compatibility support
1019 AC_ARG_ENABLE(compat-libdns_sd,
1020 AS_HELP_STRING([--enable-compat-libdns_sd],[Enable compatibility layer for libdns_sd]),
1021 [case "${enableval}" in
1022 yes) ENABLE_COMPAT_LIBDNS_SD=yes ;;
1023 no) ENABLE_COMPAT_LIBDNS_SD=no ;;
1024 *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-libdns_sd) ;;
1026 [ENABLE_COMPAT_LIBDNS_SD=no])
1028 AM_CONDITIONAL([ENABLE_COMPAT_LIBDNS_SD], [test "x$ENABLE_COMPAT_LIBDNS_SD" = "xyes"])
1031 # Optionally enable HOWL compatibility support
1033 AC_ARG_ENABLE(compat-howl,
1034 AS_HELP_STRING([--enable-compat-howl],[Enable compatibility layer for HOWL]),
1035 [case "${enableval}" in
1036 yes) ENABLE_COMPAT_HOWL=yes ;;
1037 no) ENABLE_COMPAT_HOWL=no ;;
1038 *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-howl) ;;
1040 [ENABLE_COMPAT_HOWL=no])
1042 AM_CONDITIONAL([ENABLE_COMPAT_HOWL], [test "x$ENABLE_COMPAT_HOWL" = "xyes"])
1045 # ==========================================================================
1048 avahi-common/Makefile
1051 avahi-gobject/Makefile
1053 avahi-daemon/Makefile
1054 avahi-daemon/avahi-dbus.conf
1055 avahi-discover-standalone/Makefile
1056 avahi-client/Makefile
1058 initscript/debian/Makefile
1059 initscript/gentoo/Makefile
1060 initscript/archlinux/Makefile
1061 initscript/suse/Makefile
1062 initscript/fedora/Makefile
1063 initscript/lfs/Makefile
1064 initscript/mandriva/Makefile
1065 initscript/darwin/Makefile
1066 initscript/freebsd/Makefile
1067 initscript/slackware/Makefile
1068 avahi-dnsconfd/Makefile
1069 avahi-utils/Makefile
1070 avahi-python/Makefile
1071 avahi-python/avahi/Makefile
1072 avahi-python/avahi-discover/Makefile
1077 service-type-database/Makefile
1078 avahi-sharp/Makefile
1079 avahi-ui-sharp/Makefile
1080 avahi-compat-libdns_sd/Makefile
1081 avahi-compat-howl/Makefile
1082 avahi-compat-howl/samples/Makefile
1083 avahi-autoipd/Makefile
1089 # ==========================================================================
1091 ---{ $PACKAGE_NAME $VERSION }---
1094 sysconfdir: ${sysconfdir}
1095 localstatedir: ${localstatedir}
1096 avahi socket: ${avahi_socket}
1097 dbus-1 system.d dir: ${DBUS_SYS_DIR}
1098 dbus-1 version: ${DBUS_VERSION}
1099 dbus-1 system socket: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
1102 Enable GLIB: ${HAVE_GLIB}
1103 Enable GLIB GObject: ${HAVE_GOBJECT}
1104 Enable GTK: ${HAVE_GTK}
1105 Enable D-Bus: ${HAVE_DBUS}
1106 With XML: ${with_xml}
1107 Enable GDBM: ${HAVE_GDBM}
1108 Enable DBM: ${HAVE_DBM}
1109 Enable libdaemon: ${HAVE_LIBDAEMON}
1110 Enable Python: ${HAVE_PYTHON}
1111 Enable pygtk: ${HAVE_PYGTK}
1112 Enable python-dbus: ${HAVE_PYTHON_DBUS}
1113 Enable QT3: ${HAVE_QT3}
1114 Enable QT4: ${HAVE_QT4}
1115 Enable Mono: ${HAVE_MONO}
1116 Enable Monodoc: ${HAVE_MONODOC}
1117 Distribution/OS: ${with_distro}
1118 User for avahi-daemon: ${AVAHI_USER}
1119 Group for avahi-daemon: ${AVAHI_GROUP}
1120 Priviliged access group for Avahi clients: ${AVAHI_PRIV_ACCESS_GROUP}
1121 User for avahi-autoipd: ${AVAHI_AUTOIPD_USER}
1122 Group for avahi-autoipd: ${AVAHI_AUTOIPD_GROUP}
1123 Enable chroot(): ${enable_chroot}
1124 Enable Linux inotify: ${have_inotify}
1125 Enable stack-smashing protection: ${enable_ssp}
1128 BUILD_DAEMON="no (You need libdaemon and expat/bsdxml!)"
1130 if test "x$HAVE_XML" = "xyes" -a "x$HAVE_LIBDAEMON" = "xyes" ; then
1134 BUILD_PYTHON="no (You need python, pygtk and python-dbus!)"
1136 if test "x$BUILD_DAEMON" = "xyes" -a "x$HAVE_DBUS" = "xyes" -a "x$HAVE_PYTHON" = "xyes" -a "x$HAVE_PYTHON_DBUS" = "xyes" -a "x$HAVE_PYGTK" = "xyes" ; then
1140 BUILD_CLIENT="no (You need avahi-daemon and D-Bus!)"
1142 if test "x$BUILD_DAEMON" = "xyes" -a "x$HAVE_DBUS" = "xyes" ; then
1146 if test "x$ENABLE_COMPAT_LIBDNS_SD" = "xyes" -a "x$BUILD_CLIENT" != "xyes" ; then
1147 ENABLE_COMPAT_LIBDNS_SD="no (You need libavahi-client!)"
1149 if test "x$ENABLE_COMPAT_HOWL" = "xyes" -a "x$BUILD_CLIENT" != "xyes" ; then
1150 ENABLE_COMPAT_HOWL="no (You need libavahi-client!)"
1152 if test "x$ENABLE_AUTOIPD" = "xyes" -a "x$HAVE_LIBDAEMON" != "xyes" ; then
1153 ENABLE_AUTOIPD="no (You need libdaemon!)"
1157 if test "x$HAVE_GTK" = "xyes" -a "x$BUILD_CLIENT" = "xyes" ; then
1162 if test "x$BUILD_CLIENT" = "xyes" -a "x$HAVE_GOBJECT" = "xyes" ; then
1167 Building libavahi-core yes
1168 Building avahi-daemon: ${BUILD_DAEMON}
1169 Building avahi-dnsconfd: ${BUILD_DAEMON}
1170 Building libavahi-client: ${BUILD_CLIENT}
1171 Building avahi-utils: ${BUILD_CLIENT}
1172 Building avahi-python: ${BUILD_PYTHON}
1173 Building libavahi-glib: ${HAVE_GLIB}
1174 Building libavahi-gobject: ${BUILD_GOBJECT}
1175 Building avahi-discover-standalone: ${HAVE_GTK}
1176 Building libavahi-qt3: ${HAVE_QT3}
1177 Building libavahi-qt4: ${HAVE_QT4}
1178 Building avahi-sharp: ${HAVE_MONO}
1179 Building avahi-compat-libdns_sd: ${ENABLE_COMPAT_LIBDNS_SD}
1180 Building avahi-compat-howl: ${ENABLE_COMPAT_HOWL}
1181 Building tests: ${ENABLE_TESTS}
1182 Building avahi-core documentation: ${ENABLE_CORE_DOCS}
1183 Building avahi-autoipd: ${ENABLE_AUTOIPD}
1184 Building libavahi-ui: ${BUILD_UI}