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