2 # Process this file with autoconf to produce a configure script.
6 # This file is part of avahi.
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.
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.
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
24 AC_INIT([avahi],[0.1],[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])
29 AC_SUBST(PACKAGE_URL, [http://www.freedesktop.org/Software/Avahi])
31 if type -p stow > /dev/null && test -d /usr/local/stow ; then
32 AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
33 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
36 # Checks for programs.
44 AC_PROG_GCC_TRADITIONAL
49 # Checks for header files.
51 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])
53 # Checks for typedefs, structures, and compiler characteristics.
59 # Checks for library functions.
61 AC_FUNC_SELECT_ARGTYPES
64 AC_CHECK_FUNCS([gethostname memchr memmove memset mkdir select socket strchr strcspn strdup strerror strrchr strspn strstr uname setresuid setreuid strcasecmp gettimeofday])
71 # If using GCC specify some additional parameters
72 if test "x$GCC" = "xyes" ; then
73 CFLAGS="$CFLAGS -pipe -W -Wall -pedantic"
75 AC_LANG_CONFTEST([int main() {}])
76 $CC -c conftest.c -std=c99 -Wno-unused-parameter $CFLAGS > /dev/null 2> /dev/null && CFLAGS="$CFLAGS -std=c99 -Wno-unused-parameter"
86 AS_HELP_STRING([--disable-glib],[Disable use of GLib]),
87 [case "${enableval}" in
90 *) AC_MSG_ERROR(bad value ${enableval} for --enable-glib) ;;
94 if test "x$HAVE_GLIB" = "xyes" ; then
95 PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ])
96 AC_SUBST(GLIB20_CFLAGS)
99 AM_CONDITIONAL(HAVE_GLIB, test "x$HAVE_GLIB" = "xyes")
105 AS_HELP_STRING([--disable-gtk],[Disable use of GTK+]),
106 [case "${enableval}" in
109 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk) ;;
113 if test "x$HAVE_GTK" = "xyes" ; then
115 PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.4.0 ])
116 AC_SUBST(GTK20_CFLAGS)
119 # Check for GLADE 2.0
120 PKG_CHECK_MODULES(GLADE20, [ libglade-2.0 >= 2.4.0 ])
121 AC_SUBST(GLADE20_CFLAGS)
122 AC_SUBST(GLADE20_LIBS)
124 interfacesdir="${datadir}/${PACKAGE}/interfaces/"
125 AC_SUBST(interfacesdir)
127 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
133 AS_HELP_STRING([--disable-dbus],[Disable use of D-BUS]),
134 [case "${enableval}" in
135 yes) HAVE_DBUS=yes ;;
137 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbus) ;;
141 AC_ARG_WITH(dbus-sys, AS_HELP_STRING([--with-dbus-sys=<dir>], [where D-BUS system.d directory is]))
143 if test "x$HAVE_DBUS" = "xyes" ; then
144 AC_DEFINE(HAVE_DBUS, 1, [Whether we have D-BUS or not])
146 PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 0.30 ])
147 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
148 AC_SUBST(DBUS_CFLAGS)
151 if ! test -z "$with_dbus_sys" ; then
152 DBUS_SYS_DIR="$with_dbus_sys"
154 DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
156 AC_SUBST(DBUS_SYS_DIR)
159 AM_CONDITIONAL(HAVE_DBUS, test "x$HAVE_DBUS" = "xyes")
165 AS_HELP_STRING([--disable-expat],[Disable use of Expat]),
166 [case "${enableval}" in
167 yes) HAVE_EXPAT=yes ;;
169 *) AC_MSG_ERROR(bad value ${enableval} for --enable-expat) ;;
173 if test "x$HAVE_EXPAT" = "xyes" ; then
174 AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false)
176 if ! $have_expat ; then
177 AC_MSG_ERROR([*** libexpat not found ***])
180 AM_CONDITIONAL(HAVE_EXPAT, test "x$HAVE_EXPAT" = "xyes")
185 AC_ARG_ENABLE(libdaemon,
186 AS_HELP_STRING([--disable-libdaemon],[Disable use of libdaemon]),
187 [case "${enableval}" in
188 yes) HAVE_LIBDAEMON=yes ;;
189 no) HAVE_LIBDAEMON=no ;;
190 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libdaemon) ;;
192 [HAVE_LIBDAEMON=yes])
194 if test "x$HAVE_LIBDAEMON" = "xyes" ; then
195 PKG_CHECK_MODULES(LIBDAEMON, [ libdaemon >= 0.5 ])
196 AC_SUBST(LIBDAEMON_CFLAGS)
197 AC_SUBST(LIBDAEMON_LIBS)
199 AM_CONDITIONAL(HAVE_LIBDAEMON, test "x$HAVE_LIBDAEMON" = "xyes")
204 AC_ARG_ENABLE(python,
205 AS_HELP_STRING([--disable-python], [Disable scripts that depends on python]),
206 [case "${enableval}" in
207 yes) HAVE_PYTHON=yes ;;
208 no) HAVE_PYTHON=no ;;
209 *) AC_MSG_ERROR([bad value ${enableval} for --enable-python]) ;;
210 esac],[HAVE_PYTHON=yes])
212 if test "y$HAVE_PYTHON" = xyes ; then
215 if test "x$HAVE_PYTHON" = xyes ; then
216 AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR(Could not find Python module pygtk)])
217 AM_CHECK_PYMOD(dbus,,,[AC_MSG_ERROR(Could not find Python module dbus)])
220 AM_CONDITIONAL(HAVE_PYTHON, [test "x$HAVE_PYTHON" = "xyes" ])
223 # Detecting the linux distro for specific things like initscripts.
225 AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, or slackware]))
226 if test "z$with_distro" = "z"; then
227 AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
228 AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
229 AC_CHECK_FILE(/etc/fedora-release,with_distro="redhat")
230 AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
231 AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
232 AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
234 with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
236 if test "z$with_distro" = "z"; then
237 echo "Linux distribution autodetection failed, you must specify the distribution to target using --with-distro=DISTRO"
244 echo "Your distribution (${with_distro}) is not yet supported, init scripts and dbus configuration will not be installed! (patches welcome)"
249 AM_CONDITIONAL(TARGET_REDHAT, test x"$with_distro" = xredhat)
250 AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
251 AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
252 AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
253 AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
256 # Defining Avahi User and Group.
258 AC_ARG_WITH(avahi_user, AS_HELP_STRING([--with-avahi-user=<user>],[User for running the Avahi daemon (avahi)]))
259 if test -z "$with_avahi_user" ; then
262 AVAHI_USER=$with_avahi_user
265 AC_DEFINE_UNQUOTED(AVAHI_USER,"$AVAHI_USER", [User for running the Avahi daemon])
267 AC_ARG_WITH(avahi_group,AS_HELP_STRING([--with-avahi-group=<group>],[Group for Avahi (avahi)]))
268 if test -z "$with_avahi_group" ; then
271 AVAHI_GROUP=$with_avahi_group
273 AC_SUBST(AVAHI_GROUP)
274 AC_DEFINE_UNQUOTED(AVAHI_GROUP,"$AVAHI_GROUP", [Group for Avahi])
279 avahi_runtime_dir="${localstatedir}/run"
280 avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket"
281 AC_SUBST(avahi_runtime_dir)
282 AC_SUBST(avahi_socket)
296 DX_INIT_DOXYGEN(avahi, doxygen.cfg, doxygen)
299 # XMLTOMAN manpage generation
301 AC_ARG_ENABLE(xmltoman,
302 AS_HELP_STRING([--disable-xmltoman],[Disable rebuilding of man pages with xmltoman]),
303 [case "${enableval}" in
306 *) AC_MSG_ERROR([bad value ${enableval} for --disable-xmltoman]) ;;
307 esac],[xmltoman=yes])
309 if test x$xmltoman = xyes ; then
310 AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no)
312 if test x$have_xmltoman = xno ; then
313 AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***])
318 AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes])
320 # ==========================================================================
323 avahi-common/Makefile
326 avahi-daemon/Makefile
327 avahi-daemon/avahi-dbus.conf
328 avahi-discover-standalone/Makefile
329 avahi-client/Makefile
331 initscript/Debian/Makefile
332 initscript/Gentoo/Makefile
333 initscript/SUSE/Makefile
334 avahi-dnsconfd/Makefile
336 avahi-utils/avahi/Makefile
344 # ==========================================================================
346 ---{ $PACKAGE_NAME $VERSION }---
349 sysconfdir: ${sysconfdir}
350 dbus-1 system.d dir: ${DBUS_SYS_DIR}
351 dbus-1 version: `pkg-config dbus-1 --modversion`
354 Enable GLIB: ${HAVE_GLIB}
355 Enable GTK: ${HAVE_GTK}
356 Enable D-BUS: ${HAVE_DBUS}
357 Enable Expat: ${HAVE_EXPAT}
358 Enable libdaemon: ${HAVE_LIBDAEMON}
359 Have Python: ${HAVE_PYTHON}
360 Linux Distro: ${with_distro}
361 User for Avahi: ${AVAHI_USER}
362 Group for Avahi: ${AVAHI_GROUP}
365 BUILD_DAEMON="no (!)"
367 if test "x$HAVE_EXPAT" = "xyes" -a "x$HAVE_LIBDAEMON" = "xyes" ; then
373 if test "x$BUILD_DAEMON" = "xyes" -a "x$HAVE_DBUS" = "xyes" -a "x$HAVE_PYTHON" = "xyes" ; then
378 Building avahi-core yes
379 Building avahi-daemon: ${BUILD_DAEMON}
380 Building avahi-dnsconfd: ${BUILD_DAEMON}
381 Building avahi-utils: ${BUILD_UTILS}
382 Building avahi-glib: ${HAVE_GLIB}
383 Building avahi-discover-standalone: ${HAVE_GTK}