]> code.delx.au - pulseaudio/blob - configure.ac
actually define HAVE_LIBSAMPLERATE with AC_DEFINE
[pulseaudio] / 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 PulseAudio.
7 #
8 # Copyright 2004-2006 Lennart Poettering
9 # Copyright 2006-2007 Pierre Ossman <ossman@cendio.se> for Cendio AB
10 #
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.
15 #
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.
20 #
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.
24
25 AC_PREREQ(2.57)
26
27 m4_define(PA_MAJOR, [0])
28 m4_define(PA_MINOR, [9])
29 m4_define(PA_MICRO, [7])
30
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])
35
36 AC_SUBST(PA_MAJORMINOR, "PA_MAJOR.PA_MINOR")
37 AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/pulseaudio/])
38
39 AC_SUBST(PA_API_VERSION, 10)
40 AC_SUBST(PA_PROTOCOL_VERSION, 11)
41
42 AC_SUBST(LIBPULSE_VERSION_INFO, [3:0:3])
43 AC_SUBST(LIBPULSECORE_VERSION_INFO, [4: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])
47
48 AC_CANONICAL_HOST
49
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}"
53 fi
54
55 #### Platform hacks ####
56
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
64
65 #### Checks for programs. ####
66
67 # CC
68
69 AC_PROG_CC
70 AM_PROG_CC_C_O
71 AC_PROG_GCC_TRADITIONAL
72 AC_GNU_SOURCE
73
74 # M4
75
76 AC_PATH_PROG([M4], [m4 gm4], [no])
77 if test "x$M4" = xno ; then
78 AC_MSG_ERROR([m4 missing])
79 fi
80
81 # GCC flags
82
83 test_gcc_flag() {
84 AC_LANG_CONFTEST([int main() {}])
85 $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
86 ret=$?
87 rm -f conftest.o
88 return $ret
89 }
90
91 # If using GCC specify some additional parameters
92 if test "x$GCC" = "xyes" ; then
93
94 # We use gnu99 instead of c99 because many have interpreted the standard
95 # in a way that int64_t isn't defined on non-64 bit platforms.
96 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 -ffast-math"
97
98 for flag in $DESIRED_FLAGS ; do
99 AC_MSG_CHECKING([whether $CC accepts $flag])
100 if test_gcc_flag $flag ; then
101 CFLAGS="$CFLAGS $flag"
102 AC_MSG_RESULT([yes])
103 else
104 AC_MSG_RESULT([no])
105 fi
106 done
107 fi
108
109 #### libtool stuff ####
110
111 AC_LTDL_ENABLE_INSTALL
112 AC_LIBLTDL_INSTALLABLE
113 AC_LIBTOOL_DLOPEN
114 AC_LIBTOOL_WIN32_DLL
115 AC_PROG_LIBTOOL
116 AC_SUBST(LTDLINCL)
117 AC_SUBST(LIBLTDL)
118 AC_CONFIG_SUBDIRS(libltdl)
119
120 if test "x$enable_ltdl_install" = "xno" && test "x$ac_cv_lib_ltdl_lt_dlinit" = "xno" ; then
121 AC_MSG_ERROR([[
122
123 *** Cannot find the libltdl development files.
124 *** Maybe you need to install the libltdl-dev package.
125 ]])
126 fi
127
128 #### Determine build environment ####
129
130 os_is_win32=0
131
132 case "$host_os" in
133 mingw*)
134 AC_DEFINE([OS_IS_WIN32], 1, [Build target is Windows.])
135 os_is_win32=1
136 ;;
137 esac
138
139 AM_CONDITIONAL(OS_IS_WIN32, test "x$os_is_win32" = "x1")
140
141 ###################################
142 # Basic environment checks #
143 ###################################
144
145 #### Checks for header files. ####
146
147 # ISO
148 AC_HEADER_STDC
149
150 # POSIX
151 AC_CHECK_HEADERS([arpa/inet.h glob.h grp.h netdb.h netinet/in.h \
152 netinet/in_systm.h netinet/tcp.h pwd.h sched.h \
153 sys/mman.h sys/resource.h sys/select.h sys/socket.h sys/wait.h \
154 syslog.h])
155 AC_CHECK_HEADERS([netinet/ip.h], [], [],
156 [#include <sys/types.h>
157 #if HAVE_NETINET_IN_H
158 # include <netinet/in.h>
159 #endif
160 #if HAVE_NETINET_IN_SYSTM_H
161 # include <netinet/in_systm.h>
162 #endif
163 ])
164 AC_CHECK_HEADERS([regex.h], [HAVE_REGEX=1], [HAVE_REGEX=0])
165 AC_CHECK_HEADERS([sys/un.h], [HAVE_AF_UNIX=1], [HAVE_AF_UNIX=0])
166
167 AM_CONDITIONAL(HAVE_REGEX, test "x$HAVE_REGEX" = "x1")
168 AM_CONDITIONAL(HAVE_AF_UNIX, test "x$HAVE_AF_UNIX" = "x1")
169
170 # XPG4-UNIX
171 AC_CHECK_HEADERS([sys/poll.h])
172
173 # Linux
174 AC_CHECK_HEADERS([linux/input.h], [HAVE_EVDEV=1], [HAVE_EVDEV=0])
175
176 AM_CONDITIONAL([HAVE_EVDEV], [test "x$HAVE_EVDEV" = "x1"])
177
178 AC_CHECK_HEADERS([sys/prctl.h])
179
180 # Solaris
181 AC_CHECK_HEADERS([sys/filio.h])
182
183 # Windows
184 AC_CHECK_HEADERS([windows.h winsock2.h ws2tcpip.h])
185
186 # Other
187 AC_CHECK_HEADERS([sys/ioctl.h])
188
189 #### Typdefs, structures, etc. ####
190
191 AC_C_CONST
192 AC_C_BIGENDIAN
193 AC_TYPE_PID_T
194 AC_TYPE_SIZE_T
195 AC_CHECK_TYPES(ssize_t, , [AC_DEFINE([ssize_t], [signed long],
196 [Define ssize_t if it is not done by the standard libs.])])
197 AC_TYPE_OFF_T
198 AC_TYPE_SIGNAL
199 AC_TYPE_UID_T
200
201 AC_CHECK_DEFINE([SIGXCPU], [signal.h], [
202 HAVE_SIGXCPU=1
203 AC_DEFINE([HAVE_SIGXCPU], 1, [Have SIGXCPU?])
204 ], [HAVE_SIGXCPU=0])
205 AM_CONDITIONAL(HAVE_SIGXCPU, test "x$HAVE_SIGXCPU" = "x1")
206
207 # Solaris lacks this
208 AC_CHECK_DEFINE([INADDR_NONE], [netinet/in.h], [],
209 [AC_CHECK_DEFINE([INADDR_NONE], [winsock2.h], [],
210 [AC_DEFINE([INADDR_NONE], [0xffffffff], [Define INADDR_NONE if not found in <netinet/in.h>])])])
211
212 #### Check for libs ####
213
214 # ISO
215 AC_SEARCH_LIBS([pow], [m])
216
217 # POSIX
218 AC_SEARCH_LIBS([sched_setscheduler], [rt])
219 AC_SEARCH_LIBS([dlopen], [dl])
220 AC_SEARCH_LIBS([shm_open], [rt])
221
222 # BSD
223 AC_SEARCH_LIBS([connect], [socket])
224
225 # Non-standard
226
227 # This magic is needed so we do not needlessly add static libs to the win32
228 # build, disabling its ability to make dlls.
229 AC_CHECK_FUNCS([getopt_long], [], [AC_CHECK_LIB([iberty], [getopt_long])])
230
231 #### Check for functions ####
232
233 # POSIX
234 AC_FUNC_FORK
235 AC_FUNC_GETGROUPS
236 AC_FUNC_SELECT_ARGTYPES
237 AC_CHECK_FUNCS([chmod chown getaddrinfo getgrgid_r getpwuid_r gettimeofday \
238 getuid inet_ntop inet_pton nanosleep pipe posix_memalign setpgid setsid \
239 shm_open sigaction sleep sysconf])
240 AC_CHECK_FUNCS([mkfifo], [HAVE_MKFIFO=1], [HAVE_MKFIFO=0])
241
242 AM_CONDITIONAL(HAVE_MKFIFO, test "x$HAVE_MKFIFO" = "x1")
243
244 # X/OPEN
245 AC_CHECK_FUNCS([readlink])
246
247 # SUSv2
248 AC_CHECK_FUNCS([ctime_r usleep])
249
250 # SUSv3
251 AC_CHECK_FUNCS([strerror_r])
252
253 # BSD
254 AC_CHECK_FUNCS([lstat])
255
256 # Non-standard
257
258 AC_CHECK_FUNCS([setresuid setresgid setreuid setregid seteuid setegid ppoll])
259
260 #### POSIX threads ####
261
262 ACX_PTHREAD
263
264 #### Large File-Support (LFS) ####
265
266 AC_SYS_LARGEFILE
267
268 # Check for open64 to know if the current system does have open64() and similar functions
269 AC_CHECK_FUNCS([open64])
270
271 #### [lib]iconv ####
272
273 AM_ICONV
274
275 ###################################
276 # External libraries #
277 ###################################
278
279 #### X11 (optional) ####
280
281 HAVE_X11=0
282
283 # The macro tests the host, not the build target
284 if test "x$os_is_win32" != "x1" ; then
285 AC_PATH_XTRA
286 test "x$no_x" != "xyes" && HAVE_X11=1
287 fi
288
289 AC_SUBST(HAVE_X11)
290 AM_CONDITIONAL(HAVE_X11, test "x$HAVE_X11" = "x1")
291 if test "x$HAVE_X11" = "x1" ; then
292 AC_DEFINE([HAVE_X11], 1, [Have X11])
293 fi
294
295 #### Capabilities (optional) ####
296
297 CAP_LIBS=''
298
299 AC_ARG_WITH(
300 [caps],
301 AC_HELP_STRING([--without-caps],[Omit support for POSIX capabilities.]))
302
303 if test "x${with_caps}" != "xno"; then
304 AC_SEARCH_LIBS([cap_init], [cap], [], [
305 if test "x${with_caps}" = "xyes" ; then
306 AC_MSG_ERROR([*** POSIX caps libraries not found])
307 fi])
308 AC_CHECK_HEADERS([sys/capability.h], [], [
309 if test "x${with_caps}" = "xyes" ; then
310 AC_MSG_ERROR([*** POSIX caps headers not found])
311 fi])
312 fi
313
314 #### pkg-config ####
315
316 # Check for pkg-config manually first, as if its not installed the
317 # PKG_PROG_PKG_CONFIG macro won't be defined.
318 AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
319
320 if test x"$have_pkg_config" = "xno"; then
321 AC_MSG_ERROR(pkg-config is required to install this program)
322 fi
323
324 PKG_PROG_PKG_CONFIG
325
326 #### Sound file ####
327
328 PKG_CHECK_MODULES(LIBSNDFILE, [ sndfile >= 1.0.10 ])
329 AC_SUBST(LIBSNDFILE_CFLAGS)
330 AC_SUBST(LIBSNDFILE_LIBS)
331
332 #### atomic-ops ###
333
334 AC_CHECK_HEADERS([atomic_ops.h], [], [
335 AC_MSG_ERROR([*** libatomic-ops headers not found])
336 ])
337
338 # Win32 does not need the lib and breaks horribly if we try to include it
339 if test "x$os_is_win32" != "x1" ; then
340 LIBS="$LIBS -latomic_ops"
341 fi
342
343 #### Libsamplerate support (optional) ####
344
345 AC_ARG_ENABLE([samplerate],
346 AC_HELP_STRING([--disable-samplerate], [Disable optional libsamplerate support]),
347 [
348 case "${enableval}" in
349 yes) samplerate=yes ;;
350 no) samplerate=no ;;
351 *) AC_MSG_ERROR(bad value ${enableval} for --disable-samplerate) ;;
352 esac
353 ],
354 [samplerate=auto])
355
356 if test "x${samplerate}" != xno ; then
357 PKG_CHECK_MODULES(LIBSAMPLERATE, [ samplerate >= 0.1.0 ],
358 HAVE_LIBSAMPLERATE=1,
359 [
360 HAVE_LIBSAMPLERATE=0
361 if test "x$samplerate" = xyes ; then
362 AC_MSG_ERROR([*** Libsamplerate not found])
363 fi
364 ])
365 else
366 HAVE_LIBSAMPLERATE=0
367 fi
368
369 if test "x${HAVE_LIBSAMPLERATE}" = x1 ; then
370 AC_DEFINE([HAVE_LIBSAMPLERATE], 1, [Have libsamplerate?])
371 fi
372
373 AC_SUBST(LIBSAMPLERATE_CFLAGS)
374 AC_SUBST(LIBSAMPLERATE_LIBS)
375 AC_SUBST(HAVE_LIBSAMPLERATE)
376 AM_CONDITIONAL([HAVE_LIBSAMPLERATE], [test "x$HAVE_LIBSAMPLERATE" = x1])
377
378 #### OSS support (optional) ####
379
380 AC_ARG_ENABLE([oss],
381 AC_HELP_STRING([--disable-oss], [Disable optional OSS support]),
382 [
383 case "${enableval}" in
384 yes) oss=yes ;;
385 no) oss=no ;;
386 *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;;
387 esac
388 ],
389 [oss=auto])
390
391 if test "x${oss}" != xno ; then
392 AC_CHECK_HEADERS([sys/soundcard.h],
393 [
394 HAVE_OSS=1
395 AC_DEFINE([HAVE_OSS], 1, [Have OSS?])
396 ],
397 [
398 HAVE_OSS=0
399 if test "x$oss" = xyes ; then
400 AC_MSG_ERROR([*** OSS support not found])
401 fi
402 ])
403 else
404 HAVE_OSS=0
405 fi
406
407 AC_SUBST(HAVE_OSS)
408 AM_CONDITIONAL([HAVE_OSS], [test "x$HAVE_OSS" = x1])
409
410
411 #### ALSA support (optional) ####
412
413 AC_ARG_ENABLE([alsa],
414 AC_HELP_STRING([--disable-alsa], [Disable optional ALSA support]),
415 [
416 case "${enableval}" in
417 yes) alsa=yes ;;
418 no) alsa=no ;;
419 *) AC_MSG_ERROR(bad value ${enableval} for --disable-alsa) ;;
420 esac
421 ],
422 [alsa=auto])
423
424 if test "x${alsa}" != xno ; then
425 PKG_CHECK_MODULES(ASOUNDLIB, [ alsa >= 1.0.0 ],
426 [
427 HAVE_ALSA=1
428 AC_DEFINE([HAVE_ALSA], 1, [Have ALSA?])
429 ],
430 [
431 HAVE_ALSA=0
432 if test "x$alsa" = xyes ; then
433 AC_MSG_ERROR([*** ALSA support not found])
434 fi
435 ])
436 else
437 HAVE_ALSA=0
438 fi
439
440 AC_SUBST(ASOUNDLIB_CFLAGS)
441 AC_SUBST(ASOUNDLIB_LIBS)
442 AC_SUBST(HAVE_ALSA)
443 AM_CONDITIONAL([HAVE_ALSA], [test "x$HAVE_ALSA" = x1])
444
445 #### Solaris audio support (optional) ####
446
447 AC_ARG_ENABLE([solaris],
448 AC_HELP_STRING([--disable-solaris], [Disable optional Solaris audio support]),
449 [
450 case "${enableval}" in
451 yes) solaris=yes ;;
452 no) solaris=no ;;
453 *) AC_MSG_ERROR(bad value ${enableval} for --disable-solaris) ;;
454 esac
455 ],
456 [solaris=auto])
457
458 if test "x${solaris}" != xno ; then
459 AC_CHECK_HEADERS([sys/audio.h],
460 [
461 HAVE_SOLARIS=1
462 AC_DEFINE([HAVE_SOLARIS], 1, [Have Solaris audio?])
463 ],
464 [
465 HAVE_SOLARIS=0
466 if test "x$solaris" = xyes ; then
467 AC_MSG_ERROR([*** Solaris audio support not found])
468 fi
469 ])
470 else
471 HAVE_SOLARIS=0
472 fi
473
474 AC_SUBST(HAVE_SOLARIS)
475 AM_CONDITIONAL([HAVE_SOLARIS], [test "x$HAVE_SOLARIS" = x1])
476
477 #### GLib 2 support (optional) ####
478
479 AC_ARG_ENABLE([glib2],
480 AC_HELP_STRING([--disable-glib2], [Disable optional GLib 2 support]),
481 [
482 case "${enableval}" in
483 yes) glib2=yes ;;
484 no) glib2=no ;;
485 *) AC_MSG_ERROR(bad value ${enableval} for --disable-glib2) ;;
486 esac
487 ],
488 [glib2=auto])
489
490 if test "x${glib2}" != xno ; then
491 PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ],
492 HAVE_GLIB20=1,
493 [
494 HAVE_GLIB20=0
495 if test "x$glib2" = xyes ; then
496 AC_MSG_ERROR([*** GLib 2 support not found])
497 fi
498 ])
499 else
500 HAVE_GLIB20=0
501 fi
502
503 AC_SUBST(GLIB20_CFLAGS)
504 AC_SUBST(GLIB20_LIBS)
505 AC_SUBST(HAVE_GLIB20)
506 AM_CONDITIONAL([HAVE_GLIB20], [test "x$HAVE_GLIB20" = x1])
507
508 #### GConf support (optional) ####
509
510 AC_ARG_ENABLE([gconf],
511 AC_HELP_STRING([--disable-gconf], [Disable optional GConf support]),
512 [
513 case "${enableval}" in
514 yes) gconf=yes ;;
515 no) gconf=no ;;
516 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gconf) ;;
517 esac
518 ],
519 [glib=auto])
520
521 if test "x${gconf}" != xno ; then
522 PKG_CHECK_MODULES(GCONF, [ gconf-2.0 >= 2.4.0 ],
523 HAVE_GCONF=1,
524 [
525 HAVE_GCONF=0
526 if test "x$gconf" = xyes ; then
527 AC_MSG_ERROR([*** GConf support not found])
528 fi
529 ])
530 else
531 HAVE_GCONF=0
532 fi
533
534 AC_SUBST(GCONF_CFLAGS)
535 AC_SUBST(GCONF_LIBS)
536 AC_SUBST(HAVE_GCONF)
537 AM_CONDITIONAL([HAVE_GCONF], [test "x$HAVE_GCONF" = x1])
538
539 #### Avahi support (optional) ####
540
541 AC_ARG_ENABLE([avahi],
542 AC_HELP_STRING([--disable-avahi], [Disable optional Avahi support]),
543 [
544 case "${enableval}" in
545 yes) avahi=yes ;;
546 no) avahi=no ;;
547 *) AC_MSG_ERROR(bad value ${enableval} for --disable-avahi) ;;
548 esac
549 ],
550 [avahi=auto])
551
552 if test "x${avahi}" != xno ; then
553 PKG_CHECK_MODULES(AVAHI, [ avahi-client >= 0.6.0 ],
554 HAVE_AVAHI=1,
555 [
556 HAVE_AVAHI=0
557 if test "x$avahi" = xyes ; then
558 AC_MSG_ERROR([*** Avahi support not found])
559 fi
560 ])
561 else
562 HAVE_AVAHI=0
563 fi
564
565 AC_SUBST(AVAHI_CFLAGS)
566 AC_SUBST(AVAHI_LIBS)
567 AC_SUBST(HAVE_AVAHI)
568 AM_CONDITIONAL([HAVE_AVAHI], [test "x$HAVE_AVAHI" = x1])
569
570 ### LIBOIL ####
571
572 PKG_CHECK_MODULES(LIBOIL, [ liboil-0.3 >= 0.3.0 ])
573 AC_SUBST(LIBOIL_CFLAGS)
574 AC_SUBST(LIBOIL_LIBS)
575
576 ### JACK (optional) ####
577
578 AC_ARG_ENABLE([jack],
579 AC_HELP_STRING([--disable-jack], [Disable optional JACK support]),
580 [
581 case "${enableval}" in
582 yes) jack=yes ;;
583 no) jack=no ;;
584 *) AC_MSG_ERROR(bad value ${enableval} for --disable-jack) ;;
585 esac
586 ],
587 [jack=auto])
588
589 if test "x${jack}" != xno ; then
590 PKG_CHECK_MODULES(JACK, [ jack >= 0.100 ],
591 HAVE_JACK=1,
592 [
593 HAVE_JACK=0
594 if test "x$jack" = xyes ; then
595 AC_MSG_ERROR([*** JACK support not found])
596 fi
597 ])
598 else
599 HAVE_JACK=0
600 fi
601
602 AC_SUBST(JACK_CFLAGS)
603 AC_SUBST(JACK_LIBS)
604 AC_SUBST(HAVE_JACK)
605 AM_CONDITIONAL([HAVE_JACK], [test "x$HAVE_JACK" = x1])
606
607 #### Async DNS support (optional) ####
608
609 AC_ARG_ENABLE([asyncns],
610 AC_HELP_STRING([--disable-asyncns], [Disable optional Async DNS support]),
611 [
612 case "${enableval}" in
613 yes) asyncns=yes ;;
614 no) asyncns=no ;;
615 *) AC_MSG_ERROR(bad value ${enableval} for --disable-asyncns) ;;
616 esac
617 ],
618 [asyncns=auto])
619
620 if test "x${asyncns}" != xno ; then
621 PKG_CHECK_MODULES(LIBASYNCNS, [ libasyncns >= 0.1 ],
622 HAVE_LIBASYNCNS=1,
623 [
624 HAVE_LIBASYNCNS=0
625 if test "x$asyncns" = xyes ; then
626 AC_MSG_ERROR([*** Async DNS support not found])
627 fi
628 ])
629 else
630 HAVE_LIBASYNCNS=0
631 fi
632
633 AC_SUBST(LIBASYNCNS_CFLAGS)
634 AC_SUBST(LIBASYNCNS_LIBS)
635 AC_SUBST(HAVE_LIBASYNCNS)
636 AM_CONDITIONAL([HAVE_LIBASYNCNS], [test "x$HAVE_LIBASYNCNS" = x1])
637
638 if test "x$HAVE_LIBASYNCNS" != "x0" ; then
639 AC_DEFINE([HAVE_LIBASYNCNS], 1, [Have libasyncns?])
640 fi
641
642 #### TCP wrappers (optional) ####
643
644 AC_ARG_ENABLE([tcpwrap],
645 AC_HELP_STRING([--disable-tcpwrap], [Disable optional TCP wrappers support]),
646 [
647 case "${enableval}" in
648 yes) tcpwrap=yes ;;
649 no) tcpwrap=no ;;
650 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tcpwrap) ;;
651 esac
652 ],
653 [tcpwrap=auto])
654
655 if test "x${tcpwrap}" != xno ; then
656 ACX_LIBWRAP
657 if test "x${LIBWRAP_LIBS}" = x && test "x$tcpwrap" = xyes ; then
658 AC_MSG_ERROR([*** TCP wrappers support not found])
659 fi
660 else
661 LIBWRAP_LIBS=
662 fi
663
664 AC_SUBST(LIBWRAP_LIBS)
665
666 #### LIRC support (optional) ####
667
668 AC_ARG_ENABLE([lirc],
669 AC_HELP_STRING([--disable-lirc], [Disable optional LIRC support]),
670 [
671 case "${enableval}" in
672 yes) lirc=yes ;;
673 no) lirc=no ;;
674 *) AC_MSG_ERROR(bad value ${enableval} for --disable-lirc) ;;
675 esac
676 ],
677 [lirc=auto])
678
679 if test "x${lirc}" != xno ; then
680 ACX_LIRC
681 if test "x${HAVE_LIRC}" = x0 && test "x$lirc" = xyes ; then
682 AC_MSG_ERROR([*** LIRC support not found])
683 fi
684 else
685 HAVE_LIRC=0
686 fi
687
688 AC_SUBST(LIRC_CFLAGS)
689 AC_SUBST(LIRC_LIBS)
690 AM_CONDITIONAL([HAVE_LIRC], [test "x$HAVE_LIRC" = x1])
691
692 #### HAL support (optional) ####
693
694 AC_ARG_ENABLE([hal],
695 AC_HELP_STRING([--disable-hal], [Disable optional HAL support]),
696 [
697 case "${enableval}" in
698 yes) hal=yes ;;
699 no) hal=no ;;
700 *) AC_MSG_ERROR(bad value ${enableval} for --disable-hal) ;;
701 esac
702 ],
703 [hal=auto])
704
705 if test "x${hal}" != xno -a \( "x$HAVE_OSS" = "x1" -o "x$HAVE_ALSA" = "x1" \) ; then
706 PKG_CHECK_MODULES(HAL, [ hal >= 0.5.7 ],
707 HAVE_HAL=1,
708 [
709 HAVE_HAL=0
710 if test "x$hal" = xyes ; then
711 AC_MSG_ERROR([*** HAL support not found])
712 fi
713 ])
714 else
715 HAVE_HAL=0
716 fi
717
718 AC_SUBST(HAL_CFLAGS)
719 AC_SUBST(HAL_LIBS)
720 AC_SUBST(HAVE_HAL)
721 AM_CONDITIONAL([HAVE_HAL], [test "x$HAVE_HAL" = x1])
722
723 #### PulseAudio system group & user #####
724
725 AC_ARG_WITH(system_user, AS_HELP_STRING([--with-system-user=<user>],[User for running the PulseAudio daemon as a system-wide instance (pulse)]))
726 if test -z "$with_system_user" ; then
727 PA_SYSTEM_USER=pulse
728 else
729 PA_SYSTEM_USER=$with_system_user
730 fi
731 AC_SUBST(PA_SYSTEM_USER)
732 AC_DEFINE_UNQUOTED(PA_SYSTEM_USER,"$PA_SYSTEM_USER", [User for running the PulseAudio system daemon])
733
734 AC_ARG_WITH(system_group,AS_HELP_STRING([--with-system-group=<group>],[Group for running the PulseAudio daemon as a system-wide instance (pulse)]))
735 if test -z "$with_system_group" ; then
736 PA_SYSTEM_GROUP=pulse
737 else
738 PA_SYSTEM_GROUP=$with_system_group
739 fi
740 AC_SUBST(PA_SYSTEM_GROUP)
741 AC_DEFINE_UNQUOTED(PA_SYSTEM_GROUP,"$PA_SYSTEM_GROUP", [Group for the PulseAudio system daemon])
742
743 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)]))
744 if test -z "$with_realtime_group" ; then
745 PA_REALTIME_GROUP=pulse-rt
746 else
747 PA_REALTIME_GROUP=$with_realtime_group
748 fi
749 AC_SUBST(PA_REALTIME_GROUP)
750 AC_DEFINE_UNQUOTED(PA_REALTIME_GROUP,"$PA_REALTIME_GROUP", [Realtime group])
751
752 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)]))
753 if test -z "$with_access_group" ; then
754 PA_ACCESS_GROUP=pulse-access
755 else
756 PA_ACCESS_GROUP=$with_access_group
757 fi
758 AC_SUBST(PA_ACCESS_GROUP)
759 AC_DEFINE_UNQUOTED(PA_ACCESS_GROUP,"$PA_ACCESS_GROUP", [Access group])
760
761 #### PulseAudio system runtime dir ####
762 PA_SYSTEM_RUNTIME_PATH="${localstatedir}/run/pulse"
763 AC_SUBST(PA_SYSTEM_RUNTIME_PATH)
764
765 ###################################
766 # Output #
767 ###################################
768
769 AC_ARG_ENABLE(
770 [static-bins],
771 AC_HELP_STRING([--enable-static-bins],[Statically link executables.]),
772 [STATIC_BINS=1], [STATIC_BINS=0])
773 AM_CONDITIONAL([STATIC_BINS], [test "x$STATIC_BINS" = "x1"])
774
775 AC_ARG_WITH(
776 [preopen-mods],
777 AC_HELP_STRING([--with-preopen-mods],[Modules to preopen in daemon (default: all).]),
778 [PREOPEN_MODS=$withval], [PREOPEN_MODS="all"])
779 AM_CONDITIONAL([PREOPEN_MODS], [test "x$PREOPEN_MODS" != "xall"])
780 if test "x$PREOPEN_MODS" != "xall" ; then
781 tmpLIBS=""
782 for mod in $PREOPEN_MODS; do
783 tmpLIBS="$tmpLIBS module-$mod.la"
784 done
785 PREOPEN_MODS="$tmpLIBS"
786 AC_SUBST(PREOPEN_MODS)
787 fi
788
789 AC_ARG_WITH(
790 [module-dir],
791 AC_HELP_STRING([--with-module-dir],[Directory where to install the modules to (defaults to ${libdir}/pulse-${PA_MAJORMINOR}/modules/]),
792 [modlibexecdir=$withval], [modlibexecdir="${libdir}/pulse-${PA_MAJORMINOR}/modules/"])
793
794 AC_SUBST(modlibexecdir)
795
796 AC_ARG_ENABLE(
797 [force-preopen],
798 AC_HELP_STRING([--enable-force-preopen],[Preopen modules, even when dlopen() is supported.]),
799 [FORCE_PREOPEN=1], [FORCE_PREOPEN=0])
800 AM_CONDITIONAL([FORCE_PREOPEN], [test "x$FORCE_PREOPEN" = "x1"])
801
802 AC_CONFIG_FILES([
803 Makefile
804 src/Makefile
805 libpulse.pc
806 libpulse-simple.pc
807 libpulse-browse.pc
808 libpulse-mainloop-glib.pc
809 doxygen/Makefile
810 doxygen/doxygen.conf
811 src/pulse/version.h
812 ])
813 AC_OUTPUT
814
815 # ==========================================================================
816 ENABLE_X11=no
817 if test "x$HAVE_X11" = "x1" ; then
818 ENABLE_X11=yes
819 fi
820
821 ENABLE_OSS=no
822 if test "x$HAVE_OSS" = "x1" ; then
823 ENABLE_OSS=yes
824 fi
825
826 ENABLE_ALSA=no
827 if test "x$HAVE_ALSA" = "x1" ; then
828 ENABLE_ALSA=yes
829 fi
830
831 ENABLE_SOLARIS=no
832 if test "x$HAVE_SOLARIS" = "x1" ; then
833 ENABLE_SOLARIS=yes
834 fi
835
836 ENABLE_GLIB20=no
837 if test "x$HAVE_GLIB20" = "x1" ; then
838 ENABLE_GLIB20=yes
839 fi
840
841 ENABLE_GCONF=no
842 if test "x$HAVE_GCONF" = "x1" ; then
843 ENABLE_GCONF=yes
844 fi
845
846 ENABLE_AVAHI=no
847 if test "x$HAVE_AVAHI" = "x1" ; then
848 ENABLE_AVAHI=yes
849 fi
850
851 ENABLE_JACK=no
852 if test "x$HAVE_JACK" = "x1" ; then
853 ENABLE_JACK=yes
854 fi
855
856 ENABLE_LIBASYNCNS=no
857 if test "x$HAVE_LIBASYNCNS" = "x1" ; then
858 ENABLE_LIBASYNCNS=yes
859 fi
860
861 ENABLE_LIRC=no
862 if test "x$HAVE_LIRC" = "x1" ; then
863 ENABLE_LIRC=yes
864 fi
865
866 ENABLE_HAL=no
867 if test "x$HAVE_HAL" = "x1" ; then
868 ENABLE_HAL=yes
869 fi
870
871 ENABLE_TCPWRAP=no
872 if test "x${LIBWRAP_LIBS}" != x ; then
873 ENABLE_TCPWRAP=yes
874 fi
875
876 ENABLE_LIBSAMPLERATE=no
877 if test "x${HAVE_LIBSAMPLERATE}" = "x1" ; then
878 ENABLE_LIBSAMPLERATE=yes
879 fi
880
881 echo "
882 ---{ $PACKAGE_NAME $VERSION }---
883
884 prefix: ${prefix}
885 sysconfdir: ${sysconfdir}
886 localstatedir: ${localstatedir}
887 System Runtime Path: ${PA_SYSTEM_RUNTIME_PATH}
888 Compiler: ${CC}
889 CFLAGS: ${CFLAGS}
890 Have X11: ${ENABLE_X11}
891 Enable OSS: ${ENABLE_OSS}
892 Enable Alsa: ${ENABLE_ALSA}
893 Enable Solaris: ${ENABLE_SOLARIS}
894 Enable GLib 2.0: ${ENABLE_GLIB20}
895 Enable GConf: ${ENABLE_GCONF}
896 Enable Avahi: ${ENABLE_AVAHI}
897 Enable Jack: ${ENABLE_JACK}
898 Enable Async DNS: ${ENABLE_LIBASYNCNS}
899 Enable LIRC: ${ENABLE_LIRC}
900 Enable HAL: ${ENABLE_HAL}
901 Enable TCP Wrappers: ${ENABLE_TCPWRAP}
902 Enable libsamplerate: ${ENABLE_LIBSAMPLERATE}
903 System User: ${PA_SYSTEM_USER}
904 System Group: ${PA_SYSTEM_GROUP}
905 Realtime Group: ${PA_REALTIME_GROUP}
906 Access Group: ${PA_ACCESS_GROUP}
907 "