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