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