]> git.meshlink.io Git - catta/blob - configure.ac
b5492c51e1ce108771aca293a4e7539381b7be2a
[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 # Check for DBUS
66 PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 0.23, dbus-glib-1 >= 0.23 ])
67 AC_SUBST(DBUS_CFLAGS)
68 AC_SUBST(DBUS_LIBS)
69
70 AC_ARG_ENABLE(gtk,
71         AC_HELP_STRING([--enable-gtk],[use GTK+ (default=yes)]),
72         [case "${enableval}" in
73                 yes) ENABLE_GTK=yes ;;
74                 no)  ENABLE_GTK=no ;;
75                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk) ;;
76         esac],
77         [ENABLE_GTK=yes]) dnl Default value
78
79 if test "x$ENABLE_GTK" = "xyes"; then
80         # Check for GTK 2.0
81         PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.4.0 ])
82         AC_SUBST(GTK20_CFLAGS)
83         AC_SUBST(GTK20_LIBS)
84         
85         # Check for GLADE 2.0
86         PKG_CHECK_MODULES(GLADE20, [ libglade-2.0 >= 2.4.0 ])
87         AC_SUBST(GLADE20_CFLAGS)
88         AC_SUBST(GLADE20_LIBS)
89 fi
90 AM_CONDITIONAL(ENABLE_GTK, test "x$ENABLE_GTK" = "xyes")
91
92 AC_ARG_ENABLE(doxygen,
93         AC_HELP_STRING([--enable-doxygen],[use doxygen to generate API docs (default=yes)]),
94         [case "${enableval}" in
95                 yes) ENABLE_DOXYGEN=yes ;;
96                 no)  ENABLE_DOXYGEN=no ;;
97                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk) ;;
98         esac],
99         [ENABLE_DOXYGEN=yes]) dnl Default value
100
101 AM_CONDITIONAL(ENABLE_DOXYGEN, test "x$ENABLE_DOXYGEN" = "xyes")
102
103 # If using GCC specify some additional parameters
104 if test "x$GCC" = "xyes" ; then
105    CFLAGS="$CFLAGS -pipe -W -Wall -pedantic"
106
107    AC_LANG_CONFTEST([int main() {}])
108    $CC -c conftest.c -std=c99 -Wno-unused-parameter $CFLAGS > /dev/null 2> /dev/null && CFLAGS="$CFLAGS -std=c99 -Wno-unused-parameter"
109    rm -f conftest.o
110 fi
111
112 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])
113 AC_OUTPUT