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.17],[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, [7:3:4])
32 AC_SUBST(LIBAVAHI_CORE_VERSION_INFO, [5:0:0])
33 AC_SUBST(LIBAVAHI_CLIENT_VERSION_INFO, [5:2:2])
34 AC_SUBST(LIBAVAHI_GLIB_VERSION_INFO, [1:1:0])
35 AC_SUBST(LIBAVAHI_QT3_VERSION_INFO, [1:1:0])
36 AC_SUBST(LIBAVAHI_QT4_VERSION_INFO, [1:1:0])
37 AC_SUBST(LIBAVAHI_UI_VERSION_INFO, [0:0:0])
39 # Do not touch these, since they we took this version-info from upstream HOWL/Bonjour
40 AC_SUBST(LIBAVAHI_COMPAT_LIBDNS_SD_VERSION_INFO, [1:0:0])
41 AC_SUBST(LIBAVAHI_COMPAT_HOWL_VERSION_INFO, [0:0:0])
42 AC_SUBST(HOWL_COMPAT_VERSION, [0.9.8])
44 if type -p stow > /dev/null && test -d /usr/local/stow ; then
45 AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
46 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
49 # Checks for programs.
57 AC_PROG_GCC_TRADITIONAL
62 AC_CACHE_CHECK([whether the C++ compiler works], [avahi_cv_sys_cxx_works], [
64 AC_COMPILE_IFELSE([int main() { return 0; }], [avahi_cv_sys_cxx_works=yes],
65 [avahi_cv_sys_cxx_works=no])
68 [ if [ "x$avahi_cv_sys_cxx_works" = "xno" ]; then ]
69 AC_MSG_FAILURE([The C++ compiler does not work])
72 ACX_PTHREAD(,AC_MSG_ERROR([Missing POSIX Threads support]))
77 AC_CHECK_HEADER(linux/netlink.h,
79 AC_DEFINE([HAVE_NETLINK],[],[Support for Linux netlink])
81 #include <sys/socket.h>
82 #include <asm/types.h>
85 AM_CONDITIONAL(HAVE_NETLINK, [ test x"$HAVE_NETLINK" = xyes ])
88 # Check for net/route.h
90 AC_CHECK_HEADER(net/route.h,
92 AC_DEFINE([HAVE_PF_ROUTE],[],[Support for PF_ROUTE])
94 #include <sys/types.h>
95 #include <sys/socket.h>
98 AM_CONDITIONAL(HAVE_PF_ROUTE, [ test x"$HAVE_PF_ROUTE" = xyes ])
101 # Check for sys/filio.h; needed for FIONREAD on Solaris
103 AC_CHECK_HEADER(sys/filio.h,
105 AC_DEFINE([HAVE_SYS_FILIO_H],[],[Support for sys/filio.h])
109 AM_CONDITIONAL(HAVE_SYS_FILIO_H, [ test x"$HAVE_SYS_FILIO_H" = xyes ])
112 # Check for sys/sysctl.h; not present on Solaris
114 AC_CHECK_HEADER(sys/sysctl.h,
116 AC_DEFINE([HAVE_SYS_SYSCTL_H],[],[Support for sys/sysctl.h])
118 #include <sys/types.h>
119 #include <sys/socket.h>
120 #include <sys/param.h>
123 AM_CONDITIONAL(HAVE_SYS_SYSCTL_H, [ test x"$HAVE_SYS_SYSCTL_H" = xyes ])
126 # Check for lifconf struct; only present on Solaris
128 AC_MSG_CHECKING(for struct lifconf)
129 AC_CACHE_VAL(avahi_cv_has_struct_lifconf,
131 [#include <sys/socket.h>
133 ],[sizeof (struct lifconf);],
134 avahi_cv_has_struct_lifconf=yes,avahi_cv_has_struct_lifconf=no)])
135 AC_MSG_RESULT($avahi_cv_has_struct_lifconf)
136 if test $avahi_cv_has_struct_lifconf = yes; then
137 AC_DEFINE(HAVE_STRUCT_LIFCONF,1,[Define if there is a struct lifconf.])
141 # Check for struct ip_mreqn
143 AC_MSG_CHECKING(for struct ip_mreqn)
144 AC_TRY_COMPILE([#include <netinet/in.h>], [
145 struct ip_mreqn mreq;
146 mreq.imr_address.s_addr = 0;
150 AC_DEFINE([HAVE_STRUCT_IP_MREQN],[],[Support for struct ip_mreqn])
152 # We'll just have to try and use struct ip_mreq
154 AC_MSG_CHECKING(for struct ip_mreq)
155 AC_TRY_COMPILE([#include <netinet/in.h>], [
157 mreq.imr_interface.s_addr = 0;
161 AC_DEFINE([HAVE_STRUCT_IP_MREQ],[],[Support for struct ip_mreq])
163 # No multicast support
169 # Detecting the linux distribution for specific things like init scripts.
171 AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of debian, gentoo, archlinux, fedora, mandriva, darwin, netbsd, freebsd, slackware or none]))
172 if test "z$with_distro" = "z"; then
173 AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
174 AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
175 AC_CHECK_FILE(/etc/arch-release,with_distro="archlinux")
176 AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
177 AC_CHECK_FILE(/etc/redhat-release,with_distro="fedora")
178 AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva")
179 AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
180 if test "z$with_distro" = "z"; then
181 with_distro=`uname -s`
184 with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
187 debian|gentoo|archlinux|suse|fedora|mandriva|darwin|freebsd|slackware|none)
190 AC_MSG_WARN([Your distribution (${with_distro}) is supported but no init script exist yet! (patches welcome)])
193 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.])
196 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])
200 AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
201 AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
202 AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
203 AM_CONDITIONAL(TARGET_ARCHLINUX, test x"$with_distro" = xarchlinux)
204 AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
205 AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
206 AM_CONDITIONAL(TARGET_DARWIN, test x"$with_distro" = xdarwin)
207 AM_CONDITIONAL(TARGET_NETBSD, test x"$with_distro" = xnetbsd)
208 AM_CONDITIONAL(TARGET_FREEBSD, test x"$with_distro" = xfreebsd)
209 AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
212 AC_LANG_CONFTEST([int main() {}])
213 $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
219 # If using GCC specify some additional parameters
220 if test "x$GCC" = "xyes" ; then
222 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 -fPIC"
224 if test "x$HAVE_NETLINK" = "xyes" ; then
225 # Test whether rtnetlink.h can be included when compiled with -std=c99
226 # some distributions (e.g. archlinux) have broken headers that dont
227 # define __u64 with -std=c99
228 AC_MSG_CHECKING([checking whether rtnetlink.h can be included with -std=c99])
231 AC_TRY_COMPILE([#include <linux/rtnetlink.h>], [],
232 use_stdc99=yes, use_stdc99=no)
234 if test x"$use_stdc99" = xyes; then
235 DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
243 DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
246 for flag in $DESIRED_FLAGS ; do
247 AC_MSG_CHECKING([whether $CC accepts $flag])
248 if test_gcc_flag $flag ; then
249 CFLAGS="$CFLAGS $flag"
257 # Checks for header files.
259 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])
262 # Checks for typedefs, structures, and compiler characteristics.
268 # Checks for library functions.
270 AC_FUNC_SELECT_ARGTYPES
273 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])
280 AC_CHECK_DECLS(environ)
283 AC_CHECK_HEADERS([sys/capability.h],,enable_chroot=no)
284 AC_CHECK_HEADERS([sys/prctl.h],,enable_chroot=no)
285 AC_CHECK_FUNCS([chroot],,enable_chroot=no)
287 AM_CONDITIONAL(ENABLE_CHROOT, test "x$enable_chroot" = "xyes")
289 if test "x$enable_chroot" = "xyes" ; then
290 AC_DEFINE([ENABLE_CHROOT], 1, [Enable chroot() usage])
293 AC_CHECK_LIB(dl, dlopen, [ AC_CHECK_HEADERS(dlfcn.h, HAVE_DLOPEN=yes, HAVE_DLOPEN=no) ], HAVE_DLOPEN=no)
294 if test "x$HAVE_DLOPEN" = "xyes" ; then
295 AC_DEFINE([HAVE_DLOPEN],1,[Have dlopen()])
297 AM_CONDITIONAL(HAVE_DLOPEN, test "x$HAVE_DLOPEN" = "xyes")
300 AC_CHECK_HEADERS([linux/inotify.h], [have_inotify=yes])
301 AC_CHECK_HEADERS([sys/inotify.h], [have_inotify=yes])
303 AM_CONDITIONAL(HAVE_INOTIFY, test "x$have_inotify" = "xyes")
305 if test "x$have_inotify" = "xyes" ; then
306 AC_DEFINE([HAVE_INOTIFY], 1, [Enable Linux inotify() usage])
309 # Check for pkg-config manually first, as if its not installed the
310 # PKG_PROG_PKG_CONFIG macro won't be defined.
311 AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
313 if test x"$have_pkg_config" = "xno"; then
314 AC_MSG_ERROR(pkg-config is required to install this program)
323 AS_HELP_STRING([--disable-glib],[Disable use of GLib]),
324 [case "${enableval}" in
325 yes) HAVE_GLIB=yes ;;
327 *) AC_MSG_ERROR(bad value ${enableval} for --enable-glib) ;;
331 if test "x$HAVE_GLIB" = "xyes" ; then
332 PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ])
333 AC_SUBST(GLIB20_CFLAGS)
334 AC_SUBST(GLIB20_LIBS)
336 AM_CONDITIONAL(HAVE_GLIB, test "x$HAVE_GLIB" = "xyes")
342 AS_HELP_STRING([--disable-qt3],[Disable building of Qt3 mainloop integration]),
343 [case "${enableval}" in
346 *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt3) ;;
350 if test "x$HAVE_QT3" = "xyes" ; then
351 PKG_CHECK_MODULES( QT3, [ qt-mt >= 3.0.0 ])
354 QT3_PREFIX="`$PKG_CONFIG --variable=prefix qt-mt`/bin"
356 AC_CHECK_FILE( "$QT3_PREFIX/moc-qt3", [ MOC_QT3=$QT3_PREFIX/moc-qt3 ], [
357 AC_CHECK_FILE("$QT3_PREFIX/moc", [ MOC_QT3=$QT3_PREFIX/moc ], [
358 AC_MSG_ERROR([Couldn't find QT3 moc])])])
361 AM_CONDITIONAL(HAVE_QT3, test "x$HAVE_QT3" = "xyes")
367 AS_HELP_STRING([--disable-qt4],[Disable building of Qt4Core mainloop integration]),
368 [case "${enableval}" in
371 *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt4) ;;
375 if test "x$HAVE_QT4" = "xyes" ; then
376 PKG_CHECK_MODULES( QT4, [ QtCore >= 4.0.0 ])
379 QT4_PREFIX="`$PKG_CONFIG --variable=prefix QtCore`/bin"
381 AC_CHECK_FILE( "$QT4_PREFIX/moc-qt4", [ MOC_QT4=$QT4_PREFIX/moc-qt4 ], [
382 AC_CHECK_FILE("$QT4_PREFIX/moc", [ MOC_QT4=$QT4_PREFIX/moc ], [
383 AC_MSG_ERROR([Couldn't find QT4 moc])])])
386 AM_CONDITIONAL(HAVE_QT4, test "x$HAVE_QT4" = "xyes")
392 AS_HELP_STRING([--disable-gtk],[Disable use of GTK+]),
393 [case "${enableval}" in
396 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk) ;;
400 if test "x$HAVE_GTK" = "xyes" ; then
402 PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.4.0 ])
403 AC_SUBST(GTK20_CFLAGS)
406 # Check for GLADE 2.0
407 PKG_CHECK_MODULES(GLADE20, [ libglade-2.0 >= 2.4.0 ])
408 AC_SUBST(GLADE20_CFLAGS)
409 AC_SUBST(GLADE20_LIBS)
411 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
417 AS_HELP_STRING([--disable-dbus],[Disable use of D-Bus]),
418 [case "${enableval}" in
419 yes) HAVE_DBUS=yes ;;
421 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbus) ;;
425 AC_ARG_WITH(dbus-sys, AS_HELP_STRING([--with-dbus-sys=<dir>], [Path to D-Bus system.d directory]))
426 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]))
428 DBUS_VERSION="Disabled"
429 DBUS_SYS_DIR="Disabled"
430 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="Disabled"
431 if test "x$HAVE_DBUS" = "xyes" ; then
432 PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 0.34 ])
434 AC_DEFINE(HAVE_DBUS, 1, [Whether we have D-Bus or not])
436 DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion`
437 DBUS_VERSION_MAJOR=`echo $DBUS_VERSION | awk -F. '{print $1}'`
438 DBUS_VERSION_MINOR=`echo $DBUS_VERSION | awk -F. '{print $2}'`
439 DBUS_VERSION_MICRO=`echo $DBUS_VERSION | awk -F. '{print $3}'`
440 if test "z$DBUS_VERSION_MAJOR" = "z"; then
441 DBUS_VERSION_MAJOR="0"
443 if test "z$DBUS_VERSION_MINOR" = "z"; then
444 DBUS_VERSION_MINOR="0"
446 if test "z$DBUS_VERSION_MICRO" = "z"; then
447 DBUS_VERSION_MICRO="0"
450 if test "z$DBUS_VERSION_MAJOR" = "z0" -a "z$DBUS_VERSION_MINOR" = "z0" -a "z$DBUS_VERSION_MICRO" = "z0"; then
451 echo "Error: Couldn't determine the version of your D-Bus package."
452 echo " This is probably an error in this script, please report it"
453 echo " along with the following information:"
454 echo " Base D-Buss version ='$DBUS_VERSION'"
455 echo " DBUS_VERSION_MAJOR='$DBUS_VERSION_MAJOR'"
456 echo " DBUS_VERSION_MINOR='$DBUS_VERSION_MINOR'"
457 echo " DBUS_VERSION_MICRO='$DBUS_VERSION_MICRO'"
460 echo "Your D-Bus version is $DBUS_VERSION_MAJOR,$DBUS_VERSION_MINOR,$DBUS_VERSION_MICRO."
461 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MAJOR=$DBUS_VERSION_MAJOR"
462 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MINOR=$DBUS_VERSION_MINOR"
463 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MICRO=$DBUS_VERSION_MICRO"
466 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
467 AC_SUBST(DBUS_CFLAGS)
470 if ! test -z "$with_dbus_sys" ; then
471 DBUS_SYS_DIR="$with_dbus_sys"
473 DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
475 AC_SUBST(DBUS_SYS_DIR)
477 if ! test -z "$with_dbus_system_address" ; then
478 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="$with_dbus_system_address"
480 # This is ugly, but D-Bus doesn't export this address for us
481 # so we have to guess, pretty much all setups i've seen have
482 # it in /var/lib/dbus or /var/run/dbus, and its defaulted to
483 # /var/run upstream so we will try guess first then default
486 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=/var/run/dbus/system_bus_socket"
487 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"
488 for sock in $TRY_SOCKETS; do
489 if test -S $sock; then
490 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$sock"
494 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
497 LIBS="$LIBS $DBUS_LIBS"
498 AC_CHECK_FUNCS([dbus_connection_close dbus_bus_get_private])
501 AM_CONDITIONAL(HAVE_DBUS, test "x$HAVE_DBUS" = "xyes")
507 AS_HELP_STRING([--disable-expat],[Disable use of Expat]),
508 [case "${enableval}" in
509 yes) HAVE_EXPAT=yes ;;
511 *) AC_MSG_ERROR(bad value ${enableval} for --enable-expat) ;;
515 if test "x$HAVE_EXPAT" = "xyes" ; then
516 AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false)
518 if ! $have_expat ; then
519 AC_MSG_ERROR([*** libexpat not found ***])
522 AM_CONDITIONAL(HAVE_EXPAT, test "x$HAVE_EXPAT" = "xyes")
531 AS_HELP_STRING([--enable-dbm],[Enable use of DBM]),
532 [case "${enableval}" in
535 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbm) ;;
540 AS_HELP_STRING([--disable-gdbm],[Disable use of GDBM]),
541 [case "${enableval}" in
542 yes) HAVE_GDBM=yes ;;
544 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gdbm) ;;
548 if test "x$HAVE_GDBM" = "xyes" ; then
549 if test "x$HAVE_DBM" = "xyes" ; then
550 AC_MSG_ERROR([*** --enable-gdbm and --enable-dbm both specified ***])
552 AC_CHECK_LIB(gdbm, gdbm_open, [ AC_CHECK_HEADERS(gdbm.h, have_gdbm=true, have_gdbm=false) ], have_gdbm=false)
554 if ! $have_gdbm ; then
555 AC_MSG_ERROR([*** libgdbm not found ***])
557 AC_DEFINE([HAVE_GDBM],[],[Support for GDBM])
559 if test "x$HAVE_DBM" = "xyes" ; then
560 AC_CHECK_HEADERS(ndbm.h, have_dbm=true, have_dbm=false)
562 if ! $have_dbm ; then
563 AC_MSG_ERROR([*** dbm not found ***])
565 AC_DEFINE([HAVE_DBM],[],[Support for DBM])
568 AM_CONDITIONAL(HAVE_GDBM, test "x$HAVE_GDBM" = "xyes")
569 AM_CONDITIONAL(HAVE_DBM, test "x$HAVE_DBM" = "xyes")
574 AC_ARG_ENABLE(libdaemon,
575 AS_HELP_STRING([--disable-libdaemon],[Disable use of libdaemon]),
576 [case "${enableval}" in
577 yes) HAVE_LIBDAEMON=yes ;;
578 no) HAVE_LIBDAEMON=no ;;
579 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libdaemon) ;;
581 [HAVE_LIBDAEMON=yes])
583 if test "x$HAVE_LIBDAEMON" = "xyes" ; then
584 PKG_CHECK_MODULES(LIBDAEMON, [ libdaemon >= 0.5 ])
585 AC_SUBST(LIBDAEMON_CFLAGS)
586 AC_SUBST(LIBDAEMON_LIBS)
588 AM_CONDITIONAL(HAVE_LIBDAEMON, test "x$HAVE_LIBDAEMON" = "xyes")
593 AC_ARG_ENABLE(python,
594 AS_HELP_STRING([--disable-python], [Disable scripts that depends on python]),
595 [case "${enableval}" in
596 yes) HAVE_PYTHON=yes ;;
597 no) HAVE_PYTHON=no ;;
598 *) AC_MSG_ERROR([bad value ${enableval} for --enable-python]) ;;
599 esac],[HAVE_PYTHON=yes])
604 if test "x$HAVE_PYTHON" = "xyes" ; then
605 AM_PATH_PYTHON([2.4])
608 AS_HELP_STRING([--disable-pygtk],[Disable use of GTK in Python]),
609 [case "${enableval}" in
610 yes) HAVE_PYGTK=yes ;;
612 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pygtk) ;;
616 if test "x$HAVE_PYGTK" = "xyes" ; then
617 AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR(Could not find Python module gtk)])
621 if test "x$HAVE_DBUS" = "xyes" ; then
622 AC_ARG_ENABLE(python-dbus,
623 AS_HELP_STRING([--disable-python-dbus],[Disable use of D-Bus in Python]),
624 [case "${enableval}" in
625 yes) HAVE_PYTHON_DBUS=yes ;;
626 no) HAVE_PYTHON_DBUS=no ;;
627 *) AC_MSG_ERROR(bad value ${enableval} for --enable-python-dbus) ;;
629 [HAVE_PYTHON_DBUS=yes])
631 if test "x$HAVE_PYTHON_DBUS" = "xyes"; then
632 AM_CHECK_PYMOD(dbus,,,[AC_MSG_ERROR(Could not find Python module dbus)])
635 AM_CHECK_PYMOD(socket,,,[AC_MSG_ERROR(Could not find Python module socket)])
636 if test "x$HAVE_GDBM" = "xyes"; then
637 AM_CHECK_PYMOD(gdbm,,,[AC_MSG_ERROR(Could not find Python module gdbm)])
639 if test "x$HAVE_DBM" = "xyes"; then
640 AM_CHECK_PYMOD(dbm,,,[AC_MSG_ERROR(Could not find Python module dbm)])
644 AM_CONDITIONAL(HAVE_PYTHON, [test "x$HAVE_PYTHON" = "xyes" ])
645 AM_CONDITIONAL(HAVE_PYGTK, test "x$HAVE_PYGTK" = "xyes")
646 AM_CONDITIONAL(HAVE_PYTHON_DBUS, test "x$HAVE_PYTHON_DBUS" = "xyes")
649 # Check for mono stuff
652 if test "x$HAVE_DBUS" = "xyes" ; then
654 AS_HELP_STRING([--disable-mono],[Disable mono bindings]),
655 [case "${enableval}" in
656 yes) HAVE_MONO=yes ;;
658 *) AC_MSG_ERROR(bad value ${enableval} for --enable-mono) ;;
662 if test "x$HAVE_MONO" = "xyes" ; then
663 AC_PATH_PROG(MCS, mcs)
664 if test "x$MCS" = "x" ; then
665 AC_MSG_ERROR([Can not find "mcs" - The Mono C-Sharp Compiler) in your PATH])
668 AC_PATH_PROG(GACUTIL, gacutil)
669 if test "x$GACUTIL" = "x" ; then
670 AC_MSG_ERROR([Can not find "gacutil" in your PATH])
677 AM_CONDITIONAL(HAVE_MONO, test "x$HAVE_MONO" = "xyes")
680 # Check for monodoc stuff
683 AC_ARG_ENABLE(monodoc,
684 AS_HELP_STRING([--disable-monodoc],[Disable documentation for mono bindings]),
685 [case "${enableval}" in
686 yes) HAVE_MONODOC=yes ;;
687 no) HAVE_MONODOC=no ;;
688 *) AC_MSG_ERROR(bad value ${enableval} for --enable-monodoc) ;;
692 if test "x$HAVE_MONO" = "xyes" && test "x$HAVE_MONODOC" = "xyes" ; then
693 PKG_CHECK_MODULES(MONODOC, [monodoc >= 1.1.8])
694 MONODOC_DIR=`$PKG_CONFIG --variable=sourcesdir monodoc`
696 AC_PATH_PROG(MONODOCER, monodocer)
697 AC_PATH_PROG(MDASSEMBLER, mdassembler)
699 AC_SUBST(MONODOC_DIR)
701 AC_SUBST(MDASSEMBLER)
703 AM_CONDITIONAL(HAVE_MONODOC, test "x$HAVE_MONODOC" = "xyes")
708 AC_ARG_ENABLE(autoipd,
709 AS_HELP_STRING([--disable-autoipd],[Disable building of avahi-autoipd]),
710 [case "${enableval}" in
711 yes) ENABLE_AUTOIPD=yes ;;
712 no) ENABLE_AUTOIPD=no ;;
713 *) AC_MSG_ERROR(bad value ${enableval} for --disable-autoipd) ;;
715 [ENABLE_AUTOIPD=yes])
717 AM_CONDITIONAL(ENABLE_AUTOIPD, test "x$ENABLE_AUTOIPD" = "xyes")
720 # Defining users and groups
722 AC_ARG_WITH(avahi_user, AS_HELP_STRING([--with-avahi-user=<user>],[User for running avahi-daemon (avahi)]))
723 if test -z "$with_avahi_user" ; then
726 AVAHI_USER=$with_avahi_user
729 AC_DEFINE_UNQUOTED(AVAHI_USER,"$AVAHI_USER", [User for running the Avahi daemon])
731 AC_ARG_WITH(avahi_group,AS_HELP_STRING([--with-avahi-group=<group>],[Group for running avahi-daemon (avahi)]))
732 if test -z "$with_avahi_group" ; then
735 AVAHI_GROUP=$with_avahi_group
737 AC_SUBST(AVAHI_GROUP)
738 AC_DEFINE_UNQUOTED(AVAHI_GROUP,"$AVAHI_GROUP", [Group for Avahi])
740 AC_ARG_WITH(avahi_priv_access_group,AS_HELP_STRING([--with-avahi-priv-access-group=<group>],[Priviliged access group for Avahi clients (netdev)]))
741 if test -z "$with_avahi_priv_access_group" ; then
742 AVAHI_PRIV_ACCESS_GROUP=netdev
744 AVAHI_PRIV_ACCESS_GROUP=$with_avahi_priv_access_group
746 AC_SUBST(AVAHI_PRIV_ACCESS_GROUP)
747 AC_DEFINE_UNQUOTED(AVAHI_PRIV_ACCESS_GROUP,"$AVAHI_PRIV_ACCESS_GROUP", [Privileged access group for Avahi clients])
749 AC_ARG_WITH(autoipd_user, AS_HELP_STRING([--with-autoipd-user=<user>],[User for running the avahi-autoipd daemon (avahi-autoipd)]))
750 if test -z "$with_autoipd_user" ; then
751 AVAHI_AUTOIPD_USER=avahi-autoipd
753 AVAHI_AUTOIPD_USER=$with_autoipd_user
755 AC_SUBST(AVAHI_AUTOIPD_USER)
756 AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_USER,"$AVAHI_AUTOIPD_USER", [User for running the avahi-autoipd daemon])
758 AC_ARG_WITH(autoipd_group,AS_HELP_STRING([--with-autoipd-group=<group>],[Group for running the avahi-autoipd daemon (avahi-autoipd)]))
759 if test -z "$with_autoipd_group" ; then
760 AVAHI_AUTOIPD_GROUP=avahi-autoipd
762 AVAHI_AUTOIPD_GROUP=$with_autoipd_group
764 AC_SUBST(AVAHI_AUTOIPD_GROUP)
765 AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_GROUP,"$AVAHI_AUTOIPD_GROUP", [Group for running the avahi-autoipd daemon])
770 avahi_runtime_dir="${localstatedir}/run"
771 avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket"
772 AC_SUBST(avahi_runtime_dir)
773 AC_SUBST(avahi_socket)
776 # Avahi interfaces dir
778 if test "x$HAVE_PYTHON_DBUS" = "xyes" -o "x$HAVE_GTK" = "xyes"; then
779 interfacesdir="${datadir}/${PACKAGE}/interfaces/"
780 AC_SUBST(interfacesdir)
794 DX_INIT_DOXYGEN(avahi, doxygen.cfg, doxygen)
796 AC_ARG_ENABLE(core-docs,
797 AS_HELP_STRING([--enable-core-docs],[Enable building of documentation for avahi-core]),
798 [case "${enableval}" in
799 yes) ENABLE_CORE_DOCS=yes ;;
800 no) ENABLE_CORE_DOCS=no ;;
801 *) AC_MSG_ERROR([bad value ${enableval} for --enable-core-docs]) ;;
802 esac],[ENABLE_CORE_DOCS=no])
804 AM_CONDITIONAL([ENABLE_CORE_DOCS], [test "x$ENABLE_CORE_DOCS" = xyes])
807 # Build and Install man pages
809 AC_ARG_ENABLE(manpages,
810 AS_HELP_STRING([--disable-manpages],[Disable building and installation of man pages]),
811 [case "${enableval}" in
814 *) AC_MSG_ERROR([bad value ${enableval} for --disable-manpages]) ;;
815 esac],[manpages=yes])
817 if test x$manpages = xyes ; then
819 # XMLTOMAN manpage generation
821 AC_ARG_ENABLE(xmltoman,
822 AS_HELP_STRING([--disable-xmltoman],[Disable rebuilding of man pages with xmltoman]),
823 [case "${enableval}" in
826 *) AC_MSG_ERROR([bad value ${enableval} for --disable-xmltoman]) ;;
827 esac],[xmltoman=yes])
829 if test x$xmltoman = xyes ; then
830 AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no)
833 if test x$have_xmltoman = xno -o x$xmltoman = xno; then
834 if ! test -e man/avahi-daemon.8 ; then
835 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])
838 AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***])
842 AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes])
843 AM_CONDITIONAL([BUILD_MANPAGES], [test "x$manpages" = xyes])
846 # Conditionally compile test and example programs
849 AS_HELP_STRING([--enable-tests],[Enable building of tests and examples]),
850 [case "${enableval}" in
851 yes) ENABLE_TESTS=yes ;;
852 no) ENABLE_TESTS=no ;;
853 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
857 AM_CONDITIONAL([ENABLE_TESTS], [test "x$ENABLE_TESTS" = "xyes"])
860 # Optionally enable libdns_sd compatibility support
862 AC_ARG_ENABLE(compat-libdns_sd,
863 AS_HELP_STRING([--enable-compat-libdns_sd],[Enable compatibility layer for libdns_sd]),
864 [case "${enableval}" in
865 yes) ENABLE_COMPAT_LIBDNS_SD=yes ;;
866 no) ENABLE_COMPAT_LIBDNS_SD=no ;;
867 *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-libdns_sd) ;;
869 [ENABLE_COMPAT_LIBDNS_SD=no])
871 AM_CONDITIONAL([ENABLE_COMPAT_LIBDNS_SD], [test "x$ENABLE_COMPAT_LIBDNS_SD" = "xyes"])
874 # Optionally enable HOWL compatibility support
876 AC_ARG_ENABLE(compat-howl,
877 AS_HELP_STRING([--enable-compat-howl],[Enable compatibility layer for HOWL]),
878 [case "${enableval}" in
879 yes) ENABLE_COMPAT_HOWL=yes ;;
880 no) ENABLE_COMPAT_HOWL=no ;;
881 *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-howl) ;;
883 [ENABLE_COMPAT_HOWL=no])
885 AM_CONDITIONAL([ENABLE_COMPAT_HOWL], [test "x$ENABLE_COMPAT_HOWL" = "xyes"])
888 # ==========================================================================
891 avahi-common/Makefile
895 avahi-daemon/Makefile
896 avahi-daemon/avahi-dbus.conf
897 avahi-discover-standalone/Makefile
898 avahi-client/Makefile
900 initscript/debian/Makefile
901 initscript/gentoo/Makefile
902 initscript/archlinux/Makefile
903 initscript/suse/Makefile
904 initscript/fedora/Makefile
905 initscript/mandriva/Makefile
906 initscript/darwin/Makefile
907 initscript/freebsd/Makefile
908 initscript/slackware/Makefile
909 avahi-dnsconfd/Makefile
911 avahi-python/Makefile
912 avahi-python/avahi/Makefile
917 service-type-database/Makefile
919 avahi-compat-libdns_sd/Makefile
920 avahi-compat-howl/Makefile
921 avahi-compat-howl/samples/Makefile
922 avahi-autoipd/Makefile
927 # ==========================================================================
929 ---{ $PACKAGE_NAME $VERSION }---
932 sysconfdir: ${sysconfdir}
933 localstatedir: ${localstatedir}
934 avahi socket: ${avahi_socket}
935 dbus-1 system.d dir: ${DBUS_SYS_DIR}
936 dbus-1 version: ${DBUS_VERSION}
937 dbus-1 system socket: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
940 Enable GLIB: ${HAVE_GLIB}
941 Enable GTK: ${HAVE_GTK}
942 Enable D-Bus: ${HAVE_DBUS}
943 Enable Expat: ${HAVE_EXPAT}
944 Enable GDBM: ${HAVE_GDBM}
945 Enable DBM: ${HAVE_DBM}
946 Enable libdaemon: ${HAVE_LIBDAEMON}
947 Enable Python: ${HAVE_PYTHON}
948 Enable pygtk: ${HAVE_PYGTK}
949 Enable python-dbus: ${HAVE_PYTHON_DBUS}
950 Enable QT3: ${HAVE_QT3}
951 Enable QT4: ${HAVE_QT4}
952 Enable Mono: ${HAVE_MONO}
953 Enable Monodoc: ${HAVE_MONODOC}
954 Distribution/OS: ${with_distro}
955 User for avahi-daemon: ${AVAHI_USER}
956 Group for avahi-daemon: ${AVAHI_GROUP}
957 Priviliged access group for Avahi clients: ${AVAHI_PRIV_ACCESS_GROUP}
958 User for avahi-autoipd: ${AVAHI_AUTOIPD_USER}
959 Group for avahi-autoipd: ${AVAHI_AUTOIPD_GROUP}
960 Enable chroot(): ${enable_chroot}
961 Enable Linux inotify: ${have_inotify}
964 BUILD_DAEMON="no (You need libdaemon and expat!)"
966 if test "x$HAVE_EXPAT" = "xyes" -a "x$HAVE_LIBDAEMON" = "xyes" ; then
970 BUILD_PYTHON="no (You need python, pygtk and python-dbus!)"
972 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
976 BUILD_CLIENT="no (You need avahi-daemon and D-Bus!)"
978 if test "x$BUILD_DAEMON" = "xyes" -a "x$HAVE_DBUS" = "xyes" ; then
982 if test "x$ENABLE_COMPAT_LIBDNS_SD" = "xyes" -a "x$BUILD_CLIENT" != "xyes" ; then
983 ENABLE_COMPAT_LIBDNS_SD="no (You need libavahi-client!)"
985 if test "x$ENABLE_COMPAT_HOWL" = "xyes" -a "x$BUILD_CLIENT" != "xyes" ; then
986 ENABLE_COMPAT_HOWL="no (You need libavahi-client!)"
990 if test "x$HAVE_GTK" = "xyes" -a "x$BUILD_CLIENT" = "xyes" ; then
995 Building libavahi-core yes
996 Building avahi-daemon: ${BUILD_DAEMON}
997 Building avahi-dnsconfd: ${BUILD_DAEMON}
998 Building libavahi-client: ${BUILD_CLIENT}
999 Building avahi-utils: ${BUILD_CLIENT}
1000 Building avahi-python: ${BUILD_PYTHON}
1001 Building libavahi-glib: ${HAVE_GLIB}
1002 Building avahi-discover-standalone: ${HAVE_GTK}
1003 Building libavahi-qt3: ${HAVE_QT3}
1004 Building libavahi-qt4: ${HAVE_QT4}
1005 Building avahi-sharp: ${HAVE_MONO}
1006 Building avahi-compat-libdns_sd: ${ENABLE_COMPAT_LIBDNS_SD}
1007 Building avahi-compat-howl: ${ENABLE_COMPAT_HOWL}
1008 Building tests: ${ENABLE_TESTS}
1009 Building avahi-core documentation: ${ENABLE_CORE_DOCS}
1010 Building avahi-autoipd: ${ENABLE_AUTOIPD}
1011 Building libavahi-ui: ${BUILD_UI}