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