]> git.meshlink.io Git - catta/blob - configure.ac
bump version and soname
[catta] / configure.ac
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 # $Id$
5
6 # This file is part of avahi.
7 #
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.
12 #
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.
17 #
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
21 # USA.
22
23 AC_PREREQ(2.57)
24 AC_INIT([avahi],[0.6.25],[avahi (at) lists (dot) freedesktop (dot) org])
25 AC_CONFIG_SRCDIR([avahi-core/server.c])
26 AC_CONFIG_HEADERS([config.h])
27 AM_INIT_AUTOMAKE([foreign 1.9 -Wall])
28
29 AC_SUBST(PACKAGE_URL, [http://avahi.org/])
30
31 AC_SUBST(LIBAVAHI_COMMON_VERSION_INFO, [8:1:5])
32 AC_SUBST(LIBAVAHI_CORE_VERSION_INFO, [6:1:0])
33 AC_SUBST(LIBAVAHI_CLIENT_VERSION_INFO, [5:5:2])
34 AC_SUBST(LIBAVAHI_GLIB_VERSION_INFO, [1:1:0])
35 AC_SUBST(LIBAVAHI_GOBJECT_VERSION_INFO, [0:1:0])
36 AC_SUBST(LIBAVAHI_QT3_VERSION_INFO, [1:2:0])
37 AC_SUBST(LIBAVAHI_QT4_VERSION_INFO, [1:2:0])
38 AC_SUBST(LIBAVAHI_UI_VERSION_INFO, [1:1:1])
39
40 # Do not touch these, since they we took this version-info from upstream HOWL/Bonjour
41 AC_SUBST(LIBAVAHI_COMPAT_LIBDNS_SD_VERSION_INFO, [1:0:0])
42 AC_SUBST(LIBAVAHI_COMPAT_HOWL_VERSION_INFO, [0:0:0])
43 AC_SUBST(HOWL_COMPAT_VERSION, [0.9.8])
44
45 if type -p stow > /dev/null && test -d /usr/local/stow ; then
46     AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
47     ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
48 fi
49
50 # Checks for programs.
51 AC_PROG_CC
52 AC_PROG_CXX
53 AC_GNU_SOURCE
54 AC_PROG_CPP
55 AC_PROG_INSTALL
56 AC_PROG_LN_S
57 AC_PROG_MAKE_SET
58 AC_PROG_GCC_TRADITIONAL
59
60 AM_PROG_CC_C_O
61
62 # -fstack-protector
63 AC_ARG_ENABLE([stack-protector],
64     [AS_HELP_STRING([--disable-stack-protector],
65         [Disable GCC's/libc's stack-smashing protection])],
66     [case "${enableval}" in
67          yes) enable_ssp=yes ;;
68           no) enable_ssp=no ;;
69            *) AC_MSG_ERROR([invalid value ${enableval} for --disable-stack-protector]) ;;
70      esac],
71     [enable_ssp=yes])
72
73 if test x"$enable_ssp" = x"yes" && test x"$GCC" != x"yes"; then
74     AC_MSG_NOTICE([Disabling stack-smashing protection because compiler is not GCC])
75     enable_ssp=no
76 fi
77
78 if test x"$enable_ssp" = x"yes"; then
79     # Check for broken ssp in libc: http://www.avahi.org/ticket/105
80     # libc's brokenness will get in the way regardless of whether -lssp is
81     # provided, but provide it anyway (otherwise non-libc ssp would wrongly
82     # break here)
83
84     # Get -lssp if it exists
85     GCC_STACK_PROTECT_LIB
86
87     AC_MSG_CHECKING([whether stack-smashing protection is available])
88     ssp_old_cflags="$CFLAGS"
89     ssp_old_ldflags="$LDFLAGS"
90     CFLAGS="$CFLAGS -Werror -fstack-protector-all -fPIC"
91     LDFLAGS="$LDFLAGS -Wl,-z,defs"
92     cat confdefs.h > conftest.c
93     cat >>conftest.c <<_ACEOF
94 void test_broken_ssp(c)
95     const char *c;
96 {
97     char arr[[123]], *p; /* beware of possible double-braces if copying this */
98     for (p = arr; *c; ++p) {
99         *p = *c;
100         ++c;
101     }
102 }
103 _ACEOF
104     rm -f conftest.o
105
106     if $CC -c $CFLAGS $CPPFLAGS -o conftest.o conftest.c >/dev/null 2>&1; then
107         AC_MSG_RESULT([yes])
108         AC_MSG_CHECKING([whether stack-smashing protection is buggy])
109         if $CC -o conftest.so $LDFLAGS -shared conftest.o $LIBS >/dev/null 2>&1; then
110             AC_MSG_RESULT([no])
111         else
112             AC_MSG_RESULT([yes])
113             enable_ssp=no
114         fi
115     else
116         AC_MSG_RESULT([no])
117     fi
118
119     rm -f conftest.c conftest.o conftest.so
120
121     CFLAGS="$ssp_old_cflags"
122     LDFLAGS="$ssp_old_ldflags"
123 fi
124
125 if test x"$enable_ssp" = x"yes"; then
126     # Do this the long way so we don't call GCC_STACK_PROTECT_LIB twice
127     GCC_STACK_PROTECT_CC
128
129     AC_LANG_PUSH([C++])
130     GCC_STACK_PROTECT_CXX
131     AC_LANG_POP([C++])
132     # XXX: Update the enable_ssp value now for output later?
133 fi
134
135 # libtool stuff
136 AC_PROG_LIBTOOL
137
138 AC_CACHE_CHECK([whether the C++ compiler works], [avahi_cv_sys_cxx_works], [
139     AC_LANG_PUSH([C++])
140     AC_COMPILE_IFELSE([int main() { return 0; }], [avahi_cv_sys_cxx_works=yes],
141         [avahi_cv_sys_cxx_works=no])
142     AC_LANG_POP([C++])
143     ])
144 [ if [ "x$avahi_cv_sys_cxx_works" = "xno" ]; then ]
145     AC_MSG_FAILURE([The C++ compiler does not work])
146 [ fi ]
147
148 ACX_PTHREAD(,AC_MSG_ERROR([Missing POSIX Threads support]))
149
150 #
151 # Check for netlink.h
152 #
153 AC_CHECK_HEADER(linux/netlink.h,
154 HAVE_NETLINK=yes
155 AC_DEFINE([HAVE_NETLINK],[],[Support for Linux netlink])
156 , [], [
157 #include <sys/socket.h>
158 #include <asm/types.h>
159 ])
160
161 AM_CONDITIONAL(HAVE_NETLINK, [ test x"$HAVE_NETLINK" = xyes ])
162
163 #
164 # Check for net/route.h
165 #
166 AC_CHECK_HEADER(net/route.h,
167 HAVE_PF_ROUTE=yes
168 AC_DEFINE([HAVE_PF_ROUTE],[],[Support for PF_ROUTE])
169 , [], [
170 #include <sys/types.h>
171 #include <sys/socket.h>
172 ])
173
174 AM_CONDITIONAL(HAVE_PF_ROUTE, [ test x"$HAVE_PF_ROUTE" = xyes ])
175
176 #
177 # Check for sys/filio.h; needed for FIONREAD on Solaris
178 #
179 AC_CHECK_HEADER(sys/filio.h,
180 HAVE_SYS_FILIO_H=yes
181 AC_DEFINE([HAVE_SYS_FILIO_H],[],[Support for sys/filio.h])
182 , [], [
183 ])
184
185 AM_CONDITIONAL(HAVE_SYS_FILIO_H, [ test x"$HAVE_SYS_FILIO_H" = xyes ])
186
187 #
188 # Check for sys/sysctl.h; not present on Solaris
189 #
190 AC_CHECK_HEADER(sys/sysctl.h,
191 HAVE_SYS_SYSCTL=yes
192 AC_DEFINE([HAVE_SYS_SYSCTL_H],[],[Support for sys/sysctl.h])
193 , [], [
194 #include <sys/types.h>
195 #include <sys/socket.h>
196 #include <sys/param.h>
197 ])
198
199 AM_CONDITIONAL(HAVE_SYS_SYSCTL_H, [ test x"$HAVE_SYS_SYSCTL_H" = xyes ])
200
201 #
202 # Check for lifconf struct; only present on Solaris
203 #
204 AC_MSG_CHECKING(for struct lifconf)
205 AC_CACHE_VAL(avahi_cv_has_struct_lifconf,
206 [AC_TRY_COMPILE(
207 [#include <sys/socket.h>
208 #include <net/if.h>
209 ],[sizeof (struct lifconf);],
210 avahi_cv_has_struct_lifconf=yes,avahi_cv_has_struct_lifconf=no)])
211 AC_MSG_RESULT($avahi_cv_has_struct_lifconf)
212 if test $avahi_cv_has_struct_lifconf = yes; then
213     AC_DEFINE(HAVE_STRUCT_LIFCONF,1,[Define if there is a struct lifconf.])
214 fi
215
216 #
217 # Check for struct ip_mreqn
218 #
219 AC_MSG_CHECKING(for struct ip_mreqn)
220 AC_TRY_COMPILE([#include <netinet/in.h>], [
221         struct ip_mreqn mreq;
222         mreq.imr_address.s_addr = 0;
223 ], [
224         # Yes, we have it...
225         AC_MSG_RESULT(yes)
226         AC_DEFINE([HAVE_STRUCT_IP_MREQN],[],[Support for struct ip_mreqn])
227 ], [
228         # We'll just have to try and use struct ip_mreq
229         AC_MSG_RESULT(no)
230         AC_MSG_CHECKING(for struct ip_mreq)
231         AC_TRY_COMPILE([#include <netinet/in.h>], [
232                 struct ip_mreq mreq;
233                 mreq.imr_interface.s_addr = 0;
234         ], [
235                 # Yes, we have it...
236                 AC_MSG_RESULT(yes)
237                 AC_DEFINE([HAVE_STRUCT_IP_MREQ],[],[Support for struct ip_mreq])
238         ], [
239                 # No multicast support
240                         AC_MSG_RESULT(no)
241         ])
242 ])
243
244 #
245 # Detecting the linux distribution for specific things like init scripts.
246 #
247 AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of lfs, debian, gentoo, archlinux, fedora, mandriva, darwin, netbsd, freebsd, slackware or none]))
248 if test "z$with_distro" = "z"; then
249     if test "$cross_compiling" = yes; then
250         AC_MSG_WARN([Target distribution cannot be reliably detected when cross-compiling. You should specify it with --with-distro (see $0 --help for recognized distros)])
251     else
252         AC_CHECK_FILE(/etc/lfs-release,with_distro="lfs")
253         AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
254         AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
255         AC_CHECK_FILE(/etc/arch-release,with_distro="archlinux")
256         AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
257         AC_CHECK_FILE(/etc/redhat-release,with_distro="fedora")
258         AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva")
259         AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
260     fi
261     if test "z$with_distro" = "z"; then
262         with_distro=`uname -s`
263     fi
264 fi
265 with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
266
267 case $with_distro in
268     lfs|debian|gentoo|archlinux|suse|fedora|mandriva|darwin|freebsd|slackware|none)
269      ;;
270     netbsd)
271      AC_MSG_WARN([Your distribution (${with_distro}) is supported but no init script exist yet! (patches welcome)])
272      ;;
273     linux)
274      AC_MSG_ERROR([Linux distribution autodetection failed, you must specify the distribution to target using --with-distro=DISTRO, set DISTRO to none if your distribution is not supported.])
275      ;;
276     *)
277      AC_MSG_ERROR([Your distribution (${with_distro}) is not yet supported, init scripts and D-Bus configuration will not be installed! (patches welcome), you can specify --with-distro=none to skip this check])
278      ;;
279 esac
280
281 AM_CONDITIONAL(TARGET_LFS, test x"$with_distro" = xlfs)
282 AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
283 AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
284 AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
285 AM_CONDITIONAL(TARGET_ARCHLINUX, test x"$with_distro" = xarchlinux)
286 AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
287 AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
288 AM_CONDITIONAL(TARGET_DARWIN, test x"$with_distro" = xdarwin)
289 AM_CONDITIONAL(TARGET_NETBSD, test x"$with_distro" = xnetbsd)
290 AM_CONDITIONAL(TARGET_FREEBSD, test x"$with_distro" = xfreebsd)
291 AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
292
293 test_gcc_flag() {
294     AC_LANG_CONFTEST([int main() {}])
295     $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
296     ret=$?
297     rm -f conftest.o
298     return $ret
299 }
300
301 # If using GCC specify some additional parameters
302 if test "x$GCC" = "xyes" ; then
303
304     DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline"
305
306     if test "x$HAVE_NETLINK" = "xyes" ; then
307         # Test whether rtnetlink.h can be included when compiled with -std=c99
308         # some distributions (e.g. archlinux) have broken headers that dont
309         # define __u64 with -std=c99
310         AC_MSG_CHECKING([checking whether rtnetlink.h can be included with -std=c99])
311         OLDCFLAGS="$CFLAGS"
312         CFLAGS="-std=c99"
313         AC_TRY_COMPILE([#include <linux/rtnetlink.h>], [],
314             use_stdc99=yes, use_stdc99=no)
315
316         if test x"$use_stdc99" = xyes; then
317             DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
318             AC_MSG_RESULT([yes])
319         else
320             AC_MSG_RESULT([no])
321         fi
322
323         CFLAGS="$OLDCFLAGS"
324     else
325         DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
326     fi
327
328     for flag in $DESIRED_FLAGS ; do
329         AC_MSG_CHECKING([whether $CC accepts $flag])
330         if test_gcc_flag $flag ; then
331            CFLAGS="$CFLAGS $flag"
332            AC_MSG_RESULT([yes])
333         else
334            AC_MSG_RESULT([no])
335         fi
336     done
337 fi
338
339 # Checks for header files.
340 AC_HEADER_STDC
341 AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h netdb.h syslog.h])
342 AC_HEADER_STDBOOL
343
344 # Checks for typedefs, structures, and compiler characteristics.
345 AC_C_CONST
346 AC_TYPE_SIZE_T
347 AC_HEADER_TIME
348 AC_HEADER_SYS_WAIT
349
350  # Solaris stuff
351  AC_SEARCH_LIBS([inet_ntop],[nsl])
352  AC_SEARCH_LIBS([recv],[socket])
353  AC_CHECK_DECL([CMSG_SPACE],,CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__")
354
355 # Checks for library functions.
356 AC_FUNC_MEMCMP
357 AC_FUNC_SELECT_ARGTYPES
358 # avahi_malloc actually returns NULL for avahi_malloc(0), so it does not matter
359 # whether libc's malloc does too. (Same for realloc.)
360 #AC_FUNC_MALLOC
361 #AC_FUNC_REALLOC
362 AC_CHECK_FUNCS([gethostname memchr memmove memset mkdir select socket strchr strcspn strdup strerror strrchr strspn strstr uname setresuid setreuid setresgid setregid strcasecmp gettimeofday putenv strncasecmp strlcpy gethostbyname seteuid setegid setproctitle getprogname])
363
364 AC_FUNC_CHOWN
365 AC_FUNC_STAT
366 AC_TYPE_MODE_T
367 AC_TYPE_PID_T
368
369 AC_CHECK_DECLS(environ)
370
371 # check if gcc's -fvisibility is supported
372 CHECK_VISIBILITY_HIDDEN
373
374 enable_chroot=yes
375 AC_CHECK_HEADERS([sys/capability.h],,enable_chroot=no)
376 AC_CHECK_HEADERS([sys/prctl.h],,enable_chroot=no)
377 AC_CHECK_FUNCS([chroot],,enable_chroot=no)
378
379 AM_CONDITIONAL(ENABLE_CHROOT, test "x$enable_chroot" = "xyes")
380
381 if test "x$enable_chroot" = "xyes" ; then
382    AC_DEFINE([ENABLE_CHROOT], 1, [Enable chroot() usage])
383 fi
384
385 AC_CHECK_LIB(dl, dlopen, [ AC_CHECK_HEADERS(dlfcn.h, HAVE_DLOPEN=yes, HAVE_DLOPEN=no) ], HAVE_DLOPEN=no)
386 if test "x$HAVE_DLOPEN" = "xyes" ; then
387     AC_DEFINE([HAVE_DLOPEN],1,[Have dlopen()])
388 fi
389 AM_CONDITIONAL(HAVE_DLOPEN, test "x$HAVE_DLOPEN" = "xyes")
390
391 have_inotify=no
392 AC_CHECK_HEADERS([sys/inotify.h], [have_inotify=yes])
393
394 AM_CONDITIONAL(HAVE_INOTIFY, test "x$have_inotify" = "xyes")
395
396 if test "x$have_inotify" = "xyes" ; then
397    AC_DEFINE([HAVE_INOTIFY], 1, [Enable Linux inotify() usage])
398 fi
399
400 have_kqueue=yes
401 AC_CHECK_FUNCS([kqueue],,have_kqueue=no)
402
403 AM_CONDITIONAL(HAVE_KQUEUE, test "x$have_kqueue" = "xyes")
404
405 if test "x$have_kqueue" = "xyes" ; then
406     AC_DEFINE([HAVE_KQUEUE], 1, [Enable BSD kqueue() usage])
407 fi
408
409 IT_PROG_INTLTOOL([0.35.0])
410 GETTEXT_PACKAGE=avahi
411 AC_SUBST([GETTEXT_PACKAGE])
412 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
413 AM_GLIB_GNU_GETTEXT
414
415 avahilocaledir='${prefix}/${DATADIRNAME}/locale'
416 AC_SUBST(avahilocaledir)
417
418
419 # Check for pkg-config manually first, as if its not installed the
420 # PKG_PROG_PKG_CONFIG macro won't be defined.
421 AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
422
423 if test x"$have_pkg_config" = "xno"; then
424     AC_MSG_ERROR(pkg-config is required to install this program)
425 fi
426
427 PKG_PROG_PKG_CONFIG
428
429 #
430 # Check for GLIB 2.0
431 #
432 AC_ARG_ENABLE(glib,
433         AS_HELP_STRING([--disable-glib],[Disable use of GLib]),
434         [case "${enableval}" in
435                 yes) HAVE_GLIB=yes ;;
436                 no)  HAVE_GLIB=no ;;
437                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-glib) ;;
438         esac],
439         [HAVE_GLIB=yes])
440
441 if test "x$HAVE_GLIB" = "xyes" ; then
442         PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ])
443         AC_SUBST(GLIB20_CFLAGS)
444         AC_SUBST(GLIB20_LIBS)
445 fi
446 AM_CONDITIONAL(HAVE_GLIB, test "x$HAVE_GLIB" = "xyes")
447
448 #
449 # Check for GLIB's gobject 2.0
450 #
451 AC_ARG_ENABLE(gobject,
452         AS_HELP_STRING([--disable-gobject],[Disable use of GLib GObject]),
453         [case "${enableval}" in
454                 yes) HAVE_GOBJECT=yes ;;
455                 no)  HAVE_GOBJECT=no ;;
456                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gobject) ;;
457         esac],
458         [HAVE_GOBJECT=yes])
459
460 if test "x$HAVE_GOBJECT" = "xyes" ; then
461         PKG_CHECK_MODULES(GOBJECT, [ glib-2.0 >= 2.4.0 gobject-2.0 ])
462         AC_SUBST(GOBJECT_CFLAGS)
463         AC_SUBST(GOBJECT_LIBS)
464 fi
465 AM_CONDITIONAL(HAVE_GOBJECT, test "x$HAVE_GOBJECT" = "xyes")
466
467 #
468 # Check for Qt 3
469 #
470 AC_ARG_ENABLE(qt3,
471         AS_HELP_STRING([--disable-qt3],[Disable building of Qt3 mainloop integration]),
472         [case "${enableval}" in
473                 yes) HAVE_QT3=yes ;;
474                 no)  HAVE_QT3=no ;;
475                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt3) ;;
476         esac],
477         [HAVE_QT3=yes])
478
479 if test "x$HAVE_QT3" = "xyes" ; then
480         PKG_CHECK_MODULES( QT3, [ qt-mt >= 3.0.0 ])
481         AC_SUBST(QT3_CFLAGS)
482         AC_SUBST(QT3_LIBS)
483             QT3_PREFIX="`$PKG_CONFIG --variable=prefix qt-mt`/bin"
484         AC_PATH_PROGS(MOC_QT3, [moc-qt3 moc], no, [$QT3_PREFIX])
485         if test "$MOC_QT3" = no; then
486             AC_MSG_ERROR([Could not find QT3 moc])
487         fi
488         AC_SUBST(MOC_QT3)
489 fi
490 AM_CONDITIONAL(HAVE_QT3, test "x$HAVE_QT3" = "xyes")
491
492 #
493 # Check for Qt 4
494 #
495 AC_ARG_ENABLE(qt4,
496         AS_HELP_STRING([--disable-qt4],[Disable building of Qt4Core mainloop integration]),
497         [case "${enableval}" in
498                 yes) HAVE_QT4=yes ;;
499                 no)  HAVE_QT4=no ;;
500                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt4) ;;
501         esac],
502         [HAVE_QT4=yes])
503
504 if test "x$HAVE_QT4" = "xyes" ; then
505         PKG_CHECK_MODULES( QT4, [ QtCore >= 4.0.0 ])
506         AC_SUBST(QT4_CFLAGS)
507         AC_SUBST(QT4_LIBS)
508             QT4_PREFIX="`$PKG_CONFIG --variable=prefix QtCore`/bin"
509         AC_PATH_PROGS(MOC_QT4, [moc-qt4 moc], no, [$QT4_PREFIX])
510         if test "$MOC_QT4" = no; then
511             AC_MSG_ERROR([Could not find QT4 moc])
512         fi
513         AC_SUBST(MOC_QT4)
514 fi
515 AM_CONDITIONAL(HAVE_QT4, test "x$HAVE_QT4" = "xyes")
516
517 #
518 # Check for GTK+
519 #
520 AC_ARG_ENABLE(gtk,
521         AS_HELP_STRING([--disable-gtk],[Disable use of GTK+]),
522         [case "${enableval}" in
523                 yes) HAVE_GTK=yes ;;
524                 no)  HAVE_GTK=no ;;
525                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk) ;;
526         esac],
527         [HAVE_GTK=yes])
528
529 if test "x$HAVE_GTK" = "xyes" ; then
530         # Check for GTK 2.0
531         PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.4.0 ])
532         AC_SUBST(GTK20_CFLAGS)
533         AC_SUBST(GTK20_LIBS)
534
535         # Check for GLADE 2.0
536         PKG_CHECK_MODULES(GLADE20, [ libglade-2.0 >= 2.4.0 ])
537         AC_SUBST(GLADE20_CFLAGS)
538         AC_SUBST(GLADE20_LIBS)
539 fi
540 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
541
542 #
543 # D-Bus
544 #
545 AC_ARG_ENABLE(dbus,
546         AS_HELP_STRING([--disable-dbus],[Disable use of D-Bus]),
547         [case "${enableval}" in
548                 yes) HAVE_DBUS=yes ;;
549                 no)  HAVE_DBUS=no ;;
550                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbus) ;;
551         esac],
552         [HAVE_DBUS=yes])
553
554 AC_ARG_WITH(dbus-sys, AS_HELP_STRING([--with-dbus-sys=<dir>], [Path to D-Bus system.d directory]))
555 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]))
556
557 DBUS_VERSION="Disabled"
558 DBUS_SYS_DIR="Disabled"
559 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="Disabled"
560 if test "x$HAVE_DBUS" = "xyes" ; then
561     PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 0.34 ])
562
563     AC_DEFINE(HAVE_DBUS, 1, [Whether we have D-Bus or not])
564
565     DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion`
566     DBUS_VERSION_MAJOR=`echo $DBUS_VERSION | awk -F. '{print $1}'`
567     DBUS_VERSION_MINOR=`echo $DBUS_VERSION | awk -F. '{print $2}'`
568     DBUS_VERSION_MICRO=`echo $DBUS_VERSION | awk -F. '{print $3}'`
569     if test "z$DBUS_VERSION_MAJOR" = "z"; then
570         DBUS_VERSION_MAJOR="0"
571     fi
572     if test "z$DBUS_VERSION_MINOR" = "z"; then
573         DBUS_VERSION_MINOR="0"
574     fi
575     if test "z$DBUS_VERSION_MICRO" = "z"; then
576         DBUS_VERSION_MICRO="0"
577     fi
578
579     if test "z$DBUS_VERSION_MAJOR" = "z0" -a "z$DBUS_VERSION_MINOR" = "z0" -a "z$DBUS_VERSION_MICRO" = "z0"; then
580         echo "Error: Couldn't determine the version of your D-Bus package."
581         echo "  This is probably an error in this script, please report it"
582         echo "  along with the following information:"
583         echo "      Base D-Buss version ='$DBUS_VERSION'"
584         echo "      DBUS_VERSION_MAJOR='$DBUS_VERSION_MAJOR'"
585         echo "      DBUS_VERSION_MINOR='$DBUS_VERSION_MINOR'"
586         echo "      DBUS_VERSION_MICRO='$DBUS_VERSION_MICRO'"
587         exit 1
588     else
589         echo "Your D-Bus version is $DBUS_VERSION_MAJOR,$DBUS_VERSION_MINOR,$DBUS_VERSION_MICRO."
590         DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MAJOR=$DBUS_VERSION_MAJOR"
591         DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MINOR=$DBUS_VERSION_MINOR"
592         DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MICRO=$DBUS_VERSION_MICRO"
593     fi
594
595     DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
596     AC_SUBST(DBUS_CFLAGS)
597     AC_SUBST(DBUS_LIBS)
598
599     if ! test -z "$with_dbus_sys" ; then
600         DBUS_SYS_DIR="$with_dbus_sys"
601     else
602         DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
603     fi
604     AC_SUBST(DBUS_SYS_DIR)
605
606     if ! test -z "$with_dbus_system_address" ; then
607         DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="$with_dbus_system_address"
608     else
609         # This is ugly, but D-Bus doesn't export this address for us
610         # so we have to guess, pretty much all setups i've seen have
611         # it in /var/lib/dbus or /var/run/dbus, and its defaulted to
612         # /var/run upstream so we will try guess first then default
613         # to /var/run/dbus.
614
615         DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=/var/run/dbus/system_bus_socket"
616         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"
617         for sock in $TRY_SOCKETS; do
618             if test -S $sock; then
619                 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$sock"
620             fi
621         done
622     fi
623     AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
624
625     SAVED_LIBS="$LIBS"
626     LIBS="$LIBS $DBUS_LIBS"
627     AC_CHECK_FUNCS([dbus_connection_close dbus_bus_get_private])
628     LIBS="$SAVED_LIBS"
629 fi
630 AM_CONDITIONAL(HAVE_DBUS, test "x$HAVE_DBUS" = "xyes")
631
632 #
633 # Expat
634 #
635 AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[expat/bsdxml/none]],[XML library to use]))
636 use_expat=false
637 use_bsdxml=false
638
639 # See what we have
640 AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false)
641 AC_CHECK_LIB(bsdxml, XML_ParserCreate, [ AC_CHECK_HEADERS(bsdxml.h, have_bsdxml=true, have_bsdxml=false) ], have_bsdxml=false)
642
643 if test "x$with_xml" = "xnone"; then
644         :
645 elif test "x$with_xml" = "xexpat"; then
646         use_expat=true
647         if ! $have_expat ; then
648                 AC_MSG_ERROR([*** libexpat requested, but not found ***])
649         fi
650 elif test "x$with_xml" = "xbsdxml"; then
651         use_bsdxml=true
652         if ! $have_bsdxml ; then
653                 AC_MSG_ERROR([*** libbsdxml requested, but not found ***])
654         fi
655 elif test "x$with_xml" != "x"; then
656         AC_MSG_ERROR([*** unknown with-xml option ***])
657 else
658         if $have_expat ; then
659                 use_expat=true
660         elif $have_bsdxml ; then
661                 use_bsdxml=true
662         else
663                 AC_MSG_ERROR([*** neither libexpat not libbsdxml could be found ***])
664         fi
665 fi
666
667 if $use_expat; then
668         with_xml=expat
669         XML_CFLAGS=-DUSE_EXPAT_H
670         XML_LIBS=-lexpat
671 fi
672 if $use_bsdxml; then
673         with_xml=bsdxml
674         XML_CFLAGS=-DUSE_BSDXML_H
675         XML_LIBS=-lbsdxml
676 fi
677 AC_SUBST(XML_LIBS)
678 AC_SUBST(XML_CFLAGS)
679
680 if $use_expat || $use_bsdxml; then
681         HAVE_XML=yes
682 fi
683
684 AM_CONDITIONAL(HAVE_XML, test "x$HAVE_XML" = "xyes")
685
686 #
687 # GDBM
688 #
689 #
690 # Check for dbm
691 #
692 AC_ARG_ENABLE(dbm,
693         AS_HELP_STRING([--enable-dbm],[Enable use of DBM]),
694         [case "${enableval}" in
695                 yes) HAVE_DBM=yes ;;
696                 no)  HAVE_DBM=no ;;
697                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbm) ;;
698         esac],
699         [HAVE_DBM=no])
700
701 AC_ARG_ENABLE(gdbm,
702         AS_HELP_STRING([--disable-gdbm],[Disable use of GDBM]),
703         [case "${enableval}" in
704                 yes) HAVE_GDBM=yes ;;
705                 no)  HAVE_GDBM=no ;;
706                 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gdbm) ;;
707         esac],
708         [HAVE_GDBM=yes])
709
710 if test "x$HAVE_GDBM" = "xyes" ; then
711     if test "x$HAVE_DBM" = "xyes" ; then
712         AC_MSG_ERROR([*** --enable-gdbm and --enable-dbm both specified ***])
713     fi
714     AC_CHECK_LIB(gdbm, gdbm_open, [ AC_CHECK_HEADERS(gdbm.h, have_gdbm=true, have_gdbm=false) ], have_gdbm=false)
715
716     if ! $have_gdbm ; then
717         AC_MSG_ERROR([*** libgdbm not found ***])
718     fi
719     AC_DEFINE([HAVE_GDBM],[],[Support for GDBM])
720 else
721     if test "x$HAVE_DBM" = "xyes" ; then
722         AC_CHECK_HEADERS(ndbm.h, have_dbm=true, have_dbm=false)
723
724         if ! $have_dbm ; then
725             AC_MSG_ERROR([*** dbm not found ***])
726         fi
727         AC_DEFINE([HAVE_DBM],[],[Support for DBM])
728     fi
729 fi
730 AM_CONDITIONAL(HAVE_GDBM, test "x$HAVE_GDBM" = "xyes")
731 AM_CONDITIONAL(HAVE_DBM, test "x$HAVE_DBM" = "xyes")
732
733 #
734 # libdaemon
735 #
736 AC_ARG_ENABLE(libdaemon,
737         AS_HELP_STRING([--disable-libdaemon],[Disable use of libdaemon]),
738         [case "${enableval}" in
739                 yes) HAVE_LIBDAEMON=yes ;;
740                 no)  HAVE_LIBDAEMON=no ;;
741                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libdaemon) ;;
742         esac],
743         [HAVE_LIBDAEMON=yes])
744
745 if test "x$HAVE_LIBDAEMON" = "xyes" ; then
746     PKG_CHECK_MODULES(LIBDAEMON, [ libdaemon >= 0.11 ])
747     AC_SUBST(LIBDAEMON_CFLAGS)
748     AC_SUBST(LIBDAEMON_LIBS)
749 fi
750 AM_CONDITIONAL(HAVE_LIBDAEMON, test "x$HAVE_LIBDAEMON" = "xyes")
751
752 #
753 # Python stuff
754 #
755 AC_ARG_ENABLE(python,
756     AS_HELP_STRING([--disable-python], [Disable scripts that depends on python]),
757     [case "${enableval}" in
758           yes) HAVE_PYTHON=yes ;;
759           no)  HAVE_PYTHON=no ;;
760           *) AC_MSG_ERROR([bad value ${enableval} for --enable-python]) ;;
761     esac],[HAVE_PYTHON=yes])
762
763 HAVE_PYTHON_DBUS=no
764 HAVE_PYGTK=no
765
766 if test "x$HAVE_PYTHON" = "xyes" ; then
767     AM_PATH_PYTHON([2.4])
768
769     AC_ARG_ENABLE(pygtk,
770         AS_HELP_STRING([--disable-pygtk],[Disable use of GTK in Python]),
771         [case "${enableval}" in
772                 yes) HAVE_PYGTK=yes ;;
773                 no)  HAVE_PYGTK=no ;;
774                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pygtk) ;;
775         esac],
776         [HAVE_PYGTK=yes])
777
778     if test "x$HAVE_PYGTK" = "xyes" ; then
779         AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR(Could not find Python module gtk)])
780     fi
781
782
783     if test "x$HAVE_DBUS" = "xyes" ; then
784         AC_ARG_ENABLE(python-dbus,
785             AS_HELP_STRING([--disable-python-dbus],[Disable use of D-Bus in Python]),
786             [case "${enableval}" in
787                    yes) HAVE_PYTHON_DBUS=yes ;;
788                    no)  HAVE_PYTHON_DBUS=no ;;
789                    *) AC_MSG_ERROR(bad value ${enableval} for --enable-python-dbus) ;;
790             esac],
791             [HAVE_PYTHON_DBUS=yes])
792
793         if test "x$HAVE_PYTHON_DBUS" = "xyes"; then
794             AM_CHECK_PYMOD(dbus,,,[AC_MSG_ERROR(Could not find Python module dbus)])
795         fi
796
797         AM_CHECK_PYMOD(socket,,,[AC_MSG_ERROR(Could not find Python module socket)])
798         if test "x$HAVE_GDBM" = "xyes"; then
799             AM_CHECK_PYMOD(gdbm,,,[AC_MSG_ERROR(Could not find Python module gdbm)])
800         fi
801         if test "x$HAVE_DBM" = "xyes"; then
802             AM_CHECK_PYMOD(dbm,,,[AC_MSG_ERROR(Could not find Python module dbm)])
803         fi
804     fi
805 fi
806 AM_CONDITIONAL(HAVE_PYTHON, [test "x$HAVE_PYTHON" = "xyes" ])
807 AM_CONDITIONAL(HAVE_PYGTK, test "x$HAVE_PYGTK" = "xyes")
808 AM_CONDITIONAL(HAVE_PYTHON_DBUS, test "x$HAVE_PYTHON_DBUS" = "xyes")
809
810 #
811 # Check for mono stuff
812 #
813 HAVE_MONO=no
814 if test "x$HAVE_DBUS" = "xyes" ; then
815     AC_ARG_ENABLE(mono,
816             AS_HELP_STRING([--disable-mono],[Disable mono bindings]),
817             [case "${enableval}" in
818                     yes) HAVE_MONO=yes ;;
819                     no)  HAVE_MONO=no ;;
820                     *) AC_MSG_ERROR(bad value ${enableval} for --enable-mono) ;;
821             esac],
822             [HAVE_MONO=yes])
823
824     if test "x$HAVE_MONO" = "xyes" ; then
825         AC_PATH_PROG(MCS, mcs)
826         if test "x$MCS" = "x" ; then
827             AC_MSG_ERROR([Can not find "mcs" - The Mono C-Sharp Compiler) in your PATH])
828         fi
829
830         AC_PATH_PROG(GACUTIL, gacutil)
831         if test "x$GACUTIL" = "x" ; then
832             AC_MSG_ERROR([Can not find "gacutil" in your PATH])
833         fi
834
835         AC_SUBST(MCS)
836         AC_SUBST(GACUTIL)
837     fi
838 fi
839 AM_CONDITIONAL(HAVE_MONO, test "x$HAVE_MONO" = "xyes")
840
841 #
842 # Check for monodoc stuff
843 #
844 HAVE_MONODOC=no
845 AC_ARG_ENABLE(monodoc,
846         AS_HELP_STRING([--disable-monodoc],[Disable documentation for mono bindings]),
847         [case "${enableval}" in
848                 yes) HAVE_MONODOC=yes ;;
849                 no)  HAVE_MONODOC=no ;;
850                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-monodoc) ;;
851         esac],
852         [HAVE_MONODOC=yes])
853
854 if test "x$HAVE_MONO" = "xyes" && test "x$HAVE_MONODOC" = "xyes" ; then
855         PKG_CHECK_MODULES(MONODOC, [monodoc >= 1.1.8])
856         MONODOC_DIR=`$PKG_CONFIG --variable=sourcesdir monodoc`
857
858         AC_PATH_PROG(MONODOCER, monodocer)
859         AC_PATH_PROG(MDASSEMBLER, mdassembler)
860
861         AC_SUBST(MONODOC_DIR)
862         AC_SUBST(MONODOCER)
863         AC_SUBST(MDASSEMBLER)
864 fi
865 AM_CONDITIONAL(HAVE_MONODOC, test "x$HAVE_MONODOC" = "xyes")
866
867 #
868 # Build autoipd?
869 #
870 AC_ARG_ENABLE(autoipd,
871         AS_HELP_STRING([--disable-autoipd],[Disable building of avahi-autoipd]),
872         [case "${enableval}" in
873                 yes) ENABLE_AUTOIPD=yes ;;
874                 no)  ENABLE_AUTOIPD=no ;;
875                 *) AC_MSG_ERROR(bad value ${enableval} for --disable-autoipd) ;;
876         esac],
877         [ENABLE_AUTOIPD=yes])
878
879 AM_CONDITIONAL(ENABLE_AUTOIPD, test "x$ENABLE_AUTOIPD" = "xyes")
880
881 #
882 # Defining users and groups
883 #
884 AC_ARG_WITH(avahi_user, AS_HELP_STRING([--with-avahi-user=<user>],[User for running avahi-daemon (avahi)]))
885 if test -z "$with_avahi_user" ; then
886     AVAHI_USER=avahi
887 else
888     AVAHI_USER=$with_avahi_user
889 fi
890 AC_SUBST(AVAHI_USER)
891 AC_DEFINE_UNQUOTED(AVAHI_USER,"$AVAHI_USER", [User for running the Avahi daemon])
892
893 AC_ARG_WITH(avahi_group,AS_HELP_STRING([--with-avahi-group=<group>],[Group for running avahi-daemon (avahi)]))
894 if test -z "$with_avahi_group" ; then
895     AVAHI_GROUP=avahi
896 else
897     AVAHI_GROUP=$with_avahi_group
898 fi
899 AC_SUBST(AVAHI_GROUP)
900 AC_DEFINE_UNQUOTED(AVAHI_GROUP,"$AVAHI_GROUP", [Group for Avahi])
901
902 AC_ARG_WITH(avahi_priv_access_group,AS_HELP_STRING([--with-avahi-priv-access-group=<group>],[Priviliged access group for Avahi clients (netdev)]))
903 if test -z "$with_avahi_priv_access_group" ; then
904     AVAHI_PRIV_ACCESS_GROUP=netdev
905 else
906     AVAHI_PRIV_ACCESS_GROUP=$with_avahi_priv_access_group
907 fi
908 AC_SUBST(AVAHI_PRIV_ACCESS_GROUP)
909 AC_DEFINE_UNQUOTED(AVAHI_PRIV_ACCESS_GROUP,"$AVAHI_PRIV_ACCESS_GROUP", [Privileged access group for Avahi clients])
910
911 AC_ARG_WITH(autoipd_user, AS_HELP_STRING([--with-autoipd-user=<user>],[User for running the avahi-autoipd daemon (avahi-autoipd)]))
912 if test -z "$with_autoipd_user" ; then
913     AVAHI_AUTOIPD_USER=avahi-autoipd
914 else
915     AVAHI_AUTOIPD_USER=$with_autoipd_user
916 fi
917 AC_SUBST(AVAHI_AUTOIPD_USER)
918 AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_USER,"$AVAHI_AUTOIPD_USER", [User for running the avahi-autoipd daemon])
919
920 AC_ARG_WITH(autoipd_group,AS_HELP_STRING([--with-autoipd-group=<group>],[Group for running the avahi-autoipd daemon (avahi-autoipd)]))
921 if test -z "$with_autoipd_group" ; then
922     AVAHI_AUTOIPD_GROUP=avahi-autoipd
923 else
924     AVAHI_AUTOIPD_GROUP=$with_autoipd_group
925 fi
926 AC_SUBST(AVAHI_AUTOIPD_GROUP)
927 AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_GROUP,"$AVAHI_AUTOIPD_GROUP", [Group for running the avahi-autoipd daemon])
928
929 #
930 # Avahi runtime dir
931 #
932 avahi_runtime_dir="${localstatedir}/run"
933 avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket"
934 AC_SUBST(avahi_runtime_dir)
935 AC_SUBST(avahi_socket)
936
937 #
938 # Avahi interfaces dir
939 #
940 if test "x$HAVE_PYTHON_DBUS" = "xyes" -o "x$HAVE_GTK" = "xyes"; then
941         interfacesdir="${datadir}/${PACKAGE}/interfaces/"
942         AC_SUBST(interfacesdir)
943 fi
944
945 #
946 # Doxygen
947 #
948 DX_HTML_FEATURE(ON)
949 DX_CHM_FEATURE(OFF)
950 DX_CHI_FEATURE(OFF)
951 DX_MAN_FEATURE(OFF)
952 DX_RTF_FEATURE(OFF)
953 DX_XML_FEATURE(ON)
954 DX_PDF_FEATURE(OFF)
955 DX_PS_FEATURE(OFF)
956 DX_INIT_DOXYGEN(avahi, doxygen.cfg, doxygen)
957
958 AC_ARG_ENABLE(core-docs,
959         AS_HELP_STRING([--enable-core-docs],[Enable building of documentation for avahi-core]),
960 [case "${enableval}" in
961   yes) ENABLE_CORE_DOCS=yes ;;
962   no)  ENABLE_CORE_DOCS=no ;;
963   *) AC_MSG_ERROR([bad value ${enableval} for --enable-core-docs]) ;;
964 esac],[ENABLE_CORE_DOCS=no])
965
966 AM_CONDITIONAL([ENABLE_CORE_DOCS], [test "x$ENABLE_CORE_DOCS" = xyes])
967
968 #
969 # Build and Install man pages
970 #
971 AC_ARG_ENABLE(manpages,
972         AS_HELP_STRING([--disable-manpages],[Disable building and installation of man pages]),
973 [case "${enableval}" in
974   yes) manpages=yes ;;
975   no)  manpages=no ;;
976   *) AC_MSG_ERROR([bad value ${enableval} for --disable-manpages]) ;;
977 esac],[manpages=yes])
978
979 if test x$manpages = xyes ; then
980     #
981     # XMLTOMAN manpage generation
982     #
983     AC_ARG_ENABLE(xmltoman,
984     AS_HELP_STRING([--disable-xmltoman],[Disable rebuilding of man pages with xmltoman]),
985     [case "${enableval}" in
986       yes) xmltoman=yes ;;
987       no)  xmltoman=no ;;
988       *) AC_MSG_ERROR([bad value ${enableval} for --disable-xmltoman]) ;;
989     esac],[xmltoman=yes])
990
991     if test x$xmltoman = xyes ; then
992         AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no)
993     fi
994
995     if test x$have_xmltoman = xno -o x$xmltoman = xno; then
996         if ! test -e man/avahi-daemon.8 ; then
997             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])
998             exit 1
999         fi
1000         AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***])
1001         xmltoman=no
1002     fi
1003 fi
1004 AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes])
1005 AM_CONDITIONAL([BUILD_MANPAGES], [test "x$manpages" = xyes])
1006
1007 #
1008 # Conditionally compile test and example programs
1009 #
1010 AC_ARG_ENABLE(tests,
1011         AS_HELP_STRING([--enable-tests],[Enable building of tests and examples]),
1012         [case "${enableval}" in
1013                 yes) ENABLE_TESTS=yes ;;
1014                 no)  ENABLE_TESTS=no ;;
1015                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
1016         esac],
1017         [ENABLE_TESTS=no])
1018
1019 AM_CONDITIONAL([ENABLE_TESTS], [test "x$ENABLE_TESTS" = "xyes"])
1020
1021 #
1022 # Optionally enable libdns_sd compatibility support
1023 #
1024 AC_ARG_ENABLE(compat-libdns_sd,
1025         AS_HELP_STRING([--enable-compat-libdns_sd],[Enable compatibility layer for libdns_sd]),
1026         [case "${enableval}" in
1027                 yes) ENABLE_COMPAT_LIBDNS_SD=yes ;;
1028                 no)  ENABLE_COMPAT_LIBDNS_SD=no ;;
1029                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-libdns_sd) ;;
1030         esac],
1031         [ENABLE_COMPAT_LIBDNS_SD=no])
1032
1033 AM_CONDITIONAL([ENABLE_COMPAT_LIBDNS_SD], [test "x$ENABLE_COMPAT_LIBDNS_SD" = "xyes"])
1034
1035 #
1036 # Optionally enable HOWL compatibility support
1037 #
1038 AC_ARG_ENABLE(compat-howl,
1039         AS_HELP_STRING([--enable-compat-howl],[Enable compatibility layer for HOWL]),
1040         [case "${enableval}" in
1041                 yes) ENABLE_COMPAT_HOWL=yes ;;
1042                 no)  ENABLE_COMPAT_HOWL=no ;;
1043                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-howl) ;;
1044         esac],
1045         [ENABLE_COMPAT_HOWL=no])
1046
1047 AM_CONDITIONAL([ENABLE_COMPAT_HOWL], [test "x$ENABLE_COMPAT_HOWL" = "xyes"])
1048
1049
1050 # ==========================================================================
1051 AC_CONFIG_FILES([
1052 Makefile
1053 avahi-common/Makefile
1054 avahi-core/Makefile
1055 avahi-glib/Makefile
1056 avahi-gobject/Makefile
1057 avahi-qt/Makefile
1058 avahi-daemon/Makefile
1059 avahi-daemon/avahi-dbus.conf
1060 avahi-discover-standalone/Makefile
1061 avahi-client/Makefile
1062 initscript/Makefile
1063 initscript/debian/Makefile
1064 initscript/gentoo/Makefile
1065 initscript/archlinux/Makefile
1066 initscript/suse/Makefile
1067 initscript/fedora/Makefile
1068 initscript/lfs/Makefile
1069 initscript/mandriva/Makefile
1070 initscript/darwin/Makefile
1071 initscript/freebsd/Makefile
1072 initscript/slackware/Makefile
1073 avahi-dnsconfd/Makefile
1074 avahi-utils/Makefile
1075 avahi-python/Makefile
1076 avahi-python/avahi/Makefile
1077 avahi-python/avahi-discover/Makefile
1078 examples/Makefile
1079 common/Makefile
1080 man/Makefile
1081 tests/Makefile
1082 service-type-database/Makefile
1083 avahi-sharp/Makefile
1084 avahi-ui-sharp/Makefile
1085 avahi-compat-libdns_sd/Makefile
1086 avahi-compat-howl/Makefile
1087 avahi-compat-howl/samples/Makefile
1088 avahi-autoipd/Makefile
1089 avahi-ui/Makefile
1090 po/Makefile.in
1091 ])
1092 AC_OUTPUT
1093
1094 # ==========================================================================
1095 echo "
1096  ---{ $PACKAGE_NAME $VERSION }---
1097
1098     prefix:                                    ${prefix}
1099     sysconfdir:                                ${sysconfdir}
1100     localstatedir:                             ${localstatedir}
1101     avahi socket:                              ${avahi_socket}
1102     dbus-1 system.d dir:                       ${DBUS_SYS_DIR}
1103     dbus-1 version:                            ${DBUS_VERSION}
1104     dbus-1 system socket:                      ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
1105     C Compiler:                                ${CC}
1106     CFLAGS:                                    ${CFLAGS}
1107     Enable GLIB:                               ${HAVE_GLIB}
1108     Enable GLIB GObject:                       ${HAVE_GOBJECT}
1109     Enable GTK:                                ${HAVE_GTK}
1110     Enable D-Bus:                              ${HAVE_DBUS}
1111     With XML:                                  ${with_xml}
1112     Enable GDBM:                               ${HAVE_GDBM}
1113     Enable DBM:                                ${HAVE_DBM}
1114     Enable libdaemon:                          ${HAVE_LIBDAEMON}
1115     Enable Python:                             ${HAVE_PYTHON}
1116     Enable pygtk:                              ${HAVE_PYGTK}
1117     Enable python-dbus:                        ${HAVE_PYTHON_DBUS}
1118     Enable QT3:                                ${HAVE_QT3}
1119     Enable QT4:                                ${HAVE_QT4}
1120     Enable Mono:                               ${HAVE_MONO}
1121     Enable Monodoc:                            ${HAVE_MONODOC}
1122     Distribution/OS:                           ${with_distro}
1123     User for avahi-daemon:                     ${AVAHI_USER}
1124     Group for avahi-daemon:                    ${AVAHI_GROUP}
1125     Priviliged access group for Avahi clients: ${AVAHI_PRIV_ACCESS_GROUP}
1126     User for avahi-autoipd:                    ${AVAHI_AUTOIPD_USER}
1127     Group for avahi-autoipd:                   ${AVAHI_AUTOIPD_GROUP}
1128     Enable chroot():                           ${enable_chroot}
1129     Enable Linux inotify:                      ${have_inotify}
1130     Enable stack-smashing protection:          ${enable_ssp}
1131 "
1132
1133 BUILD_DAEMON="no   (You need libdaemon and expat/bsdxml!)"
1134
1135 if test "x$HAVE_XML" = "xyes" -a "x$HAVE_LIBDAEMON" = "xyes" ; then
1136     BUILD_DAEMON=yes
1137 fi
1138
1139 BUILD_PYTHON="no   (You need python, pygtk and python-dbus!)"
1140
1141 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
1142     BUILD_PYTHON=yes
1143 fi
1144
1145 BUILD_CLIENT="no   (You need avahi-daemon and D-Bus!)"
1146
1147 if test "x$BUILD_DAEMON" = "xyes" -a "x$HAVE_DBUS" = "xyes" ; then
1148     BUILD_CLIENT=yes
1149 fi
1150
1151 if test "x$ENABLE_COMPAT_LIBDNS_SD" = "xyes" -a "x$BUILD_CLIENT" != "xyes" ; then
1152    ENABLE_COMPAT_LIBDNS_SD="no   (You need libavahi-client!)"
1153 fi
1154 if test "x$ENABLE_COMPAT_HOWL" = "xyes" -a "x$BUILD_CLIENT" != "xyes" ; then
1155    ENABLE_COMPAT_HOWL="no   (You need libavahi-client!)"
1156 fi
1157 if test "x$ENABLE_AUTOIPD" = "xyes" -a "x$HAVE_LIBDAEMON" != "xyes" ; then
1158    ENABLE_AUTOIPD="no   (You need libdaemon!)"
1159 fi
1160
1161 BUILD_UI="no"
1162 if test "x$HAVE_GTK" = "xyes" -a "x$BUILD_CLIENT" = "xyes" ; then
1163    BUILD_UI="yes"
1164 fi
1165
1166 BUILD_GOBJECT="no"
1167 if test "x$BUILD_CLIENT" = "xyes" -a "x$HAVE_GOBJECT" = "xyes" ; then
1168    BUILD_GOBJECT="yes"
1169 fi
1170
1171 echo "\
1172     Building libavahi-core              yes
1173     Building avahi-daemon:              ${BUILD_DAEMON}
1174     Building avahi-dnsconfd:            ${BUILD_DAEMON}
1175     Building libavahi-client:           ${BUILD_CLIENT}
1176     Building avahi-utils:               ${BUILD_CLIENT}
1177     Building avahi-python:              ${BUILD_PYTHON}
1178     Building libavahi-glib:             ${HAVE_GLIB}
1179     Building libavahi-gobject:          ${BUILD_GOBJECT}
1180     Building avahi-discover-standalone: ${HAVE_GTK}
1181     Building libavahi-qt3:              ${HAVE_QT3}
1182     Building libavahi-qt4:              ${HAVE_QT4}
1183     Building avahi-sharp:               ${HAVE_MONO}
1184     Building avahi-compat-libdns_sd:    ${ENABLE_COMPAT_LIBDNS_SD}
1185     Building avahi-compat-howl:         ${ENABLE_COMPAT_HOWL}
1186     Building tests:                     ${ENABLE_TESTS}
1187     Building avahi-core documentation:  ${ENABLE_CORE_DOCS}
1188     Building avahi-autoipd:             ${ENABLE_AUTOIPD}
1189     Building libavahi-ui:               ${BUILD_UI}
1190 "