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