2 # Process this file with autoconf to produce a configure script.
6 # This file is part of polypaudio.
8 # polypaudio is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU Lesser General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # polypaudio is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU Lesser General Public License
19 # along with polypaudio; if not, write to the Free Software Foundation,
20 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
23 AC_INIT([polypaudio],[0.8],[mzcbylcnhqvb (at) 0pointer (dot) de])
24 AC_CONFIG_SRCDIR([polyp/main.c])
25 AC_CONFIG_HEADERS([config.h])
26 AM_INIT_AUTOMAKE([foreign -Wall])
28 AC_SUBST(PA_MAJORMINOR, "$PACKAGE_VERSION")
29 AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/polypaudio/])
31 AC_SUBST(PA_API_VERSION, 8)
33 if type -p stow > /dev/null && test -d /usr/local/stow ; then
34 AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
35 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
38 # Checks for programs.
42 AC_LIBLTDL_INSTALLABLE
47 AC_CONFIG_SUBDIRS(libltdl)
49 # Checks for header files.
51 AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h syslog.h])
57 test "x$no_x" != "xyes" && HAVE_X11=1
59 AM_CONDITIONAL(HAVE_X11, test "x$no_x" != "xyes")
60 if test "x$no_x" != "xyes" ; then
61 AC_DEFINE([HAVE_X11], 1, [Have X11])
64 # Checks for typedefs, structures, and compiler characteristics.
71 # Checks for library functions.
73 AC_PROG_GCC_TRADITIONAL
75 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
83 AC_FUNC_SELECT_ARGTYPES
86 AC_CHECK_FUNCS([gethostname gettimeofday memchr memmove memset mkdir mkfifo munmap rmdir socket strcspn strerror strrchr strspn strstr strtol strtoul strcasecmp putenv strchr strpbrk strdup getgrgid_r getpwuid_r regcomp ftruncate select])
96 AC_CHECK_LIB(cap, cap_init, [CAP_LIBS='-lcap'], [CAP_LIBS=''])
99 AC_CHECK_HEADERS(sys/capability.h)
101 AC_CHECK_FUNCS(setresuid)
102 AC_CHECK_FUNCS(setreuid)
104 PKG_CHECK_MODULES(LIBSAMPLERATE, [ samplerate >= 0.1.0 ])
105 AC_SUBST(LIBSAMPLERATE_CFLAGS)
106 AC_SUBST(LIBSAMPLERATE_LIBS)
108 PKG_CHECK_MODULES(LIBSNDFILE, [ sndfile >= 1.0.10 ])
109 AC_SUBST(LIBSNDFILE_CFLAGS)
110 AC_SUBST(LIBSNDFILE_LIBS)
112 PKG_CHECK_MODULES(ASOUNDLIB, [ alsa >= 1.0.0 ], [HAVE_ALSA=1], [HAVE_ALSA=0])
113 AC_SUBST(ASOUNDLIB_CFLAGS)
114 AC_SUBST(ASOUNDLIB_LIBS)
116 AM_CONDITIONAL([HAVE_ALSA], [test "x$HAVE_ALSA" = x1])
118 PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ], HAVE_GLIB20=1, HAVE_GLIB20=0)
119 AC_SUBST(GLIB20_CFLAGS)
120 AC_SUBST(GLIB20_LIBS)
121 AC_SUBST(HAVE_GLIB20)
122 AM_CONDITIONAL([HAVE_GLIB20], [test "x$HAVE_GLIB20" = x1])
124 PKG_CHECK_MODULES(GLIB12, [ glib >= 1.2.0 ], HAVE_GLIB12=1, HAVE_GLIB12=0)
125 AC_SUBST(GLIB12_CFLAGS)
126 AC_SUBST(GLIB12_LIBS)
127 AC_SUBST(HAVE_GLIB12)
128 AM_CONDITIONAL([HAVE_GLIB12], [test "x$HAVE_GLIB12" = x1])
130 PKG_CHECK_MODULES(HOWL, [ howl >= 0.9.8 ], HAVE_HOWL=1, HAVE_HOWL=0)
131 AC_SUBST(HOWL_CFLAGS)
134 AM_CONDITIONAL([HAVE_HOWL], [test "x$HAVE_HOWL" = x1])
136 PKG_CHECK_MODULES(LIBASYNCNS, [ libasyncns >= 0.1 ], HAVE_LIBASYNCNS=1, HAVE_LIBASYNCNS=0)
137 AC_SUBST(LIBASYNCNS_CFLAGS)
138 AC_SUBST(LIBASYNCNS_LIBS)
139 AC_SUBST(HAVE_LIBASYNCNS)
140 AM_CONDITIONAL([HAVE_LIBASYNCNS], [test "x$HAVE_LIBASYNCNS" = x1])
142 if test "x$HAVE_LIBASYNCNS" != "x0" ; then
143 AC_DEFINE([HAVE_LIBASYNCNS], 1, [Have libasyncns?])
146 AC_PATH_PROG([M4], [m4 gm4], [no])
147 if test "x$M4" = xno ; then
148 AC_MSG_ERROR([m4 missing])
151 AC_MSG_CHECKING([for tcpwrap library and headers])
159 int allow_severity = LOG_INFO;
160 int deny_severity = LOG_WARNING;],
161 [struct request_info *req;
162 return hosts_access (req);]),
163 [AC_DEFINE(HAVE_LIBWRAP, [], [Have tcpwrap?])
164 LIBWRAP_LIBS="-lwrap"
167 AC_SUBST(LIBWRAP_LIBS)
171 AC_CHECK_HEADER(lirc/lirc_client.h,[AC_CHECK_LIB(lirc_client,lirc_init,,HAVE_LIRC=0)],HAVE_LIRC=0)
172 LIRC_LIBS=-llirc_client
173 AC_SUBST(LIRC_CFLAGS)
175 AM_CONDITIONAL([HAVE_LIRC], [test "x$HAVE_LIRC" = x1])
177 AC_CHECK_HEADER(linux/input.h,HAVE_EVDEV=1,HAVE_EVDEV=0)
178 AM_CONDITIONAL([HAVE_EVDEV], [test "x$HAVE_EVDEV" = x1])
180 # If using GCC specify some additional parameters
181 if test "x$GCC" = "xyes" ; then
182 CFLAGS="$CFLAGS -pipe -W -Wall -pedantic"
184 AC_LANG_CONFTEST([int main() {}])
185 $CC -c conftest.c -std=c99 -Wno-unused-parameter $CFLAGS > /dev/null 2> /dev/null && CFLAGS="$CFLAGS -std=c99 -Wno-unused-parameter"
189 # LYNX documentation generation
191 AC_HELP_STRING(--disable-lynx,Turn off lynx usage for documentation generation),
192 [case "${enableval}" in
195 *) AC_MSG_ERROR(bad value ${enableval} for --disable-lynx) ;;
198 if test x$lynx = xyes ; then
199 AC_CHECK_PROG(have_lynx, lynx, yes, no)
201 if test x$have_lynx = xno ; then
202 AC_MSG_WARN([*** lynx not found, plain text README will not be built ***])
206 AM_CONDITIONAL([USE_LYNX], [test "x$lynx" = xyes])
208 AM_CONDITIONAL(BUILD_LIBPOLYPCORE, false)
210 AC_CONFIG_FILES([Makefile polyp/Makefile polyplib.pc polyplib-simple.pc polyplib-mainloop.pc polyplib-browse.pc polyplib-error.pc polyplib-glib-mainloop.pc polyplib-glib12-mainloop.pc doc/Makefile doc/README.html doc/cli.html doc/daemon.html doc/modules.html doxygen/Makefile doxygen/doxygen.conf polyp/polyplib-version.h doc/FAQ.html])