]> git.meshlink.io Git - catta/blob - configure.ac
* More distcheck loving.
[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],[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://www.freedesktop.org/Software/Avahi])
30
31 AC_SUBST(LIBAVAHI_COMMON_VERSION_INFO, [2:0:2])
32 AC_SUBST(LIBAVAHI_CORE_VERSION_INFO, [2:0:1])
33 AC_SUBST(LIBAVAHI_CLIENT_VERSION_INFO, [2:0:1])
34 AC_SUBST(LIBAVAHI_GLIB_VERSION_INFO, [0:1:0])
35 AC_SUBST(LIBAVAHI_QT3_VERSION_INFO, [0:0:0])
36 AC_SUBST(LIBAVAHI_QT4_VERSION_INFO, [0:0:0])
37 AC_SUBST(LIBAVAHI_COMPAT_LIBDNS_SD_VERSION_INFO, [1:0:0])
38 AC_SUBST(LIBAVAHI_COMPAT_HOWL_VERSION_INFO, [0:0:0])
39
40 if type -p stow > /dev/null && test -d /usr/local/stow ; then
41     AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
42     ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
43 fi
44
45 # Checks for programs.
46 AC_PROG_CC
47 AC_PROG_CXX
48 AC_GNU_SOURCE
49 AC_PROG_CPP
50 AC_PROG_INSTALL
51 AC_PROG_LN_S
52 AC_PROG_MAKE_SET
53 AC_PROG_GCC_TRADITIONAL
54
55 # libtool stuff
56 AC_PROG_LIBTOOL
57
58 ACX_PTHREAD(,AC_MSG_ERROR([Missing POSIX Threads support]))
59
60 #
61 # Host specific stuffs
62 #
63 case "$host" in
64   *-netbsd* | *-knetbsd*-gnu)
65     AC_DEFINE([NETBSD],[],[ Support for NetBSD])
66     avahi_platform=netbsd
67     ;;
68   *-openbsd*)
69     AC_DEFINE([OPENBSD],[],[ Support for OpenBSD])
70     avahi_platform=openbsd
71     ;;
72   *-solaris*)
73     AC_DEFINE([SOLARIS],[],[ Support for Sun Solaris])
74     avahi_platform=solaris
75     ;;
76   *-linux*)
77     AC_DEFINE([LINUX],[],[ Support for GNU/Linux])
78     avahi_platform=linux
79     ;;
80   *-freebsd* | *-kfreebsd*-gnu)
81     AC_DEFINE([FREEBSD],[],[ Support for FreeBSD])
82     avahi_platform=freebsd
83     ;;
84   *-apple-darwin*)
85     AC_DEFINE([DARWIN],[],[ Support for AppleDarwin])
86     avahi_platform=darwin
87     ;;
88 esac
89
90 #
91 # Check for netlink.h
92 #
93 AC_CHECK_HEADER(linux/netlink.h, 
94 HAVE_NETLINK=yes
95 AC_DEFINE([HAVE_NETLINK],[],[Support for Linux netlink])
96 , [], [
97 #include <sys/socket.h>
98 #include <asm/types.h>
99 ])
100
101 AM_CONDITIONAL(HAVE_NETLINK, [ test x"$HAVE_NETLINK" = xyes ])
102
103 #
104 # Check for struct ip_mreqn
105 #
106 AC_MSG_CHECKING(for struct ip_mreqn)
107 AC_TRY_COMPILE([#include <netinet/in.h>], [
108         struct ip_mreqn mreq;
109         mreq.imr_address.s_addr = 0;
110 ], [
111         # Yes, we have it...
112         AC_MSG_RESULT(yes)
113         AC_DEFINE([HAVE_STRUCT_IP_MREQN],[],[Support for struct ip_mreqn])
114 ], [
115         # We'll just have to try and use struct ip_mreq
116         AC_MSG_RESULT(no)
117         AC_MSG_CHECKING(for struct ip_mreq)
118         AC_TRY_COMPILE([#include <netinet/in.h>], [
119                 struct ip_mreq mreq;
120                 mreq.imr_interface.s_addr = 0;
121         ], [
122                 # Yes, we have it...
123                 AC_MSG_RESULT(yes)
124                 AC_DEFINE([HAVE_STRUCT_IP_MREQ],[],[Support for struct ip_mreq])
125         ], [
126                 # No multicast support
127                         AC_MSG_RESULT(no)
128         ])
129 ])
130
131 #
132 # Detecting the linux distribution for specific things like init scripts.
133 #
134 AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the Linux distribution to target: One of debian, gentoo, archlinux or none]))
135 if test "z$with_distro" = "z"; then
136     AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
137     AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
138     AC_CHECK_FILE(/etc/arch-release,with_distro="archlinux")
139     AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
140 fi
141 with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
142
143 if test "z$with_distro" = "z"; then
144     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.])
145     exit 1
146 else
147 case $with_distro in
148     debian|gentoo|archlinux|suse|none)
149      ;;
150     *)
151      AC_MSG_ERROR([Your distribution (${with_distro}) is not yet supported, init scripts and dbus configuration will not be installed! (patches welcome), you can specify --with-distro=none to skip this check])
152      ;;
153 esac
154 fi
155
156 AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
157 AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
158 AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
159 AM_CONDITIONAL(TARGET_ARCHLINUX, test x"$with_distro" = xarchlinux)
160
161 test_gcc_flag() {
162     AC_LANG_CONFTEST([int main() {}])
163     $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
164     ret=$?
165     rm -f conftest.o
166     return $ret
167 }
168
169 # If using GCC specify some additional parameters
170 if test "x$GCC" = "xyes" ; then
171
172     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 -Wlarger-than-4000 -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter"
173
174     # Test whether rtnetlink.h can be included when compiled with -std=c99
175     # some distributions (e.g. archlinux) have broken headers that dont
176     # define __u64 with -std=c99
177     AC_MSG_CHECKING([checking whether rtnetlink.h can be included with -std=c99])
178     OLDCFLAGS="$CFLAGS"
179     CFLAGS="-std=c99"
180     AC_TRY_COMPILE([#include <linux/rtnetlink.h>], [],
181         use_stdc99=yes, use_stdc99=no)
182
183     if test x"$use_stdc99" = xyes; then
184         DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
185         AC_MSG_RESULT([yes])
186     else
187         AC_MSG_RESULT([no])
188     fi
189
190     CFLAGS="$OLDCFLAGS"
191
192     for flag in $DESIRED_FLAGS ; do
193         AC_MSG_CHECKING([whether $CC accepts $flag])
194         if test_gcc_flag $flag ; then 
195            CFLAGS="$CFLAGS $flag"
196            AC_MSG_RESULT([yes])
197         else
198            AC_MSG_RESULT([no])
199         fi
200     done 
201 fi
202
203 # Checks for header files.
204 AC_HEADER_STDC
205 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])
206
207 # Checks for typedefs, structures, and compiler characteristics.
208 AC_C_CONST
209 AC_TYPE_SIZE_T
210 AC_HEADER_TIME
211 AC_HEADER_SYS_WAIT
212
213 # Checks for library functions.
214 AC_FUNC_MEMCMP
215 AC_FUNC_SELECT_ARGTYPES
216 AC_FUNC_MALLOC
217 AC_FUNC_REALLOC
218 AC_CHECK_FUNCS([gethostname memchr memmove memset mkdir select socket strchr strcspn strdup strerror strrchr strspn strstr uname setresuid setreuid strcasecmp gettimeofday putenv strncasecmp])
219
220 AC_FUNC_CHOWN
221 AC_FUNC_STAT
222 AC_TYPE_MODE_T
223 AC_TYPE_PID_T
224
225 # Check for pkg-config manually first, as if its not installed the
226 # PKG_PROG_PKG_CONFIG macro won't be defined.
227 AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
228
229 if test x"$have_pkg_config" == xno; then
230     AC_MSG_ERROR(pkg-config is required to install this program)
231 fi
232
233 PKG_PROG_PKG_CONFIG
234
235 #
236 # Check for GLIB 2.0
237 #
238 AC_ARG_ENABLE(glib,
239         AS_HELP_STRING([--disable-glib],[Disable use of GLib]),
240         [case "${enableval}" in
241                 yes) HAVE_GLIB=yes ;;
242                 no)  HAVE_GLIB=no ;;
243                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-glib) ;;
244         esac],
245         [HAVE_GLIB=yes])
246
247 if test "x$HAVE_GLIB" = "xyes" ; then
248         PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ])
249         AC_SUBST(GLIB20_CFLAGS)
250         AC_SUBST(GLIB20_LIBS)
251 fi
252 AM_CONDITIONAL(HAVE_GLIB, test "x$HAVE_GLIB" = "xyes")
253
254 #
255 # Check for Qt 3
256 #
257 AC_ARG_ENABLE(qt3,
258         AS_HELP_STRING([--disable-qt3],[Disable building of Qt3 mainloop integration]),
259         [case "${enableval}" in
260                 yes) HAVE_QT3=yes ;;
261                 no)  HAVE_QT3=no ;;
262                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt3) ;;
263         esac],
264         [HAVE_QT3=yes])
265
266 if test "x$HAVE_QT3" = "xyes" ; then
267         PKG_CHECK_MODULES( QT3, [ qt-mt >= 3.0.0 ])
268         AC_SUBST(QT3_CFLAGS)
269         AC_SUBST(QT3_LIBS)
270             QT3_PREFIX="`$PKG_CONFIG --variable=prefix qt-mt`/bin"
271         MOC_QT3="no"
272             AC_CHECK_FILE( "$QT3_PREFIX/moc-qt3", [ MOC_QT3=$QT3_PREFIX/moc-qt3 ], [
273                     AC_CHECK_FILE("$QT3_PREFIX/moc", [ MOC_QT3=$QT3_PREFIX/moc ], [ 
274                 AC_MSG_ERROR([Couldn't find QT3 moc])])])
275         AC_SUBST(MOC_QT3)
276 fi
277 AM_CONDITIONAL(HAVE_QT3, test "x$HAVE_QT3" = "xyes")
278
279 #
280 # Check for Qt 4
281 #
282 AC_ARG_ENABLE(qt4,
283         AS_HELP_STRING([--disable-qt4],[Disable building of Qt4Core mainloop integration]),
284         [case "${enableval}" in
285                 yes) HAVE_QT4=yes ;;
286                 no)  HAVE_QT4=no ;;
287                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt4) ;;
288         esac],
289         [HAVE_QT4=yes])
290
291 if test "x$HAVE_QT4" = "xyes" ; then
292         PKG_CHECK_MODULES( QT4, [ QtCore >= 4.0.0 ])
293         AC_SUBST(QT4_CFLAGS)
294         AC_SUBST(QT4_LIBS)
295             QT4_PREFIX="`$PKG_CONFIG --variable=prefix QtCore`/bin"
296         MOC_QT4="no"
297             AC_CHECK_FILE( "$QT4_PREFIX/moc-qt4", [ MOC_QT4=$QT4_PREFIX/moc-qt4 ], [
298                AC_CHECK_FILE("$QT4_PREFIX/moc", [ MOC_QT4=$QT4_PREFIX/moc ], [ 
299                AC_MSG_ERROR([Couldn't find QT4 moc])])])
300         AC_SUBST(MOC_QT4)
301 fi
302 AM_CONDITIONAL(HAVE_QT4, test "x$HAVE_QT4" = "xyes")
303
304 #
305 # Check for GTK+
306 #
307 AC_ARG_ENABLE(gtk,
308         AS_HELP_STRING([--disable-gtk],[Disable use of GTK+]),
309         [case "${enableval}" in
310                 yes) HAVE_GTK=yes ;;
311                 no)  HAVE_GTK=no ;;
312                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk) ;;
313         esac],
314         [HAVE_GTK=yes])
315
316 if test "x$HAVE_GTK" = "xyes" ; then
317         # Check for GTK 2.0
318         PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.4.0 ])
319         AC_SUBST(GTK20_CFLAGS)
320         AC_SUBST(GTK20_LIBS)
321         
322         # Check for GLADE 2.0
323         PKG_CHECK_MODULES(GLADE20, [ libglade-2.0 >= 2.4.0 ])
324         AC_SUBST(GLADE20_CFLAGS)
325         AC_SUBST(GLADE20_LIBS)
326 fi
327 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
328
329
330
331 #
332 # D-BUS
333 #
334 AC_ARG_ENABLE(dbus,
335         AS_HELP_STRING([--disable-dbus],[Disable use of D-BUS]),
336         [case "${enableval}" in
337                 yes) HAVE_DBUS=yes ;;
338                 no)  HAVE_DBUS=no ;;
339                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbus) ;;
340         esac],
341         [HAVE_DBUS=yes]) 
342
343 AC_ARG_WITH(dbus-sys, AS_HELP_STRING([--with-dbus-sys=<dir>], [where D-BUS system.d directory is]))
344 AC_ARG_WITH(dbus-system-socket, AS_HELP_STRING([--with-dbus-system-address=<address>], [where the dbus system socket is, you probably want to put unix:path= at the start]))
345
346 if test "x$HAVE_DBUS" = "xyes" ; then
347     AC_DEFINE(HAVE_DBUS, 1, [Whether we have D-BUS or not])
348
349     PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 0.34 ])
350     DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
351     AC_SUBST(DBUS_CFLAGS)
352     AC_SUBST(DBUS_LIBS)
353
354     if ! test -z "$with_dbus_sys" ; then
355         DBUS_SYS_DIR="$with_dbus_sys"
356     else
357         DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
358     fi
359     AC_SUBST(DBUS_SYS_DIR)
360
361     if ! test -z "$with_dbus_system_address" ; then
362         DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="$with_dbus_system_address"
363     else
364         # This is ugly, but D-BUS doesn't export this address for us
365         # so we have to guess, pretty much all setups i've seen have 
366         # it in /var/lib/dbus or /var/run/dbus, and its defaulted to
367         # /var/run upstream so we will try guess first then default
368         # to /var/run/dbus
369
370         DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=/var/run/dbus/system_bus_socket"
371         TRY_SOCKETS="/var/lib/dbus/system_bus_socket /var/run/dbus/system_bus_socket"
372         for sock in $TRY_SOCKETS; do
373             if test -S $sock; then
374                 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$sock"
375             fi
376         done
377     fi
378     AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
379     
380 fi
381 AM_CONDITIONAL(HAVE_DBUS, test "x$HAVE_DBUS" = "xyes")
382
383 #
384 # Expat
385 #
386 AC_ARG_ENABLE(expat,
387         AS_HELP_STRING([--disable-expat],[Disable use of Expat]),
388         [case "${enableval}" in
389                 yes) HAVE_EXPAT=yes ;;
390                 no)  HAVE_EXPAT=no ;;
391                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-expat) ;;
392         esac],
393         [HAVE_EXPAT=yes]) 
394
395 if test "x$HAVE_EXPAT" = "xyes" ; then
396     AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false)
397
398     if ! $have_expat ; then
399         AC_MSG_ERROR([*** libexpat not found ***])
400     fi
401 fi
402 AM_CONDITIONAL(HAVE_EXPAT, test "x$HAVE_EXPAT" = "xyes")
403
404 #
405 # libdaemon
406 #
407 AC_ARG_ENABLE(libdaemon,
408         AS_HELP_STRING([--disable-libdaemon],[Disable use of libdaemon]),
409         [case "${enableval}" in
410                 yes) HAVE_LIBDAEMON=yes ;;
411                 no)  HAVE_LIBDAEMON=no ;;
412                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libdaemon) ;;
413         esac],
414         [HAVE_LIBDAEMON=yes]) 
415
416 if test "x$HAVE_LIBDAEMON" = "xyes" ; then
417     PKG_CHECK_MODULES(LIBDAEMON, [ libdaemon >= 0.5 ])
418     AC_SUBST(LIBDAEMON_CFLAGS)
419     AC_SUBST(LIBDAEMON_LIBS)
420 fi
421 AM_CONDITIONAL(HAVE_LIBDAEMON, test "x$HAVE_LIBDAEMON" = "xyes")
422
423 #
424 # Python stuff
425 #
426 AC_ARG_ENABLE(python,
427     AS_HELP_STRING([--disable-python], [Disable scripts that depends on python]),
428     [case "${enableval}" in
429           yes) HAVE_PYTHON=yes ;;
430           no)  HAVE_PYTHON=no ;;
431           *) AC_MSG_ERROR([bad value ${enableval} for --enable-python]) ;;
432     esac],[HAVE_PYTHON=yes])
433
434 HAVE_PYTHON_DBUS=no
435 HAVE_PYGTK=no
436
437 if test "x$HAVE_PYTHON" = "xyes" ; then
438     AM_PATH_PYTHON([2.4])
439
440     AC_ARG_ENABLE(pygtk,
441         AS_HELP_STRING([--disable-pygtk],[Disable use of GTK in Python]),
442         [case "${enableval}" in
443                 yes) HAVE_PYGTK=yes ;;
444                 no)  HAVE_PYGTK=no ;;
445                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pygtk) ;;
446         esac],
447         [HAVE_PYGTK=yes])
448     
449     if test "x$HAVE_PYGTK" = "xyes" ; then
450         AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR(Could not find Python module gtk)])
451     fi
452
453
454     AC_ARG_ENABLE(python-dbus,
455         AS_HELP_STRING([--disable-python-dbus],[Disable use of D-BUS in Python]),
456         [case "${enableval}" in
457                 yes) HAVE_PYTHON_DBUS=yes ;;
458                 no)  HAVE_PYTHON_DBUS=no ;;
459                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-python-dbus) ;;
460         esac],
461         [HAVE_PYTHON_DBUS=yes])
462     
463     if test "x$HAVE_PYTHON_DBUS" = "xyes"; then
464         AM_CHECK_PYMOD(dbus,,,[AC_MSG_ERROR(Could not find Python module dbus)])
465     fi
466
467     AM_CHECK_PYMOD(socket,,,[AC_MSG_ERROR(Could not find Python module socket)])
468     AM_CHECK_PYMOD(gdbm,,,[AC_MSG_ERROR(Could not find Python module gdbm)])
469 fi
470 AM_CONDITIONAL(HAVE_PYTHON, [test "x$HAVE_PYTHON" = "xyes" ])
471 AM_CONDITIONAL(HAVE_PYGTK, test "x$HAVE_PYGTK" = "xyes")
472 AM_CONDITIONAL(HAVE_PYTHON_DBUS, test "x$HAVE_PYTHON_DBUS" = "xyes")
473
474 #
475 # Check for mono stuff
476 #
477 AC_ARG_ENABLE(mono,
478         AS_HELP_STRING([--disable-mono],[Disable mono bindings]),
479         [case "${enableval}" in
480                 yes) HAVE_MONO=yes ;;
481                 no)  HAVE_MONO=no ;;
482                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-mono) ;;
483         esac],
484         [HAVE_MONO=yes])
485
486 AC_ARG_ENABLE(monodoc,
487         AS_HELP_STRING([--disable-monodoc],[Disable documentation for mono bindings]),
488         [case "${enableval}" in
489                 yes) HAVE_MONODOC=yes ;;
490                 no)  HAVE_MONODOC=no ;;
491                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-monodoc) ;;
492         esac],
493         [HAVE_MONODOC=yes])
494
495 if test "x$HAVE_MONO" = "xyes" ; then
496         AC_PATH_PROG(MCS, mcs)
497         if test "x$MCS" = "x" ; then
498                AC_MSG_ERROR([Can not find "mcs" in your PATH])
499         fi
500
501         AC_PATH_PROG(GACUTIL, gacutil)
502         if test "x$GACUTIL" = "x" ; then
503                 AC_MSG_ERROR([Can not find "gacutil" in your PATH])
504         fi
505
506         AC_SUBST(MCS)
507         AC_SUBST(GACUTIL)
508 fi
509 AM_CONDITIONAL(HAVE_MONO, test "x$HAVE_MONO" = "xyes")
510
511 #
512 # Check for monodoc stuff
513 #
514 if test "x$HAVE_MONODOC" = "xyes" ; then
515         PKG_CHECK_MODULES(MONODOC, [monodoc >= 1.1.8])
516         MONODOC_DIR=`$PKG_CONFIG --variable=sourcesdir monodoc`        
517
518         AC_PATH_PROG(MONODOCER, monodocer)
519         AC_PATH_PROG(MDASSEMBLER, mdassembler)
520
521         AC_SUBST(MONODOC_DIR)
522         AC_SUBST(MONODOCER)
523         AC_SUBST(MDASSEMBLER)
524 fi
525 AM_CONDITIONAL(HAVE_MONODOC, test "x$HAVE_MONODOC" = "xyes")
526
527 #
528 # Defining Avahi User and Group.
529 #
530 AC_ARG_WITH(avahi_user, AS_HELP_STRING([--with-avahi-user=<user>],[User for running the Avahi daemon (avahi)]))
531 if test -z "$with_avahi_user" ; then
532     AVAHI_USER=avahi
533 else
534     AVAHI_USER=$with_avahi_user
535 fi
536 AC_SUBST(AVAHI_USER)
537 AC_DEFINE_UNQUOTED(AVAHI_USER,"$AVAHI_USER", [User for running the Avahi daemon])
538
539 AC_ARG_WITH(avahi_group,AS_HELP_STRING([--with-avahi-group=<group>],[Group for Avahi (avahi)]))
540 if test -z "$with_avahi_group" ; then
541     AVAHI_GROUP=avahi
542 else
543     AVAHI_GROUP=$with_avahi_group
544 fi
545 AC_SUBST(AVAHI_GROUP)
546 AC_DEFINE_UNQUOTED(AVAHI_GROUP,"$AVAHI_GROUP", [Group for Avahi])
547
548 #
549 # Avahi runtime dir
550 #
551 avahi_runtime_dir="${localstatedir}/run"
552 avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket"
553 AC_SUBST(avahi_runtime_dir)
554 AC_SUBST(avahi_socket)
555
556
557 #
558 # Avahi interfaces dir
559 #
560 if test "x$HAVE_PYTHON_DBUS" = "xyes" -o "x$HAVE_GTK" = "xyes"; then
561         interfacesdir="${datadir}/${PACKAGE}/interfaces/"
562         AC_SUBST(interfacesdir)
563 fi
564
565
566 #
567 # Doxygen
568 #
569 DX_HTML_FEATURE(ON)
570 DX_CHM_FEATURE(OFF)
571 DX_CHI_FEATURE(OFF)
572 DX_MAN_FEATURE(OFF)
573 DX_RTF_FEATURE(OFF)
574 DX_XML_FEATURE(OFF)
575 DX_PDF_FEATURE(OFF)
576 DX_PS_FEATURE(OFF)
577 DX_INIT_DOXYGEN(avahi, doxygen.cfg, doxygen)
578
579 #
580 # XMLTOMAN manpage generation
581 #
582 AC_ARG_ENABLE(xmltoman,
583         AS_HELP_STRING([--disable-xmltoman],[Disable rebuilding of man pages with xmltoman]),
584 [case "${enableval}" in
585   yes) xmltoman=yes ;;
586   no)  xmltoman=no ;;
587   *) AC_MSG_ERROR([bad value ${enableval} for --disable-xmltoman]) ;;
588 esac],[xmltoman=yes])
589
590 if test x$xmltoman = xyes ; then
591     AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no)
592  
593     if test x$have_xmltoman = xno ; then
594         if ! test -e man/avahi-daemon.8 ; then
595             AC_MSG_ERROR([*** xmltoman was not found, it is required to build the manpages and they have not been pre-built])
596             exit 1
597         fi
598         AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***])
599         xmltoman=no
600     fi
601 fi
602
603 AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes])
604
605 # ==========================================================================
606 AC_CONFIG_FILES([
607 Makefile 
608 avahi-common/Makefile 
609 avahi-core/Makefile 
610 avahi-glib/Makefile 
611 avahi-qt/Makefile
612 avahi-daemon/Makefile 
613 avahi-daemon/avahi-dbus.conf
614 avahi-discover-standalone/Makefile 
615 avahi-client/Makefile 
616 initscript/Makefile 
617 initscript/debian/Makefile
618 initscript/gentoo/Makefile
619 initscript/archlinux/Makefile
620 initscript/suse/Makefile
621 avahi-dnsconfd/Makefile
622 avahi-utils/Makefile
623 avahi-utils/avahi/Makefile
624 examples/Makefile
625 common/Makefile
626 man/Makefile
627 tests/Makefile
628 service-type-database/Makefile
629 avahi-sharp/Makefile
630 avahi-compat-libdns_sd/Makefile
631 avahi-compat-howl/Makefile
632 avahi-compat-howl/samples/Makefile
633 ])
634 AC_OUTPUT
635
636 # ==========================================================================
637 echo "
638  ---{ $PACKAGE_NAME $VERSION }---
639
640     prefix:                 ${prefix}
641     sysconfdir:             ${sysconfdir}
642     localstatedir:          ${localstatedir}
643     avahi socket:           ${avahi_socket}
644     dbus-1 system.d dir:    ${DBUS_SYS_DIR}
645     dbus-1 version:         `pkg-config dbus-1 --modversion`
646     dbus-1 system socket    ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
647     compiler:               ${CC}
648     cflags:                 ${CFLAGS}
649     Enable GLIB:            ${HAVE_GLIB}
650     Enable GTK:             ${HAVE_GTK}
651     Enable D-BUS:           ${HAVE_DBUS}
652     Enable Expat:           ${HAVE_EXPAT}
653     Enable libdaemon:       ${HAVE_LIBDAEMON}
654     Enable Python:          ${HAVE_PYTHON}
655     Enable pygtk:           ${HAVE_PYGTK}
656     Enable python-dbus:     ${HAVE_PYTHON_DBUS}
657     Enable QT3:             ${HAVE_QT3}
658     Enable QT4:             ${HAVE_QT4}
659     Enable Mono:            ${HAVE_MONO}
660     Linux Distro:           ${with_distro}
661     User for Avahi:         ${AVAHI_USER}
662     Group for Avahi:        ${AVAHI_GROUP}
663 "
664
665 BUILD_DAEMON="no (!)"
666
667 if test "x$HAVE_EXPAT" = "xyes" -a "x$HAVE_LIBDAEMON" = "xyes" ; then
668     BUILD_DAEMON=yes
669 fi
670
671 BUILD_UTILS="no (!)"
672
673 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
674     BUILD_UTILS=yes
675 fi
676
677 BUILD_CLIENT="no (!)"
678
679 if test "x$BUILD_DAEMON" = "xyes" -a "x$HAVE_DBUS" = "xyes" ; then
680     BUILD_CLIENT=yes
681 fi
682
683 echo "
684     Building libavahi-core              yes
685     Building avahi-daemon:              ${BUILD_DAEMON}
686     Building avahi-dnsconfd:            ${BUILD_DAEMON}
687     Building avahi-utils:               ${BUILD_UTILS}
688     Building libavahi-glib:             ${HAVE_GLIB}
689     Building libavahi-client:           ${BUILD_CLIENT}
690     Building avahi-discover-standalone: ${HAVE_GTK}
691     Building libavahi-qt3:              ${HAVE_QT3}
692     Building libavahi-qt4:              ${HAVE_QT4}
693     Building avahi-sharp:               ${HAVE_MONO}
694     Building avahi-compat-libdns_sd:    ${BUILD_CLIENT}
695     Building avahi-compat-howl:         ${BUILD_CLIENT}
696 "