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.20],[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:4:4])
32 AC_SUBST(LIBAVAHI_CORE_VERSION_INFO, [5:2: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:1: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
60 AC_ARG_ENABLE([stack-protector],
61 [AS_HELP_STRING([--disable-stack-protector],
62 [Disable GCC's/libc's stack-smashing protection])],
63 [case "${enableval}" in
64 yes) enable_ssp=yes ;;
66 *) AC_MSG_ERROR([invalid value ${enableval} for --disable-stack-protector]) ;;
70 if test x"$enable_ssp" = x"yes" && test x"$GCC" != x"yes"; then
71 AC_MSG_NOTICE([Disabling stack-smashing protection because compiler is not GCC])
75 if test x"$enable_ssp" = x"yes"; then
76 # Check for broken ssp in libc: http://www.avahi.org/ticket/105
77 # libc's brokenness will get in the way regardless of whether -lssp is
78 # provided, but provide it anyway (otherwise non-libc ssp would wrongly
81 # Get -lssp if it exists
84 AC_MSG_CHECKING([whether stack-smashing protection is available])
85 ssp_old_cflags="$CFLAGS"
86 ssp_old_ldflags="$LDFLAGS"
87 CFLAGS="$CFLAGS -Werror -fstack-protector-all -fPIC"
88 LDFLAGS="$LDFLAGS -Wl,-z,defs"
89 cat confdefs.h > conftest.c
90 cat >>conftest.c <<_ACEOF
91 void test_broken_ssp(c)
94 char arr[[123]], *p; /* beware of possible double-braces if copying this */
95 for (p = arr; *c; ++p) {
103 if $CC -c $CFLAGS $CPPFLAGS -o conftest.o conftest.c >/dev/null 2>&1; then
105 AC_MSG_CHECKING([whether stack-smashing protection is buggy])
106 if $CC -o conftest.so $LDFLAGS -shared conftest.o $LIBS >/dev/null 2>&1; then
116 rm -f conftest.c conftest.o conftest.so
118 CFLAGS="$ssp_old_cflags"
119 LDFLAGS="$ssp_old_ldflags"
122 if test x"$enable_ssp" = x"yes"; then
123 # Do this the long way so we don't call GCC_STACK_PROTECT_LIB twice
127 GCC_STACK_PROTECT_CXX
129 # XXX: Update the enable_ssp value now for output later?
135 AC_CACHE_CHECK([whether the C++ compiler works], [avahi_cv_sys_cxx_works], [
137 AC_COMPILE_IFELSE([int main() { return 0; }], [avahi_cv_sys_cxx_works=yes],
138 [avahi_cv_sys_cxx_works=no])
141 [ if [ "x$avahi_cv_sys_cxx_works" = "xno" ]; then ]
142 AC_MSG_FAILURE([The C++ compiler does not work])
145 ACX_PTHREAD(,AC_MSG_ERROR([Missing POSIX Threads support]))
148 # Check for netlink.h
150 AC_CHECK_HEADER(linux/netlink.h,
152 AC_DEFINE([HAVE_NETLINK],[],[Support for Linux netlink])
154 #include <sys/socket.h>
155 #include <asm/types.h>
158 AM_CONDITIONAL(HAVE_NETLINK, [ test x"$HAVE_NETLINK" = xyes ])
161 # Check for net/route.h
163 AC_CHECK_HEADER(net/route.h,
165 AC_DEFINE([HAVE_PF_ROUTE],[],[Support for PF_ROUTE])
167 #include <sys/types.h>
168 #include <sys/socket.h>
171 AM_CONDITIONAL(HAVE_PF_ROUTE, [ test x"$HAVE_PF_ROUTE" = xyes ])
174 # Check for sys/filio.h; needed for FIONREAD on Solaris
176 AC_CHECK_HEADER(sys/filio.h,
178 AC_DEFINE([HAVE_SYS_FILIO_H],[],[Support for sys/filio.h])
182 AM_CONDITIONAL(HAVE_SYS_FILIO_H, [ test x"$HAVE_SYS_FILIO_H" = xyes ])
185 # Check for sys/sysctl.h; not present on Solaris
187 AC_CHECK_HEADER(sys/sysctl.h,
189 AC_DEFINE([HAVE_SYS_SYSCTL_H],[],[Support for sys/sysctl.h])
191 #include <sys/types.h>
192 #include <sys/socket.h>
193 #include <sys/param.h>
196 AM_CONDITIONAL(HAVE_SYS_SYSCTL_H, [ test x"$HAVE_SYS_SYSCTL_H" = xyes ])
199 # Check for lifconf struct; only present on Solaris
201 AC_MSG_CHECKING(for struct lifconf)
202 AC_CACHE_VAL(avahi_cv_has_struct_lifconf,
204 [#include <sys/socket.h>
206 ],[sizeof (struct lifconf);],
207 avahi_cv_has_struct_lifconf=yes,avahi_cv_has_struct_lifconf=no)])
208 AC_MSG_RESULT($avahi_cv_has_struct_lifconf)
209 if test $avahi_cv_has_struct_lifconf = yes; then
210 AC_DEFINE(HAVE_STRUCT_LIFCONF,1,[Define if there is a struct lifconf.])
214 # Check for struct ip_mreqn
216 AC_MSG_CHECKING(for struct ip_mreqn)
217 AC_TRY_COMPILE([#include <netinet/in.h>], [
218 struct ip_mreqn mreq;
219 mreq.imr_address.s_addr = 0;
223 AC_DEFINE([HAVE_STRUCT_IP_MREQN],[],[Support for struct ip_mreqn])
225 # We'll just have to try and use struct ip_mreq
227 AC_MSG_CHECKING(for struct ip_mreq)
228 AC_TRY_COMPILE([#include <netinet/in.h>], [
230 mreq.imr_interface.s_addr = 0;
234 AC_DEFINE([HAVE_STRUCT_IP_MREQ],[],[Support for struct ip_mreq])
236 # No multicast support
242 # Detecting the linux distribution for specific things like init scripts.
244 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]))
245 if test "z$with_distro" = "z"; then
246 AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
247 AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
248 AC_CHECK_FILE(/etc/arch-release,with_distro="archlinux")
249 AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
250 AC_CHECK_FILE(/etc/redhat-release,with_distro="fedora")
251 AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva")
252 AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
253 if test "z$with_distro" = "z"; then
254 with_distro=`uname -s`
257 with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
260 debian|gentoo|archlinux|suse|fedora|mandriva|darwin|freebsd|slackware|none)
263 AC_MSG_WARN([Your distribution (${with_distro}) is supported but no init script exist yet! (patches welcome)])
266 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.])
269 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])
273 AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
274 AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
275 AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
276 AM_CONDITIONAL(TARGET_ARCHLINUX, test x"$with_distro" = xarchlinux)
277 AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
278 AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
279 AM_CONDITIONAL(TARGET_DARWIN, test x"$with_distro" = xdarwin)
280 AM_CONDITIONAL(TARGET_NETBSD, test x"$with_distro" = xnetbsd)
281 AM_CONDITIONAL(TARGET_FREEBSD, test x"$with_distro" = xfreebsd)
282 AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
285 AC_LANG_CONFTEST([int main() {}])
286 $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
292 # If using GCC specify some additional parameters
293 if test "x$GCC" = "xyes" ; then
295 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"
297 if test "x$HAVE_NETLINK" = "xyes" ; then
298 # Test whether rtnetlink.h can be included when compiled with -std=c99
299 # some distributions (e.g. archlinux) have broken headers that dont
300 # define __u64 with -std=c99
301 AC_MSG_CHECKING([checking whether rtnetlink.h can be included with -std=c99])
304 AC_TRY_COMPILE([#include <linux/rtnetlink.h>], [],
305 use_stdc99=yes, use_stdc99=no)
307 if test x"$use_stdc99" = xyes; then
308 DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
316 DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
319 for flag in $DESIRED_FLAGS ; do
320 AC_MSG_CHECKING([whether $CC accepts $flag])
321 if test_gcc_flag $flag ; then
322 CFLAGS="$CFLAGS $flag"
330 # Checks for header files.
332 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])
335 # Checks for typedefs, structures, and compiler characteristics.
342 AC_SEARCH_LIBS([inet_ntop],[nsl])
343 AC_SEARCH_LIBS([recv],[socket])
344 AC_CHECK_DECL([CMSG_SPACE],,CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__")
346 # Checks for library functions.
348 AC_FUNC_SELECT_ARGTYPES
351 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])
358 AC_CHECK_DECLS(environ)
361 AC_CHECK_HEADERS([sys/capability.h],,enable_chroot=no)
362 AC_CHECK_HEADERS([sys/prctl.h],,enable_chroot=no)
363 AC_CHECK_FUNCS([chroot],,enable_chroot=no)
365 AM_CONDITIONAL(ENABLE_CHROOT, test "x$enable_chroot" = "xyes")
367 if test "x$enable_chroot" = "xyes" ; then
368 AC_DEFINE([ENABLE_CHROOT], 1, [Enable chroot() usage])
371 AC_CHECK_LIB(dl, dlopen, [ AC_CHECK_HEADERS(dlfcn.h, HAVE_DLOPEN=yes, HAVE_DLOPEN=no) ], HAVE_DLOPEN=no)
372 if test "x$HAVE_DLOPEN" = "xyes" ; then
373 AC_DEFINE([HAVE_DLOPEN],1,[Have dlopen()])
375 AM_CONDITIONAL(HAVE_DLOPEN, test "x$HAVE_DLOPEN" = "xyes")
378 AC_CHECK_HEADERS([linux/inotify.h], [have_inotify=yes])
379 AC_CHECK_HEADERS([sys/inotify.h], [have_inotify=yes])
381 AM_CONDITIONAL(HAVE_INOTIFY, test "x$have_inotify" = "xyes")
383 if test "x$have_inotify" = "xyes" ; then
384 AC_DEFINE([HAVE_INOTIFY], 1, [Enable Linux inotify() usage])
388 AC_CHECK_FUNCS([kqueue],,have_kqueue=no)
390 AM_CONDITIONAL(HAVE_KQUEUE, test "x$have_kqueue" = "xyes")
392 if test "x$have_kqueue" = "xyes" ; then
393 AC_DEFINE([HAVE_KQUEUE], 1, [Enable BSD kqueue() usage])
396 # Check for pkg-config manually first, as if its not installed the
397 # PKG_PROG_PKG_CONFIG macro won't be defined.
398 AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
400 if test x"$have_pkg_config" = "xno"; then
401 AC_MSG_ERROR(pkg-config is required to install this program)
410 AS_HELP_STRING([--disable-glib],[Disable use of GLib]),
411 [case "${enableval}" in
412 yes) HAVE_GLIB=yes ;;
414 *) AC_MSG_ERROR(bad value ${enableval} for --enable-glib) ;;
418 if test "x$HAVE_GLIB" = "xyes" ; then
419 PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ])
420 AC_SUBST(GLIB20_CFLAGS)
421 AC_SUBST(GLIB20_LIBS)
423 AM_CONDITIONAL(HAVE_GLIB, test "x$HAVE_GLIB" = "xyes")
429 AS_HELP_STRING([--disable-qt3],[Disable building of Qt3 mainloop integration]),
430 [case "${enableval}" in
433 *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt3) ;;
437 if test "x$HAVE_QT3" = "xyes" ; then
438 PKG_CHECK_MODULES( QT3, [ qt-mt >= 3.0.0 ])
441 QT3_PREFIX="`$PKG_CONFIG --variable=prefix qt-mt`/bin"
443 AC_CHECK_FILE( "$QT3_PREFIX/moc-qt3", [ MOC_QT3=$QT3_PREFIX/moc-qt3 ], [
444 AC_CHECK_FILE("$QT3_PREFIX/moc", [ MOC_QT3=$QT3_PREFIX/moc ], [
445 AC_MSG_ERROR([Couldn't find QT3 moc])])])
448 AM_CONDITIONAL(HAVE_QT3, test "x$HAVE_QT3" = "xyes")
454 AS_HELP_STRING([--disable-qt4],[Disable building of Qt4Core mainloop integration]),
455 [case "${enableval}" in
458 *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt4) ;;
462 if test "x$HAVE_QT4" = "xyes" ; then
463 PKG_CHECK_MODULES( QT4, [ QtCore >= 4.0.0 ])
466 QT4_PREFIX="`$PKG_CONFIG --variable=prefix QtCore`/bin"
468 AC_CHECK_FILE( "$QT4_PREFIX/moc-qt4", [ MOC_QT4=$QT4_PREFIX/moc-qt4 ], [
469 AC_CHECK_FILE("$QT4_PREFIX/moc", [ MOC_QT4=$QT4_PREFIX/moc ], [
470 AC_MSG_ERROR([Couldn't find QT4 moc])])])
473 AM_CONDITIONAL(HAVE_QT4, test "x$HAVE_QT4" = "xyes")
479 AS_HELP_STRING([--disable-gtk],[Disable use of GTK+]),
480 [case "${enableval}" in
483 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk) ;;
487 if test "x$HAVE_GTK" = "xyes" ; then
489 PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.4.0 ])
490 AC_SUBST(GTK20_CFLAGS)
493 # Check for GLADE 2.0
494 PKG_CHECK_MODULES(GLADE20, [ libglade-2.0 >= 2.4.0 ])
495 AC_SUBST(GLADE20_CFLAGS)
496 AC_SUBST(GLADE20_LIBS)
498 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
504 AS_HELP_STRING([--disable-dbus],[Disable use of D-Bus]),
505 [case "${enableval}" in
506 yes) HAVE_DBUS=yes ;;
508 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbus) ;;
512 AC_ARG_WITH(dbus-sys, AS_HELP_STRING([--with-dbus-sys=<dir>], [Path to D-Bus system.d directory]))
513 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]))
515 DBUS_VERSION="Disabled"
516 DBUS_SYS_DIR="Disabled"
517 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="Disabled"
518 if test "x$HAVE_DBUS" = "xyes" ; then
519 PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 0.34 ])
521 AC_DEFINE(HAVE_DBUS, 1, [Whether we have D-Bus or not])
523 DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion`
524 DBUS_VERSION_MAJOR=`echo $DBUS_VERSION | awk -F. '{print $1}'`
525 DBUS_VERSION_MINOR=`echo $DBUS_VERSION | awk -F. '{print $2}'`
526 DBUS_VERSION_MICRO=`echo $DBUS_VERSION | awk -F. '{print $3}'`
527 if test "z$DBUS_VERSION_MAJOR" = "z"; then
528 DBUS_VERSION_MAJOR="0"
530 if test "z$DBUS_VERSION_MINOR" = "z"; then
531 DBUS_VERSION_MINOR="0"
533 if test "z$DBUS_VERSION_MICRO" = "z"; then
534 DBUS_VERSION_MICRO="0"
537 if test "z$DBUS_VERSION_MAJOR" = "z0" -a "z$DBUS_VERSION_MINOR" = "z0" -a "z$DBUS_VERSION_MICRO" = "z0"; then
538 echo "Error: Couldn't determine the version of your D-Bus package."
539 echo " This is probably an error in this script, please report it"
540 echo " along with the following information:"
541 echo " Base D-Buss version ='$DBUS_VERSION'"
542 echo " DBUS_VERSION_MAJOR='$DBUS_VERSION_MAJOR'"
543 echo " DBUS_VERSION_MINOR='$DBUS_VERSION_MINOR'"
544 echo " DBUS_VERSION_MICRO='$DBUS_VERSION_MICRO'"
547 echo "Your D-Bus version is $DBUS_VERSION_MAJOR,$DBUS_VERSION_MINOR,$DBUS_VERSION_MICRO."
548 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MAJOR=$DBUS_VERSION_MAJOR"
549 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MINOR=$DBUS_VERSION_MINOR"
550 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MICRO=$DBUS_VERSION_MICRO"
553 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
554 AC_SUBST(DBUS_CFLAGS)
557 if ! test -z "$with_dbus_sys" ; then
558 DBUS_SYS_DIR="$with_dbus_sys"
560 DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
562 AC_SUBST(DBUS_SYS_DIR)
564 if ! test -z "$with_dbus_system_address" ; then
565 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="$with_dbus_system_address"
567 # This is ugly, but D-Bus doesn't export this address for us
568 # so we have to guess, pretty much all setups i've seen have
569 # it in /var/lib/dbus or /var/run/dbus, and its defaulted to
570 # /var/run upstream so we will try guess first then default
573 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=/var/run/dbus/system_bus_socket"
574 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"
575 for sock in $TRY_SOCKETS; do
576 if test -S $sock; then
577 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$sock"
581 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
584 LIBS="$LIBS $DBUS_LIBS"
585 AC_CHECK_FUNCS([dbus_connection_close dbus_bus_get_private])
588 AM_CONDITIONAL(HAVE_DBUS, test "x$HAVE_DBUS" = "xyes")
594 AS_HELP_STRING([--disable-expat],[Disable use of Expat]),
595 [case "${enableval}" in
596 yes) HAVE_EXPAT=yes ;;
598 *) AC_MSG_ERROR(bad value ${enableval} for --enable-expat) ;;
602 if test "x$HAVE_EXPAT" = "xyes" ; then
603 AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false)
605 if ! $have_expat ; then
606 AC_MSG_ERROR([*** libexpat not found ***])
609 AM_CONDITIONAL(HAVE_EXPAT, test "x$HAVE_EXPAT" = "xyes")
618 AS_HELP_STRING([--enable-dbm],[Enable use of DBM]),
619 [case "${enableval}" in
622 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbm) ;;
627 AS_HELP_STRING([--disable-gdbm],[Disable use of GDBM]),
628 [case "${enableval}" in
629 yes) HAVE_GDBM=yes ;;
631 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gdbm) ;;
635 if test "x$HAVE_GDBM" = "xyes" ; then
636 if test "x$HAVE_DBM" = "xyes" ; then
637 AC_MSG_ERROR([*** --enable-gdbm and --enable-dbm both specified ***])
639 AC_CHECK_LIB(gdbm, gdbm_open, [ AC_CHECK_HEADERS(gdbm.h, have_gdbm=true, have_gdbm=false) ], have_gdbm=false)
641 if ! $have_gdbm ; then
642 AC_MSG_ERROR([*** libgdbm not found ***])
644 AC_DEFINE([HAVE_GDBM],[],[Support for GDBM])
646 if test "x$HAVE_DBM" = "xyes" ; then
647 AC_CHECK_HEADERS(ndbm.h, have_dbm=true, have_dbm=false)
649 if ! $have_dbm ; then
650 AC_MSG_ERROR([*** dbm not found ***])
652 AC_DEFINE([HAVE_DBM],[],[Support for DBM])
655 AM_CONDITIONAL(HAVE_GDBM, test "x$HAVE_GDBM" = "xyes")
656 AM_CONDITIONAL(HAVE_DBM, test "x$HAVE_DBM" = "xyes")
661 AC_ARG_ENABLE(libdaemon,
662 AS_HELP_STRING([--disable-libdaemon],[Disable use of libdaemon]),
663 [case "${enableval}" in
664 yes) HAVE_LIBDAEMON=yes ;;
665 no) HAVE_LIBDAEMON=no ;;
666 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libdaemon) ;;
668 [HAVE_LIBDAEMON=yes])
670 if test "x$HAVE_LIBDAEMON" = "xyes" ; then
671 PKG_CHECK_MODULES(LIBDAEMON, [ libdaemon >= 0.11 ])
672 AC_SUBST(LIBDAEMON_CFLAGS)
673 AC_SUBST(LIBDAEMON_LIBS)
675 AM_CONDITIONAL(HAVE_LIBDAEMON, test "x$HAVE_LIBDAEMON" = "xyes")
680 AC_ARG_ENABLE(python,
681 AS_HELP_STRING([--disable-python], [Disable scripts that depends on python]),
682 [case "${enableval}" in
683 yes) HAVE_PYTHON=yes ;;
684 no) HAVE_PYTHON=no ;;
685 *) AC_MSG_ERROR([bad value ${enableval} for --enable-python]) ;;
686 esac],[HAVE_PYTHON=yes])
691 if test "x$HAVE_PYTHON" = "xyes" ; then
692 AM_PATH_PYTHON([2.4])
695 AS_HELP_STRING([--disable-pygtk],[Disable use of GTK in Python]),
696 [case "${enableval}" in
697 yes) HAVE_PYGTK=yes ;;
699 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pygtk) ;;
703 if test "x$HAVE_PYGTK" = "xyes" ; then
704 AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR(Could not find Python module gtk)])
708 if test "x$HAVE_DBUS" = "xyes" ; then
709 AC_ARG_ENABLE(python-dbus,
710 AS_HELP_STRING([--disable-python-dbus],[Disable use of D-Bus in Python]),
711 [case "${enableval}" in
712 yes) HAVE_PYTHON_DBUS=yes ;;
713 no) HAVE_PYTHON_DBUS=no ;;
714 *) AC_MSG_ERROR(bad value ${enableval} for --enable-python-dbus) ;;
716 [HAVE_PYTHON_DBUS=yes])
718 if test "x$HAVE_PYTHON_DBUS" = "xyes"; then
719 AM_CHECK_PYMOD(dbus,,,[AC_MSG_ERROR(Could not find Python module dbus)])
722 AM_CHECK_PYMOD(socket,,,[AC_MSG_ERROR(Could not find Python module socket)])
723 if test "x$HAVE_GDBM" = "xyes"; then
724 AM_CHECK_PYMOD(gdbm,,,[AC_MSG_ERROR(Could not find Python module gdbm)])
726 if test "x$HAVE_DBM" = "xyes"; then
727 AM_CHECK_PYMOD(dbm,,,[AC_MSG_ERROR(Could not find Python module dbm)])
731 AM_CONDITIONAL(HAVE_PYTHON, [test "x$HAVE_PYTHON" = "xyes" ])
732 AM_CONDITIONAL(HAVE_PYGTK, test "x$HAVE_PYGTK" = "xyes")
733 AM_CONDITIONAL(HAVE_PYTHON_DBUS, test "x$HAVE_PYTHON_DBUS" = "xyes")
736 # Check for mono stuff
739 if test "x$HAVE_DBUS" = "xyes" ; then
741 AS_HELP_STRING([--disable-mono],[Disable mono bindings]),
742 [case "${enableval}" in
743 yes) HAVE_MONO=yes ;;
745 *) AC_MSG_ERROR(bad value ${enableval} for --enable-mono) ;;
749 if test "x$HAVE_MONO" = "xyes" ; then
750 AC_PATH_PROG(MCS, mcs)
751 if test "x$MCS" = "x" ; then
752 AC_MSG_ERROR([Can not find "mcs" - The Mono C-Sharp Compiler) in your PATH])
755 AC_PATH_PROG(GACUTIL, gacutil)
756 if test "x$GACUTIL" = "x" ; then
757 AC_MSG_ERROR([Can not find "gacutil" in your PATH])
764 AM_CONDITIONAL(HAVE_MONO, test "x$HAVE_MONO" = "xyes")
767 # Check for monodoc stuff
770 AC_ARG_ENABLE(monodoc,
771 AS_HELP_STRING([--disable-monodoc],[Disable documentation for mono bindings]),
772 [case "${enableval}" in
773 yes) HAVE_MONODOC=yes ;;
774 no) HAVE_MONODOC=no ;;
775 *) AC_MSG_ERROR(bad value ${enableval} for --enable-monodoc) ;;
779 if test "x$HAVE_MONO" = "xyes" && test "x$HAVE_MONODOC" = "xyes" ; then
780 PKG_CHECK_MODULES(MONODOC, [monodoc >= 1.1.8])
781 MONODOC_DIR=`$PKG_CONFIG --variable=sourcesdir monodoc`
783 AC_PATH_PROG(MONODOCER, monodocer)
784 AC_PATH_PROG(MDASSEMBLER, mdassembler)
786 AC_SUBST(MONODOC_DIR)
788 AC_SUBST(MDASSEMBLER)
790 AM_CONDITIONAL(HAVE_MONODOC, test "x$HAVE_MONODOC" = "xyes")
795 AC_ARG_ENABLE(autoipd,
796 AS_HELP_STRING([--disable-autoipd],[Disable building of avahi-autoipd]),
797 [case "${enableval}" in
798 yes) ENABLE_AUTOIPD=yes ;;
799 no) ENABLE_AUTOIPD=no ;;
800 *) AC_MSG_ERROR(bad value ${enableval} for --disable-autoipd) ;;
802 [ENABLE_AUTOIPD=yes])
804 AM_CONDITIONAL(ENABLE_AUTOIPD, test "x$ENABLE_AUTOIPD" = "xyes")
807 # Defining users and groups
809 AC_ARG_WITH(avahi_user, AS_HELP_STRING([--with-avahi-user=<user>],[User for running avahi-daemon (avahi)]))
810 if test -z "$with_avahi_user" ; then
813 AVAHI_USER=$with_avahi_user
816 AC_DEFINE_UNQUOTED(AVAHI_USER,"$AVAHI_USER", [User for running the Avahi daemon])
818 AC_ARG_WITH(avahi_group,AS_HELP_STRING([--with-avahi-group=<group>],[Group for running avahi-daemon (avahi)]))
819 if test -z "$with_avahi_group" ; then
822 AVAHI_GROUP=$with_avahi_group
824 AC_SUBST(AVAHI_GROUP)
825 AC_DEFINE_UNQUOTED(AVAHI_GROUP,"$AVAHI_GROUP", [Group for Avahi])
827 AC_ARG_WITH(avahi_priv_access_group,AS_HELP_STRING([--with-avahi-priv-access-group=<group>],[Priviliged access group for Avahi clients (netdev)]))
828 if test -z "$with_avahi_priv_access_group" ; then
829 AVAHI_PRIV_ACCESS_GROUP=netdev
831 AVAHI_PRIV_ACCESS_GROUP=$with_avahi_priv_access_group
833 AC_SUBST(AVAHI_PRIV_ACCESS_GROUP)
834 AC_DEFINE_UNQUOTED(AVAHI_PRIV_ACCESS_GROUP,"$AVAHI_PRIV_ACCESS_GROUP", [Privileged access group for Avahi clients])
836 AC_ARG_WITH(autoipd_user, AS_HELP_STRING([--with-autoipd-user=<user>],[User for running the avahi-autoipd daemon (avahi-autoipd)]))
837 if test -z "$with_autoipd_user" ; then
838 AVAHI_AUTOIPD_USER=avahi-autoipd
840 AVAHI_AUTOIPD_USER=$with_autoipd_user
842 AC_SUBST(AVAHI_AUTOIPD_USER)
843 AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_USER,"$AVAHI_AUTOIPD_USER", [User for running the avahi-autoipd daemon])
845 AC_ARG_WITH(autoipd_group,AS_HELP_STRING([--with-autoipd-group=<group>],[Group for running the avahi-autoipd daemon (avahi-autoipd)]))
846 if test -z "$with_autoipd_group" ; then
847 AVAHI_AUTOIPD_GROUP=avahi-autoipd
849 AVAHI_AUTOIPD_GROUP=$with_autoipd_group
851 AC_SUBST(AVAHI_AUTOIPD_GROUP)
852 AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_GROUP,"$AVAHI_AUTOIPD_GROUP", [Group for running the avahi-autoipd daemon])
857 avahi_runtime_dir="${localstatedir}/run"
858 avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket"
859 AC_SUBST(avahi_runtime_dir)
860 AC_SUBST(avahi_socket)
863 # Avahi interfaces dir
865 if test "x$HAVE_PYTHON_DBUS" = "xyes" -o "x$HAVE_GTK" = "xyes"; then
866 interfacesdir="${datadir}/${PACKAGE}/interfaces/"
867 AC_SUBST(interfacesdir)
881 DX_INIT_DOXYGEN(avahi, doxygen.cfg, doxygen)
883 AC_ARG_ENABLE(core-docs,
884 AS_HELP_STRING([--enable-core-docs],[Enable building of documentation for avahi-core]),
885 [case "${enableval}" in
886 yes) ENABLE_CORE_DOCS=yes ;;
887 no) ENABLE_CORE_DOCS=no ;;
888 *) AC_MSG_ERROR([bad value ${enableval} for --enable-core-docs]) ;;
889 esac],[ENABLE_CORE_DOCS=no])
891 AM_CONDITIONAL([ENABLE_CORE_DOCS], [test "x$ENABLE_CORE_DOCS" = xyes])
894 # Build and Install man pages
896 AC_ARG_ENABLE(manpages,
897 AS_HELP_STRING([--disable-manpages],[Disable building and installation of man pages]),
898 [case "${enableval}" in
901 *) AC_MSG_ERROR([bad value ${enableval} for --disable-manpages]) ;;
902 esac],[manpages=yes])
904 if test x$manpages = xyes ; then
906 # XMLTOMAN manpage generation
908 AC_ARG_ENABLE(xmltoman,
909 AS_HELP_STRING([--disable-xmltoman],[Disable rebuilding of man pages with xmltoman]),
910 [case "${enableval}" in
913 *) AC_MSG_ERROR([bad value ${enableval} for --disable-xmltoman]) ;;
914 esac],[xmltoman=yes])
916 if test x$xmltoman = xyes ; then
917 AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no)
920 if test x$have_xmltoman = xno -o x$xmltoman = xno; then
921 if ! test -e man/avahi-daemon.8 ; then
922 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])
925 AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***])
929 AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes])
930 AM_CONDITIONAL([BUILD_MANPAGES], [test "x$manpages" = xyes])
933 # Conditionally compile test and example programs
936 AS_HELP_STRING([--enable-tests],[Enable building of tests and examples]),
937 [case "${enableval}" in
938 yes) ENABLE_TESTS=yes ;;
939 no) ENABLE_TESTS=no ;;
940 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
944 AM_CONDITIONAL([ENABLE_TESTS], [test "x$ENABLE_TESTS" = "xyes"])
947 # Optionally enable libdns_sd compatibility support
949 AC_ARG_ENABLE(compat-libdns_sd,
950 AS_HELP_STRING([--enable-compat-libdns_sd],[Enable compatibility layer for libdns_sd]),
951 [case "${enableval}" in
952 yes) ENABLE_COMPAT_LIBDNS_SD=yes ;;
953 no) ENABLE_COMPAT_LIBDNS_SD=no ;;
954 *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-libdns_sd) ;;
956 [ENABLE_COMPAT_LIBDNS_SD=no])
958 AM_CONDITIONAL([ENABLE_COMPAT_LIBDNS_SD], [test "x$ENABLE_COMPAT_LIBDNS_SD" = "xyes"])
961 # Optionally enable HOWL compatibility support
963 AC_ARG_ENABLE(compat-howl,
964 AS_HELP_STRING([--enable-compat-howl],[Enable compatibility layer for HOWL]),
965 [case "${enableval}" in
966 yes) ENABLE_COMPAT_HOWL=yes ;;
967 no) ENABLE_COMPAT_HOWL=no ;;
968 *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-howl) ;;
970 [ENABLE_COMPAT_HOWL=no])
972 AM_CONDITIONAL([ENABLE_COMPAT_HOWL], [test "x$ENABLE_COMPAT_HOWL" = "xyes"])
975 # ==========================================================================
978 avahi-common/Makefile
982 avahi-daemon/Makefile
983 avahi-daemon/avahi-dbus.conf
984 avahi-discover-standalone/Makefile
985 avahi-client/Makefile
987 initscript/debian/Makefile
988 initscript/gentoo/Makefile
989 initscript/archlinux/Makefile
990 initscript/suse/Makefile
991 initscript/fedora/Makefile
992 initscript/mandriva/Makefile
993 initscript/darwin/Makefile
994 initscript/freebsd/Makefile
995 initscript/slackware/Makefile
996 avahi-dnsconfd/Makefile
998 avahi-python/Makefile
999 avahi-python/avahi/Makefile
1004 service-type-database/Makefile
1005 avahi-sharp/Makefile
1006 avahi-ui-sharp/Makefile
1007 avahi-compat-libdns_sd/Makefile
1008 avahi-compat-howl/Makefile
1009 avahi-compat-howl/samples/Makefile
1010 avahi-autoipd/Makefile
1015 # ==========================================================================
1017 ---{ $PACKAGE_NAME $VERSION }---
1020 sysconfdir: ${sysconfdir}
1021 localstatedir: ${localstatedir}
1022 avahi socket: ${avahi_socket}
1023 dbus-1 system.d dir: ${DBUS_SYS_DIR}
1024 dbus-1 version: ${DBUS_VERSION}
1025 dbus-1 system socket: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
1028 Enable GLIB: ${HAVE_GLIB}
1029 Enable GTK: ${HAVE_GTK}
1030 Enable D-Bus: ${HAVE_DBUS}
1031 Enable Expat: ${HAVE_EXPAT}
1032 Enable GDBM: ${HAVE_GDBM}
1033 Enable DBM: ${HAVE_DBM}
1034 Enable libdaemon: ${HAVE_LIBDAEMON}
1035 Enable Python: ${HAVE_PYTHON}
1036 Enable pygtk: ${HAVE_PYGTK}
1037 Enable python-dbus: ${HAVE_PYTHON_DBUS}
1038 Enable QT3: ${HAVE_QT3}
1039 Enable QT4: ${HAVE_QT4}
1040 Enable Mono: ${HAVE_MONO}
1041 Enable Monodoc: ${HAVE_MONODOC}
1042 Distribution/OS: ${with_distro}
1043 User for avahi-daemon: ${AVAHI_USER}
1044 Group for avahi-daemon: ${AVAHI_GROUP}
1045 Priviliged access group for Avahi clients: ${AVAHI_PRIV_ACCESS_GROUP}
1046 User for avahi-autoipd: ${AVAHI_AUTOIPD_USER}
1047 Group for avahi-autoipd: ${AVAHI_AUTOIPD_GROUP}
1048 Enable chroot(): ${enable_chroot}
1049 Enable Linux inotify: ${have_inotify}
1050 Enable stack-smashing protection: ${enable_ssp}
1053 BUILD_DAEMON="no (You need libdaemon and expat!)"
1055 if test "x$HAVE_EXPAT" = "xyes" -a "x$HAVE_LIBDAEMON" = "xyes" ; then
1059 BUILD_PYTHON="no (You need python, pygtk and python-dbus!)"
1061 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
1065 BUILD_CLIENT="no (You need avahi-daemon and D-Bus!)"
1067 if test "x$BUILD_DAEMON" = "xyes" -a "x$HAVE_DBUS" = "xyes" ; then
1071 if test "x$ENABLE_COMPAT_LIBDNS_SD" = "xyes" -a "x$BUILD_CLIENT" != "xyes" ; then
1072 ENABLE_COMPAT_LIBDNS_SD="no (You need libavahi-client!)"
1074 if test "x$ENABLE_COMPAT_HOWL" = "xyes" -a "x$BUILD_CLIENT" != "xyes" ; then
1075 ENABLE_COMPAT_HOWL="no (You need libavahi-client!)"
1077 if test "x$ENABLE_AUTOIPD" = "xyes" -a "x$HAVE_LIBDAEMON" != "xyes" ; then
1078 ENABLE_AUTOIPD="no (You need libdaemon!)"
1082 if test "x$HAVE_GTK" = "xyes" -a "x$BUILD_CLIENT" = "xyes" ; then
1087 Building libavahi-core yes
1088 Building avahi-daemon: ${BUILD_DAEMON}
1089 Building avahi-dnsconfd: ${BUILD_DAEMON}
1090 Building libavahi-client: ${BUILD_CLIENT}
1091 Building avahi-utils: ${BUILD_CLIENT}
1092 Building avahi-python: ${BUILD_PYTHON}
1093 Building libavahi-glib: ${HAVE_GLIB}
1094 Building avahi-discover-standalone: ${HAVE_GTK}
1095 Building libavahi-qt3: ${HAVE_QT3}
1096 Building libavahi-qt4: ${HAVE_QT4}
1097 Building avahi-sharp: ${HAVE_MONO}
1098 Building avahi-compat-libdns_sd: ${ENABLE_COMPAT_LIBDNS_SD}
1099 Building avahi-compat-howl: ${ENABLE_COMPAT_HOWL}
1100 Building tests: ${ENABLE_TESTS}
1101 Building avahi-core documentation: ${ENABLE_CORE_DOCS}
1102 Building avahi-autoipd: ${ENABLE_AUTOIPD}
1103 Building libavahi-ui: ${BUILD_UI}