2 # Process this file with autoconf to produce a configure script.
4 # This file is part of avahi.
6 # avahi is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU Lesser General Public License as
8 # published by the Free Software Foundation; either version 2 of the
9 # License, or (at your option) any later version.
11 # avahi is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 # License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with avahi; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 AC_INIT([avahi],[0.6.25],[avahi (at) lists (dot) freedesktop (dot) org])
23 AC_CONFIG_SRCDIR([avahi-core/server.c])
24 AC_CONFIG_HEADERS([config.h])
25 AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax])
27 AC_SUBST(PACKAGE_URL, [http://avahi.org/])
29 AC_SUBST(LIBAVAHI_COMMON_VERSION_INFO, [8:1:5])
30 AC_SUBST(LIBAVAHI_CORE_VERSION_INFO, [6:1:0])
31 AC_SUBST(LIBAVAHI_CLIENT_VERSION_INFO, [5:5:2])
32 AC_SUBST(LIBAVAHI_GLIB_VERSION_INFO, [1:1:0])
33 AC_SUBST(LIBAVAHI_GOBJECT_VERSION_INFO, [0:1:0])
34 AC_SUBST(LIBAVAHI_QT3_VERSION_INFO, [1:2:0])
35 AC_SUBST(LIBAVAHI_QT4_VERSION_INFO, [1:2:0])
36 AC_SUBST(LIBAVAHI_UI_VERSION_INFO, [1:1:1])
38 # Do not touch these, since they we took this version-info from upstream HOWL/Bonjour
39 AC_SUBST(LIBAVAHI_COMPAT_LIBDNS_SD_VERSION_INFO, [1:0:0])
40 AC_SUBST(LIBAVAHI_COMPAT_HOWL_VERSION_INFO, [0:0:0])
41 AC_SUBST(HOWL_COMPAT_VERSION, [0.9.8])
45 AM_SILENT_RULES([yes])
47 AC_CHECK_PROG([STOW], [stow], [yes], [no])
49 AS_IF([test "x$STOW" = "xyes" && test -d /usr/local/stow], [
50 AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
51 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
54 # Checks for programs.
59 AC_USE_SYSTEM_EXTENSIONS
64 AC_PROG_GCC_TRADITIONAL
67 AC_ARG_ENABLE([stack-protector],
68 [AS_HELP_STRING([--disable-stack-protector],
69 [Disable GCC's/libc's stack-smashing protection])],
70 [case "${enableval}" in
71 yes) enable_ssp=yes ;;
73 *) AC_MSG_ERROR([invalid value ${enableval} for --disable-stack-protector]) ;;
77 if test x"$enable_ssp" = x"yes" && test x"$GCC" != x"yes"; then
78 AC_MSG_NOTICE([Disabling stack-smashing protection because compiler is not GCC])
82 if test x"$enable_ssp" = x"yes"; then
83 # Check for broken ssp in libc: http://www.avahi.org/ticket/105
84 # libc's brokenness will get in the way regardless of whether -lssp is
85 # provided, but provide it anyway (otherwise non-libc ssp would wrongly
88 # Get -lssp if it exists
91 AC_MSG_CHECKING([whether stack-smashing protection is available])
92 ssp_old_cflags="$CFLAGS"
93 ssp_old_ldflags="$LDFLAGS"
94 CFLAGS="$CFLAGS -Werror -fstack-protector-all -fPIC"
95 LDFLAGS="$LDFLAGS -Wl,-z,defs"
96 cat confdefs.h > conftest.c
97 cat >>conftest.c <<_ACEOF
98 void test_broken_ssp(c)
101 char arr[[123]], *p; /* beware of possible double-braces if copying this */
102 for (p = arr; *c; ++p) {
110 if $CC -c $CFLAGS $CPPFLAGS -o conftest.o conftest.c >/dev/null 2>&1; then
112 AC_MSG_CHECKING([whether stack-smashing protection is buggy])
113 if $CC -o conftest.so $LDFLAGS -shared conftest.o $LIBS >/dev/null 2>&1; then
123 rm -f conftest.c conftest.o conftest.so
125 CFLAGS="$ssp_old_cflags"
126 LDFLAGS="$ssp_old_ldflags"
129 if test x"$enable_ssp" = x"yes"; then
130 # Do this the long way so we don't call GCC_STACK_PROTECT_LIB twice
134 GCC_STACK_PROTECT_CXX
136 # XXX: Update the enable_ssp value now for output later?
142 AC_CACHE_CHECK([whether the C++ compiler works], [avahi_cv_sys_cxx_works], [
144 AC_COMPILE_IFELSE([int main() { return 0; }], [avahi_cv_sys_cxx_works=yes],
145 [avahi_cv_sys_cxx_works=no])
148 [ if [ "x$avahi_cv_sys_cxx_works" = "xno" ]; then ]
149 AC_MSG_FAILURE([The C++ compiler does not work])
152 ACX_PTHREAD(,AC_MSG_ERROR([Missing POSIX Threads support]))
155 # Check for netlink.h
157 AC_CHECK_HEADER(linux/netlink.h,
159 AC_DEFINE([HAVE_NETLINK],[],[Support for Linux netlink])
161 #include <sys/socket.h>
162 #include <asm/types.h>
165 AM_CONDITIONAL(HAVE_NETLINK, [ test x"$HAVE_NETLINK" = xyes ])
168 # Check for net/route.h
170 AC_CHECK_HEADER(net/route.h,
172 AC_DEFINE([HAVE_PF_ROUTE],[],[Support for PF_ROUTE])
174 #include <sys/types.h>
175 #include <sys/socket.h>
178 AM_CONDITIONAL(HAVE_PF_ROUTE, [ test x"$HAVE_PF_ROUTE" = xyes ])
181 # Check for sys/filio.h; needed for FIONREAD on Solaris
183 AC_CHECK_HEADER(sys/filio.h,
185 AC_DEFINE([HAVE_SYS_FILIO_H],[],[Support for sys/filio.h])
189 AM_CONDITIONAL(HAVE_SYS_FILIO_H, [ test x"$HAVE_SYS_FILIO_H" = xyes ])
192 # Check for sys/sysctl.h; not present on Solaris
194 AC_CHECK_HEADER(sys/sysctl.h,
196 AC_DEFINE([HAVE_SYS_SYSCTL_H],[],[Support for sys/sysctl.h])
198 #include <sys/types.h>
199 #include <sys/socket.h>
200 #include <sys/param.h>
203 AM_CONDITIONAL(HAVE_SYS_SYSCTL_H, [ test x"$HAVE_SYS_SYSCTL_H" = xyes ])
206 # Check for lifconf struct; only present on Solaris
208 AC_MSG_CHECKING(for struct lifconf)
209 AC_CACHE_VAL(avahi_cv_has_struct_lifconf,
211 [#include <sys/socket.h>
213 ],[sizeof (struct lifconf);],
214 avahi_cv_has_struct_lifconf=yes,avahi_cv_has_struct_lifconf=no)])
215 AC_MSG_RESULT($avahi_cv_has_struct_lifconf)
216 if test $avahi_cv_has_struct_lifconf = yes; then
217 AC_DEFINE(HAVE_STRUCT_LIFCONF,1,[Define if there is a struct lifconf.])
221 # Check for struct ip_mreqn
223 AC_MSG_CHECKING(for struct ip_mreqn)
224 AC_TRY_COMPILE([#include <netinet/in.h>], [
225 struct ip_mreqn mreq;
226 mreq.imr_address.s_addr = 0;
230 AC_DEFINE([HAVE_STRUCT_IP_MREQN],[],[Support for struct ip_mreqn])
232 # We'll just have to try and use struct ip_mreq
234 AC_MSG_CHECKING(for struct ip_mreq)
235 AC_TRY_COMPILE([#include <netinet/in.h>], [
237 mreq.imr_interface.s_addr = 0;
241 AC_DEFINE([HAVE_STRUCT_IP_MREQ],[],[Support for struct ip_mreq])
243 # No multicast support
249 # Detecting the linux distribution for specific things like init scripts.
251 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]))
252 if test "z$with_distro" = "z"; then
253 if test "$cross_compiling" = yes; then
254 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)])
256 AC_CHECK_FILE(/etc/lfs-release,with_distro="lfs")
257 AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
258 AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
259 AC_CHECK_FILE(/etc/arch-release,with_distro="archlinux")
260 AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
261 AC_CHECK_FILE(/etc/redhat-release,with_distro="fedora")
262 AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva")
263 AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
265 if test "z$with_distro" = "z"; then
266 with_distro=`uname -s`
269 with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
272 lfs|debian|gentoo|archlinux|suse|fedora|mandriva|darwin|freebsd|slackware|none)
275 AC_MSG_WARN([Your distribution (${with_distro}) is supported but no init script exist yet! (patches welcome)])
278 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.])
281 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])
285 AM_CONDITIONAL(TARGET_LFS, test x"$with_distro" = xlfs)
286 AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
287 AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
288 AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
289 AM_CONDITIONAL(TARGET_ARCHLINUX, test x"$with_distro" = xarchlinux)
290 AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
291 AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
292 AM_CONDITIONAL(TARGET_DARWIN, test x"$with_distro" = xdarwin)
293 AM_CONDITIONAL(TARGET_NETBSD, test x"$with_distro" = xnetbsd)
294 AM_CONDITIONAL(TARGET_FREEBSD, test x"$with_distro" = xfreebsd)
295 AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
298 AC_LANG_CONFTEST([int main() {}])
299 $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
305 # If using GCC specify some additional parameters
306 if test "x$GCC" = "xyes" ; then
308 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 -fdiagnostics-show-option -Wno-cast-qual"
310 if test "x$HAVE_NETLINK" = "xyes" ; then
311 # Test whether rtnetlink.h can be included when compiled with -std=c99
312 # some distributions (e.g. archlinux) have broken headers that dont
313 # define __u64 with -std=c99
314 AC_MSG_CHECKING([checking whether rtnetlink.h can be included with -std=c99])
317 AC_TRY_COMPILE([#include <linux/rtnetlink.h>], [],
318 use_stdc99=yes, use_stdc99=no)
320 if test x"$use_stdc99" = xyes; then
321 DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
329 DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
332 for flag in $DESIRED_FLAGS ; do
333 AC_MSG_CHECKING([whether $CC accepts $flag])
334 if test_gcc_flag $flag ; then
335 CFLAGS="$CFLAGS $flag"
343 # Checks for header files.
345 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])
348 # Checks for typedefs, structures, and compiler characteristics.
355 AC_SEARCH_LIBS([inet_ntop],[nsl])
356 AC_SEARCH_LIBS([recv],[socket])
357 AC_CHECK_DECL([CMSG_SPACE],,CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__", [[#include <sys/socket.h>]])
359 # Checks for library functions.
361 AC_FUNC_SELECT_ARGTYPES
362 # avahi_malloc actually returns NULL for avahi_malloc(0), so it does not matter
363 # whether libc's malloc does too. (Same for realloc.)
366 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])
373 AC_CHECK_DECLS(environ)
375 # check if gcc's -fvisibility is supported
376 CHECK_VISIBILITY_HIDDEN
379 AC_CHECK_HEADERS([sys/capability.h],,enable_chroot=no)
380 AC_CHECK_HEADERS([sys/prctl.h],,enable_chroot=no)
381 AC_CHECK_FUNCS([chroot],,enable_chroot=no)
383 AM_CONDITIONAL(ENABLE_CHROOT, test "x$enable_chroot" = "xyes")
385 if test "x$enable_chroot" = "xyes" ; then
386 AC_DEFINE([ENABLE_CHROOT], 1, [Enable chroot() usage])
389 AC_CHECK_LIB(dl, dlopen, [ AC_CHECK_HEADERS(dlfcn.h, HAVE_DLOPEN=yes, HAVE_DLOPEN=no) ], HAVE_DLOPEN=no)
390 if test "x$HAVE_DLOPEN" = "xyes" ; then
391 AC_DEFINE([HAVE_DLOPEN],1,[Have dlopen()])
393 AM_CONDITIONAL(HAVE_DLOPEN, test "x$HAVE_DLOPEN" = "xyes")
396 AC_CHECK_HEADERS([sys/inotify.h], [have_inotify=yes])
398 AM_CONDITIONAL(HAVE_INOTIFY, test "x$have_inotify" = "xyes")
400 if test "x$have_inotify" = "xyes" ; then
401 AC_DEFINE([HAVE_INOTIFY], 1, [Enable Linux inotify() usage])
405 AC_CHECK_FUNCS([kqueue],,have_kqueue=no)
407 AM_CONDITIONAL(HAVE_KQUEUE, test "x$have_kqueue" = "xyes")
409 if test "x$have_kqueue" = "xyes" ; then
410 AC_DEFINE([HAVE_KQUEUE], 1, [Enable BSD kqueue() usage])
413 IT_PROG_INTLTOOL([0.35.0])
414 GETTEXT_PACKAGE=avahi
415 AC_SUBST([GETTEXT_PACKAGE])
416 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
419 avahilocaledir='${prefix}/${DATADIRNAME}/locale'
420 AC_SUBST(avahilocaledir)
422 # Check for pkg-config manually first, as if its not installed the
423 # PKG_PROG_PKG_CONFIG macro won't be defined.
424 AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
426 if test x"$have_pkg_config" = "xno"; then
427 AC_MSG_ERROR(pkg-config is required to install this program)
436 AS_HELP_STRING([--disable-glib],[Disable use of GLib]),
437 [case "${enableval}" in
438 yes) HAVE_GLIB=yes ;;
440 *) AC_MSG_ERROR(bad value ${enableval} for --enable-glib) ;;
444 if test "x$HAVE_GLIB" = "xyes" ; then
445 PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ])
446 AC_SUBST(GLIB20_CFLAGS)
447 AC_SUBST(GLIB20_LIBS)
449 AM_CONDITIONAL(HAVE_GLIB, test "x$HAVE_GLIB" = "xyes")
452 # Check for GLIB's gobject 2.0
454 AC_ARG_ENABLE(gobject,
455 AS_HELP_STRING([--disable-gobject],[Disable use of GLib GObject]),
456 [case "${enableval}" in
457 yes) HAVE_GOBJECT=yes ;;
458 no) HAVE_GOBJECT=no ;;
459 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gobject) ;;
463 if test "x$HAVE_GOBJECT" = "xyes" ; then
464 PKG_CHECK_MODULES(GOBJECT, [ glib-2.0 >= 2.4.0 gobject-2.0 ])
465 AC_SUBST(GOBJECT_CFLAGS)
466 AC_SUBST(GOBJECT_LIBS)
468 AM_CONDITIONAL(HAVE_GOBJECT, test "x$HAVE_GOBJECT" = "xyes")
474 AS_HELP_STRING([--disable-qt3],[Disable building of Qt3 mainloop integration]),
475 [case "${enableval}" in
478 *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt3) ;;
482 if test "x$HAVE_QT3" = "xyes" ; then
483 PKG_CHECK_MODULES( QT3, [ qt-mt >= 3.0.0 ])
486 QT3_PREFIX="`$PKG_CONFIG --variable=prefix qt-mt`/bin"
487 AC_PATH_PROGS(MOC_QT3, [moc-qt3 moc], no, [$QT3_PREFIX])
488 if test "$MOC_QT3" = no; then
489 AC_MSG_ERROR([Could not find QT3 moc])
493 AM_CONDITIONAL(HAVE_QT3, test "x$HAVE_QT3" = "xyes")
499 AS_HELP_STRING([--disable-qt4],[Disable building of Qt4Core mainloop integration]),
500 [case "${enableval}" in
503 *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt4) ;;
507 if test "x$HAVE_QT4" = "xyes" ; then
508 PKG_CHECK_MODULES( QT4, [ QtCore >= 4.0.0 ])
511 QT4_PREFIX="`$PKG_CONFIG --variable=prefix QtCore`/bin"
512 AC_PATH_PROGS(MOC_QT4, [moc-qt4 moc], no, [$QT4_PREFIX])
513 if test "$MOC_QT4" = no; then
514 AC_MSG_ERROR([Could not find QT4 moc])
518 AM_CONDITIONAL(HAVE_QT4, test "x$HAVE_QT4" = "xyes")
524 AS_HELP_STRING([--disable-gtk],[Disable use of GTK+ 2]),
525 [case "${enableval}" in
528 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk) ;;
532 if test "x$HAVE_GTK" = "xyes" ; then
534 PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.14.0 ])
535 AC_SUBST(GTK20_CFLAGS)
538 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
544 AS_HELP_STRING([--disable-gtk3],[Disable use of GTK+ 3]),
545 [case "${enableval}" in
546 yes) HAVE_GTK3=yes ;;
548 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk3) ;;
552 if test "x$HAVE_GTK3" = "xyes" ; then
554 PKG_CHECK_MODULES(GTK30, [ gtk+-3.0 ])
555 AC_SUBST(GTK30_CFLAGS)
558 AM_CONDITIONAL(HAVE_GTK3, test "x$HAVE_GTK3" = "xyes")
560 AM_CONDITIONAL(HAVE_GTK2OR3, test "x$HAVE_GTK3" = "xyes" -o "x$HAVE_GTK2" = "xyes" )
566 AS_HELP_STRING([--disable-dbus],[Disable use of D-Bus]),
567 [case "${enableval}" in
568 yes) HAVE_DBUS=yes ;;
570 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbus) ;;
574 AC_ARG_WITH(dbus-sys, AS_HELP_STRING([--with-dbus-sys=<dir>], [Path to D-Bus system.d directory]))
575 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]))
577 DBUS_VERSION="Disabled"
578 DBUS_SYS_DIR="Disabled"
579 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="Disabled"
580 if test "x$HAVE_DBUS" = "xyes" ; then
581 PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 0.34 ])
583 AC_DEFINE(HAVE_DBUS, 1, [Whether we have D-Bus or not])
585 DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion`
586 DBUS_VERSION_MAJOR=`echo $DBUS_VERSION | awk -F. '{print $1}'`
587 DBUS_VERSION_MINOR=`echo $DBUS_VERSION | awk -F. '{print $2}'`
588 DBUS_VERSION_MICRO=`echo $DBUS_VERSION | awk -F. '{print $3}'`
589 if test "z$DBUS_VERSION_MAJOR" = "z"; then
590 DBUS_VERSION_MAJOR="0"
592 if test "z$DBUS_VERSION_MINOR" = "z"; then
593 DBUS_VERSION_MINOR="0"
595 if test "z$DBUS_VERSION_MICRO" = "z"; then
596 DBUS_VERSION_MICRO="0"
599 if test "z$DBUS_VERSION_MAJOR" = "z0" -a "z$DBUS_VERSION_MINOR" = "z0" -a "z$DBUS_VERSION_MICRO" = "z0"; then
600 echo "Error: Couldn't determine the version of your D-Bus package."
601 echo " This is probably an error in this script, please report it"
602 echo " along with the following information:"
603 echo " Base D-Buss version ='$DBUS_VERSION'"
604 echo " DBUS_VERSION_MAJOR='$DBUS_VERSION_MAJOR'"
605 echo " DBUS_VERSION_MINOR='$DBUS_VERSION_MINOR'"
606 echo " DBUS_VERSION_MICRO='$DBUS_VERSION_MICRO'"
609 echo "Your D-Bus version is $DBUS_VERSION_MAJOR,$DBUS_VERSION_MINOR,$DBUS_VERSION_MICRO."
610 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MAJOR=$DBUS_VERSION_MAJOR"
611 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MINOR=$DBUS_VERSION_MINOR"
612 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MICRO=$DBUS_VERSION_MICRO"
615 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
616 AC_SUBST(DBUS_CFLAGS)
619 if ! test -z "$with_dbus_sys" ; then
620 DBUS_SYS_DIR="$with_dbus_sys"
622 DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
624 AC_SUBST(DBUS_SYS_DIR)
626 if ! test -z "$with_dbus_system_address" ; then
627 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="$with_dbus_system_address"
629 # This is ugly, but D-Bus doesn't export this address for us
630 # so we have to guess, pretty much all setups i've seen have
631 # it in /var/lib/dbus or /var/run/dbus, and its defaulted to
632 # /var/run upstream so we will try guess first then default
635 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=/var/run/dbus/system_bus_socket"
636 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"
637 for sock in $TRY_SOCKETS; do
638 if test -S $sock; then
639 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$sock"
643 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
646 LIBS="$LIBS $DBUS_LIBS"
647 AC_CHECK_FUNCS([dbus_connection_close dbus_bus_get_private])
650 AM_CONDITIONAL(HAVE_DBUS, test "x$HAVE_DBUS" = "xyes")
655 AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[expat/bsdxml/none]],[XML library to use]))
660 AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false)
661 AC_CHECK_LIB(bsdxml, XML_ParserCreate, [ AC_CHECK_HEADERS(bsdxml.h, have_bsdxml=true, have_bsdxml=false) ], have_bsdxml=false)
663 if test "x$with_xml" = "xnone"; then
665 elif test "x$with_xml" = "xexpat"; then
667 if ! $have_expat ; then
668 AC_MSG_ERROR([*** libexpat requested, but not found ***])
670 elif test "x$with_xml" = "xbsdxml"; then
672 if ! $have_bsdxml ; then
673 AC_MSG_ERROR([*** libbsdxml requested, but not found ***])
675 elif test "x$with_xml" != "x"; then
676 AC_MSG_ERROR([*** unknown with-xml option ***])
678 if $have_expat ; then
680 elif $have_bsdxml ; then
683 AC_MSG_ERROR([*** neither libexpat not libbsdxml could be found ***])
689 XML_CFLAGS=-DUSE_EXPAT_H
694 XML_CFLAGS=-DUSE_BSDXML_H
700 if $use_expat || $use_bsdxml; then
704 AM_CONDITIONAL(HAVE_XML, test "x$HAVE_XML" = "xyes")
713 AS_HELP_STRING([--enable-dbm],[Enable use of DBM]),
714 [case "${enableval}" in
717 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbm) ;;
722 AS_HELP_STRING([--disable-gdbm],[Disable use of GDBM]),
723 [case "${enableval}" in
724 yes) HAVE_GDBM=yes ;;
726 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gdbm) ;;
730 if test "x$HAVE_GDBM" = "xyes" ; then
731 if test "x$HAVE_DBM" = "xyes" ; then
732 AC_MSG_ERROR([*** --enable-gdbm and --enable-dbm both specified ***])
734 AC_CHECK_LIB(gdbm, gdbm_open, [ AC_CHECK_HEADERS(gdbm.h, have_gdbm=true, have_gdbm=false) ], have_gdbm=false)
736 if ! $have_gdbm ; then
737 AC_MSG_ERROR([*** libgdbm not found ***])
739 AC_DEFINE([HAVE_GDBM],[],[Support for GDBM])
741 if test "x$HAVE_DBM" = "xyes" ; then
742 AC_CHECK_HEADERS(ndbm.h, have_dbm=true, have_dbm=false)
744 if ! $have_dbm ; then
745 AC_MSG_ERROR([*** dbm not found ***])
747 AC_DEFINE([HAVE_DBM],[],[Support for DBM])
750 AM_CONDITIONAL(HAVE_GDBM, test "x$HAVE_GDBM" = "xyes")
751 AM_CONDITIONAL(HAVE_DBM, test "x$HAVE_DBM" = "xyes")
756 AC_ARG_ENABLE(libdaemon,
757 AS_HELP_STRING([--disable-libdaemon],[Disable use of libdaemon]),
758 [case "${enableval}" in
759 yes) HAVE_LIBDAEMON=yes ;;
760 no) HAVE_LIBDAEMON=no ;;
761 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libdaemon) ;;
763 [HAVE_LIBDAEMON=yes])
765 if test "x$HAVE_LIBDAEMON" = "xyes" ; then
766 PKG_CHECK_MODULES(LIBDAEMON, [ libdaemon >= 0.11 ])
767 AC_SUBST(LIBDAEMON_CFLAGS)
768 AC_SUBST(LIBDAEMON_LIBS)
770 AM_CONDITIONAL(HAVE_LIBDAEMON, test "x$HAVE_LIBDAEMON" = "xyes")
775 AC_ARG_ENABLE(python,
776 AS_HELP_STRING([--disable-python], [Disable scripts that depends on python]),
777 [case "${enableval}" in
778 yes) HAVE_PYTHON=yes ;;
779 no) HAVE_PYTHON=no ;;
780 *) AC_MSG_ERROR([bad value ${enableval} for --enable-python]) ;;
781 esac],[HAVE_PYTHON=yes])
786 if test "x$HAVE_PYTHON" = "xyes" ; then
787 AM_PATH_PYTHON([2.4])
790 AS_HELP_STRING([--disable-pygtk],[Disable use of GTK in Python]),
791 [case "${enableval}" in
792 yes) HAVE_PYGTK=yes ;;
794 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pygtk) ;;
798 if test "x$HAVE_PYGTK" = "xyes" ; then
799 AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR(Could not find Python module gtk)])
803 if test "x$HAVE_DBUS" = "xyes" ; then
804 AC_ARG_ENABLE(python-dbus,
805 AS_HELP_STRING([--disable-python-dbus],[Disable use of D-Bus in Python]),
806 [case "${enableval}" in
807 yes) HAVE_PYTHON_DBUS=yes ;;
808 no) HAVE_PYTHON_DBUS=no ;;
809 *) AC_MSG_ERROR(bad value ${enableval} for --enable-python-dbus) ;;
811 [HAVE_PYTHON_DBUS=yes])
813 if test "x$HAVE_PYTHON_DBUS" = "xyes"; then
814 AM_CHECK_PYMOD(dbus,,,[AC_MSG_ERROR(Could not find Python module dbus)])
817 AM_CHECK_PYMOD(socket,,,[AC_MSG_ERROR(Could not find Python module socket)])
818 if test "x$HAVE_GDBM" = "xyes"; then
819 AM_CHECK_PYMOD(gdbm,,,[AC_MSG_ERROR(Could not find Python module gdbm)])
821 if test "x$HAVE_DBM" = "xyes"; then
822 AM_CHECK_PYMOD(dbm,,,[AC_MSG_ERROR(Could not find Python module dbm)])
826 AM_CONDITIONAL(HAVE_PYTHON, [test "x$HAVE_PYTHON" = "xyes" ])
827 AM_CONDITIONAL(HAVE_PYGTK, test "x$HAVE_PYGTK" = "xyes")
828 AM_CONDITIONAL(HAVE_PYTHON_DBUS, test "x$HAVE_PYTHON_DBUS" = "xyes")
831 # Check for mono stuff
834 if test "x$HAVE_DBUS" = "xyes" ; then
836 AS_HELP_STRING([--disable-mono],[Disable mono bindings]),
837 [case "${enableval}" in
838 yes) HAVE_MONO=yes ;;
840 *) AC_MSG_ERROR(bad value ${enableval} for --enable-mono) ;;
844 if test "x$HAVE_MONO" = "xyes" ; then
845 AC_PATH_PROG(MCS, mcs)
846 if test "x$MCS" = "x" ; then
847 AC_MSG_ERROR([Can not find "mcs" - The Mono C-Sharp Compiler) in your PATH])
850 AC_PATH_PROG(GACUTIL, gacutil)
851 if test "x$GACUTIL" = "x" ; then
852 AC_MSG_ERROR([Can not find "gacutil" in your PATH])
859 AM_CONDITIONAL(HAVE_MONO, test "x$HAVE_MONO" = "xyes")
862 # Check for monodoc stuff
865 AC_ARG_ENABLE(monodoc,
866 AS_HELP_STRING([--disable-monodoc],[Disable documentation for mono bindings]),
867 [case "${enableval}" in
868 yes) HAVE_MONODOC=yes ;;
869 no) HAVE_MONODOC=no ;;
870 *) AC_MSG_ERROR(bad value ${enableval} for --enable-monodoc) ;;
874 if test "x$HAVE_MONO" = "xyes" && test "x$HAVE_MONODOC" = "xyes" ; then
875 PKG_CHECK_MODULES(MONODOC, [monodoc >= 1.1.8])
876 MONODOC_DIR=`$PKG_CONFIG --variable=sourcesdir monodoc`
878 AC_PATH_PROG(MONODOCER, monodocer)
879 AC_PATH_PROG(MDASSEMBLER, mdassembler)
881 AC_SUBST(MONODOC_DIR)
883 AC_SUBST(MDASSEMBLER)
885 AM_CONDITIONAL(HAVE_MONODOC, test "x$HAVE_MONODOC" = "xyes")
890 AC_ARG_ENABLE(autoipd,
891 AS_HELP_STRING([--disable-autoipd],[Disable building of avahi-autoipd]),
892 [case "${enableval}" in
893 yes) ENABLE_AUTOIPD=yes ;;
894 no) ENABLE_AUTOIPD=no ;;
895 *) AC_MSG_ERROR(bad value ${enableval} for --disable-autoipd) ;;
897 [ENABLE_AUTOIPD=yes])
899 AM_CONDITIONAL(ENABLE_AUTOIPD, test "x$ENABLE_AUTOIPD" = "xyes")
902 # Defining users and groups
904 AC_ARG_WITH(avahi_user, AS_HELP_STRING([--with-avahi-user=<user>],[User for running avahi-daemon (avahi)]))
905 if test -z "$with_avahi_user" ; then
908 AVAHI_USER=$with_avahi_user
911 AC_DEFINE_UNQUOTED(AVAHI_USER,"$AVAHI_USER", [User for running the Avahi daemon])
913 AC_ARG_WITH(avahi_group,AS_HELP_STRING([--with-avahi-group=<group>],[Group for running avahi-daemon (avahi)]))
914 if test -z "$with_avahi_group" ; then
917 AVAHI_GROUP=$with_avahi_group
919 AC_SUBST(AVAHI_GROUP)
920 AC_DEFINE_UNQUOTED(AVAHI_GROUP,"$AVAHI_GROUP", [Group for Avahi])
922 AC_ARG_WITH(avahi_priv_access_group,AS_HELP_STRING([--with-avahi-priv-access-group=<group>],[Priviliged access group for Avahi clients (netdev)]))
923 if test -z "$with_avahi_priv_access_group" ; then
924 AVAHI_PRIV_ACCESS_GROUP=netdev
926 AVAHI_PRIV_ACCESS_GROUP=$with_avahi_priv_access_group
928 AC_SUBST(AVAHI_PRIV_ACCESS_GROUP)
929 AC_DEFINE_UNQUOTED(AVAHI_PRIV_ACCESS_GROUP,"$AVAHI_PRIV_ACCESS_GROUP", [Privileged access group for Avahi clients])
931 AC_ARG_WITH(autoipd_user, AS_HELP_STRING([--with-autoipd-user=<user>],[User for running the avahi-autoipd daemon (avahi-autoipd)]))
932 if test -z "$with_autoipd_user" ; then
933 AVAHI_AUTOIPD_USER=avahi-autoipd
935 AVAHI_AUTOIPD_USER=$with_autoipd_user
937 AC_SUBST(AVAHI_AUTOIPD_USER)
938 AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_USER,"$AVAHI_AUTOIPD_USER", [User for running the avahi-autoipd daemon])
940 AC_ARG_WITH(autoipd_group,AS_HELP_STRING([--with-autoipd-group=<group>],[Group for running the avahi-autoipd daemon (avahi-autoipd)]))
941 if test -z "$with_autoipd_group" ; then
942 AVAHI_AUTOIPD_GROUP=avahi-autoipd
944 AVAHI_AUTOIPD_GROUP=$with_autoipd_group
946 AC_SUBST(AVAHI_AUTOIPD_GROUP)
947 AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_GROUP,"$AVAHI_AUTOIPD_GROUP", [Group for running the avahi-autoipd daemon])
952 avahi_runtime_dir="${localstatedir}/run"
953 avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket"
954 AC_SUBST(avahi_runtime_dir)
955 AC_SUBST(avahi_socket)
958 # Avahi interfaces dir
960 if test "x$HAVE_PYTHON_DBUS" = "xyes" -o "x$HAVE_GTK" = "xyes"; then
961 interfacesdir="${datadir}/${PACKAGE}/interfaces/"
962 AC_SUBST(interfacesdir)
976 DX_INIT_DOXYGEN(avahi, doxygen.cfg, doxygen)
978 AC_ARG_ENABLE(core-docs,
979 AS_HELP_STRING([--enable-core-docs],[Enable building of documentation for avahi-core]),
980 [case "${enableval}" in
981 yes) ENABLE_CORE_DOCS=yes ;;
982 no) ENABLE_CORE_DOCS=no ;;
983 *) AC_MSG_ERROR([bad value ${enableval} for --enable-core-docs]) ;;
984 esac],[ENABLE_CORE_DOCS=no])
986 AM_CONDITIONAL([ENABLE_CORE_DOCS], [test "x$ENABLE_CORE_DOCS" = xyes])
989 # Build and Install man pages
991 AC_ARG_ENABLE(manpages,
992 AS_HELP_STRING([--disable-manpages],[Disable building and installation of man pages]),
993 [case "${enableval}" in
996 *) AC_MSG_ERROR([bad value ${enableval} for --disable-manpages]) ;;
997 esac],[manpages=yes])
999 if test x$manpages = xyes ; then
1001 # XMLTOMAN manpage generation
1003 AC_ARG_ENABLE(xmltoman,
1004 AS_HELP_STRING([--disable-xmltoman],[Disable rebuilding of man pages with xmltoman]),
1005 [case "${enableval}" in
1006 yes) xmltoman=yes ;;
1008 *) AC_MSG_ERROR([bad value ${enableval} for --disable-xmltoman]) ;;
1009 esac],[xmltoman=yes])
1011 if test x$xmltoman = xyes ; then
1012 AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no)
1015 if test x$have_xmltoman = xno -o x$xmltoman = xno; then
1016 if ! test -e man/avahi-daemon.8 ; then
1017 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])
1020 AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***])
1024 AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes])
1025 AM_CONDITIONAL([BUILD_MANPAGES], [test "x$manpages" = xyes])
1028 # Conditionally compile test and example programs
1030 AC_ARG_ENABLE(tests,
1031 AS_HELP_STRING([--enable-tests],[Enable building of tests and examples]),
1032 [case "${enableval}" in
1033 yes) ENABLE_TESTS=yes ;;
1034 no) ENABLE_TESTS=no ;;
1035 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
1039 AM_CONDITIONAL([ENABLE_TESTS], [test "x$ENABLE_TESTS" = "xyes"])
1042 # Optionally enable libdns_sd compatibility support
1044 AC_ARG_ENABLE(compat-libdns_sd,
1045 AS_HELP_STRING([--enable-compat-libdns_sd],[Enable compatibility layer for libdns_sd]),
1046 [case "${enableval}" in
1047 yes) ENABLE_COMPAT_LIBDNS_SD=yes ;;
1048 no) ENABLE_COMPAT_LIBDNS_SD=no ;;
1049 *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-libdns_sd) ;;
1051 [ENABLE_COMPAT_LIBDNS_SD=no])
1053 AM_CONDITIONAL([ENABLE_COMPAT_LIBDNS_SD], [test "x$ENABLE_COMPAT_LIBDNS_SD" = "xyes"])
1056 # Optionally enable HOWL compatibility support
1058 AC_ARG_ENABLE(compat-howl,
1059 AS_HELP_STRING([--enable-compat-howl],[Enable compatibility layer for HOWL]),
1060 [case "${enableval}" in
1061 yes) ENABLE_COMPAT_HOWL=yes ;;
1062 no) ENABLE_COMPAT_HOWL=no ;;
1063 *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-howl) ;;
1065 [ENABLE_COMPAT_HOWL=no])
1067 AM_CONDITIONAL([ENABLE_COMPAT_HOWL], [test "x$ENABLE_COMPAT_HOWL" = "xyes"])
1070 # ==========================================================================
1073 avahi-common/Makefile
1076 avahi-gobject/Makefile
1078 avahi-daemon/Makefile
1079 avahi-daemon/avahi-dbus.conf
1080 avahi-discover-standalone/Makefile
1081 avahi-client/Makefile
1083 initscript/debian/Makefile
1084 initscript/gentoo/Makefile
1085 initscript/archlinux/Makefile
1086 initscript/suse/Makefile
1087 initscript/fedora/Makefile
1088 initscript/lfs/Makefile
1089 initscript/mandriva/Makefile
1090 initscript/darwin/Makefile
1091 initscript/freebsd/Makefile
1092 initscript/slackware/Makefile
1093 avahi-dnsconfd/Makefile
1094 avahi-utils/Makefile
1095 avahi-python/Makefile
1096 avahi-python/avahi/Makefile
1097 avahi-python/avahi-discover/Makefile
1102 service-type-database/Makefile
1103 avahi-sharp/Makefile
1104 avahi-ui-sharp/Makefile
1105 avahi-compat-libdns_sd/Makefile
1106 avahi-compat-howl/Makefile
1107 avahi-compat-howl/samples/Makefile
1108 avahi-autoipd/Makefile
1114 # ==========================================================================
1116 ---{ $PACKAGE_NAME $VERSION }---
1119 sysconfdir: ${sysconfdir}
1120 localstatedir: ${localstatedir}
1121 avahi socket: ${avahi_socket}
1122 dbus-1 system.d dir: ${DBUS_SYS_DIR}
1123 dbus-1 version: ${DBUS_VERSION}
1124 dbus-1 system socket: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
1127 Enable GLIB: ${HAVE_GLIB}
1128 Enable GLIB GObject: ${HAVE_GOBJECT}
1129 Enable GTK 2.0: ${HAVE_GTK}
1130 Enable GTK 3.0: ${HAVE_GTK3}
1131 Enable D-Bus: ${HAVE_DBUS}
1132 With XML: ${with_xml}
1133 Enable GDBM: ${HAVE_GDBM}
1134 Enable DBM: ${HAVE_DBM}
1135 Enable libdaemon: ${HAVE_LIBDAEMON}
1136 Enable Python: ${HAVE_PYTHON}
1137 Enable pygtk: ${HAVE_PYGTK}
1138 Enable python-dbus: ${HAVE_PYTHON_DBUS}
1139 Enable QT3: ${HAVE_QT3}
1140 Enable QT4: ${HAVE_QT4}
1141 Enable Mono: ${HAVE_MONO}
1142 Enable Monodoc: ${HAVE_MONODOC}
1143 Distribution/OS: ${with_distro}
1144 User for avahi-daemon: ${AVAHI_USER}
1145 Group for avahi-daemon: ${AVAHI_GROUP}
1146 Priviliged access group for Avahi clients: ${AVAHI_PRIV_ACCESS_GROUP}
1147 User for avahi-autoipd: ${AVAHI_AUTOIPD_USER}
1148 Group for avahi-autoipd: ${AVAHI_AUTOIPD_GROUP}
1149 Enable chroot(): ${enable_chroot}
1150 Enable Linux inotify: ${have_inotify}
1151 Enable stack-smashing protection: ${enable_ssp}
1154 BUILD_DAEMON="no (You need libdaemon and expat/bsdxml!)"
1156 if test "x$HAVE_XML" = "xyes" -a "x$HAVE_LIBDAEMON" = "xyes" ; then
1160 BUILD_PYTHON="no (You need python, pygtk and python-dbus!)"
1162 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
1166 BUILD_CLIENT="no (You need avahi-daemon and D-Bus!)"
1168 if test "x$BUILD_DAEMON" = "xyes" -a "x$HAVE_DBUS" = "xyes" ; then
1172 if test "x$ENABLE_COMPAT_LIBDNS_SD" = "xyes" -a "x$BUILD_CLIENT" != "xyes" ; then
1173 ENABLE_COMPAT_LIBDNS_SD="no (You need libavahi-client!)"
1175 if test "x$ENABLE_COMPAT_HOWL" = "xyes" -a "x$BUILD_CLIENT" != "xyes" ; then
1176 ENABLE_COMPAT_HOWL="no (You need libavahi-client!)"
1178 if test "x$ENABLE_AUTOIPD" = "xyes" -a "x$HAVE_LIBDAEMON" != "xyes" ; then
1179 ENABLE_AUTOIPD="no (You need libdaemon!)"
1183 if test "x$HAVE_GTK" = "xyes" -o "x$HAVE_GTK3" = "xyes" ; then
1188 if test "x$HAVE_GTK2OR3" = "xyes" -a "x$BUILD_CLIENT" = "xyes" ; then
1193 if test "x$BUILD_CLIENT" = "xyes" -a "x$HAVE_GOBJECT" = "xyes" ; then
1198 Building libavahi-core yes
1199 Building avahi-daemon: ${BUILD_DAEMON}
1200 Building avahi-dnsconfd: ${BUILD_DAEMON}
1201 Building libavahi-client: ${BUILD_CLIENT}
1202 Building avahi-utils: ${BUILD_CLIENT}
1203 Building avahi-python: ${BUILD_PYTHON}
1204 Building libavahi-glib: ${HAVE_GLIB}
1205 Building libavahi-gobject: ${BUILD_GOBJECT}
1206 Building avahi-discover-standalone: ${HAVE_GTK2OR3}
1207 Building libavahi-qt3: ${HAVE_QT3}
1208 Building libavahi-qt4: ${HAVE_QT4}
1209 Building avahi-sharp: ${HAVE_MONO}
1210 Building avahi-compat-libdns_sd: ${ENABLE_COMPAT_LIBDNS_SD}
1211 Building avahi-compat-howl: ${ENABLE_COMPAT_HOWL}
1212 Building tests: ${ENABLE_TESTS}
1213 Building avahi-core documentation: ${ENABLE_CORE_DOCS}
1214 Building avahi-autoipd: ${ENABLE_AUTOIPD}
1215 Building libavahi-ui: ${BUILD_UI}