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.
24 m4_define(PA_MAJOR, [0])
25 m4_define(PA_MINOR, [9])
26 m4_define(PA_MICRO, [1])
28 AC_INIT([polypaudio], PA_MAJOR.PA_MINOR.PA_MICRO,[mzcbylcnhqvb (at) 0pointer (dot) de])
29 AC_CONFIG_SRCDIR([src/daemon/main.c])
30 AC_CONFIG_HEADERS([config.h])
31 AM_INIT_AUTOMAKE([foreign -Wall])
33 AC_SUBST(PA_MAJORMINOR, "PA_MAJOR.PA_MINOR")
34 AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/polypaudio/])
36 AC_SUBST(PA_API_VERSION, 9)
37 AC_SUBST(PA_PROTOCOL_VERSION, 9)
39 AC_SUBST(LIBPOLYP_VERSION_INFO, [0:0:0])
40 AC_SUBST(LIBPOLYPCORE_VERSION_INFO, [0:1:0])
41 AC_SUBST(LIBPOLYP_SIMPLE_VERSION_INFO, [0:0:0])
42 AC_SUBST(LIBPOLYP_BROWSE_VERSION_INFO, [0:0:0])
43 AC_SUBST(LIBPOLYP_MAINLOOP_GLIB_VERSION_INFO, [0:0:0])
45 if type -p stow > /dev/null && test -d /usr/local/stow ; then
46 AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
47 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
50 #### Platform hacks ####
54 AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, Needed to get declarations for msg_control and msg_controllen on Solaris)
55 AC_DEFINE(_XOPEN_SOURCE, 2, Needed to get declarations for msg_control and msg_controllen on Solaris)
56 AC_DEFINE(__EXTENSIONS__, 1, Needed to get declarations for msg_control and msg_controllen on Solaris)
60 #### Checks for programs. ####
65 AC_PROG_GCC_TRADITIONAL
70 AC_PATH_PROG([M4], [m4 gm4], [no])
71 if test "x$M4" = xno ; then
72 AC_MSG_ERROR([m4 missing])
78 AC_LANG_CONFTEST([int main() {}])
79 $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
85 # If using GCC specify some additional parameters
86 if test "x$GCC" = "xyes" ; then
88 # We use gnu99 instead of c99 because many have interpreted the standard
89 # in a way that int64_t isn't defined on non-64 bit platforms.
90 DESIRED_FLAGS="-std=gnu99 -Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter"
92 for flag in $DESIRED_FLAGS ; do
93 AC_MSG_CHECKING([whether $CC accepts $flag])
94 if test_gcc_flag $flag ; then
95 CFLAGS="$CFLAGS $flag"
103 # LYNX documentation generation
105 AC_HELP_STRING(--disable-lynx,Turn off lynx usage for documentation generation),
106 [case "${enableval}" in
109 *) AC_MSG_ERROR(bad value ${enableval} for --disable-lynx) ;;
112 if test x$lynx != xno ; then
113 AC_CHECK_PROG(have_lynx, lynx, yes, no)
115 if test x$have_lynx = xno ; then
116 if test x$lynx = xyes ; then
117 AC_MSG_ERROR([*** lynx not found])
119 AC_MSG_WARN([*** lynx not found, plain text README will not be built ***])
124 AM_CONDITIONAL([USE_LYNX], [test "x$have_lynx" = xyes])
126 #### libtool stuff ####
128 AC_LTDL_ENABLE_INSTALL
129 AC_LIBLTDL_INSTALLABLE
135 AC_CONFIG_SUBDIRS(libltdl)
137 if test "x$enable_ltdl_install" = "xno" && test "x$ac_cv_lib_ltdl_lt_dlinit" = "xno" ; then
140 *** Cannot find the libltdl development files.
141 *** Maybe you need to install the libltdl-dev package.
145 #### Determine build environment ####
151 AC_DEFINE([OS_IS_WIN32], 1, [Build target is Windows.])
156 AM_CONDITIONAL(OS_IS_WIN32, test "x$os_is_win32" = "x1")
158 ###################################
159 # Basic environment checks #
160 ###################################
162 #### Checks for header files. ####
168 AC_CHECK_HEADERS([arpa/inet.h glob.h grp.h netdb.h netinet/in.h \
169 netinet/in_systm.h netinet/ip.h netinet/tcp.h pwd.h sched.h \
170 sys/resource.h sys/select.h sys/socket.h sys/wait.h \
172 AC_CHECK_HEADERS([regex.h], [HAVE_REGEX=1], [HAVE_REGEX=0])
173 AC_CHECK_HEADERS([sys/un.h], [HAVE_AF_UNIX=1], [HAVE_AF_UNIX=0])
175 AM_CONDITIONAL(HAVE_REGEX, test "x$HAVE_REGEX" = "x1")
176 AM_CONDITIONAL(HAVE_AF_UNIX, test "x$HAVE_AF_UNIX" = "x1")
179 AC_CHECK_HEADERS([sys/poll.h])
182 AC_CHECK_HEADERS([linux/input.h], [HAVE_EVDEV=1], [HAVE_EVDEV=0])
184 AM_CONDITIONAL([HAVE_EVDEV], [test "x$HAVE_EVDEV" = "x1"])
187 AC_CHECK_HEADERS([sys/filio.h])
190 AC_CHECK_HEADERS([windows.h winsock2.h ws2tcpip.h])
193 AC_CHECK_HEADERS([sys/ioctl.h])
195 #### Typdefs, structures, etc. ####
201 AC_CHECK_TYPES(ssize_t, , [AC_DEFINE([ssize_t], [signed long],
202 [Define ssize_t if it is not done by the standard libs.])])
207 AC_CHECK_DEFINE([SIGXCPU], [signal.h], [
209 AC_DEFINE([HAVE_SIGXCPU], 1, [Have SIGXCPU?])
211 AM_CONDITIONAL(HAVE_SIGXCPU, test "x$HAVE_SIGXCPU" = "x1")
214 AC_CHECK_DEFINE([INADDR_NONE], [netinet/in.h], [],
215 [AC_CHECK_DEFINE([INADDR_NONE], [winsock2.h], [],
216 [AC_DEFINE([INADDR_NONE], [0xffffffff], [Define INADDR_NONE if not found in <netinet/in.h>])])])
218 #### Check for libs ####
221 AC_SEARCH_LIBS([pow], [m])
224 AC_SEARCH_LIBS([sched_setscheduler], [rt])
225 AC_SEARCH_LIBS([dlopen], [dl])
228 AC_SEARCH_LIBS([connect], [socket])
232 # This magic is needed so we do not needlessly add static libs to the win32
233 # build, disabling its ability to make dlls.
234 AC_CHECK_FUNCS([getopt_long], [], [AC_CHECK_LIB([iberty], [getopt_long])])
236 #### Check for functions ####
241 AC_FUNC_SELECT_ARGTYPES
242 AC_CHECK_FUNCS([chmod chown getaddrinfo getgrgid_r getpwuid_r gettimeofday \
243 getuid inet_ntop inet_pton nanosleep pipe setpgid setsid sigaction sleep])
244 AC_CHECK_FUNCS([mkfifo], [HAVE_MKFIFO=1], [HAVE_MKFIFO=0])
246 AM_CONDITIONAL(HAVE_MKFIFO, test "x$HAVE_MKFIFO" = "x1")
249 AC_CHECK_FUNCS([readlink])
252 AC_CHECK_FUNCS([ctime_r usleep])
255 AC_CHECK_FUNCS([strerror_r])
258 AC_CHECK_FUNCS([lstat])
262 AC_CHECK_FUNCS(setresuid)
263 AC_CHECK_FUNCS(setreuid)
265 #### POSIX threads ####
269 #### Large File-Support (LFS) ####
277 ###################################
278 # External libraries #
279 ###################################
281 #### X11 (optional) ####
285 # The macro tests the host, not the build target
286 if test "x$os_is_win32" != "x1" ; then
288 test "x$no_x" != "xyes" && HAVE_X11=1
292 AM_CONDITIONAL(HAVE_X11, test "x$HAVE_X11" = "x1")
293 if test "x$HAVE_X11" = "x1" ; then
294 AC_DEFINE([HAVE_X11], 1, [Have X11])
297 #### Capabilities (optional) ####
303 AC_HELP_STRING([--without-caps],[Omit support for POSIX capabilities.]))
305 if test "x${with_caps}" != "xno"; then
306 AC_SEARCH_LIBS([cap_init], [cap], [], [
307 if test "x${with_caps}" = "xyes" ; then
308 AC_MSG_ERROR([*** POSIX caps libraries not found])
310 AC_CHECK_HEADERS([sys/capability.h], [], [
311 if test "x${with_caps}" = "xyes" ; then
312 AC_MSG_ERROR([*** POSIX caps headers not found])
318 # Check for pkg-config manually first, as if its not installed the
319 # PKG_PROG_PKG_CONFIG macro won't be defined.
320 AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
322 if test x"$have_pkg_config" = "xno"; then
323 AC_MSG_ERROR(pkg-config is required to install this program)
328 #### Sample rate conversion ####
330 PKG_CHECK_MODULES(LIBSAMPLERATE, [ samplerate >= 0.1.0 ])
331 AC_SUBST(LIBSAMPLERATE_CFLAGS)
332 AC_SUBST(LIBSAMPLERATE_LIBS)
336 PKG_CHECK_MODULES(LIBSNDFILE, [ sndfile >= 1.0.10 ])
337 AC_SUBST(LIBSNDFILE_CFLAGS)
338 AC_SUBST(LIBSNDFILE_LIBS)
340 #### OSS support (optional) ####
343 AC_HELP_STRING([--disable-oss], [Disable optional OSS support]),
345 case "${enableval}" in
348 *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;;
353 if test "x${oss}" != xno ; then
354 AC_CHECK_HEADERS([sys/soundcard.h],
357 AC_DEFINE([HAVE_OSS], 1, [Have OSS?])
361 if test "x$oss" = xyes ; then
362 AC_MSG_ERROR([*** OSS support not found])
370 AM_CONDITIONAL([HAVE_OSS], [test "x$HAVE_OSS" = x1])
373 #### ALSA support (optional) ####
375 AC_ARG_ENABLE([alsa],
376 AC_HELP_STRING([--disable-alsa], [Disable optional ALSA support]),
378 case "${enableval}" in
381 *) AC_MSG_ERROR(bad value ${enableval} for --disable-alsa) ;;
386 if test "x${alsa}" != xno ; then
387 PKG_CHECK_MODULES(ASOUNDLIB, [ alsa >= 1.0.0 ],
390 AC_DEFINE([HAVE_ALSA], 1, [Have ALSA?])
394 if test "x$alsa" = xyes ; then
395 AC_MSG_ERROR([*** ALSA support not found])
402 AC_SUBST(ASOUNDLIB_CFLAGS)
403 AC_SUBST(ASOUNDLIB_LIBS)
405 AM_CONDITIONAL([HAVE_ALSA], [test "x$HAVE_ALSA" = x1])
407 #### Solaris audio support (optional) ####
409 AC_ARG_ENABLE([solaris],
410 AC_HELP_STRING([--disable-solaris], [Disable optional Solaris audio support]),
412 case "${enableval}" in
415 *) AC_MSG_ERROR(bad value ${enableval} for --disable-solaris) ;;
420 if test "x${solaris}" != xno ; then
421 AC_CHECK_HEADERS([sys/audio.h],
424 AC_DEFINE([HAVE_SOLARIS], 1, [Have Solaris audio?])
428 if test "x$solaris" = xyes ; then
429 AC_MSG_ERROR([*** Solaris audio support not found])
436 AC_SUBST(HAVE_SOLARIS)
437 AM_CONDITIONAL([HAVE_SOLARIS], [test "x$HAVE_SOLARIS" = x1])
439 #### GLib 2 support (optional) ####
441 AC_ARG_ENABLE([glib2],
442 AC_HELP_STRING([--disable-glib2], [Disable optional GLib 2 support]),
444 case "${enableval}" in
447 *) AC_MSG_ERROR(bad value ${enableval} for --disable-glib2) ;;
452 if test "x${glib2}" != xno ; then
453 PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ],
457 if test "x$glib2" = xyes ; then
458 AC_MSG_ERROR([*** GLib 2 support not found])
465 AC_SUBST(GLIB20_CFLAGS)
466 AC_SUBST(GLIB20_LIBS)
467 AC_SUBST(HAVE_GLIB20)
468 AM_CONDITIONAL([HAVE_GLIB20], [test "x$HAVE_GLIB20" = x1])
470 #### GLib 1 support (optional) ####
472 AC_ARG_ENABLE([glib1],
473 AC_HELP_STRING([--disable-glib1], [Disable optional GLib 1 support]),
475 case "${enableval}" in
478 *) AC_MSG_ERROR(bad value ${enableval} for --disable-glib1) ;;
483 if test "x${glib1}" != xno ; then
484 PKG_CHECK_MODULES(GLIB12, [ glib >= 1.2.0 ],
488 if test "x$glib1" = xyes ; then
489 AC_MSG_ERROR([*** GLib 1 support not found])
496 AC_SUBST(GLIB12_CFLAGS)
497 AC_SUBST(GLIB12_LIBS)
498 AC_SUBST(HAVE_GLIB12)
499 AM_CONDITIONAL([HAVE_GLIB12], [test "x$HAVE_GLIB12" = x1])
501 #### Howl support (optional) ####
503 AC_ARG_ENABLE([howl],
504 AC_HELP_STRING([--disable-howl], [Disable optional Howl support]),
506 case "${enableval}" in
509 *) AC_MSG_ERROR(bad value ${enableval} for --disable-howl) ;;
514 if test "x${howl}" != xno ; then
515 PKG_CHECK_MODULES(HOWL, [ howl >= 0.9.8 ],
518 PKG_CHECK_MODULES(HOWL, [ avahi-compat-howl >= 0.9.8 ],
522 if test "x$howl" = xyes ; then
523 AC_MSG_ERROR([*** Howl support not found])
531 AC_SUBST(HOWL_CFLAGS)
534 AM_CONDITIONAL([HAVE_HOWL], [test "x$HAVE_HOWL" = x1])
538 PKG_CHECK_MODULES(LIBOIL, [ liboil-0.3 >= 0.3.0 ])
539 AC_SUBST(LIBOIL_CFLAGS)
540 AC_SUBST(LIBOIL_LIBS)
542 ### JACK (optional) ####
544 AC_ARG_ENABLE([jack],
545 AC_HELP_STRING([--disable-jack], [Disable optional JACK support]),
547 case "${enableval}" in
550 *) AC_MSG_ERROR(bad value ${enableval} for --disable-jack) ;;
555 if test "x${jack}" != xno ; then
556 PKG_CHECK_MODULES(JACK, [ jack >= 0.100 ],
560 if test "x$jack" = xyes ; then
561 AC_MSG_ERROR([*** JACK support not found])
568 AC_SUBST(JACK_CFLAGS)
571 AM_CONDITIONAL([HAVE_JACK], [test "x$HAVE_JACK" = x1])
573 #### Async DNS support (optional) ####
575 AC_ARG_ENABLE([asyncns],
576 AC_HELP_STRING([--disable-asyncns], [Disable optional Async DNS support]),
578 case "${enableval}" in
581 *) AC_MSG_ERROR(bad value ${enableval} for --disable-asyncns) ;;
586 if test "x${asyncns}" != xno ; then
587 PKG_CHECK_MODULES(LIBASYNCNS, [ libasyncns >= 0.1 ],
591 if test "x$asyncns" = xyes ; then
592 AC_MSG_ERROR([*** Async DNS support not found])
599 AC_SUBST(LIBASYNCNS_CFLAGS)
600 AC_SUBST(LIBASYNCNS_LIBS)
601 AC_SUBST(HAVE_LIBASYNCNS)
602 AM_CONDITIONAL([HAVE_LIBASYNCNS], [test "x$HAVE_LIBASYNCNS" = x1])
604 if test "x$HAVE_LIBASYNCNS" != "x0" ; then
605 AC_DEFINE([HAVE_LIBASYNCNS], 1, [Have libasyncns?])
608 #### TCP wrappers (optional) ####
610 AC_ARG_ENABLE([tcpwrap],
611 AC_HELP_STRING([--disable-tcpwrap], [Disable optional TCP wrappers support]),
613 case "${enableval}" in
616 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tcpwrap) ;;
621 if test "x${tcpwrap}" != xno ; then
623 if test "x${LIBWRAP_LIBS}" = x && test "x$tcpwrap" = xyes ; then
624 AC_MSG_ERROR([*** TCP wrappers support not found])
630 AC_SUBST(LIBWRAP_LIBS)
632 #### LIRC support (optional) ####
634 AC_ARG_ENABLE([lirc],
635 AC_HELP_STRING([--disable-lirc], [Disable optional LIRC support]),
637 case "${enableval}" in
640 *) AC_MSG_ERROR(bad value ${enableval} for --disable-lirc) ;;
645 if test "x${lirc}" != xno ; then
647 if test "x${HAVE_LIRC}" = x0 && test "x$lirc" = xyes ; then
648 AC_MSG_ERROR([*** LIRC support not found])
654 AC_SUBST(LIRC_CFLAGS)
656 AM_CONDITIONAL([HAVE_LIRC], [test "x$HAVE_LIRC" = x1])
658 ###################################
660 ###################################
664 AC_HELP_STRING([--enable-static-bins],[Statically link executables.]),
665 [STATIC_BINS=1], [STATIC_BINS=0])
666 AM_CONDITIONAL([STATIC_BINS], [test "x$STATIC_BINS" = "x1"])
670 AC_HELP_STRING([--with-preopen-mods],[Modules to preopen in daemon (default: all).]),
671 [PREOPEN_MODS=$withval], [PREOPEN_MODS="all"])
672 AM_CONDITIONAL([PREOPEN_MODS], [test "x$PREOPEN_MODS" != "xall"])
673 if test "x$PREOPEN_MODS" != "xall" ; then
675 for mod in $PREOPEN_MODS; do
676 tmpLIBS="$tmpLIBS module-$mod.la"
678 PREOPEN_MODS="$tmpLIBS"
679 AC_SUBST(PREOPEN_MODS)
684 AC_HELP_STRING([--with-module-dir],[Directory where to install the modules to (defaults to ${libdir}/polypaudio-${PA_MAJORMINOR}/modules/]),
685 [modlibexecdir=$withval], [modlibexecdir="${libdir}/polypaudio-${PA_MAJORMINOR}/modules/"])
687 AC_SUBST(modlibexecdir)
691 AC_HELP_STRING([--enable-force-preopen],[Preopen modules, even when dlopen() is supported.]),
692 [FORCE_PREOPEN=1], [FORCE_PREOPEN=0])
693 AM_CONDITIONAL([FORCE_PREOPEN], [test "x$FORCE_PREOPEN" = "x1"])
701 polyplib-glib-mainloop.pc
702 polyplib-glib12-mainloop.pc