add target "eolspace" to makefil to remove trailing newlines from all source files
[pulseaudio.git] / configure.ac
blob9a1e6c51391526ce33dc3af7464a740482637bde
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 # $Id$
6 # This file is part of PulseAudio.
8 # Copyright 2004-2006 Lennart Poettering
9 # Copyright 2006-2007 Pierre Ossman <ossman@cendio.se> for Cendio AB
11 # PulseAudio is free software; you can redistribute it and/or modify it
12 # under the terms of the GNU Lesser General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
16 # PulseAudio is distributed in the hope that it will be useful, but
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 # General Public License for more details.
21 # You should have received a copy of the GNU Lesser General Public License
22 # along with PulseAudio; if not, write to the Free Software Foundation,
23 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25 AC_PREREQ(2.57)
27 m4_define(PA_MAJOR, [0])
28 m4_define(PA_MINOR, [9])
29 m4_define(PA_MICRO, [6])
31 AC_INIT([pulseaudio], PA_MAJOR.PA_MINOR.PA_MICRO,[mzcbylcnhqvb (at) 0pointer (dot) de])
32 AC_CONFIG_SRCDIR([src/daemon/main.c])
33 AC_CONFIG_HEADERS([config.h])
34 AM_INIT_AUTOMAKE([foreign -Wall])
36 AC_SUBST(PA_MAJORMINOR, "PA_MAJOR.PA_MINOR")
37 AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/pulseaudio/])
39 AC_SUBST(PA_API_VERSION, 10)
40 AC_SUBST(PA_PROTOCOL_VERSION, 10)
42 AC_SUBST(LIBPULSE_VERSION_INFO, [2:0:2])
43 AC_SUBST(LIBPULSECORE_VERSION_INFO, [3:0:0])
44 AC_SUBST(LIBPULSE_SIMPLE_VERSION_INFO, [0:0:0])
45 AC_SUBST(LIBPULSE_BROWSE_VERSION_INFO, [1:0:1])
46 AC_SUBST(LIBPULSE_MAINLOOP_GLIB_VERSION_INFO, [0:2:0])
48 AC_CANONICAL_HOST
50 if type -p stow > /dev/null && test -d /usr/local/stow ; then
51    AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
52    ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
55 #### Platform hacks ####
57 case $host in
58    *-*-solaris* )
59       AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, Needed to get declarations for msg_control and msg_controllen on Solaris)
60       AC_DEFINE(_XOPEN_SOURCE,          2, Needed to get declarations for msg_control and msg_controllen on Solaris)
61       AC_DEFINE(__EXTENSIONS__,         1, Needed to get declarations for msg_control and msg_controllen on Solaris)
62       ;;
63 esac
65 #### Checks for programs. ####
67 # CC
69 AC_PROG_CC
70 AC_PROG_GCC_TRADITIONAL
71 AC_GNU_SOURCE
73 # M4
75 AC_PATH_PROG([M4], [m4 gm4], [no])
76 if test "x$M4" = xno ; then
77    AC_MSG_ERROR([m4 missing])
80 # GCC flags
82 test_gcc_flag() {
83     AC_LANG_CONFTEST([int main() {}])
84     $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
85     ret=$?
86     rm -f conftest.o
87     return $ret
90 # If using GCC specify some additional parameters
91 if test "x$GCC" = "xyes" ; then
93     # We use gnu99 instead of c99 because many have interpreted the standard
94     # in a way that int64_t isn't defined on non-64 bit platforms.
95     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"
97     for flag in $DESIRED_FLAGS ; do
98         AC_MSG_CHECKING([whether $CC accepts $flag])
99         if test_gcc_flag $flag ; then 
100            CFLAGS="$CFLAGS $flag"
101            AC_MSG_RESULT([yes])
102         else
103            AC_MSG_RESULT([no])
104         fi
105     done 
108 #### libtool stuff ####
110 AC_LTDL_ENABLE_INSTALL
111 AC_LIBLTDL_INSTALLABLE
112 AC_SUBST(LTDLINCL)
113 AC_SUBST(LIBLTDL)
114 AC_LIBTOOL_DLOPEN
115 AC_LIBTOOL_WIN32_DLL
116 AC_PROG_LIBTOOL
117 AC_CONFIG_SUBDIRS(libltdl)
119 if test "x$enable_ltdl_install" = "xno" && test "x$ac_cv_lib_ltdl_lt_dlinit" = "xno" ; then
120     AC_MSG_ERROR([[
122         *** Cannot find the libltdl development files.
123         *** Maybe you need to install the libltdl-dev package.
124         ]])
127 #### Determine build environment ####
129 os_is_win32=0
131 case "$host_os" in
132         mingw*)
133         AC_DEFINE([OS_IS_WIN32], 1, [Build target is Windows.])
134         os_is_win32=1
135                 ;;
136         esac
138 AM_CONDITIONAL(OS_IS_WIN32, test "x$os_is_win32" = "x1")
140 ###################################
141 #   Basic environment checks      #
142 ###################################
144 #### Checks for header files. ####
146 # ISO
147 AC_HEADER_STDC
149 # POSIX
150 AC_CHECK_HEADERS([arpa/inet.h glob.h grp.h netdb.h netinet/in.h \
151     netinet/in_systm.h netinet/tcp.h pwd.h sched.h \
152     sys/mman.h sys/resource.h sys/select.h sys/socket.h sys/wait.h \
153     syslog.h])
154 AC_CHECK_HEADERS([netinet/ip.h], [], [],
155                  [#include <sys/types.h>
156                   #if HAVE_NETINET_IN_H
157                   # include <netinet/in.h>
158                   #endif
159                   #if HAVE_NETINET_IN_SYSTM_H
160                   # include <netinet/in_systm.h>
161                   #endif
162                  ])
163 AC_CHECK_HEADERS([regex.h], [HAVE_REGEX=1], [HAVE_REGEX=0])
164 AC_CHECK_HEADERS([sys/un.h], [HAVE_AF_UNIX=1], [HAVE_AF_UNIX=0])
166 AM_CONDITIONAL(HAVE_REGEX, test "x$HAVE_REGEX" = "x1")
167 AM_CONDITIONAL(HAVE_AF_UNIX, test "x$HAVE_AF_UNIX" = "x1")
169 # XPG4-UNIX
170 AC_CHECK_HEADERS([sys/poll.h])
172 # Linux
173 AC_CHECK_HEADERS([linux/input.h], [HAVE_EVDEV=1], [HAVE_EVDEV=0])
175 AM_CONDITIONAL([HAVE_EVDEV], [test "x$HAVE_EVDEV" = "x1"])
177 AC_CHECK_HEADERS([sys/prctl.h])
179 # Solaris
180 AC_CHECK_HEADERS([sys/filio.h])
182 # Windows
183 AC_CHECK_HEADERS([windows.h winsock2.h ws2tcpip.h])
185 # Other
186 AC_CHECK_HEADERS([sys/ioctl.h])
188 #### Typdefs, structures, etc. ####
190 AC_C_CONST
191 AC_C_BIGENDIAN
192 AC_TYPE_PID_T
193 AC_TYPE_SIZE_T
194 AC_CHECK_TYPES(ssize_t, , [AC_DEFINE([ssize_t], [signed long],
195     [Define ssize_t if it is not done by the standard libs.])])
196 AC_TYPE_OFF_T
197 AC_TYPE_SIGNAL
198 AC_TYPE_UID_T
200 AC_CHECK_DEFINE([SIGXCPU], [signal.h], [
201 HAVE_SIGXCPU=1
202 AC_DEFINE([HAVE_SIGXCPU], 1, [Have SIGXCPU?])
203 ], [HAVE_SIGXCPU=0])
204 AM_CONDITIONAL(HAVE_SIGXCPU, test "x$HAVE_SIGXCPU" = "x1")
206 # Solaris lacks this
207 AC_CHECK_DEFINE([INADDR_NONE], [netinet/in.h], [],
208     [AC_CHECK_DEFINE([INADDR_NONE], [winsock2.h], [],
209         [AC_DEFINE([INADDR_NONE],  [0xffffffff], [Define INADDR_NONE if not found in <netinet/in.h>])])])
211 #### Check for libs ####
213 # ISO
214 AC_SEARCH_LIBS([pow], [m])
216 # POSIX
217 AC_SEARCH_LIBS([sched_setscheduler], [rt])
218 AC_SEARCH_LIBS([dlopen], [dl])
219 AC_SEARCH_LIBS([shm_open], [rt])
221 # BSD
222 AC_SEARCH_LIBS([connect], [socket])
224 # Non-standard
226 # This magic is needed so we do not needlessly add static libs to the win32
227 # build, disabling its ability to make dlls.
228 AC_CHECK_FUNCS([getopt_long], [], [AC_CHECK_LIB([iberty], [getopt_long])])
230 #### Check for functions ####
232 # POSIX
233 AC_FUNC_FORK
234 AC_FUNC_GETGROUPS
235 AC_FUNC_SELECT_ARGTYPES
236 AC_CHECK_FUNCS([chmod chown getaddrinfo getgrgid_r getpwuid_r gettimeofday \
237     getuid inet_ntop inet_pton nanosleep pipe posix_memalign setpgid setsid \
238     shm_open sigaction sleep sysconf])
239 AC_CHECK_FUNCS([mkfifo], [HAVE_MKFIFO=1], [HAVE_MKFIFO=0])
241 AM_CONDITIONAL(HAVE_MKFIFO, test "x$HAVE_MKFIFO" = "x1")
243 # X/OPEN
244 AC_CHECK_FUNCS([readlink])
246 # SUSv2
247 AC_CHECK_FUNCS([ctime_r usleep])
249 # SUSv3
250 AC_CHECK_FUNCS([strerror_r])
252 # BSD
253 AC_CHECK_FUNCS([lstat])
255 # Non-standard
257 AC_CHECK_FUNCS([setresuid setresgid setreuid setregid seteuid setegid])
259 #### POSIX threads ####
261 ACX_PTHREAD
263 #### Large File-Support (LFS) ####
265 AC_SYS_LARGEFILE
267 # Check for open64 to know if the current system does have open64() and similar functions
268 AC_CHECK_FUNCS([open64])
270 #### [lib]iconv ####
272 AM_ICONV
274 ###################################
275 #      External libraries         #
276 ###################################
278 #### X11 (optional) ####
280 HAVE_X11=0
282 # The macro tests the host, not the build target
283 if test "x$os_is_win32" != "x1" ; then
284     AC_PATH_XTRA
285     test "x$no_x" != "xyes" && HAVE_X11=1
288 AC_SUBST(HAVE_X11)
289 AM_CONDITIONAL(HAVE_X11, test "x$HAVE_X11" = "x1")
290 if test "x$HAVE_X11" = "x1" ; then
291     AC_DEFINE([HAVE_X11], 1, [Have X11])
294 #### Capabilities (optional) ####
296 CAP_LIBS=''
298 AC_ARG_WITH(
299         [caps],
300         AC_HELP_STRING([--without-caps],[Omit support for POSIX capabilities.]))
302 if test "x${with_caps}" != "xno"; then
303     AC_SEARCH_LIBS([cap_init], [cap], [], [
304                     if test "x${with_caps}" = "xyes" ; then
305                         AC_MSG_ERROR([*** POSIX caps libraries not found])
306                     fi])
307     AC_CHECK_HEADERS([sys/capability.h], [], [
308                     if test "x${with_caps}" = "xyes" ; then
309                         AC_MSG_ERROR([*** POSIX caps headers not found])
310                     fi])
313 #### pkg-config ####
315 # Check for pkg-config manually first, as if its not installed the
316 # PKG_PROG_PKG_CONFIG macro won't be defined.
317 AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
319 if test x"$have_pkg_config" = "xno"; then
320     AC_MSG_ERROR(pkg-config is required to install this program)
323 PKG_PROG_PKG_CONFIG
325 #### Sample rate conversion ####
327 PKG_CHECK_MODULES(LIBSAMPLERATE, [ samplerate >= 0.1.0 ])
328 AC_SUBST(LIBSAMPLERATE_CFLAGS)
329 AC_SUBST(LIBSAMPLERATE_LIBS)
331 #### Sound file ####
333 PKG_CHECK_MODULES(LIBSNDFILE, [ sndfile >= 1.0.10 ])
334 AC_SUBST(LIBSNDFILE_CFLAGS)
335 AC_SUBST(LIBSNDFILE_LIBS)
337 #### atomic-ops ###
339 AC_CHECK_HEADERS([atomic_ops.h], [], [
340 AC_MSG_ERROR([*** libatomic-ops headers not found])
343 # Win32 does not need the lib and breaks horribly if we try to include it
344 if test "x$os_is_win32" != "x1" ; then
345     LIBS="$LIBS -latomic_ops"
348 #### OSS support (optional) ####
350 AC_ARG_ENABLE([oss], 
351     AC_HELP_STRING([--disable-oss], [Disable optional OSS support]), 
352         [
353             case "${enableval}" in
354                 yes) oss=yes ;;
355                 no) oss=no ;;
356                 *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;;
357             esac
358         ],
359         [oss=auto])
361 if test "x${oss}" != xno ; then
362     AC_CHECK_HEADERS([sys/soundcard.h],
363         [
364             HAVE_OSS=1
365             AC_DEFINE([HAVE_OSS], 1, [Have OSS?])
366         ],
367         [
368             HAVE_OSS=0
369             if test "x$oss" = xyes ; then
370                 AC_MSG_ERROR([*** OSS support not found])
371             fi
372         ])
373 else
374     HAVE_OSS=0
377 AC_SUBST(HAVE_OSS)
378 AM_CONDITIONAL([HAVE_OSS], [test "x$HAVE_OSS" = x1])
381 #### ALSA support (optional) ####
383 AC_ARG_ENABLE([alsa], 
384     AC_HELP_STRING([--disable-alsa], [Disable optional ALSA support]), 
385         [
386             case "${enableval}" in
387                 yes) alsa=yes ;;
388                 no) alsa=no ;;
389                 *) AC_MSG_ERROR(bad value ${enableval} for --disable-alsa) ;;
390             esac
391         ],
392         [alsa=auto])
394 if test "x${alsa}" != xno ; then
395     PKG_CHECK_MODULES(ASOUNDLIB, [ alsa >= 1.0.0 ],
396         [
397             HAVE_ALSA=1
398             AC_DEFINE([HAVE_ALSA], 1, [Have ALSA?])
399         ],
400         [
401             HAVE_ALSA=0
402             if test "x$alsa" = xyes ; then
403                 AC_MSG_ERROR([*** ALSA support not found])
404             fi
405         ])
406 else
407     HAVE_ALSA=0
410 AC_SUBST(ASOUNDLIB_CFLAGS)
411 AC_SUBST(ASOUNDLIB_LIBS) 
412 AC_SUBST(HAVE_ALSA)
413 AM_CONDITIONAL([HAVE_ALSA], [test "x$HAVE_ALSA" = x1])
415 #### Solaris audio support (optional) ####
417 AC_ARG_ENABLE([solaris], 
418     AC_HELP_STRING([--disable-solaris], [Disable optional Solaris audio support]), 
419         [
420             case "${enableval}" in
421                 yes) solaris=yes ;;
422                 no) solaris=no ;;
423                 *) AC_MSG_ERROR(bad value ${enableval} for --disable-solaris) ;;
424             esac
425         ],
426         [solaris=auto])
428 if test "x${solaris}" != xno ; then
429     AC_CHECK_HEADERS([sys/audio.h],
430         [
431             HAVE_SOLARIS=1
432             AC_DEFINE([HAVE_SOLARIS], 1, [Have Solaris audio?])
433         ],
434         [
435             HAVE_SOLARIS=0
436             if test "x$solaris" = xyes ; then
437                 AC_MSG_ERROR([*** Solaris audio support not found])
438             fi
439         ])
440 else
441     HAVE_SOLARIS=0
444 AC_SUBST(HAVE_SOLARIS)
445 AM_CONDITIONAL([HAVE_SOLARIS], [test "x$HAVE_SOLARIS" = x1])
447 #### GLib 2 support (optional) ####
449 AC_ARG_ENABLE([glib2], 
450     AC_HELP_STRING([--disable-glib2], [Disable optional GLib 2 support]), 
451         [
452             case "${enableval}" in
453                 yes) glib2=yes ;;
454                 no) glib2=no ;;
455                 *) AC_MSG_ERROR(bad value ${enableval} for --disable-glib2) ;;
456             esac
457         ],
458         [glib2=auto])
460 if test "x${glib2}" != xno ; then
461     PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ],
462         HAVE_GLIB20=1,
463         [
464             HAVE_GLIB20=0
465             if test "x$glib2" = xyes ; then
466                 AC_MSG_ERROR([*** GLib 2 support not found])
467             fi
468         ])
469 else
470     HAVE_GLIB20=0
473 AC_SUBST(GLIB20_CFLAGS)
474 AC_SUBST(GLIB20_LIBS)
475 AC_SUBST(HAVE_GLIB20)
476 AM_CONDITIONAL([HAVE_GLIB20], [test "x$HAVE_GLIB20" = x1])
478 #### GConf support (optional) ####
480 AC_ARG_ENABLE([gconf], 
481     AC_HELP_STRING([--disable-gconf], [Disable optional GConf support]), 
482         [
483             case "${enableval}" in
484                 yes) gconf=yes ;;
485                 no) gconf=no ;;
486                 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gconf) ;;
487             esac
488         ],
489         [glib=auto])
491 if test "x${gconf}" != xno ; then
492     PKG_CHECK_MODULES(GCONF, [ gconf-2.0 >= 2.4.0 ],
493         HAVE_GCONF=1,
494         [
495             HAVE_GCONF=0
496             if test "x$gconf" = xyes ; then
497                 AC_MSG_ERROR([*** GConf support not found])
498             fi
499         ])
500 else
501     HAVE_GCONF=0
504 AC_SUBST(GCONF_CFLAGS)
505 AC_SUBST(GCONF_LIBS)
506 AC_SUBST(HAVE_GCONF)
507 AM_CONDITIONAL([HAVE_GCONF], [test "x$HAVE_GCONF" = x1])
509 #### Avahi support (optional) ####
511 AC_ARG_ENABLE([avahi], 
512     AC_HELP_STRING([--disable-avahi], [Disable optional Avahi support]), 
513         [
514             case "${enableval}" in
515                 yes) avahi=yes ;;
516                 no) avahi=no ;;
517                 *) AC_MSG_ERROR(bad value ${enableval} for --disable-avahi) ;;
518             esac
519         ],
520         [avahi=auto])
522 if test "x${avahi}" != xno ; then
523     PKG_CHECK_MODULES(AVAHI, [ avahi-client >= 0.6.0 ],
524         HAVE_AVAHI=1,
525         [
526                 HAVE_AVAHI=0
527                 if test "x$avahi" = xyes ; then
528                         AC_MSG_ERROR([*** Avahi support not found])
529                 fi
530         ])
531 else
532     HAVE_AVAHI=0
535 AC_SUBST(AVAHI_CFLAGS)
536 AC_SUBST(AVAHI_LIBS)
537 AC_SUBST(HAVE_AVAHI)
538 AM_CONDITIONAL([HAVE_AVAHI], [test "x$HAVE_AVAHI" = x1])
540 ### LIBOIL ####
542 PKG_CHECK_MODULES(LIBOIL, [ liboil-0.3 >= 0.3.0 ])
543 AC_SUBST(LIBOIL_CFLAGS)
544 AC_SUBST(LIBOIL_LIBS)
546 ### JACK (optional) ####
548 AC_ARG_ENABLE([jack], 
549     AC_HELP_STRING([--disable-jack], [Disable optional JACK support]), 
550         [
551             case "${enableval}" in
552                 yes) jack=yes ;;
553                 no) jack=no ;;
554                 *) AC_MSG_ERROR(bad value ${enableval} for --disable-jack) ;;
555             esac
556         ],
557         [jack=auto])
559 if test "x${jack}" != xno ; then
560     PKG_CHECK_MODULES(JACK, [ jack >= 0.100 ],
561         HAVE_JACK=1,
562         [
563             HAVE_JACK=0
564             if test "x$jack" = xyes ; then
565                 AC_MSG_ERROR([*** JACK support not found])
566             fi
567         ])
568 else
569     HAVE_JACK=0
572 AC_SUBST(JACK_CFLAGS)
573 AC_SUBST(JACK_LIBS)
574 AC_SUBST(HAVE_JACK)
575 AM_CONDITIONAL([HAVE_JACK], [test "x$HAVE_JACK" = x1])
577 #### Async DNS support (optional) ####
579 AC_ARG_ENABLE([asyncns], 
580     AC_HELP_STRING([--disable-asyncns], [Disable optional Async DNS support]), 
581         [
582             case "${enableval}" in
583                 yes) asyncns=yes ;;
584                 no) asyncns=no ;;
585                 *) AC_MSG_ERROR(bad value ${enableval} for --disable-asyncns) ;;
586             esac
587         ],
588         [asyncns=auto])
590 if test "x${asyncns}" != xno ; then
591     PKG_CHECK_MODULES(LIBASYNCNS, [ libasyncns >= 0.1 ],
592         HAVE_LIBASYNCNS=1,
593         [
594             HAVE_LIBASYNCNS=0
595             if test "x$asyncns" = xyes ; then
596                 AC_MSG_ERROR([*** Async DNS support not found])
597             fi
598         ])
599 else
600     HAVE_LIBASYNCNS=0
603 AC_SUBST(LIBASYNCNS_CFLAGS)
604 AC_SUBST(LIBASYNCNS_LIBS)
605 AC_SUBST(HAVE_LIBASYNCNS)
606 AM_CONDITIONAL([HAVE_LIBASYNCNS], [test "x$HAVE_LIBASYNCNS" = x1])
608 if test "x$HAVE_LIBASYNCNS" != "x0" ; then
609    AC_DEFINE([HAVE_LIBASYNCNS], 1, [Have libasyncns?])
612 #### TCP wrappers (optional) ####
614 AC_ARG_ENABLE([tcpwrap], 
615     AC_HELP_STRING([--disable-tcpwrap], [Disable optional TCP wrappers support]), 
616         [
617             case "${enableval}" in
618                 yes) tcpwrap=yes ;;
619                 no) tcpwrap=no ;;
620                 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tcpwrap) ;;
621             esac
622         ],
623         [tcpwrap=auto])
625 if test "x${tcpwrap}" != xno ; then
626     ACX_LIBWRAP
627     if test "x${LIBWRAP_LIBS}" = x && test "x$tcpwrap" = xyes ; then
628         AC_MSG_ERROR([*** TCP wrappers support not found])
629     fi
630 else
631     LIBWRAP_LIBS=
634 AC_SUBST(LIBWRAP_LIBS)
636 #### LIRC support (optional) ####
638 AC_ARG_ENABLE([lirc], 
639     AC_HELP_STRING([--disable-lirc], [Disable optional LIRC support]), 
640         [
641             case "${enableval}" in
642                 yes) lirc=yes ;;
643                 no) lirc=no ;;
644                 *) AC_MSG_ERROR(bad value ${enableval} for --disable-lirc) ;;
645             esac
646         ],
647         [lirc=auto])
649 if test "x${lirc}" != xno ; then
650     ACX_LIRC
651     if test "x${HAVE_LIRC}" = x0 && test "x$lirc" = xyes ; then
652         AC_MSG_ERROR([*** LIRC support not found])
653     fi
654 else
655     HAVE_LIRC=0
658 AC_SUBST(LIRC_CFLAGS)
659 AC_SUBST(LIRC_LIBS)
660 AM_CONDITIONAL([HAVE_LIRC], [test "x$HAVE_LIRC" = x1])
662 #### HAL support (optional) ####
664 AC_ARG_ENABLE([hal], 
665     AC_HELP_STRING([--disable-hal], [Disable optional HAL support]), 
666         [
667             case "${enableval}" in
668                 yes) hal=yes ;;
669                 no) hal=no ;;
670                 *) AC_MSG_ERROR(bad value ${enableval} for --disable-hal) ;;
671             esac
672         ],
673         [hal=auto])
675 if test "x${hal}" != xno -a \( "x$HAVE_OSS" = "x1" -o "x$HAVE_ALSA" = "x1" \) ; then
676     PKG_CHECK_MODULES(HAL, [ hal >= 0.5.7 ],
677         HAVE_HAL=1,
678         [
679             HAVE_HAL=0
680             if test "x$hal" = xyes ; then
681                 AC_MSG_ERROR([*** HAL support not found])
682             fi
683         ])
684 else
685     HAVE_HAL=0
688 AC_SUBST(HAL_CFLAGS)
689 AC_SUBST(HAL_LIBS)
690 AC_SUBST(HAVE_HAL)
691 AM_CONDITIONAL([HAVE_HAL], [test "x$HAVE_HAL" = x1])
693 #### PulseAudio system group & user  #####
695 AC_ARG_WITH(system_user, AS_HELP_STRING([--with-system-user=<user>],[User for running the PulseAudio daemon as a system-wide instance (pulse)]))
696 if test -z "$with_system_user" ; then
697     PA_SYSTEM_USER=pulse
698 else
699     PA_SYSTEM_USER=$with_system_user
701 AC_SUBST(PA_SYSTEM_USER)
702 AC_DEFINE_UNQUOTED(PA_SYSTEM_USER,"$PA_SYSTEM_USER", [User for running the PulseAudio system daemon])
704 AC_ARG_WITH(system_group,AS_HELP_STRING([--with-system-group=<group>],[Group for running the PulseAudio daemon as a system-wide instance (pulse)]))
705 if test -z "$with_system_group" ; then
706     PA_SYSTEM_GROUP=pulse
707 else
708     PA_SYSTEM_GROUP=$with_system_group
710 AC_SUBST(PA_SYSTEM_GROUP)
711 AC_DEFINE_UNQUOTED(PA_SYSTEM_GROUP,"$PA_SYSTEM_GROUP", [Group for the PulseAudio system daemon])
713 AC_ARG_WITH(realtime_group,AS_HELP_STRING([--with-realtime-group=<group>],[Group for users that are allowed to start the PulseAudio daemon with realtime scheduling (realtime)]))
714 if test -z "$with_realtime_group" ; then
715     PA_REALTIME_GROUP=pulse-rt
716 else
717     PA_REALTIME_GROUP=$with_realtime_group
719 AC_SUBST(PA_REALTIME_GROUP)
720 AC_DEFINE_UNQUOTED(PA_REALTIME_GROUP,"$PA_REALTIME_GROUP", [Realtime group])
722 AC_ARG_WITH(access_group,AS_HELP_STRING([--with-access-group=<group>],[Group which is allowed access to a system-wide PulseAudio daemon (pulse-access)]))
723 if test -z "$with_access_group" ; then
724     PA_ACCESS_GROUP=pulse-access
725 else
726     PA_ACCESS_GROUP=$with_access_group
728 AC_SUBST(PA_ACCESS_GROUP)
729 AC_DEFINE_UNQUOTED(PA_ACCESS_GROUP,"$PA_ACCESS_GROUP", [Access group])
731 #### PulseAudio system runtime dir ####
732 PA_SYSTEM_RUNTIME_PATH="${localstatedir}/run/pulse"
733 AC_SUBST(PA_SYSTEM_RUNTIME_PATH)
735 ###################################
736 #            Output               #
737 ###################################
739 AC_ARG_ENABLE(
740         [static-bins],
741         AC_HELP_STRING([--enable-static-bins],[Statically link executables.]),
742         [STATIC_BINS=1], [STATIC_BINS=0])
743 AM_CONDITIONAL([STATIC_BINS], [test "x$STATIC_BINS" = "x1"])
745 AC_ARG_WITH(
746         [preopen-mods],
747         AC_HELP_STRING([--with-preopen-mods],[Modules to preopen in daemon (default: all).]),
748         [PREOPEN_MODS=$withval], [PREOPEN_MODS="all"])
749 AM_CONDITIONAL([PREOPEN_MODS], [test "x$PREOPEN_MODS" != "xall"])
750 if test "x$PREOPEN_MODS" != "xall" ; then
751     tmpLIBS=""
752     for mod in $PREOPEN_MODS; do
753         tmpLIBS="$tmpLIBS module-$mod.la"
754     done
755     PREOPEN_MODS="$tmpLIBS"
756     AC_SUBST(PREOPEN_MODS)
759 AC_ARG_WITH(
760         [module-dir],
761         AC_HELP_STRING([--with-module-dir],[Directory where to install the modules to (defaults to ${libdir}/pulse-${PA_MAJORMINOR}/modules/]),
762         [modlibexecdir=$withval], [modlibexecdir="${libdir}/pulse-${PA_MAJORMINOR}/modules/"])
764 AC_SUBST(modlibexecdir)
766 AC_ARG_ENABLE(
767         [force-preopen],
768         AC_HELP_STRING([--enable-force-preopen],[Preopen modules, even when dlopen() is supported.]),
769         [FORCE_PREOPEN=1], [FORCE_PREOPEN=0])
770 AM_CONDITIONAL([FORCE_PREOPEN], [test "x$FORCE_PREOPEN" = "x1"])
772 AC_CONFIG_FILES([
773 Makefile
774 src/Makefile
775 libpulse.pc
776 libpulse-simple.pc
777 libpulse-browse.pc
778 libpulse-mainloop-glib.pc
779 doxygen/Makefile
780 doxygen/doxygen.conf
781 src/pulse/version.h
783 AC_OUTPUT
785 # ==========================================================================
786 ENABLE_X11=no
787 if test "x$HAVE_X11" = "x1" ; then
788    ENABLE_X11=yes
791 ENABLE_OSS=no
792 if test "x$HAVE_OSS" = "x1" ; then
793    ENABLE_OSS=yes
796 ENABLE_ALSA=no
797 if test "x$HAVE_ALSA" = "x1" ; then
798    ENABLE_ALSA=yes
801 ENABLE_SOLARIS=no
802 if test "x$HAVE_SOLARIS" = "x1" ; then
803    ENABLE_SOLARIS=yes
806 ENABLE_GLIB20=no
807 if test "x$HAVE_GLIB20" = "x1" ; then
808    ENABLE_GLIB20=yes
811 ENABLE_GCONF=no
812 if test "x$HAVE_GCONF" = "x1" ; then
813    ENABLE_GCONF=yes
816 ENABLE_AVAHI=no
817 if test "x$HAVE_AVAHI" = "x1" ; then
818    ENABLE_AVAHI=yes
821 ENABLE_JACK=no
822 if test "x$HAVE_JACK" = "x1" ; then
823    ENABLE_JACK=yes
826 ENABLE_LIBASYNCNS=no
827 if test "x$HAVE_LIBASYNCNS" = "x1" ; then
828    ENABLE_LIBASYNCNS=yes
831 ENABLE_LIRC=no
832 if test "x$HAVE_LIRC" = "x1" ; then
833    ENABLE_LIRC=yes
836 ENABLE_HAL=no
837 if test "x$HAVE_HAL" = "x1" ; then
838    ENABLE_HAL=yes
841 ENABLE_TCPWRAP=no
842 if test "x${LIBWRAP_LIBS}" != x ; then
843    ENABLE_TCPWRAP=yes
846 echo "
847  ---{ $PACKAGE_NAME $VERSION }---
849     prefix:                 ${prefix}
850     sysconfdir:             ${sysconfdir}
851     localstatedir:          ${localstatedir}
852     System Runtime Path:    ${PA_SYSTEM_RUNTIME_PATH}
853     Compiler:               ${CC}
854     CFLAGS:                 ${CFLAGS}
855     Have X11:               ${ENABLE_X11}
856     Enable OSS:             ${ENABLE_OSS}
857     Enable Alsa:            ${ENABLE_ALSA}
858     Enable Solaris:         ${ENABLE_SOLARIS}
859     Enable GLib 2.0:        ${ENABLE_GLIB20}
860     Enable GConf:           ${ENABLE_GCONF}
861     Enable Avahi:           ${ENABLE_AVAHI}
862     Enable Jack:            ${ENABLE_JACK}
863     Enable Async DNS:       ${ENABLE_LIBASYNCNS}
864     Enable LIRC:            ${ENABLE_LIRC}
865     Enable HAL:             ${ENABLE_HAL}
866     Enable TCP Wrappers:    ${ENABLE_TCPWRAP}
867     System User:            ${PA_SYSTEM_USER}
868     System Group:           ${PA_SYSTEM_GROUP}
869     Realtime Group:         ${PA_REALTIME_GROUP}
870     Access Group:           ${PA_ACCESS_GROUP}