]> git.meshlink.io Git - catta/blob - configure.ac
* Patch by Ross Burton to enable conditional use of dbus (--enable-dbus=no), disable...
[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.1],[mzninuv (at) 0pointer (dot) de])
25 AC_CONFIG_SRCDIR([avahi-core])
26 AC_CONFIG_HEADERS([config.h])
27 AM_INIT_AUTOMAKE([foreign -Wall])
28
29 AC_SUBST(PACKAGE_URL, [http://www.freedesktop.org/Software/Avahi])
30
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}"
34 fi
35
36 # Checks for programs.
37 AC_PROG_CC
38 AC_PROG_CPP
39 AC_PROG_INSTALL
40 AC_PROG_LN_S
41 AC_PROG_MAKE_SET
42
43 # libtool stuff
44 AC_PROG_LIBTOOL
45
46 # Checks for header files.
47 AC_HEADER_STDC
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])
49
50 # Checks for typedefs, structures, and compiler characteristics.
51 AC_C_CONST
52 AC_TYPE_SIZE_T
53 AC_HEADER_TIME
54
55 # Checks for library functions.
56 AC_FUNC_MEMCMP
57 AC_FUNC_SELECT_ARGTYPES
58 AC_CHECK_FUNCS([gethostname memset select socket strchr strcspn strerror uname])
59
60 # Check for GLIB 2.0
61 PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ])
62 AC_SUBST(GLIB20_CFLAGS)
63 AC_SUBST(GLIB20_LIBS)
64
65 AC_ARG_ENABLE(gtk,
66         AC_HELP_STRING([--enable-gtk],[use GTK+ (default=yes)]),
67         [case "${enableval}" in
68                 yes) ENABLE_GTK=yes ;;
69                 no)  ENABLE_GTK=no ;;
70                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk) ;;
71         esac],
72         [ENABLE_GTK=yes]) dnl Default value
73
74 if test "x$ENABLE_GTK" = "xyes"; then
75         # Check for GTK 2.0
76         PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.4.0 ])
77         AC_SUBST(GTK20_CFLAGS)
78         AC_SUBST(GTK20_LIBS)
79         
80         # Check for GLADE 2.0
81         PKG_CHECK_MODULES(GLADE20, [ libglade-2.0 >= 2.4.0 ])
82         AC_SUBST(GLADE20_CFLAGS)
83         AC_SUBST(GLADE20_LIBS)
84 fi
85 AM_CONDITIONAL(ENABLE_GTK, test "x$ENABLE_GTK" = "xyes")
86
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) ;;
93         esac],
94         [ENABLE_DOXYGEN=yes]) dnl Default value
95
96 AM_CONDITIONAL(ENABLE_DOXYGEN, test "x$ENABLE_DOXYGEN" = "xyes")
97
98 AC_ARG_ENABLE(dbus,
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) ;;
104         esac],
105         [ENABLE_DBUS=yes]) dnl Default value
106
107 if test "x$ENABLE_DBUS" = "xyes"; then
108         PKG_CHECK_MODULES(DBUS, [ dbus-glib-1 >= 0.23])
109         AC_SUBST(DBUS_CFLAGS)
110         AC_SUBST(DBUS_LIBS)
111 fi
112
113 AM_CONDITIONAL(ENABLE_DBUS, test "x$ENABLE_DBUS" = "xyes")
114
115
116 # If using GCC specify some additional parameters
117 if test "x$GCC" = "xyes" ; then
118    CFLAGS="$CFLAGS -pipe -W -Wall -pedantic"
119
120    AC_LANG_CONFTEST([int main() {}])
121    $CC -c conftest.c -std=c99 -Wno-unused-parameter $CFLAGS > /dev/null 2> /dev/null && CFLAGS="$CFLAGS -std=c99 -Wno-unused-parameter"
122    rm -f conftest.o
123 fi
124
125 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])
126 AC_OUTPUT