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 "x$HAVE_PYTHON" = "xyes" ; then
213 AM_PATH_PYTHON([2.4])
214 AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR(Could not find Python module pygtk)])
215 AM_CHECK_PYMOD(dbus,,,[AC_MSG_ERROR(Could not find Python module dbus)])
217 AM_CONDITIONAL(HAVE_PYTHON, [test "x$HAVE_PYTHON" = "xyes" ])
220 # Detecting the linux distro for specific things like initscripts.
222 AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, or slackware]))
223 if test "z$with_distro" = "z"; then
224 AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
225 AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
226 AC_CHECK_FILE(/etc/fedora-release,with_distro="redhat")
227 AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
228 AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
229 AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
231 with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
233 if test "z$with_distro" = "z"; then
234 echo "Linux distribution autodetection failed, you must specify the distribution to target using --with-distro=DISTRO"
241 echo "Your distribution (${with_distro}) is not yet supported, init scripts and dbus configuration will not be installed! (patches welcome)"
246 AM_CONDITIONAL(TARGET_REDHAT, test x"$with_distro" = xredhat)
247 AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
248 AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
249 AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
250 AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
253 # Defining Avahi User and Group.
255 AC_ARG_WITH(avahi_user, AS_HELP_STRING([--with-avahi-user=<user>],[User for running the Avahi daemon (avahi)]))
256 if test -z "$with_avahi_user" ; then
259 AVAHI_USER=$with_avahi_user
262 AC_DEFINE_UNQUOTED(AVAHI_USER,"$AVAHI_USER", [User for running the Avahi daemon])
264 AC_ARG_WITH(avahi_group,AS_HELP_STRING([--with-avahi-group=<group>],[Group for Avahi (avahi)]))
265 if test -z "$with_avahi_group" ; then
268 AVAHI_GROUP=$with_avahi_group
270 AC_SUBST(AVAHI_GROUP)
271 AC_DEFINE_UNQUOTED(AVAHI_GROUP,"$AVAHI_GROUP", [Group for Avahi])
276 avahi_runtime_dir="${localstatedir}/run"
277 avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket"
278 AC_SUBST(avahi_runtime_dir)
279 AC_SUBST(avahi_socket)
293 DX_INIT_DOXYGEN(avahi, doxygen.cfg, doxygen)
296 # XMLTOMAN manpage generation
298 AC_ARG_ENABLE(xmltoman,
299 AS_HELP_STRING([--disable-xmltoman],[Disable rebuilding of man pages with xmltoman]),
300 [case "${enableval}" in
303 *) AC_MSG_ERROR([bad value ${enableval} for --disable-xmltoman]) ;;
304 esac],[xmltoman=yes])
306 if test x$xmltoman = xyes ; then
307 AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no)
309 if test x$have_xmltoman = xno ; then
310 AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***])
315 AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes])
317 # ==========================================================================
320 avahi-common/Makefile
323 avahi-daemon/Makefile
324 avahi-daemon/avahi-dbus.conf
325 avahi-discover-standalone/Makefile
326 avahi-client/Makefile
328 initscript/Debian/Makefile
329 initscript/Gentoo/Makefile
330 initscript/SUSE/Makefile
331 avahi-dnsconfd/Makefile
333 avahi-utils/avahi/Makefile
341 # ==========================================================================
343 ---{ $PACKAGE_NAME $VERSION }---
346 sysconfdir: ${sysconfdir}
347 dbus-1 system.d dir: ${DBUS_SYS_DIR}
348 dbus-1 version: `pkg-config dbus-1 --modversion`
351 Enable GLIB: ${HAVE_GLIB}
352 Enable GTK: ${HAVE_GTK}
353 Enable D-BUS: ${HAVE_DBUS}
354 Enable Expat: ${HAVE_EXPAT}
355 Enable libdaemon: ${HAVE_LIBDAEMON}
356 Have Python: ${HAVE_PYTHON}
357 Linux Distro: ${with_distro}
358 User for Avahi: ${AVAHI_USER}
359 Group for Avahi: ${AVAHI_GROUP}
362 BUILD_DAEMON="no (!)"
364 if test "x$HAVE_EXPAT" = "xyes" -a "x$HAVE_LIBDAEMON" = "xyes" ; then
370 if test "x$BUILD_DAEMON" = "xyes" -a "x$HAVE_DBUS" = "xyes" -a "x$HAVE_PYTHON" = "xyes" ; then
375 Building avahi-core yes
376 Building avahi-daemon: ${BUILD_DAEMON}
377 Building avahi-dnsconfd: ${BUILD_DAEMON}
378 Building avahi-utils: ${BUILD_UTILS}
379 Building avahi-glib: ${HAVE_GLIB}
380 Building avahi-discover-standalone: ${HAVE_GTK}