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],[mzninuv (at) 0pointer (dot) de])
25 AC_CONFIG_SRCDIR([avahi-core])
26 AC_CONFIG_HEADERS([config.h])
27 AM_INIT_AUTOMAKE([foreign -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.
46 # Checks for header files.
48 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])
50 # Checks for typedefs, structures, and compiler characteristics.
55 # Checks for library functions.
57 AC_FUNC_SELECT_ARGTYPES
58 AC_CHECK_FUNCS([gethostname memset select socket strchr strcspn strerror uname])
61 PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ])
62 AC_SUBST(GLIB20_CFLAGS)
66 AC_HELP_STRING([--enable-gtk],[use GTK+ (default=yes)]),
67 [case "${enableval}" in
68 yes) ENABLE_GTK=yes ;;
70 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk) ;;
72 [ENABLE_GTK=yes]) dnl Default value
74 if test "x$ENABLE_GTK" = "xyes"; then
76 PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.4.0 ])
77 AC_SUBST(GTK20_CFLAGS)
81 PKG_CHECK_MODULES(GLADE20, [ libglade-2.0 >= 2.4.0 ])
82 AC_SUBST(GLADE20_CFLAGS)
83 AC_SUBST(GLADE20_LIBS)
85 AM_CONDITIONAL(ENABLE_GTK, test "x$ENABLE_GTK" = "xyes")
87 AC_ARG_ENABLE(doxygen,
88 AC_HELP_STRING([--enable-doxygen],[use doxygen to generate API docs (default=yes)]),
89 [case "${enableval}" in
90 yes) ENABLE_DOXYGEN=yes ;;
91 no) ENABLE_DOXYGEN=no ;;
92 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk) ;;
94 [ENABLE_DOXYGEN=yes]) dnl Default value
96 AM_CONDITIONAL(ENABLE_DOXYGEN, test "x$ENABLE_DOXYGEN" = "xyes")
99 AC_HELP_STRING([--enable-dbus],[use DBus (default=yes)]),
100 [case "${enableval}" in
101 yes) ENABLE_DBUS=yes ;;
102 no) ENABLE_DBUS=no ;;
103 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbus) ;;
105 [ENABLE_DBUS=yes]) dnl Default value
107 AC_DEFINE(ENABLE_DBUS, 1, [Whether to use DBUS or not])
109 if test "x$ENABLE_DBUS" = "xyes"; then
110 PKG_CHECK_MODULES(DBUS, [ dbus-glib-1 >= 0.23])
111 AC_SUBST(DBUS_CFLAGS)
114 if pkg-config dbus-1 --atleast-version=0.30 ; then
115 AC_DEFINE(DBUS_USE_NEW_API, 1, [Whether to use the new API for DBUS 0.30])
119 AM_CONDITIONAL(ENABLE_DBUS, test "x$ENABLE_DBUS" = "xyes")
121 AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false)
123 if ! $have_expat ; then
124 AC_MSG_ERROR([*** libexpat not found ***])
127 PKG_CHECK_MODULES(LIBDAEMON, [ libdaemon >= 0.5 ])
128 AC_SUBST(LIBDAEMON_CFLAGS)
129 AC_SUBST(LIBDAEMON_LIBS)
131 # If using GCC specify some additional parameters
132 if test "x$GCC" = "xyes" ; then
133 CFLAGS="$CFLAGS -pipe -W -Wall -pedantic"
135 AC_LANG_CONFTEST([int main() {}])
136 $CC -c conftest.c -std=c99 -Wno-unused-parameter $CFLAGS > /dev/null 2> /dev/null && CFLAGS="$CFLAGS -std=c99 -Wno-unused-parameter"
140 AC_CONFIG_FILES([Makefile avahi-core.pc doxygen/Makefile doxygen/doxygen.conf avahi-common/Makefile avahi-core/Makefile avahi-daemon/Makefile avahi-discover/Makefile avahi-client/Makefile])