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.21],[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:5:4])
32 AC_SUBST(LIBAVAHI_CORE_VERSION_INFO, [5:3:0])
33 AC_SUBST(LIBAVAHI_CLIENT_VERSION_INFO, [5:3: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:2: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_ARG_ENABLE([stack-protector],
63 [AS_HELP_STRING([--disable-stack-protector],
64 [Disable GCC's/libc's stack-smashing protection])],
65 [case "${enableval}" in
66 yes) enable_ssp=yes ;;
68 *) AC_MSG_ERROR([invalid value ${enableval} for --disable-stack-protector]) ;;
72 if test x"$enable_ssp" = x"yes" && test x"$GCC" != x"yes"; then
73 AC_MSG_NOTICE([Disabling stack-smashing protection because compiler is not GCC])
77 if test x"$enable_ssp" = x"yes"; then
78 # Check for broken ssp in libc: http://www.avahi.org/ticket/105
79 # libc's brokenness will get in the way regardless of whether -lssp is
80 # provided, but provide it anyway (otherwise non-libc ssp would wrongly
83 # Get -lssp if it exists
86 AC_MSG_CHECKING([whether stack-smashing protection is available])
87 ssp_old_cflags="$CFLAGS"
88 ssp_old_ldflags="$LDFLAGS"
89 CFLAGS="$CFLAGS -Werror -fstack-protector-all -fPIC"
90 LDFLAGS="$LDFLAGS -Wl,-z,defs"
91 cat confdefs.h > conftest.c
92 cat >>conftest.c <<_ACEOF
93 void test_broken_ssp(c)
96 char arr[[123]], *p; /* beware of possible double-braces if copying this */
97 for (p = arr; *c; ++p) {
105 if $CC -c $CFLAGS $CPPFLAGS -o conftest.o conftest.c >/dev/null 2>&1; then
107 AC_MSG_CHECKING([whether stack-smashing protection is buggy])
108 if $CC -o conftest.so $LDFLAGS -shared conftest.o $LIBS >/dev/null 2>&1; then
118 rm -f conftest.c conftest.o conftest.so
120 CFLAGS="$ssp_old_cflags"
121 LDFLAGS="$ssp_old_ldflags"
124 if test x"$enable_ssp" = x"yes"; then
125 # Do this the long way so we don't call GCC_STACK_PROTECT_LIB twice
129 GCC_STACK_PROTECT_CXX
131 # XXX: Update the enable_ssp value now for output later?
137 AC_CACHE_CHECK([whether the C++ compiler works], [avahi_cv_sys_cxx_works], [
139 AC_COMPILE_IFELSE([int main() { return 0; }], [avahi_cv_sys_cxx_works=yes],
140 [avahi_cv_sys_cxx_works=no])
143 [ if [ "x$avahi_cv_sys_cxx_works" = "xno" ]; then ]
144 AC_MSG_FAILURE([The C++ compiler does not work])
147 ACX_PTHREAD(,AC_MSG_ERROR([Missing POSIX Threads support]))
150 # Check for netlink.h
152 AC_CHECK_HEADER(linux/netlink.h,
154 AC_DEFINE([HAVE_NETLINK],[],[Support for Linux netlink])
156 #include <sys/socket.h>
157 #include <asm/types.h>
160 AM_CONDITIONAL(HAVE_NETLINK, [ test x"$HAVE_NETLINK" = xyes ])
163 # Check for net/route.h
165 AC_CHECK_HEADER(net/route.h,
167 AC_DEFINE([HAVE_PF_ROUTE],[],[Support for PF_ROUTE])
169 #include <sys/types.h>
170 #include <sys/socket.h>
173 AM_CONDITIONAL(HAVE_PF_ROUTE, [ test x"$HAVE_PF_ROUTE" = xyes ])
176 # Check for sys/filio.h; needed for FIONREAD on Solaris
178 AC_CHECK_HEADER(sys/filio.h,
180 AC_DEFINE([HAVE_SYS_FILIO_H],[],[Support for sys/filio.h])
184 AM_CONDITIONAL(HAVE_SYS_FILIO_H, [ test x"$HAVE_SYS_FILIO_H" = xyes ])
187 # Check for sys/sysctl.h; not present on Solaris
189 AC_CHECK_HEADER(sys/sysctl.h,
191 AC_DEFINE([HAVE_SYS_SYSCTL_H],[],[Support for sys/sysctl.h])
193 #include <sys/types.h>
194 #include <sys/socket.h>
195 #include <sys/param.h>
198 AM_CONDITIONAL(HAVE_SYS_SYSCTL_H, [ test x"$HAVE_SYS_SYSCTL_H" = xyes ])
201 # Check for lifconf struct; only present on Solaris
203 AC_MSG_CHECKING(for struct lifconf)
204 AC_CACHE_VAL(avahi_cv_has_struct_lifconf,
206 [#include <sys/socket.h>
208 ],[sizeof (struct lifconf);],
209 avahi_cv_has_struct_lifconf=yes,avahi_cv_has_struct_lifconf=no)])
210 AC_MSG_RESULT($avahi_cv_has_struct_lifconf)
211 if test $avahi_cv_has_struct_lifconf = yes; then
212 AC_DEFINE(HAVE_STRUCT_LIFCONF,1,[Define if there is a struct lifconf.])
216 # Check for struct ip_mreqn
218 AC_MSG_CHECKING(for struct ip_mreqn)
219 AC_TRY_COMPILE([#include <netinet/in.h>], [
220 struct ip_mreqn mreq;
221 mreq.imr_address.s_addr = 0;
225 AC_DEFINE([HAVE_STRUCT_IP_MREQN],[],[Support for struct ip_mreqn])
227 # We'll just have to try and use struct ip_mreq
229 AC_MSG_CHECKING(for struct ip_mreq)
230 AC_TRY_COMPILE([#include <netinet/in.h>], [
232 mreq.imr_interface.s_addr = 0;
236 AC_DEFINE([HAVE_STRUCT_IP_MREQ],[],[Support for struct ip_mreq])
238 # No multicast support
244 # Detecting the linux distribution for specific things like init scripts.
246 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]))
247 if test "z$with_distro" = "z"; then
248 AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
249 AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
250 AC_CHECK_FILE(/etc/arch-release,with_distro="archlinux")
251 AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
252 AC_CHECK_FILE(/etc/redhat-release,with_distro="fedora")
253 AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva")
254 AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
255 if test "z$with_distro" = "z"; then
256 with_distro=`uname -s`
259 with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
262 debian|gentoo|archlinux|suse|fedora|mandriva|darwin|freebsd|slackware|none)
265 AC_MSG_WARN([Your distribution (${with_distro}) is supported but no init script exist yet! (patches welcome)])
268 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.])
271 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])
275 AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
276 AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
277 AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
278 AM_CONDITIONAL(TARGET_ARCHLINUX, test x"$with_distro" = xarchlinux)
279 AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
280 AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
281 AM_CONDITIONAL(TARGET_DARWIN, test x"$with_distro" = xdarwin)
282 AM_CONDITIONAL(TARGET_NETBSD, test x"$with_distro" = xnetbsd)
283 AM_CONDITIONAL(TARGET_FREEBSD, test x"$with_distro" = xfreebsd)
284 AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
287 AC_LANG_CONFTEST([int main() {}])
288 $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
294 # If using GCC specify some additional parameters
295 if test "x$GCC" = "xyes" ; then
297 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"
299 if test "x$HAVE_NETLINK" = "xyes" ; then
300 # Test whether rtnetlink.h can be included when compiled with -std=c99
301 # some distributions (e.g. archlinux) have broken headers that dont
302 # define __u64 with -std=c99
303 AC_MSG_CHECKING([checking whether rtnetlink.h can be included with -std=c99])
306 AC_TRY_COMPILE([#include <linux/rtnetlink.h>], [],
307 use_stdc99=yes, use_stdc99=no)
309 if test x"$use_stdc99" = xyes; then
310 DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
318 DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
321 for flag in $DESIRED_FLAGS ; do
322 AC_MSG_CHECKING([whether $CC accepts $flag])
323 if test_gcc_flag $flag ; then
324 CFLAGS="$CFLAGS $flag"
332 # Checks for header files.
334 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])
337 # Checks for typedefs, structures, and compiler characteristics.
344 AC_SEARCH_LIBS([inet_ntop],[nsl])
345 AC_SEARCH_LIBS([recv],[socket])
346 AC_CHECK_DECL([CMSG_SPACE],,CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__")
348 # Checks for library functions.
350 AC_FUNC_SELECT_ARGTYPES
353 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])
360 AC_CHECK_DECLS(environ)
363 AC_CHECK_HEADERS([sys/capability.h],,enable_chroot=no)
364 AC_CHECK_HEADERS([sys/prctl.h],,enable_chroot=no)
365 AC_CHECK_FUNCS([chroot],,enable_chroot=no)
367 AM_CONDITIONAL(ENABLE_CHROOT, test "x$enable_chroot" = "xyes")
369 if test "x$enable_chroot" = "xyes" ; then
370 AC_DEFINE([ENABLE_CHROOT], 1, [Enable chroot() usage])
373 AC_CHECK_LIB(dl, dlopen, [ AC_CHECK_HEADERS(dlfcn.h, HAVE_DLOPEN=yes, HAVE_DLOPEN=no) ], HAVE_DLOPEN=no)
374 if test "x$HAVE_DLOPEN" = "xyes" ; then
375 AC_DEFINE([HAVE_DLOPEN],1,[Have dlopen()])
377 AM_CONDITIONAL(HAVE_DLOPEN, test "x$HAVE_DLOPEN" = "xyes")
380 AC_CHECK_HEADERS([linux/inotify.h], [have_inotify=yes])
381 AC_CHECK_HEADERS([sys/inotify.h], [have_inotify=yes])
383 AM_CONDITIONAL(HAVE_INOTIFY, test "x$have_inotify" = "xyes")
385 if test "x$have_inotify" = "xyes" ; then
386 AC_DEFINE([HAVE_INOTIFY], 1, [Enable Linux inotify() usage])
390 AC_CHECK_FUNCS([kqueue],,have_kqueue=no)
392 AM_CONDITIONAL(HAVE_KQUEUE, test "x$have_kqueue" = "xyes")
394 if test "x$have_kqueue" = "xyes" ; then
395 AC_DEFINE([HAVE_KQUEUE], 1, [Enable BSD kqueue() usage])
398 # Check for pkg-config manually first, as if its not installed the
399 # PKG_PROG_PKG_CONFIG macro won't be defined.
400 AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
402 if test x"$have_pkg_config" = "xno"; then
403 AC_MSG_ERROR(pkg-config is required to install this program)
412 AS_HELP_STRING([--disable-glib],[Disable use of GLib]),
413 [case "${enableval}" in
414 yes) HAVE_GLIB=yes ;;
416 *) AC_MSG_ERROR(bad value ${enableval} for --enable-glib) ;;
420 if test "x$HAVE_GLIB" = "xyes" ; then
421 PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 gobject-2.0 ])
422 AC_SUBST(GLIB20_CFLAGS)
423 AC_SUBST(GLIB20_LIBS)
425 AM_CONDITIONAL(HAVE_GLIB, test "x$HAVE_GLIB" = "xyes")
431 AS_HELP_STRING([--disable-qt3],[Disable building of Qt3 mainloop integration]),
432 [case "${enableval}" in
435 *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt3) ;;
439 if test "x$HAVE_QT3" = "xyes" ; then
440 PKG_CHECK_MODULES( QT3, [ qt-mt >= 3.0.0 ])
443 QT3_PREFIX="`$PKG_CONFIG --variable=prefix qt-mt`/bin"
445 AC_CHECK_FILE( "$QT3_PREFIX/moc-qt3", [ MOC_QT3=$QT3_PREFIX/moc-qt3 ], [
446 AC_CHECK_FILE("$QT3_PREFIX/moc", [ MOC_QT3=$QT3_PREFIX/moc ], [
447 AC_MSG_ERROR([Couldn't find QT3 moc])])])
450 AM_CONDITIONAL(HAVE_QT3, test "x$HAVE_QT3" = "xyes")
456 AS_HELP_STRING([--disable-qt4],[Disable building of Qt4Core mainloop integration]),
457 [case "${enableval}" in
460 *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt4) ;;
464 if test "x$HAVE_QT4" = "xyes" ; then
465 PKG_CHECK_MODULES( QT4, [ QtCore >= 4.0.0 ])
468 QT4_PREFIX="`$PKG_CONFIG --variable=prefix QtCore`/bin"
470 AC_CHECK_FILE( "$QT4_PREFIX/moc-qt4", [ MOC_QT4=$QT4_PREFIX/moc-qt4 ], [
471 AC_CHECK_FILE("$QT4_PREFIX/moc", [ MOC_QT4=$QT4_PREFIX/moc ], [
472 AC_MSG_ERROR([Couldn't find QT4 moc])])])
475 AM_CONDITIONAL(HAVE_QT4, test "x$HAVE_QT4" = "xyes")
481 AS_HELP_STRING([--disable-gtk],[Disable use of GTK+]),
482 [case "${enableval}" in
485 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk) ;;
489 if test "x$HAVE_GTK" = "xyes" ; then
491 PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.4.0 ])
492 AC_SUBST(GTK20_CFLAGS)
495 # Check for GLADE 2.0
496 PKG_CHECK_MODULES(GLADE20, [ libglade-2.0 >= 2.4.0 ])
497 AC_SUBST(GLADE20_CFLAGS)
498 AC_SUBST(GLADE20_LIBS)
500 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
506 AS_HELP_STRING([--disable-dbus],[Disable use of D-Bus]),
507 [case "${enableval}" in
508 yes) HAVE_DBUS=yes ;;
510 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbus) ;;
514 AC_ARG_WITH(dbus-sys, AS_HELP_STRING([--with-dbus-sys=<dir>], [Path to D-Bus system.d directory]))
515 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]))
517 DBUS_VERSION="Disabled"
518 DBUS_SYS_DIR="Disabled"
519 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="Disabled"
520 if test "x$HAVE_DBUS" = "xyes" ; then
521 PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 0.34 ])
523 AC_DEFINE(HAVE_DBUS, 1, [Whether we have D-Bus or not])
525 DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion`
526 DBUS_VERSION_MAJOR=`echo $DBUS_VERSION | awk -F. '{print $1}'`
527 DBUS_VERSION_MINOR=`echo $DBUS_VERSION | awk -F. '{print $2}'`
528 DBUS_VERSION_MICRO=`echo $DBUS_VERSION | awk -F. '{print $3}'`
529 if test "z$DBUS_VERSION_MAJOR" = "z"; then
530 DBUS_VERSION_MAJOR="0"
532 if test "z$DBUS_VERSION_MINOR" = "z"; then
533 DBUS_VERSION_MINOR="0"
535 if test "z$DBUS_VERSION_MICRO" = "z"; then
536 DBUS_VERSION_MICRO="0"
539 if test "z$DBUS_VERSION_MAJOR" = "z0" -a "z$DBUS_VERSION_MINOR" = "z0" -a "z$DBUS_VERSION_MICRO" = "z0"; then
540 echo "Error: Couldn't determine the version of your D-Bus package."
541 echo " This is probably an error in this script, please report it"
542 echo " along with the following information:"
543 echo " Base D-Buss version ='$DBUS_VERSION'"
544 echo " DBUS_VERSION_MAJOR='$DBUS_VERSION_MAJOR'"
545 echo " DBUS_VERSION_MINOR='$DBUS_VERSION_MINOR'"
546 echo " DBUS_VERSION_MICRO='$DBUS_VERSION_MICRO'"
549 echo "Your D-Bus version is $DBUS_VERSION_MAJOR,$DBUS_VERSION_MINOR,$DBUS_VERSION_MICRO."
550 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MAJOR=$DBUS_VERSION_MAJOR"
551 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MINOR=$DBUS_VERSION_MINOR"
552 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MICRO=$DBUS_VERSION_MICRO"
555 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
556 AC_SUBST(DBUS_CFLAGS)
559 if ! test -z "$with_dbus_sys" ; then
560 DBUS_SYS_DIR="$with_dbus_sys"
562 DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
564 AC_SUBST(DBUS_SYS_DIR)
566 if ! test -z "$with_dbus_system_address" ; then
567 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="$with_dbus_system_address"
569 # This is ugly, but D-Bus doesn't export this address for us
570 # so we have to guess, pretty much all setups i've seen have
571 # it in /var/lib/dbus or /var/run/dbus, and its defaulted to
572 # /var/run upstream so we will try guess first then default
575 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=/var/run/dbus/system_bus_socket"
576 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"
577 for sock in $TRY_SOCKETS; do
578 if test -S $sock; then
579 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$sock"
583 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
586 LIBS="$LIBS $DBUS_LIBS"
587 AC_CHECK_FUNCS([dbus_connection_close dbus_bus_get_private])
590 AM_CONDITIONAL(HAVE_DBUS, test "x$HAVE_DBUS" = "xyes")
596 AS_HELP_STRING([--disable-expat],[Disable use of Expat]),
597 [case "${enableval}" in
598 yes) HAVE_EXPAT=yes ;;
600 *) AC_MSG_ERROR(bad value ${enableval} for --enable-expat) ;;
604 if test "x$HAVE_EXPAT" = "xyes" ; then
605 AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false)
607 if ! $have_expat ; then
608 AC_MSG_ERROR([*** libexpat not found ***])
611 AM_CONDITIONAL(HAVE_EXPAT, test "x$HAVE_EXPAT" = "xyes")
620 AS_HELP_STRING([--enable-dbm],[Enable use of DBM]),
621 [case "${enableval}" in
624 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbm) ;;
629 AS_HELP_STRING([--disable-gdbm],[Disable use of GDBM]),
630 [case "${enableval}" in
631 yes) HAVE_GDBM=yes ;;
633 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gdbm) ;;
637 if test "x$HAVE_GDBM" = "xyes" ; then
638 if test "x$HAVE_DBM" = "xyes" ; then
639 AC_MSG_ERROR([*** --enable-gdbm and --enable-dbm both specified ***])
641 AC_CHECK_LIB(gdbm, gdbm_open, [ AC_CHECK_HEADERS(gdbm.h, have_gdbm=true, have_gdbm=false) ], have_gdbm=false)
643 if ! $have_gdbm ; then
644 AC_MSG_ERROR([*** libgdbm not found ***])
646 AC_DEFINE([HAVE_GDBM],[],[Support for GDBM])
648 if test "x$HAVE_DBM" = "xyes" ; then
649 AC_CHECK_HEADERS(ndbm.h, have_dbm=true, have_dbm=false)
651 if ! $have_dbm ; then
652 AC_MSG_ERROR([*** dbm not found ***])
654 AC_DEFINE([HAVE_DBM],[],[Support for DBM])
657 AM_CONDITIONAL(HAVE_GDBM, test "x$HAVE_GDBM" = "xyes")
658 AM_CONDITIONAL(HAVE_DBM, test "x$HAVE_DBM" = "xyes")
663 AC_ARG_ENABLE(libdaemon,
664 AS_HELP_STRING([--disable-libdaemon],[Disable use of libdaemon]),
665 [case "${enableval}" in
666 yes) HAVE_LIBDAEMON=yes ;;
667 no) HAVE_LIBDAEMON=no ;;
668 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libdaemon) ;;
670 [HAVE_LIBDAEMON=yes])
672 if test "x$HAVE_LIBDAEMON" = "xyes" ; then
673 PKG_CHECK_MODULES(LIBDAEMON, [ libdaemon >= 0.11 ])
674 AC_SUBST(LIBDAEMON_CFLAGS)
675 AC_SUBST(LIBDAEMON_LIBS)
677 AM_CONDITIONAL(HAVE_LIBDAEMON, test "x$HAVE_LIBDAEMON" = "xyes")
682 AC_ARG_ENABLE(python,
683 AS_HELP_STRING([--disable-python], [Disable scripts that depends on python]),
684 [case "${enableval}" in
685 yes) HAVE_PYTHON=yes ;;
686 no) HAVE_PYTHON=no ;;
687 *) AC_MSG_ERROR([bad value ${enableval} for --enable-python]) ;;
688 esac],[HAVE_PYTHON=yes])
693 if test "x$HAVE_PYTHON" = "xyes" ; then
694 AM_PATH_PYTHON([2.4])
697 AS_HELP_STRING([--disable-pygtk],[Disable use of GTK in Python]),
698 [case "${enableval}" in
699 yes) HAVE_PYGTK=yes ;;
701 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pygtk) ;;
705 if test "x$HAVE_PYGTK" = "xyes" ; then
706 AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR(Could not find Python module gtk)])
710 if test "x$HAVE_DBUS" = "xyes" ; then
711 AC_ARG_ENABLE(python-dbus,
712 AS_HELP_STRING([--disable-python-dbus],[Disable use of D-Bus in Python]),
713 [case "${enableval}" in
714 yes) HAVE_PYTHON_DBUS=yes ;;
715 no) HAVE_PYTHON_DBUS=no ;;
716 *) AC_MSG_ERROR(bad value ${enableval} for --enable-python-dbus) ;;
718 [HAVE_PYTHON_DBUS=yes])
720 if test "x$HAVE_PYTHON_DBUS" = "xyes"; then
721 AM_CHECK_PYMOD(dbus,,,[AC_MSG_ERROR(Could not find Python module dbus)])
724 AM_CHECK_PYMOD(socket,,,[AC_MSG_ERROR(Could not find Python module socket)])
725 if test "x$HAVE_GDBM" = "xyes"; then
726 AM_CHECK_PYMOD(gdbm,,,[AC_MSG_ERROR(Could not find Python module gdbm)])
728 if test "x$HAVE_DBM" = "xyes"; then
729 AM_CHECK_PYMOD(dbm,,,[AC_MSG_ERROR(Could not find Python module dbm)])
733 AM_CONDITIONAL(HAVE_PYTHON, [test "x$HAVE_PYTHON" = "xyes" ])
734 AM_CONDITIONAL(HAVE_PYGTK, test "x$HAVE_PYGTK" = "xyes")
735 AM_CONDITIONAL(HAVE_PYTHON_DBUS, test "x$HAVE_PYTHON_DBUS" = "xyes")
738 # Check for mono stuff
741 if test "x$HAVE_DBUS" = "xyes" ; then
743 AS_HELP_STRING([--disable-mono],[Disable mono bindings]),
744 [case "${enableval}" in
745 yes) HAVE_MONO=yes ;;
747 *) AC_MSG_ERROR(bad value ${enableval} for --enable-mono) ;;
751 if test "x$HAVE_MONO" = "xyes" ; then
752 AC_PATH_PROG(MCS, mcs)
753 if test "x$MCS" = "x" ; then
754 AC_MSG_ERROR([Can not find "mcs" - The Mono C-Sharp Compiler) in your PATH])
757 AC_PATH_PROG(GACUTIL, gacutil)
758 if test "x$GACUTIL" = "x" ; then
759 AC_MSG_ERROR([Can not find "gacutil" in your PATH])
766 AM_CONDITIONAL(HAVE_MONO, test "x$HAVE_MONO" = "xyes")
769 # Check for monodoc stuff
772 AC_ARG_ENABLE(monodoc,
773 AS_HELP_STRING([--disable-monodoc],[Disable documentation for mono bindings]),
774 [case "${enableval}" in
775 yes) HAVE_MONODOC=yes ;;
776 no) HAVE_MONODOC=no ;;
777 *) AC_MSG_ERROR(bad value ${enableval} for --enable-monodoc) ;;
781 if test "x$HAVE_MONO" = "xyes" && test "x$HAVE_MONODOC" = "xyes" ; then
782 PKG_CHECK_MODULES(MONODOC, [monodoc >= 1.1.8])
783 MONODOC_DIR=`$PKG_CONFIG --variable=sourcesdir monodoc`
785 AC_PATH_PROG(MONODOCER, monodocer)
786 AC_PATH_PROG(MDASSEMBLER, mdassembler)
788 AC_SUBST(MONODOC_DIR)
790 AC_SUBST(MDASSEMBLER)
792 AM_CONDITIONAL(HAVE_MONODOC, test "x$HAVE_MONODOC" = "xyes")
797 AC_ARG_ENABLE(autoipd,
798 AS_HELP_STRING([--disable-autoipd],[Disable building of avahi-autoipd]),
799 [case "${enableval}" in
800 yes) ENABLE_AUTOIPD=yes ;;
801 no) ENABLE_AUTOIPD=no ;;
802 *) AC_MSG_ERROR(bad value ${enableval} for --disable-autoipd) ;;
804 [ENABLE_AUTOIPD=yes])
806 AM_CONDITIONAL(ENABLE_AUTOIPD, test "x$ENABLE_AUTOIPD" = "xyes")
809 # Defining users and groups
811 AC_ARG_WITH(avahi_user, AS_HELP_STRING([--with-avahi-user=<user>],[User for running avahi-daemon (avahi)]))
812 if test -z "$with_avahi_user" ; then
815 AVAHI_USER=$with_avahi_user
818 AC_DEFINE_UNQUOTED(AVAHI_USER,"$AVAHI_USER", [User for running the Avahi daemon])
820 AC_ARG_WITH(avahi_group,AS_HELP_STRING([--with-avahi-group=<group>],[Group for running avahi-daemon (avahi)]))
821 if test -z "$with_avahi_group" ; then
824 AVAHI_GROUP=$with_avahi_group
826 AC_SUBST(AVAHI_GROUP)
827 AC_DEFINE_UNQUOTED(AVAHI_GROUP,"$AVAHI_GROUP", [Group for Avahi])
829 AC_ARG_WITH(avahi_priv_access_group,AS_HELP_STRING([--with-avahi-priv-access-group=<group>],[Priviliged access group for Avahi clients (netdev)]))
830 if test -z "$with_avahi_priv_access_group" ; then
831 AVAHI_PRIV_ACCESS_GROUP=netdev
833 AVAHI_PRIV_ACCESS_GROUP=$with_avahi_priv_access_group
835 AC_SUBST(AVAHI_PRIV_ACCESS_GROUP)
836 AC_DEFINE_UNQUOTED(AVAHI_PRIV_ACCESS_GROUP,"$AVAHI_PRIV_ACCESS_GROUP", [Privileged access group for Avahi clients])
838 AC_ARG_WITH(autoipd_user, AS_HELP_STRING([--with-autoipd-user=<user>],[User for running the avahi-autoipd daemon (avahi-autoipd)]))
839 if test -z "$with_autoipd_user" ; then
840 AVAHI_AUTOIPD_USER=avahi-autoipd
842 AVAHI_AUTOIPD_USER=$with_autoipd_user
844 AC_SUBST(AVAHI_AUTOIPD_USER)
845 AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_USER,"$AVAHI_AUTOIPD_USER", [User for running the avahi-autoipd daemon])
847 AC_ARG_WITH(autoipd_group,AS_HELP_STRING([--with-autoipd-group=<group>],[Group for running the avahi-autoipd daemon (avahi-autoipd)]))
848 if test -z "$with_autoipd_group" ; then
849 AVAHI_AUTOIPD_GROUP=avahi-autoipd
851 AVAHI_AUTOIPD_GROUP=$with_autoipd_group
853 AC_SUBST(AVAHI_AUTOIPD_GROUP)
854 AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_GROUP,"$AVAHI_AUTOIPD_GROUP", [Group for running the avahi-autoipd daemon])
859 avahi_runtime_dir="${localstatedir}/run"
860 avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket"
861 AC_SUBST(avahi_runtime_dir)
862 AC_SUBST(avahi_socket)
865 # Avahi interfaces dir
867 if test "x$HAVE_PYTHON_DBUS" = "xyes" -o "x$HAVE_GTK" = "xyes"; then
868 interfacesdir="${datadir}/${PACKAGE}/interfaces/"
869 AC_SUBST(interfacesdir)
883 DX_INIT_DOXYGEN(avahi, doxygen.cfg, doxygen)
885 AC_ARG_ENABLE(core-docs,
886 AS_HELP_STRING([--enable-core-docs],[Enable building of documentation for avahi-core]),
887 [case "${enableval}" in
888 yes) ENABLE_CORE_DOCS=yes ;;
889 no) ENABLE_CORE_DOCS=no ;;
890 *) AC_MSG_ERROR([bad value ${enableval} for --enable-core-docs]) ;;
891 esac],[ENABLE_CORE_DOCS=no])
893 AM_CONDITIONAL([ENABLE_CORE_DOCS], [test "x$ENABLE_CORE_DOCS" = xyes])
896 # Build and Install man pages
898 AC_ARG_ENABLE(manpages,
899 AS_HELP_STRING([--disable-manpages],[Disable building and installation of man pages]),
900 [case "${enableval}" in
903 *) AC_MSG_ERROR([bad value ${enableval} for --disable-manpages]) ;;
904 esac],[manpages=yes])
906 if test x$manpages = xyes ; then
908 # XMLTOMAN manpage generation
910 AC_ARG_ENABLE(xmltoman,
911 AS_HELP_STRING([--disable-xmltoman],[Disable rebuilding of man pages with xmltoman]),
912 [case "${enableval}" in
915 *) AC_MSG_ERROR([bad value ${enableval} for --disable-xmltoman]) ;;
916 esac],[xmltoman=yes])
918 if test x$xmltoman = xyes ; then
919 AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no)
922 if test x$have_xmltoman = xno -o x$xmltoman = xno; then
923 if ! test -e man/avahi-daemon.8 ; then
924 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])
927 AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***])
931 AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes])
932 AM_CONDITIONAL([BUILD_MANPAGES], [test "x$manpages" = xyes])
935 # Conditionally compile test and example programs
938 AS_HELP_STRING([--enable-tests],[Enable building of tests and examples]),
939 [case "${enableval}" in
940 yes) ENABLE_TESTS=yes ;;
941 no) ENABLE_TESTS=no ;;
942 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
946 AM_CONDITIONAL([ENABLE_TESTS], [test "x$ENABLE_TESTS" = "xyes"])
949 # Optionally enable libdns_sd compatibility support
951 AC_ARG_ENABLE(compat-libdns_sd,
952 AS_HELP_STRING([--enable-compat-libdns_sd],[Enable compatibility layer for libdns_sd]),
953 [case "${enableval}" in
954 yes) ENABLE_COMPAT_LIBDNS_SD=yes ;;
955 no) ENABLE_COMPAT_LIBDNS_SD=no ;;
956 *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-libdns_sd) ;;
958 [ENABLE_COMPAT_LIBDNS_SD=no])
960 AM_CONDITIONAL([ENABLE_COMPAT_LIBDNS_SD], [test "x$ENABLE_COMPAT_LIBDNS_SD" = "xyes"])
963 # Optionally enable HOWL compatibility support
965 AC_ARG_ENABLE(compat-howl,
966 AS_HELP_STRING([--enable-compat-howl],[Enable compatibility layer for HOWL]),
967 [case "${enableval}" in
968 yes) ENABLE_COMPAT_HOWL=yes ;;
969 no) ENABLE_COMPAT_HOWL=no ;;
970 *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-howl) ;;
972 [ENABLE_COMPAT_HOWL=no])
974 AM_CONDITIONAL([ENABLE_COMPAT_HOWL], [test "x$ENABLE_COMPAT_HOWL" = "xyes"])
977 # ==========================================================================
980 avahi-common/Makefile
984 avahi-daemon/Makefile
985 avahi-daemon/avahi-dbus.conf
986 avahi-discover-standalone/Makefile
987 avahi-client/Makefile
989 initscript/debian/Makefile
990 initscript/gentoo/Makefile
991 initscript/archlinux/Makefile
992 initscript/suse/Makefile
993 initscript/fedora/Makefile
994 initscript/mandriva/Makefile
995 initscript/darwin/Makefile
996 initscript/freebsd/Makefile
997 initscript/slackware/Makefile
998 avahi-dnsconfd/Makefile
1000 avahi-python/Makefile
1001 avahi-python/avahi/Makefile
1002 avahi-python/avahi-discover/Makefile
1007 service-type-database/Makefile
1008 avahi-sharp/Makefile
1009 avahi-ui-sharp/Makefile
1010 avahi-compat-libdns_sd/Makefile
1011 avahi-compat-howl/Makefile
1012 avahi-compat-howl/samples/Makefile
1013 avahi-autoipd/Makefile
1018 # ==========================================================================
1020 ---{ $PACKAGE_NAME $VERSION }---
1023 sysconfdir: ${sysconfdir}
1024 localstatedir: ${localstatedir}
1025 avahi socket: ${avahi_socket}
1026 dbus-1 system.d dir: ${DBUS_SYS_DIR}
1027 dbus-1 version: ${DBUS_VERSION}
1028 dbus-1 system socket: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
1031 Enable GLIB: ${HAVE_GLIB}
1032 Enable GTK: ${HAVE_GTK}
1033 Enable D-Bus: ${HAVE_DBUS}
1034 Enable Expat: ${HAVE_EXPAT}
1035 Enable GDBM: ${HAVE_GDBM}
1036 Enable DBM: ${HAVE_DBM}
1037 Enable libdaemon: ${HAVE_LIBDAEMON}
1038 Enable Python: ${HAVE_PYTHON}
1039 Enable pygtk: ${HAVE_PYGTK}
1040 Enable python-dbus: ${HAVE_PYTHON_DBUS}
1041 Enable QT3: ${HAVE_QT3}
1042 Enable QT4: ${HAVE_QT4}
1043 Enable Mono: ${HAVE_MONO}
1044 Enable Monodoc: ${HAVE_MONODOC}
1045 Distribution/OS: ${with_distro}
1046 User for avahi-daemon: ${AVAHI_USER}
1047 Group for avahi-daemon: ${AVAHI_GROUP}
1048 Priviliged access group for Avahi clients: ${AVAHI_PRIV_ACCESS_GROUP}
1049 User for avahi-autoipd: ${AVAHI_AUTOIPD_USER}
1050 Group for avahi-autoipd: ${AVAHI_AUTOIPD_GROUP}
1051 Enable chroot(): ${enable_chroot}
1052 Enable Linux inotify: ${have_inotify}
1053 Enable stack-smashing protection: ${enable_ssp}
1056 BUILD_DAEMON="no (You need libdaemon and expat!)"
1058 if test "x$HAVE_EXPAT" = "xyes" -a "x$HAVE_LIBDAEMON" = "xyes" ; then
1062 BUILD_PYTHON="no (You need python, pygtk and python-dbus!)"
1064 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
1068 BUILD_CLIENT="no (You need avahi-daemon and D-Bus!)"
1070 if test "x$BUILD_DAEMON" = "xyes" -a "x$HAVE_DBUS" = "xyes" ; then
1074 if test "x$ENABLE_COMPAT_LIBDNS_SD" = "xyes" -a "x$BUILD_CLIENT" != "xyes" ; then
1075 ENABLE_COMPAT_LIBDNS_SD="no (You need libavahi-client!)"
1077 if test "x$ENABLE_COMPAT_HOWL" = "xyes" -a "x$BUILD_CLIENT" != "xyes" ; then
1078 ENABLE_COMPAT_HOWL="no (You need libavahi-client!)"
1080 if test "x$ENABLE_AUTOIPD" = "xyes" -a "x$HAVE_LIBDAEMON" != "xyes" ; then
1081 ENABLE_AUTOIPD="no (You need libdaemon!)"
1085 if test "x$HAVE_GTK" = "xyes" -a "x$BUILD_CLIENT" = "xyes" ; then
1090 Building libavahi-core yes
1091 Building avahi-daemon: ${BUILD_DAEMON}
1092 Building avahi-dnsconfd: ${BUILD_DAEMON}
1093 Building libavahi-client: ${BUILD_CLIENT}
1094 Building avahi-utils: ${BUILD_CLIENT}
1095 Building avahi-python: ${BUILD_PYTHON}
1096 Building libavahi-glib: ${HAVE_GLIB}
1097 Building avahi-discover-standalone: ${HAVE_GTK}
1098 Building libavahi-qt3: ${HAVE_QT3}
1099 Building libavahi-qt4: ${HAVE_QT4}
1100 Building avahi-sharp: ${HAVE_MONO}
1101 Building avahi-compat-libdns_sd: ${ENABLE_COMPAT_LIBDNS_SD}
1102 Building avahi-compat-howl: ${ENABLE_COMPAT_HOWL}
1103 Building tests: ${ENABLE_TESTS}
1104 Building avahi-core documentation: ${ENABLE_CORE_DOCS}
1105 Building avahi-autoipd: ${ENABLE_AUTOIPD}
1106 Building libavahi-ui: ${BUILD_UI}