]> git.meshlink.io Git - catta/blob - configure.ac
gtk: build for both gtk2 and gtk3
[catta] / configure.ac
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 # This file is part of avahi.
5 #
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.
10 #
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.
15 #
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
19 # USA.
20
21 AC_PREREQ(2.63)
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])
26
27 AC_SUBST(PACKAGE_URL, [http://avahi.org/])
28
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])
37
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])
42
43 AC_CANONICAL_HOST
44
45 AM_SILENT_RULES([yes])
46
47 AC_CHECK_PROG([STOW], [stow], [yes], [no])
48
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}"
52 ])
53
54 # Checks for programs.
55 AC_PROG_CC
56 AC_PROG_CC_C99
57 AC_PROG_CXX
58 AM_PROG_CC_C_O
59 AC_USE_SYSTEM_EXTENSIONS
60 AC_PROG_CPP
61 AC_PROG_INSTALL
62 AC_PROG_LN_S
63 AC_PROG_MAKE_SET
64 AC_PROG_GCC_TRADITIONAL
65
66 # -fstack-protector
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 ;;
72           no) enable_ssp=no ;;
73            *) AC_MSG_ERROR([invalid value ${enableval} for --disable-stack-protector]) ;;
74      esac],
75     [enable_ssp=yes])
76
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])
79     enable_ssp=no
80 fi
81
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
86     # break here)
87
88     # Get -lssp if it exists
89     GCC_STACK_PROTECT_LIB
90
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)
99     const char *c;
100 {
101     char arr[[123]], *p; /* beware of possible double-braces if copying this */
102     for (p = arr; *c; ++p) {
103         *p = *c;
104         ++c;
105     }
106 }
107 _ACEOF
108     rm -f conftest.o
109
110     if $CC -c $CFLAGS $CPPFLAGS -o conftest.o conftest.c >/dev/null 2>&1; then
111         AC_MSG_RESULT([yes])
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
114             AC_MSG_RESULT([no])
115         else
116             AC_MSG_RESULT([yes])
117             enable_ssp=no
118         fi
119     else
120         AC_MSG_RESULT([no])
121     fi
122
123     rm -f conftest.c conftest.o conftest.so
124
125     CFLAGS="$ssp_old_cflags"
126     LDFLAGS="$ssp_old_ldflags"
127 fi
128
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
131     GCC_STACK_PROTECT_CC
132
133     AC_LANG_PUSH([C++])
134     GCC_STACK_PROTECT_CXX
135     AC_LANG_POP([C++])
136     # XXX: Update the enable_ssp value now for output later?
137 fi
138
139 # libtool stuff
140 AC_PROG_LIBTOOL
141
142 AC_CACHE_CHECK([whether the C++ compiler works], [avahi_cv_sys_cxx_works], [
143     AC_LANG_PUSH([C++])
144     AC_COMPILE_IFELSE([int main() { return 0; }], [avahi_cv_sys_cxx_works=yes],
145         [avahi_cv_sys_cxx_works=no])
146     AC_LANG_POP([C++])
147     ])
148 [ if [ "x$avahi_cv_sys_cxx_works" = "xno" ]; then ]
149     AC_MSG_FAILURE([The C++ compiler does not work])
150 [ fi ]
151
152 ACX_PTHREAD(,AC_MSG_ERROR([Missing POSIX Threads support]))
153
154 #
155 # Check for netlink.h
156 #
157 AC_CHECK_HEADER(linux/netlink.h,
158 HAVE_NETLINK=yes
159 AC_DEFINE([HAVE_NETLINK],[],[Support for Linux netlink])
160 , [], [
161 #include <sys/socket.h>
162 #include <asm/types.h>
163 ])
164
165 AM_CONDITIONAL(HAVE_NETLINK, [ test x"$HAVE_NETLINK" = xyes ])
166
167 #
168 # Check for net/route.h
169 #
170 AC_CHECK_HEADER(net/route.h,
171 HAVE_PF_ROUTE=yes
172 AC_DEFINE([HAVE_PF_ROUTE],[],[Support for PF_ROUTE])
173 , [], [
174 #include <sys/types.h>
175 #include <sys/socket.h>
176 ])
177
178 AM_CONDITIONAL(HAVE_PF_ROUTE, [ test x"$HAVE_PF_ROUTE" = xyes ])
179
180 #
181 # Check for sys/filio.h; needed for FIONREAD on Solaris
182 #
183 AC_CHECK_HEADER(sys/filio.h,
184 HAVE_SYS_FILIO_H=yes
185 AC_DEFINE([HAVE_SYS_FILIO_H],[],[Support for sys/filio.h])
186 , [], [
187 ])
188
189 AM_CONDITIONAL(HAVE_SYS_FILIO_H, [ test x"$HAVE_SYS_FILIO_H" = xyes ])
190
191 #
192 # Check for sys/sysctl.h; not present on Solaris
193 #
194 AC_CHECK_HEADER(sys/sysctl.h,
195 HAVE_SYS_SYSCTL=yes
196 AC_DEFINE([HAVE_SYS_SYSCTL_H],[],[Support for sys/sysctl.h])
197 , [], [
198 #include <sys/types.h>
199 #include <sys/socket.h>
200 #include <sys/param.h>
201 ])
202
203 AM_CONDITIONAL(HAVE_SYS_SYSCTL_H, [ test x"$HAVE_SYS_SYSCTL_H" = xyes ])
204
205 #
206 # Check for lifconf struct; only present on Solaris
207 #
208 AC_MSG_CHECKING(for struct lifconf)
209 AC_CACHE_VAL(avahi_cv_has_struct_lifconf,
210 [AC_TRY_COMPILE(
211 [#include <sys/socket.h>
212 #include <net/if.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.])
218 fi
219
220 #
221 # Check for struct ip_mreqn
222 #
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;
227 ], [
228         # Yes, we have it...
229         AC_MSG_RESULT(yes)
230         AC_DEFINE([HAVE_STRUCT_IP_MREQN],[],[Support for struct ip_mreqn])
231 ], [
232         # We'll just have to try and use struct ip_mreq
233         AC_MSG_RESULT(no)
234         AC_MSG_CHECKING(for struct ip_mreq)
235         AC_TRY_COMPILE([#include <netinet/in.h>], [
236                 struct ip_mreq mreq;
237                 mreq.imr_interface.s_addr = 0;
238         ], [
239                 # Yes, we have it...
240                 AC_MSG_RESULT(yes)
241                 AC_DEFINE([HAVE_STRUCT_IP_MREQ],[],[Support for struct ip_mreq])
242         ], [
243                 # No multicast support
244                         AC_MSG_RESULT(no)
245         ])
246 ])
247
248 #
249 # Detecting the linux distribution for specific things like init scripts.
250 #
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)])
255     else
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")
264     fi
265     if test "z$with_distro" = "z"; then
266         with_distro=`uname -s`
267     fi
268 fi
269 with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
270
271 case $with_distro in
272     lfs|debian|gentoo|archlinux|suse|fedora|mandriva|darwin|freebsd|slackware|none)
273      ;;
274     netbsd)
275      AC_MSG_WARN([Your distribution (${with_distro}) is supported but no init script exist yet! (patches welcome)])
276      ;;
277     linux)
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.])
279      ;;
280     *)
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])
282      ;;
283 esac
284
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)
296
297 test_gcc_flag() {
298     AC_LANG_CONFTEST([int main() {}])
299     $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
300     ret=$?
301     rm -f conftest.o
302     return $ret
303 }
304
305 # If using GCC specify some additional parameters
306 if test "x$GCC" = "xyes" ; then
307
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"
309
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])
315         OLDCFLAGS="$CFLAGS"
316         CFLAGS="-std=c99"
317         AC_TRY_COMPILE([#include <linux/rtnetlink.h>], [],
318             use_stdc99=yes, use_stdc99=no)
319
320         if test x"$use_stdc99" = xyes; then
321             DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
322             AC_MSG_RESULT([yes])
323         else
324             AC_MSG_RESULT([no])
325         fi
326
327         CFLAGS="$OLDCFLAGS"
328     else
329         DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
330     fi
331
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"
336            AC_MSG_RESULT([yes])
337         else
338            AC_MSG_RESULT([no])
339         fi
340     done
341 fi
342
343 # Checks for header files.
344 AC_HEADER_STDC
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])
346 AC_HEADER_STDBOOL
347
348 # Checks for typedefs, structures, and compiler characteristics.
349 AC_C_CONST
350 AC_TYPE_SIZE_T
351 AC_HEADER_TIME
352 AC_HEADER_SYS_WAIT
353
354  # Solaris stuff
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>]])
358
359 # Checks for library functions.
360 AC_FUNC_MEMCMP
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.)
364 #AC_FUNC_MALLOC
365 #AC_FUNC_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])
367
368 AC_FUNC_CHOWN
369 AC_FUNC_STAT
370 AC_TYPE_MODE_T
371 AC_TYPE_PID_T
372
373 AC_CHECK_DECLS(environ)
374
375 # check if gcc's -fvisibility is supported
376 CHECK_VISIBILITY_HIDDEN
377
378 enable_chroot=yes
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)
382
383 AM_CONDITIONAL(ENABLE_CHROOT, test "x$enable_chroot" = "xyes")
384
385 if test "x$enable_chroot" = "xyes" ; then
386    AC_DEFINE([ENABLE_CHROOT], 1, [Enable chroot() usage])
387 fi
388
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()])
392 fi
393 AM_CONDITIONAL(HAVE_DLOPEN, test "x$HAVE_DLOPEN" = "xyes")
394
395 have_inotify=no
396 AC_CHECK_HEADERS([sys/inotify.h], [have_inotify=yes])
397
398 AM_CONDITIONAL(HAVE_INOTIFY, test "x$have_inotify" = "xyes")
399
400 if test "x$have_inotify" = "xyes" ; then
401    AC_DEFINE([HAVE_INOTIFY], 1, [Enable Linux inotify() usage])
402 fi
403
404 have_kqueue=yes
405 AC_CHECK_FUNCS([kqueue],,have_kqueue=no)
406
407 AM_CONDITIONAL(HAVE_KQUEUE, test "x$have_kqueue" = "xyes")
408
409 if test "x$have_kqueue" = "xyes" ; then
410     AC_DEFINE([HAVE_KQUEUE], 1, [Enable BSD kqueue() usage])
411 fi
412
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])
417 AM_GLIB_GNU_GETTEXT
418
419 avahilocaledir='${prefix}/${DATADIRNAME}/locale'
420 AC_SUBST(avahilocaledir)
421
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)
425
426 if test x"$have_pkg_config" = "xno"; then
427     AC_MSG_ERROR(pkg-config is required to install this program)
428 fi
429
430 PKG_PROG_PKG_CONFIG
431
432 #
433 # Check for GLIB 2.0
434 #
435 AC_ARG_ENABLE(glib,
436         AS_HELP_STRING([--disable-glib],[Disable use of GLib]),
437         [case "${enableval}" in
438                 yes) HAVE_GLIB=yes ;;
439                 no)  HAVE_GLIB=no ;;
440                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-glib) ;;
441         esac],
442         [HAVE_GLIB=yes])
443
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)
448 fi
449 AM_CONDITIONAL(HAVE_GLIB, test "x$HAVE_GLIB" = "xyes")
450
451 #
452 # Check for GLIB's gobject 2.0
453 #
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) ;;
460         esac],
461         [HAVE_GOBJECT=yes])
462
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)
467 fi
468 AM_CONDITIONAL(HAVE_GOBJECT, test "x$HAVE_GOBJECT" = "xyes")
469
470 #
471 # Check for Qt 3
472 #
473 AC_ARG_ENABLE(qt3,
474         AS_HELP_STRING([--disable-qt3],[Disable building of Qt3 mainloop integration]),
475         [case "${enableval}" in
476                 yes) HAVE_QT3=yes ;;
477                 no)  HAVE_QT3=no ;;
478                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt3) ;;
479         esac],
480         [HAVE_QT3=yes])
481
482 if test "x$HAVE_QT3" = "xyes" ; then
483         PKG_CHECK_MODULES( QT3, [ qt-mt >= 3.0.0 ])
484         AC_SUBST(QT3_CFLAGS)
485         AC_SUBST(QT3_LIBS)
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])
490         fi
491         AC_SUBST(MOC_QT3)
492 fi
493 AM_CONDITIONAL(HAVE_QT3, test "x$HAVE_QT3" = "xyes")
494
495 #
496 # Check for Qt 4
497 #
498 AC_ARG_ENABLE(qt4,
499         AS_HELP_STRING([--disable-qt4],[Disable building of Qt4Core mainloop integration]),
500         [case "${enableval}" in
501                 yes) HAVE_QT4=yes ;;
502                 no)  HAVE_QT4=no ;;
503                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt4) ;;
504         esac],
505         [HAVE_QT4=yes])
506
507 if test "x$HAVE_QT4" = "xyes" ; then
508         PKG_CHECK_MODULES( QT4, [ QtCore >= 4.0.0 ])
509         AC_SUBST(QT4_CFLAGS)
510         AC_SUBST(QT4_LIBS)
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])
515         fi
516         AC_SUBST(MOC_QT4)
517 fi
518 AM_CONDITIONAL(HAVE_QT4, test "x$HAVE_QT4" = "xyes")
519
520 #
521 # Check for GTK+ 2.0
522 #
523 AC_ARG_ENABLE(gtk,
524         AS_HELP_STRING([--disable-gtk],[Disable use of GTK+ 2]),
525         [case "${enableval}" in
526                 yes) HAVE_GTK=yes ;;
527                 no)  HAVE_GTK=no ;;
528                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk) ;;
529         esac],
530         [HAVE_GTK=yes])
531
532 if test "x$HAVE_GTK" = "xyes" ; then
533         # Check for GTK 2.0
534         PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.14.0 ])
535         AC_SUBST(GTK20_CFLAGS)
536         AC_SUBST(GTK20_LIBS)
537 fi
538 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
539
540 #
541 # Check for GTK+ 3.0
542 #
543 AC_ARG_ENABLE(gtk3,
544         AS_HELP_STRING([--disable-gtk3],[Disable use of GTK+ 3]),
545         [case "${enableval}" in
546                 yes) HAVE_GTK3=yes ;;
547                 no)  HAVE_GTK3=no ;;
548                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk3) ;;
549         esac],
550         [HAVE_GTK3=yes])
551
552 if test "x$HAVE_GTK3" = "xyes" ; then
553         # Check for GTK 3.0
554         PKG_CHECK_MODULES(GTK30, [ gtk+-3.0 ])
555         AC_SUBST(GTK30_CFLAGS)
556         AC_SUBST(GTK30_LIBS)
557 fi
558 AM_CONDITIONAL(HAVE_GTK3, test "x$HAVE_GTK3" = "xyes")
559
560 AM_CONDITIONAL(HAVE_GTK2OR3, test "x$HAVE_GTK3" = "xyes" -o "x$HAVE_GTK2" = "xyes" )
561
562 #
563 # D-Bus
564 #
565 AC_ARG_ENABLE(dbus,
566         AS_HELP_STRING([--disable-dbus],[Disable use of D-Bus]),
567         [case "${enableval}" in
568                 yes) HAVE_DBUS=yes ;;
569                 no)  HAVE_DBUS=no ;;
570                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbus) ;;
571         esac],
572         [HAVE_DBUS=yes])
573
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]))
576
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 ])
582
583     AC_DEFINE(HAVE_DBUS, 1, [Whether we have D-Bus or not])
584
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"
591     fi
592     if test "z$DBUS_VERSION_MINOR" = "z"; then
593         DBUS_VERSION_MINOR="0"
594     fi
595     if test "z$DBUS_VERSION_MICRO" = "z"; then
596         DBUS_VERSION_MICRO="0"
597     fi
598
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'"
607         exit 1
608     else
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"
613     fi
614
615     DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
616     AC_SUBST(DBUS_CFLAGS)
617     AC_SUBST(DBUS_LIBS)
618
619     if ! test -z "$with_dbus_sys" ; then
620         DBUS_SYS_DIR="$with_dbus_sys"
621     else
622         DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
623     fi
624     AC_SUBST(DBUS_SYS_DIR)
625
626     if ! test -z "$with_dbus_system_address" ; then
627         DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="$with_dbus_system_address"
628     else
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
633         # to /var/run/dbus.
634
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"
640             fi
641         done
642     fi
643     AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
644
645     SAVED_LIBS="$LIBS"
646     LIBS="$LIBS $DBUS_LIBS"
647     AC_CHECK_FUNCS([dbus_connection_close dbus_bus_get_private])
648     LIBS="$SAVED_LIBS"
649 fi
650 AM_CONDITIONAL(HAVE_DBUS, test "x$HAVE_DBUS" = "xyes")
651
652 #
653 # Expat
654 #
655 AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[expat/bsdxml/none]],[XML library to use]))
656 use_expat=false
657 use_bsdxml=false
658
659 # See what we have
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)
662
663 if test "x$with_xml" = "xnone"; then
664         :
665 elif test "x$with_xml" = "xexpat"; then
666         use_expat=true
667         if ! $have_expat ; then
668                 AC_MSG_ERROR([*** libexpat requested, but not found ***])
669         fi
670 elif test "x$with_xml" = "xbsdxml"; then
671         use_bsdxml=true
672         if ! $have_bsdxml ; then
673                 AC_MSG_ERROR([*** libbsdxml requested, but not found ***])
674         fi
675 elif test "x$with_xml" != "x"; then
676         AC_MSG_ERROR([*** unknown with-xml option ***])
677 else
678         if $have_expat ; then
679                 use_expat=true
680         elif $have_bsdxml ; then
681                 use_bsdxml=true
682         else
683                 AC_MSG_ERROR([*** neither libexpat not libbsdxml could be found ***])
684         fi
685 fi
686
687 if $use_expat; then
688         with_xml=expat
689         XML_CFLAGS=-DUSE_EXPAT_H
690         XML_LIBS=-lexpat
691 fi
692 if $use_bsdxml; then
693         with_xml=bsdxml
694         XML_CFLAGS=-DUSE_BSDXML_H
695         XML_LIBS=-lbsdxml
696 fi
697 AC_SUBST(XML_LIBS)
698 AC_SUBST(XML_CFLAGS)
699
700 if $use_expat || $use_bsdxml; then
701         HAVE_XML=yes
702 fi
703
704 AM_CONDITIONAL(HAVE_XML, test "x$HAVE_XML" = "xyes")
705
706 #
707 # GDBM
708 #
709 #
710 # Check for dbm
711 #
712 AC_ARG_ENABLE(dbm,
713         AS_HELP_STRING([--enable-dbm],[Enable use of DBM]),
714         [case "${enableval}" in
715                 yes) HAVE_DBM=yes ;;
716                 no)  HAVE_DBM=no ;;
717                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbm) ;;
718         esac],
719         [HAVE_DBM=no])
720
721 AC_ARG_ENABLE(gdbm,
722         AS_HELP_STRING([--disable-gdbm],[Disable use of GDBM]),
723         [case "${enableval}" in
724                 yes) HAVE_GDBM=yes ;;
725                 no)  HAVE_GDBM=no ;;
726                 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gdbm) ;;
727         esac],
728         [HAVE_GDBM=yes])
729
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 ***])
733     fi
734     AC_CHECK_LIB(gdbm, gdbm_open, [ AC_CHECK_HEADERS(gdbm.h, have_gdbm=true, have_gdbm=false) ], have_gdbm=false)
735
736     if ! $have_gdbm ; then
737         AC_MSG_ERROR([*** libgdbm not found ***])
738     fi
739     AC_DEFINE([HAVE_GDBM],[],[Support for GDBM])
740 else
741     if test "x$HAVE_DBM" = "xyes" ; then
742         AC_CHECK_HEADERS(ndbm.h, have_dbm=true, have_dbm=false)
743
744         if ! $have_dbm ; then
745             AC_MSG_ERROR([*** dbm not found ***])
746         fi
747         AC_DEFINE([HAVE_DBM],[],[Support for DBM])
748     fi
749 fi
750 AM_CONDITIONAL(HAVE_GDBM, test "x$HAVE_GDBM" = "xyes")
751 AM_CONDITIONAL(HAVE_DBM, test "x$HAVE_DBM" = "xyes")
752
753 #
754 # libdaemon
755 #
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) ;;
762         esac],
763         [HAVE_LIBDAEMON=yes])
764
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)
769 fi
770 AM_CONDITIONAL(HAVE_LIBDAEMON, test "x$HAVE_LIBDAEMON" = "xyes")
771
772 #
773 # Python stuff
774 #
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])
782
783 HAVE_PYTHON_DBUS=no
784 HAVE_PYGTK=no
785
786 if test "x$HAVE_PYTHON" = "xyes" ; then
787     AM_PATH_PYTHON([2.4])
788
789     AC_ARG_ENABLE(pygtk,
790         AS_HELP_STRING([--disable-pygtk],[Disable use of GTK in Python]),
791         [case "${enableval}" in
792                 yes) HAVE_PYGTK=yes ;;
793                 no)  HAVE_PYGTK=no ;;
794                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pygtk) ;;
795         esac],
796         [HAVE_PYGTK=yes])
797
798     if test "x$HAVE_PYGTK" = "xyes" ; then
799         AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR(Could not find Python module gtk)])
800     fi
801
802
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) ;;
810             esac],
811             [HAVE_PYTHON_DBUS=yes])
812
813         if test "x$HAVE_PYTHON_DBUS" = "xyes"; then
814             AM_CHECK_PYMOD(dbus,,,[AC_MSG_ERROR(Could not find Python module dbus)])
815         fi
816
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)])
820         fi
821         if test "x$HAVE_DBM" = "xyes"; then
822             AM_CHECK_PYMOD(dbm,,,[AC_MSG_ERROR(Could not find Python module dbm)])
823         fi
824     fi
825 fi
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")
829
830 #
831 # Check for mono stuff
832 #
833 HAVE_MONO=no
834 if test "x$HAVE_DBUS" = "xyes" ; then
835     AC_ARG_ENABLE(mono,
836             AS_HELP_STRING([--disable-mono],[Disable mono bindings]),
837             [case "${enableval}" in
838                     yes) HAVE_MONO=yes ;;
839                     no)  HAVE_MONO=no ;;
840                     *) AC_MSG_ERROR(bad value ${enableval} for --enable-mono) ;;
841             esac],
842             [HAVE_MONO=yes])
843
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])
848         fi
849
850         AC_PATH_PROG(GACUTIL, gacutil)
851         if test "x$GACUTIL" = "x" ; then
852             AC_MSG_ERROR([Can not find "gacutil" in your PATH])
853         fi
854
855         AC_SUBST(MCS)
856         AC_SUBST(GACUTIL)
857     fi
858 fi
859 AM_CONDITIONAL(HAVE_MONO, test "x$HAVE_MONO" = "xyes")
860
861 #
862 # Check for monodoc stuff
863 #
864 HAVE_MONODOC=no
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) ;;
871         esac],
872         [HAVE_MONODOC=yes])
873
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`
877
878         AC_PATH_PROG(MONODOCER, monodocer)
879         AC_PATH_PROG(MDASSEMBLER, mdassembler)
880
881         AC_SUBST(MONODOC_DIR)
882         AC_SUBST(MONODOCER)
883         AC_SUBST(MDASSEMBLER)
884 fi
885 AM_CONDITIONAL(HAVE_MONODOC, test "x$HAVE_MONODOC" = "xyes")
886
887 #
888 # Build autoipd?
889 #
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) ;;
896         esac],
897         [ENABLE_AUTOIPD=yes])
898
899 AM_CONDITIONAL(ENABLE_AUTOIPD, test "x$ENABLE_AUTOIPD" = "xyes")
900
901 #
902 # Defining users and groups
903 #
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
906     AVAHI_USER=avahi
907 else
908     AVAHI_USER=$with_avahi_user
909 fi
910 AC_SUBST(AVAHI_USER)
911 AC_DEFINE_UNQUOTED(AVAHI_USER,"$AVAHI_USER", [User for running the Avahi daemon])
912
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
915     AVAHI_GROUP=avahi
916 else
917     AVAHI_GROUP=$with_avahi_group
918 fi
919 AC_SUBST(AVAHI_GROUP)
920 AC_DEFINE_UNQUOTED(AVAHI_GROUP,"$AVAHI_GROUP", [Group for Avahi])
921
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
925 else
926     AVAHI_PRIV_ACCESS_GROUP=$with_avahi_priv_access_group
927 fi
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])
930
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
934 else
935     AVAHI_AUTOIPD_USER=$with_autoipd_user
936 fi
937 AC_SUBST(AVAHI_AUTOIPD_USER)
938 AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_USER,"$AVAHI_AUTOIPD_USER", [User for running the avahi-autoipd daemon])
939
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
943 else
944     AVAHI_AUTOIPD_GROUP=$with_autoipd_group
945 fi
946 AC_SUBST(AVAHI_AUTOIPD_GROUP)
947 AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_GROUP,"$AVAHI_AUTOIPD_GROUP", [Group for running the avahi-autoipd daemon])
948
949 #
950 # Avahi runtime dir
951 #
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)
956
957 #
958 # Avahi interfaces dir
959 #
960 if test "x$HAVE_PYTHON_DBUS" = "xyes" -o "x$HAVE_GTK" = "xyes"; then
961         interfacesdir="${datadir}/${PACKAGE}/interfaces/"
962         AC_SUBST(interfacesdir)
963 fi
964
965 #
966 # Doxygen
967 #
968 DX_HTML_FEATURE(ON)
969 DX_CHM_FEATURE(OFF)
970 DX_CHI_FEATURE(OFF)
971 DX_MAN_FEATURE(OFF)
972 DX_RTF_FEATURE(OFF)
973 DX_XML_FEATURE(ON)
974 DX_PDF_FEATURE(OFF)
975 DX_PS_FEATURE(OFF)
976 DX_INIT_DOXYGEN(avahi, doxygen.cfg, doxygen)
977
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])
985
986 AM_CONDITIONAL([ENABLE_CORE_DOCS], [test "x$ENABLE_CORE_DOCS" = xyes])
987
988 #
989 # Build and Install man pages
990 #
991 AC_ARG_ENABLE(manpages,
992         AS_HELP_STRING([--disable-manpages],[Disable building and installation of man pages]),
993 [case "${enableval}" in
994   yes) manpages=yes ;;
995   no)  manpages=no ;;
996   *) AC_MSG_ERROR([bad value ${enableval} for --disable-manpages]) ;;
997 esac],[manpages=yes])
998
999 if test x$manpages = xyes ; then
1000     #
1001     # XMLTOMAN manpage generation
1002     #
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 ;;
1007       no)  xmltoman=no ;;
1008       *) AC_MSG_ERROR([bad value ${enableval} for --disable-xmltoman]) ;;
1009     esac],[xmltoman=yes])
1010
1011     if test x$xmltoman = xyes ; then
1012         AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no)
1013     fi
1014
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])
1018             exit 1
1019         fi
1020         AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***])
1021         xmltoman=no
1022     fi
1023 fi
1024 AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes])
1025 AM_CONDITIONAL([BUILD_MANPAGES], [test "x$manpages" = xyes])
1026
1027 #
1028 # Conditionally compile test and example programs
1029 #
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) ;;
1036         esac],
1037         [ENABLE_TESTS=no])
1038
1039 AM_CONDITIONAL([ENABLE_TESTS], [test "x$ENABLE_TESTS" = "xyes"])
1040
1041 #
1042 # Optionally enable libdns_sd compatibility support
1043 #
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) ;;
1050         esac],
1051         [ENABLE_COMPAT_LIBDNS_SD=no])
1052
1053 AM_CONDITIONAL([ENABLE_COMPAT_LIBDNS_SD], [test "x$ENABLE_COMPAT_LIBDNS_SD" = "xyes"])
1054
1055 #
1056 # Optionally enable HOWL compatibility support
1057 #
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) ;;
1064         esac],
1065         [ENABLE_COMPAT_HOWL=no])
1066
1067 AM_CONDITIONAL([ENABLE_COMPAT_HOWL], [test "x$ENABLE_COMPAT_HOWL" = "xyes"])
1068
1069
1070 # ==========================================================================
1071 AC_CONFIG_FILES([
1072 Makefile
1073 avahi-common/Makefile
1074 avahi-core/Makefile
1075 avahi-glib/Makefile
1076 avahi-gobject/Makefile
1077 avahi-qt/Makefile
1078 avahi-daemon/Makefile
1079 avahi-daemon/avahi-dbus.conf
1080 avahi-discover-standalone/Makefile
1081 avahi-client/Makefile
1082 initscript/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
1098 examples/Makefile
1099 common/Makefile
1100 man/Makefile
1101 tests/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
1109 avahi-ui/Makefile
1110 po/Makefile.in
1111 ])
1112 AC_OUTPUT
1113
1114 # ==========================================================================
1115 echo "
1116  ---{ $PACKAGE_NAME $VERSION }---
1117
1118     prefix:                                    ${prefix}
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}
1125     C Compiler:                                ${CC}
1126     CFLAGS:                                    ${CFLAGS}
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}
1152 "
1153
1154 BUILD_DAEMON="no   (You need libdaemon and expat/bsdxml!)"
1155
1156 if test "x$HAVE_XML" = "xyes" -a "x$HAVE_LIBDAEMON" = "xyes" ; then
1157     BUILD_DAEMON=yes
1158 fi
1159
1160 BUILD_PYTHON="no   (You need python, pygtk and python-dbus!)"
1161
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
1163     BUILD_PYTHON=yes
1164 fi
1165
1166 BUILD_CLIENT="no   (You need avahi-daemon and D-Bus!)"
1167
1168 if test "x$BUILD_DAEMON" = "xyes" -a "x$HAVE_DBUS" = "xyes" ; then
1169     BUILD_CLIENT=yes
1170 fi
1171
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!)"
1174 fi
1175 if test "x$ENABLE_COMPAT_HOWL" = "xyes" -a "x$BUILD_CLIENT" != "xyes" ; then
1176    ENABLE_COMPAT_HOWL="no   (You need libavahi-client!)"
1177 fi
1178 if test "x$ENABLE_AUTOIPD" = "xyes" -a "x$HAVE_LIBDAEMON" != "xyes" ; then
1179    ENABLE_AUTOIPD="no   (You need libdaemon!)"
1180 fi
1181
1182 HAVE_GTK2OR3=no
1183 if test "x$HAVE_GTK" = "xyes" -o "x$HAVE_GTK3" = "xyes" ; then
1184    HAVE_GTK2OR3=yes
1185 fi
1186
1187 BUILD_UI="no"
1188 if test "x$HAVE_GTK2OR3" = "xyes" -a "x$BUILD_CLIENT" = "xyes" ; then
1189    BUILD_UI="yes"
1190 fi
1191
1192 BUILD_GOBJECT="no"
1193 if test "x$BUILD_CLIENT" = "xyes" -a "x$HAVE_GOBJECT" = "xyes" ; then
1194    BUILD_GOBJECT="yes"
1195 fi
1196
1197 echo "\
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}
1216 "