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])
72 PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ])
73 AC_SUBST(GLIB20_CFLAGS)
77 AS_HELP_STRING([--disable-gtk],[Use GTK+ (default=yes)]),
78 [case "${enableval}" in
79 yes) ENABLE_GTK=yes ;;
81 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk) ;;
83 [ENABLE_GTK=yes]) dnl Default value
85 if test "x$ENABLE_GTK" = "xyes"; then
87 PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.4.0 ])
88 AC_SUBST(GTK20_CFLAGS)
92 PKG_CHECK_MODULES(GLADE20, [ libglade-2.0 >= 2.4.0 ])
93 AC_SUBST(GLADE20_CFLAGS)
94 AC_SUBST(GLADE20_LIBS)
96 interfacesdir="${datadir}/${PACKAGE}/interfaces/"
97 AC_SUBST(interfacesdir)
100 AM_CONDITIONAL(ENABLE_GTK, test "x$ENABLE_GTK" = "xyes")
113 DX_INIT_DOXYGEN(avahi, doxygen.cfg, doxygen)
116 # XMLTOMAN manpage generation
118 AC_ARG_ENABLE(xmltoman,
119 AS_HELP_STRING([--disable-xmltoman],[Disable rebuilding of man pages with xmltoman]),
120 [case "${enableval}" in
123 *) AC_MSG_ERROR([bad value ${enableval} for --disable-xmltoman]) ;;
124 esac],[xmltoman=yes])
126 if test x$xmltoman = xyes ; then
127 AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no)
129 if test x$have_xmltoman = xno ; then
130 AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***])
135 AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes])
141 AS_HELP_STRING([--disable-dbus],[Enable DBUS support (default=no)]),
142 [case "${enableval}" in
143 yes) ENABLE_DBUS=yes ;;
144 no) ENABLE_DBUS=no ;;
145 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbus) ;;
147 [ENABLE_DBUS=yes]) dnl Default value
150 if test "x$ENABLE_DBUS" = "xyes"; then
151 AC_DEFINE(ENABLE_DBUS, 1, [Whether to use DBUS or not])
152 PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 0.30])
154 AC_ARG_WITH(dbus-sys, AS_HELP_STRING([--with-dbus-sys=<dir>], [where D-BUS system.d directory is]))
156 if ! test -z "$with_dbus_sys" ; then
157 DBUS_SYS_DIR="$with_dbus_sys"
159 DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
161 AC_SUBST(DBUS_SYS_DIR)
163 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
164 AC_SUBST(DBUS_CFLAGS)
168 AM_CONDITIONAL(ENABLE_DBUS, test "x$ENABLE_DBUS" = "xyes")
173 AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false)
175 if ! $have_expat ; then
176 AC_MSG_ERROR([*** libexpat not found ***])
182 PKG_CHECK_MODULES(LIBDAEMON, [ libdaemon >= 0.5 ])
183 AC_SUBST(LIBDAEMON_CFLAGS)
184 AC_SUBST(LIBDAEMON_LIBS)
186 # If using GCC specify some additional parameters
187 if test "x$GCC" = "xyes" ; then
188 CFLAGS="$CFLAGS -pipe -W -Wall -pedantic"
190 AC_LANG_CONFTEST([int main() {}])
191 $CC -c conftest.c -std=c99 -Wno-unused-parameter $CFLAGS > /dev/null 2> /dev/null && CFLAGS="$CFLAGS -std=c99 -Wno-unused-parameter"
196 # Detecting the linux distro for specific things like initscripts.
198 AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, or slackware]))
199 if test "z$with_distro" = "z"; then
200 AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
201 AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
202 AC_CHECK_FILE(/etc/fedora-release,with_distro="redhat")
203 AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
204 AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
205 AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
207 with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
209 if test "z$with_distro" = "z"; then
210 echo "Linux distribution autodetection failed, you must specify the distribution to target using --with-distro=DISTRO"
217 echo "Your distribution (${with_distro}) is not yet supported, init scripts and dbus configuration will not be installed! (patches welcome)"
222 AM_CONDITIONAL(TARGET_REDHAT, test x"$with_distro" = xredhat)
223 AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
224 AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
225 AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
226 AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
229 # Defining Avahi User and Group.
231 AC_ARG_WITH(avahi_user, AS_HELP_STRING([--with-avahi-user=<user>],[User for running the Avahi daemon (avahi)]))
232 if test -z "$with_avahi_user" ; then
235 AVAHI_USER=$with_avahi_user
238 AC_DEFINE_UNQUOTED(AVAHI_USER,"$AVAHI_USER", [User for running the Avahi daemon])
240 AC_ARG_WITH(avahi_group,AS_HELP_STRING([--with-avahi-group=<group>],[Group for Avahi (avahi)]))
241 if test -z "$with_avahi_group" ; then
244 AVAHI_GROUP=$with_avahi_group
246 AC_SUBST(AVAHI_GROUP)
247 AC_DEFINE_UNQUOTED(AVAHI_GROUP,"$AVAHI_GROUP", [Group for Avahi])
252 avahi_runtime_dir="${localstatedir}/run"
253 avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket"
254 AC_SUBST(avahi_runtime_dir)
255 AC_SUBST(avahi_socket)
260 AC_ARG_ENABLE(python,
261 AS_HELP_STRING([--disable-python], [Disable scripts that depends on python]),
262 [case "${enableval}" in
263 yes) use_python=yes ;;
265 *) AC_MSG_ERROR([bad value ${enableval} for --disable-python]) ;;
266 esac],[use_python=yes])
269 if test "x$use_python" = xyes ; then
270 AM_PATH_PYTHON(2.4, [HAVE_PYTHON=yes], [HAVE_PYTHON=no])
272 if test "x$HAVE_PYTHON" = xyes ; then
273 AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR(could not find pygtk module)])
274 AM_CHECK_PYMOD(dbus,,,[AC_MSG_ERROR(could not find python dbus module)])
278 AM_CONDITIONAL(HAVE_PYTHON, [test "x$HAVE_PYTHON" = xyes ])
280 # ==========================================================================
283 avahi-common/Makefile
286 avahi-daemon/Makefile
287 avahi-daemon/avahi-dbus.conf
288 avahi-discover-standalone/Makefile
289 avahi-client/Makefile
291 initscript/Debian/Makefile
292 initscript/Gentoo/Makefile
293 initscript/SUSE/Makefile
294 avahi-dnsconfd/Makefile
296 avahi-utils/avahi/Makefile
304 # ==========================================================================
306 ---{ $PACKAGE_NAME $VERSION }---
309 sysconfdir: ${sysconfdir}
310 dbus-1 system.d dir: ${DBUS_SYS_DIR}
311 dbus-1 version: `pkg-config dbus-1 --modversion`
314 Enable Gtk: ${ENABLE_GTK}
315 Enable DBUS: ${ENABLE_DBUS}
316 Have Python: ${HAVE_PYTHON}
317 Linux Distro: ${with_distro}
318 User for Avahi: ${AVAHI_USER}
319 Group for Avahi: ${AVAHI_GROUP}
321 NOTE: Remember to create user ${AVAHI_USER} and group ${AVAHI_GROUP} before make install