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