]> code.delx.au - pulseaudio/blob - configure.ac
9c96d1c5b5f8058addcb7d60501cc582eab331fc
[pulseaudio] / configure.ac
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 # This file is part of PulseAudio.
5 #
6 # Copyright 2004-2008 Lennart Poettering
7 # Copyright 2006-2007 Pierre Ossman <ossman@cendio.se> for Cendio AB
8 #
9 # PulseAudio is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU Lesser General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
13 #
14 # PulseAudio is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
18 #
19 # You should have received a copy of the GNU Lesser General Public License
20 # along with PulseAudio; if not, write to the Free Software Foundation,
21 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
22
23 AC_PREREQ(2.63)
24
25 AC_INIT([pulseaudio], m4_esyscmd([./git-version-gen .tarball-version]),
26 [mzchyfrnhqvb (at) 0pointer (dot) net])
27 AC_CONFIG_SRCDIR([src/daemon/main.c])
28 AC_CONFIG_MACRO_DIR([m4])
29 AC_CONFIG_HEADERS([config.h])
30 AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax])
31
32 m4_define(pa_major, `echo $VERSION | cut -d. -f1 | cut -d- -f1`)
33 m4_define(pa_minor, `echo $VERSION | cut -d. -f2 | cut -d- -f1`)
34 m4_define(pa_micro, `echo $VERSION | cut -d. -f3 | cut -d- -f1`)
35
36 AC_SUBST(PA_MAJOR, pa_major)
37 AC_SUBST(PA_MINOR, pa_minor)
38 AC_SUBST(PA_MICRO, pa_micro)
39 AC_SUBST(PA_MAJORMINOR, pa_major.pa_minor)
40 AC_SUBST(PA_MAJORMINORMICRO, pa_major.pa_minor.pa_micro)
41 AC_SUBST(PACKAGE_URL, [http://pulseaudio.org/])
42
43 AC_SUBST(PA_API_VERSION, 12)
44 AC_SUBST(PA_PROTOCOL_VERSION, 16)
45
46 # The stable ABI for client applications, for the version info x:y:z
47 # always will hold y=z
48 AC_SUBST(LIBPULSE_VERSION_INFO, [8:0:8])
49
50 # A simplified, synchronous, ABI-stable interface for client
51 # applications, for the version info x:y:z always will hold y=z
52 AC_SUBST(LIBPULSE_SIMPLE_VERSION_INFO, [0:2:0])
53
54 # The ABI-stable network browsing interface for client applications,
55 # for the version info x:y:z always will hold y=z
56 AC_SUBST(LIBPULSE_BROWSE_VERSION_INFO, [1:1:1])
57
58 # The ABI-stable GLib adapter for client applications, for the version
59 # info x:y:z always will hold y=z
60 AC_SUBST(LIBPULSE_MAINLOOP_GLIB_VERSION_INFO, [0:4:0])
61
62 AC_CANONICAL_HOST
63 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
64
65 if type -p stow > /dev/null && test -d /usr/local/stow ; then
66 AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
67 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
68 fi
69
70 #### Platform hacks ####
71
72 case $host in
73 *-*-solaris* )
74 AC_DEFINE(_XOPEN_SOURCE, 600, Needed to get declarations for msg_control and msg_controllen on Solaris)
75 AC_DEFINE(__EXTENSIONS__, 1, Needed to get declarations for msg_control and msg_controllen on Solaris)
76 ;;
77 esac
78
79 AM_SILENT_RULES([yes])
80
81 #### Checks for programs. ####
82
83 # mkdir -p
84
85 AC_PROG_MKDIR_P
86
87 # CC
88
89 AC_PROG_CC
90 AC_PROG_CC_C99
91 AM_PROG_CC_C_O
92 AC_PROG_GCC_TRADITIONAL
93 AC_USE_SYSTEM_EXTENSIONS
94
95 # M4
96
97 AC_CHECK_PROGS([M4], gm4 m4, no)
98 if test "x$M4" = xno ; then
99 AC_MSG_ERROR([m4 missing])
100 fi
101
102 dnl Compiler flags
103 CC_CHECK_CFLAGS_APPEND([-Wall -W -Wextra -pipe -Wno-long-long -Winline -Wvla -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option])
104
105 dnl Linker flags.
106 dnl Check whether the linker supports the -version-script option.
107
108 dnl This variable is used to make sure ${srcdir} is expanded and not
109 dnl passed to the CC_CHECK_LDFLAGS macro as a name.
110 tmp_ldflag="-Wl,-version-script=${srcdir}/src/map-file"
111
112 CC_CHECK_LDFLAGS([${tmp_ldflag}],
113 [VERSIONING_LDFLAGS='-Wl,-version-script=$(srcdir)/map-file'])
114 AC_SUBST([VERSIONING_LDFLAGS])
115
116 dnl Check for the proper way to build libraries that have no undefined
117 dnl symbols; on some hosts this needs to be avoided but the macro
118 dnl takes care of it.
119 CC_NOUNDEFINED
120
121 dnl Check whether to build tests by default (as compile-test) or not
122 AC_ARG_ENABLE([default-build-tests],
123 AS_HELP_STRING([--disable-default-build-tests], [Build test programs only during make check]))
124
125 AM_CONDITIONAL([BUILD_TESTS_DEFAULT], [test "x$enable_default_build_tests" != "xno"])
126
127 # Native atomic operation support
128 AC_ARG_ENABLE([atomic-arm-linux-helpers],
129 AS_HELP_STRING([--disable-atomic-arm-linux-helpers],[use inline asm or libatomic_ops instead]),
130 [
131 case "${enableval}" in
132 yes) atomic_arm_linux_helpers=yes ;;
133 no) atomic_arm_linux_helpers=no ;;
134 *) AC_MSG_ERROR(bad value ${enableval} for --disable-atomic-arm-linux-helpers) ;;
135 esac
136 ],
137 [atomic_arm_linux_helpers=auto])
138
139 AC_ARG_ENABLE([atomic-arm-memory-barrier],
140 AS_HELP_STRING([--enable-atomic-arm-memory-barrier],[only really needed in SMP arm systems]),
141 [
142 case "${enableval}" in
143 yes) AC_DEFINE_UNQUOTED(ATOMIC_ARM_MEMORY_BARRIER_ENABLED, 1, [Enable memory barriers]) ;;
144 no) ;;
145 *) AC_MSG_ERROR(bad value ${enableval} for --disable-atomic-arm-linux-helpers) ;;
146 esac
147 ],)
148
149 AC_ARG_ENABLE([netbsd-atomic-ops],
150 AS_HELP_STRING([--enable-netbsd-atomic-ops],[Use the native NetBSD atomic_ops implementation]),
151 [
152 case "${enableval}" in
153 yes) atomic_netbsd_helpers=yes ;;
154 no) atomic_netbsd_helpers=no ;;
155 *) AC_MSG_ERROR(bad value ${enableval} for --enable-netbsd-atomic-ops) ;;
156 esac
157 ],
158 [atomic_netbsd_helpers=auto])
159
160 AC_MSG_CHECKING([target operating system])
161 case $host in
162 *-*-linux*)
163 AC_MSG_RESULT([linux])
164 pulse_target_os=linux
165 ;;
166 *-*-netbsd*)
167 AC_MSG_RESULT([netbsd])
168 pulse_target_os=netbsd
169 ;;
170 *)
171 AC_MSG_RESULT([unknown])
172 pulse_target_os=unknown
173 ;;
174 esac
175
176 # If everything else fails use libatomic_ops
177 need_libatomic_ops=yes
178
179 AC_CACHE_CHECK([whether $CC knows __sync_bool_compare_and_swap()],
180 pulseaudio_cv_sync_bool_compare_and_swap,
181 [AC_LINK_IFELSE(
182 AC_LANG_PROGRAM([], [[int a = 4; __sync_bool_compare_and_swap(&a, 4, 5);]]),
183 [pulseaudio_cv_sync_bool_compare_and_swap=yes],
184 [pulseaudio_cv_sync_bool_compare_and_swap=no])
185 ])
186
187 if test "$pulseaudio_cv_sync_bool_compare_and_swap" = "yes" ; then
188 AC_DEFINE([HAVE_ATOMIC_BUILTINS], 1, [Have __sync_bool_compare_and_swap() and friends.])
189 need_libatomic_ops=no
190 else
191 # HW specific atomic ops stuff
192 AC_MSG_CHECKING([architecture for native atomic operations])
193 case $host_cpu in
194 arm*)
195 AC_MSG_RESULT([arm])
196 AC_MSG_CHECKING([whether we can use Linux kernel helpers])
197 # The Linux kernel helper functions have been there since 2.6.16. However
198 # compile time checking for kernel version in cross compile environment
199 # (which is usually the case for arm cpu) is tricky (or impossible).
200 if test "x$pulse_target_os" = "xlinux" && test "x$atomic_arm_linux_helpers" != "xno"; then
201 AC_MSG_RESULT([yes])
202 AC_DEFINE_UNQUOTED(ATOMIC_ARM_LINUX_HELPERS, 1, [special arm linux implementation])
203 need_libatomic_ops=no
204 else
205 AC_MSG_RESULT([no])
206 AC_CACHE_CHECK([compiler support for arm inline asm atomic operations],
207 pulseaudio_cv_support_arm_atomic_ops,
208 [AC_COMPILE_IFELSE(
209 AC_LANG_PROGRAM([],
210 [[volatile int a=0;
211 int o=0, n=1, r;
212 asm volatile ("ldrex %0, [%1]\n"
213 "subs %0, %0, %2\n"
214 "strexeq %0, %3, [%1]\n"
215 : "=&r" (r)
216 : "r" (&a), "Ir" (o), "r" (n)
217 : "cc");
218 return (a==1 ? 0 : -1);
219 ]]),
220 [pulseaudio_cv_support_arm_atomic_ops=yes],
221 [pulseaudio_cv_support_arm_atomic_ops=no])
222 ])
223 AS_IF([test "$pulseaudio_cv_support_arm_atomic_ops" = "yes"], [
224 AC_DEFINE([ATOMIC_ARM_INLINE_ASM], 1, [Have ARMv6 instructions.])
225 need_libatomic_ops=no
226 ])
227 fi
228 ;;
229 *)
230 if test "x$pulse_target_os" = "xnetbsd" && test "x$atomic_netbsd_helpers" = "xyes"; then
231 AC_MSG_RESULT([yes])
232 AC_DEFINE_UNQUOTED(NETBSD_ATOMIC_OPS, 1, [netbsd implementation])
233 need_libatomic_ops=no
234 else
235 AC_MSG_RESULT([unknown])
236 fi
237 ;;
238 esac
239 fi
240
241 CC_CHECK_TLS
242
243 AC_CACHE_CHECK([whether $CC knows _Bool],
244 pulseaudio_cv__Bool,
245 [AC_COMPILE_IFELSE(
246 AC_LANG_PROGRAM([], [[_Bool b;]]),
247 [pulseaudio_cv__Bool=yes],
248 [pulseaudio_cv__Bool=no])
249 ])
250
251 AS_IF([test "$pulseaudio_cv__Bool" = "yes"], [
252 AC_DEFINE([HAVE_STD_BOOL], 1, [Have _Bool.])
253 ])
254
255 #### libtool stuff ####
256 LT_PREREQ(2.2)
257 LT_INIT([dlopen win32-dll disable-static])
258
259 dnl Unfortunately, even up to libtool 2.2.6a there is no way to know
260 dnl exactly which version of libltdl is present in the system, so we
261 dnl just assume that it's a working version as long as we have the
262 dnl library and the header files.
263 dnl
264 dnl As an extra safety device, check for lt_dladvise_init() which is
265 dnl only implemented in libtool 2.x, and refine as we go if we have
266 dnl refined requirements.
267 dnl
268 dnl Check the header files first since the system may have a
269 dnl libltdl.so for runtime, but no headers, and we want to bail out as
270 dnl soon as possible.
271 dnl
272 dnl We don't need any special variable for this though, since the user
273 dnl can give the proper place to find libltdl through the standard
274 dnl variables like LDFLAGS and CPPFLAGS.
275
276 AC_CHECK_HEADER([ltdl.h],
277 [AC_CHECK_LIB([ltdl], [lt_dladvise_init], [LIBLTDL=-lltdl], [LIBLTDL=])],
278 [LIBLTDL=])
279
280 AS_IF([test "x$LIBLTDL" = "x"],
281 [AC_MSG_ERROR([Unable to find libltdl version 2. Makes sure you have libtool 2.2 or later installed.])])
282 AC_SUBST([LIBLTDL])
283
284 #### Determine build environment ####
285
286 os_is_win32=0
287
288 case "$host_os" in
289 mingw*)
290 AC_DEFINE([OS_IS_WIN32], 1, [Build target is Windows.])
291 os_is_win32=1
292 ;;
293 esac
294
295 AM_CONDITIONAL(OS_IS_WIN32, test "x$os_is_win32" = "x1")
296
297 ###################################
298 # Basic environment checks #
299 ###################################
300
301 #### Checks for header files. ####
302
303 # ISO
304 AC_HEADER_STDC
305
306 # POSIX
307 AC_CHECK_HEADERS_ONCE([arpa/inet.h glob.h grp.h netdb.h netinet/in.h \
308 netinet/in_systm.h netinet/tcp.h poll.h pwd.h sched.h \
309 sys/mman.h sys/resource.h sys/select.h sys/socket.h sys/wait.h \
310 sys/uio.h syslog.h sys/dl.h dlfcn.h linux/sockios.h])
311 AC_CHECK_HEADERS([netinet/ip.h], [], [],
312 [#include <sys/types.h>
313 #if HAVE_NETINET_IN_H
314 # include <netinet/in.h>
315 #endif
316 #if HAVE_NETINET_IN_SYSTM_H
317 # include <netinet/in_systm.h>
318 #endif
319 ])
320 AC_CHECK_HEADERS([regex.h], [HAVE_REGEX=1], [HAVE_REGEX=0])
321 AC_CHECK_HEADERS([sys/un.h], [HAVE_AF_UNIX=1], [HAVE_AF_UNIX=0])
322
323 AM_CONDITIONAL(HAVE_REGEX, test "x$HAVE_REGEX" = "x1")
324 AM_CONDITIONAL(HAVE_AF_UNIX, test "x$HAVE_AF_UNIX" = "x1")
325
326 # Linux
327 AC_CHECK_HEADERS([linux/input.h], [HAVE_EVDEV=1], [HAVE_EVDEV=0])
328
329 AM_CONDITIONAL([HAVE_EVDEV], [test "x$HAVE_EVDEV" = "x1"])
330
331 AC_CHECK_HEADERS_ONCE([sys/prctl.h])
332
333 # Solaris
334 AC_CHECK_HEADERS_ONCE([sys/filio.h])
335
336 # Windows
337 AC_CHECK_HEADERS_ONCE([windows.h winsock2.h ws2tcpip.h])
338
339 # NetBSD
340 AC_CHECK_HEADERS_ONCE([sys/atomic.h])
341
342 # Other
343 AC_CHECK_HEADERS_ONCE([sys/ioctl.h])
344 AC_CHECK_HEADERS_ONCE([byteswap.h])
345 AC_CHECK_HEADERS_ONCE([sys/syscall.h])
346 AC_CHECK_HEADERS_ONCE([sys/eventfd.h])
347 AC_CHECK_HEADERS_ONCE([execinfo.h])
348
349 #### Typdefs, structures, etc. ####
350
351 AC_C_CONST
352 AC_C_BIGENDIAN
353 AC_TYPE_PID_T
354 AC_TYPE_SIZE_T
355 AC_CHECK_TYPES(ssize_t, , [AC_DEFINE([ssize_t], [signed long],
356 [Define ssize_t if it is not done by the standard libs.])])
357 AC_TYPE_OFF_T
358
359 AC_TYPE_UID_T
360 AC_CHECK_DECLS(environ)
361
362 AC_CHECK_DEFINE([SIGXCPU], [signal.h], [
363 HAVE_SIGXCPU=1
364 AC_DEFINE([HAVE_SIGXCPU], 1, [Have SIGXCPU?])
365 ], [HAVE_SIGXCPU=0])
366 AM_CONDITIONAL(HAVE_SIGXCPU, test "x$HAVE_SIGXCPU" = "x1")
367
368 # Solaris lacks this
369 AC_CHECK_DEFINE([INADDR_NONE], [netinet/in.h], [],
370 [AC_CHECK_DEFINE([INADDR_NONE], [winsock2.h], [],
371 [AC_DEFINE([INADDR_NONE], [0xffffffff], [Define INADDR_NONE if not found in <netinet/in.h>])])])
372
373 #### POSIX threads ####
374
375 ACX_PTHREAD
376
377 #### Check for libs ####
378
379 # ISO
380 AC_SEARCH_LIBS([pow], [m])
381
382 # POSIX
383 AC_SEARCH_LIBS([sched_setscheduler], [rt])
384 AC_SEARCH_LIBS([dlopen], [dl])
385 AC_SEARCH_LIBS([shm_open], [rt])
386 AC_SEARCH_LIBS([inet_ntop], [nsl])
387 AC_SEARCH_LIBS([timer_create], [rt])
388
389 # BSD
390 AC_SEARCH_LIBS([connect], [socket])
391 AC_SEARCH_LIBS([backtrace], [execinfo])
392
393 # Non-standard
394
395 # This magic is needed so we do not needlessly add static libs to the win32
396 # build, disabling its ability to make dlls.
397 AC_CHECK_FUNCS([getopt_long], [], [AC_CHECK_LIB([iberty], [getopt_long])])
398
399 #### Check for functions ####
400
401 # ISO
402 AC_CHECK_FUNCS_ONCE([lrintf strtof])
403
404 # POSIX
405 AC_FUNC_FORK
406 AC_FUNC_GETGROUPS
407 AC_FUNC_SELECT_ARGTYPES
408 AC_CHECK_FUNCS_ONCE([chmod chown clock_gettime getaddrinfo getgrgid_r getgrnam_r \
409 getpwnam_r getpwuid_r gettimeofday getuid inet_ntop inet_pton mlock nanosleep \
410 pipe posix_fadvise posix_madvise posix_memalign setpgid setsid shm_open \
411 sigaction sleep sysconf pthread_setaffinity_np])
412 AC_CHECK_FUNCS([mkfifo], [HAVE_MKFIFO=1], [HAVE_MKFIFO=0])
413
414 AM_CONDITIONAL(HAVE_MKFIFO, test "x$HAVE_MKFIFO" = "x1")
415
416 # X/OPEN
417 AC_CHECK_FUNCS_ONCE([readlink])
418
419 # SUSv2
420 AC_CHECK_FUNCS_ONCE([ctime_r usleep])
421
422 # SUSv3
423 AC_CHECK_FUNCS_ONCE([strerror_r])
424
425 # BSD
426 AC_CHECK_FUNCS_ONCE([lstat])
427
428 # Non-standard
429
430 AC_CHECK_FUNCS_ONCE([setresuid setresgid setreuid setregid seteuid setegid ppoll strsignal sig2str strtof_l])
431
432 AC_FUNC_ALLOCA
433
434 AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
435 pulseaudio_cv_PTHREAD_PRIO_INHERIT,
436 [save_CC=$CC; CC=$PTHREAD_CC
437 save_CFLAGS=$CFLAGS; CFLAGS=$PTHREAD_CFLAGS
438 save_LIBS=$LIBS; LIBS=$PTHREAD_LIBS
439 AC_LINK_IFELSE(
440 AC_LANG_PROGRAM(
441 [[
442 #include <pthread.h>
443 ]],
444 [[int i = PTHREAD_PRIO_INHERIT;]]),
445 [pulseaudio_cv_PTHREAD_PRIO_INHERIT=yes],
446 [pulseaudio_cv_PTHREAD_PRIO_INHERIT=no])
447 CC=$save_CC
448 CFLAGS=$save_CFLAGS
449 LIBS=$save_LIBS
450 ])
451
452 AS_IF([test "$pulseaudio_cv_PTHREAD_PRIO_INHERIT" = "yes"], [
453 AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.])
454 ])
455
456 AC_DEFINE_UNQUOTED(PA_CFLAGS,"$CFLAGS", [The CFLAGS used during compilation])
457
458 #### Large File-Support (LFS) ####
459
460 AC_SYS_LARGEFILE
461
462 # Check for open64 to know if the current system does have open64() and similar functions
463 AC_CHECK_FUNCS_ONCE([open64])
464
465 #### [lib]iconv ####
466
467 AM_ICONV
468
469 IT_PROG_INTLTOOL([0.35.0])
470 GETTEXT_PACKAGE=pulseaudio
471 AC_SUBST([GETTEXT_PACKAGE])
472 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
473 AM_GLIB_GNU_GETTEXT
474
475 pulselocaledir='${prefix}/${DATADIRNAME}/locale'
476 AC_SUBST(pulselocaledir)
477
478 ###################################
479 # External libraries #
480 ###################################
481
482 #### pkg-config ####
483
484 PKG_PROG_PKG_CONFIG
485
486 #### X11 (optional) ####
487
488 AC_ARG_ENABLE([x11],
489 AS_HELP_STRING([--disable-x11],[Disable optional X11 support]),
490 [
491 case "${enableval}" in
492 yes) x11=yes ;;
493 no) x11=no ;;
494 *) AC_MSG_ERROR(bad value ${enableval} for --disable-x11) ;;
495 esac
496 ],
497 [x11=auto])
498
499 if test "x${x11}" != xno ; then
500 PKG_CHECK_MODULES(X11, [ x11 ice sm xtst ],
501 HAVE_X11=1,
502 [
503 HAVE_X11=0
504 if test "x$x11" = xyes ; then
505 AC_MSG_ERROR([*** X11 not found])
506 fi
507 ])
508 else
509 HAVE_X11=0
510 fi
511
512 if test "x${HAVE_X11}" = x1 ; then
513 AC_DEFINE([HAVE_X11], 1, [Have X11?])
514 fi
515
516 AC_SUBST(X11_CFLAGS)
517 AC_SUBST(X11_LIBS)
518 AC_SUBST(HAVE_X11)
519 AM_CONDITIONAL([HAVE_X11], [test "x$HAVE_X11" = x1])
520
521 #### Capabilities (optional) ####
522
523 CAP_LIBS=''
524
525 AC_ARG_WITH(
526 [caps],
527 AS_HELP_STRING([--without-caps],[Omit support for POSIX capabilities.]))
528
529 if test "x${with_caps}" != "xno"; then
530 AC_SEARCH_LIBS([cap_init], [cap], [], [
531 if test "x${with_caps}" = "xyes" ; then
532 AC_MSG_ERROR([*** POSIX caps libraries not found])
533 fi])
534 AC_CHECK_HEADERS([sys/capability.h], [], [
535 if test "x${with_caps}" = "xyes" ; then
536 AC_MSG_ERROR([*** POSIX caps headers not found])
537 fi])
538 fi
539
540 #### Valgrind (optional) ####
541
542 AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h])
543
544 #### Sound file ####
545
546 PKG_CHECK_MODULES(LIBSNDFILE, [ sndfile >= 1.0.20 ])
547 AC_SUBST(LIBSNDFILE_CFLAGS)
548 AC_SUBST(LIBSNDFILE_LIBS)
549
550 PKG_CHECK_MODULES(LIBSPEEX, [ speexdsp >= 1.2 ])
551 AC_SUBST(LIBSPEEX_CFLAGS)
552 AC_SUBST(LIBSPEEX_LIBS)
553
554 #### atomic-ops ###
555
556 AC_MSG_CHECKING([whether we need libatomic_ops])
557 if test "x$need_libatomic_ops" = "xyes"; then
558 AC_MSG_RESULT([yes])
559 AC_CHECK_HEADERS([atomic_ops.h], [], [
560 AC_MSG_ERROR([*** libatomic-ops headers not found])
561 ])
562
563 # Win32 does not need the lib and breaks horribly if we try to include it
564 if test "x$os_is_win32" != "x1" ; then
565 LIBS="$LIBS -latomic_ops"
566 fi
567 else
568 AC_MSG_RESULT([no])
569 fi
570
571 #### Libsamplerate support (optional) ####
572
573 AC_ARG_ENABLE([samplerate],
574 AS_HELP_STRING([--disable-samplerate],[Disable optional libsamplerate support]),
575 [
576 case "${enableval}" in
577 yes) samplerate=yes ;;
578 no) samplerate=no ;;
579 *) AC_MSG_ERROR(bad value ${enableval} for --disable-samplerate) ;;
580 esac
581 ],
582 [samplerate=auto])
583
584 if test "x${samplerate}" != xno ; then
585 PKG_CHECK_MODULES(LIBSAMPLERATE, [ samplerate >= 0.1.0 ],
586 HAVE_LIBSAMPLERATE=1,
587 [
588 HAVE_LIBSAMPLERATE=0
589 if test "x$samplerate" = xyes ; then
590 AC_MSG_ERROR([*** Libsamplerate not found])
591 fi
592 ])
593 else
594 HAVE_LIBSAMPLERATE=0
595 fi
596
597 if test "x${HAVE_LIBSAMPLERATE}" = x1 ; then
598 AC_DEFINE([HAVE_LIBSAMPLERATE], 1, [Have libsamplerate?])
599 fi
600
601 AC_SUBST(LIBSAMPLERATE_CFLAGS)
602 AC_SUBST(LIBSAMPLERATE_LIBS)
603 AC_SUBST(HAVE_LIBSAMPLERATE)
604 AM_CONDITIONAL([HAVE_LIBSAMPLERATE], [test "x$HAVE_LIBSAMPLERATE" = x1])
605
606 #### Database support ####
607
608 HAVE_TDB=0
609 HAVE_GDBM=0
610
611 AC_ARG_WITH(
612 [database],
613 AS_HELP_STRING([--with-database=auto|tdb|gdbm],[Choose database backend.]),[],[with_database=auto])
614
615 if test "x${with_database}" = "xauto" -o "x${with_database}" = "xtdb" ; then
616 PKG_CHECK_MODULES(TDB, [ tdb ],
617 [
618 HAVE_TDB=1
619 with_database=tdb
620 ], [
621 if test "x${with_database}" = "xtdb" ; then
622 AC_MSG_ERROR([*** tdb not found])
623 fi
624 ])
625 fi
626
627 if test "x${with_database}" = "xauto" -o "x${with_database}" = "xgdbm" ; then
628 have_gdbm=yes
629
630 AC_CHECK_LIB(gdbm, gdbm_open, [], [have_gdbm=no])
631 AC_CHECK_HEADERS(gdbm.h, [], [have_gdbm=no])
632
633 if test "x${have_gdbm}" = "xyes" ; then
634 HAVE_GDBM=1
635 GDBM_CFLAGS=
636 GDBM_LIBS=-lgdbm
637 with_database=gdbm
638 elif test "x${with_database}" = "xgdbm"; then
639 AC_MSG_ERROR([*** gdbm not found])
640 fi
641 fi
642
643 if test "x${HAVE_TDB}" != x1 -a "x${HAVE_GDBM}" != x1; then
644 AC_MSG_ERROR([*** missing database backend])
645 fi
646
647 if test "x${HAVE_TDB}" = x1 ; then
648 AC_DEFINE([HAVE_TDB], 1, [Have tdb?])
649 fi
650
651 if test "x${HAVE_GDBM}" = x1 ; then
652 AC_DEFINE([HAVE_GDBM], 1, [Have gdbm?])
653 fi
654
655 AC_SUBST(TDB_CFLAGS)
656 AC_SUBST(TDB_LIBS)
657 AC_SUBST(HAVE_TDB)
658 AM_CONDITIONAL([HAVE_TDB], [test "x$HAVE_TDB" = x1])
659
660 AC_SUBST(GDBM_CFLAGS)
661 AC_SUBST(GDBM_LIBS)
662 AC_SUBST(HAVE_GDBM)
663 AM_CONDITIONAL([HAVE_GDBM], [test "x$HAVE_GDBM" = x1])
664
665 #### OSS support (optional) ####
666
667 AC_ARG_ENABLE([oss],
668 AS_HELP_STRING([--disable-oss],[Disable optional OSS support]),
669 [
670 case "${enableval}" in
671 yes) oss=yes ;;
672 no) oss=no ;;
673 *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;;
674 esac
675 ],
676 [oss=auto])
677
678 if test "x${oss}" != xno ; then
679 AC_CHECK_HEADERS([sys/soundcard.h],
680 [
681 HAVE_OSS=1
682 AC_DEFINE([HAVE_OSS], 1, [Have OSS?])
683 ],
684 [
685 HAVE_OSS=0
686 if test "x$oss" = xyes ; then
687 AC_MSG_ERROR([*** OSS support not found])
688 fi
689 ])
690 else
691 HAVE_OSS=0
692 fi
693
694 AC_SUBST(HAVE_OSS)
695 AM_CONDITIONAL([HAVE_OSS], [test "x$HAVE_OSS" = x1])
696
697
698 #### ALSA support (optional) ####
699
700 AC_ARG_ENABLE([alsa],
701 AS_HELP_STRING([--disable-alsa],[Disable optional ALSA support]),
702 [
703 case "${enableval}" in
704 yes) alsa=yes ;;
705 no) alsa=no ;;
706 *) AC_MSG_ERROR(bad value ${enableval} for --disable-alsa) ;;
707 esac
708 ],
709 [alsa=auto])
710
711 if test "x${alsa}" != xno ; then
712 PKG_CHECK_MODULES(ASOUNDLIB, [ alsa >= 1.0.19 ],
713 [
714 HAVE_ALSA=1
715 AC_DEFINE([HAVE_ALSA], 1, [Have ALSA?])
716 ],
717 [
718 HAVE_ALSA=0
719 if test "x$alsa" = xyes ; then
720 AC_MSG_ERROR([*** Needed alsa >= 1.0.19 support not found])
721 fi
722 ])
723 else
724 HAVE_ALSA=0
725 fi
726
727 AC_SUBST(ASOUNDLIB_CFLAGS)
728 AC_SUBST(ASOUNDLIB_LIBS)
729 AC_SUBST(HAVE_ALSA)
730 AM_CONDITIONAL([HAVE_ALSA], [test "x$HAVE_ALSA" = x1])
731
732 #### Solaris audio support (optional) ####
733
734 AC_ARG_ENABLE([solaris],
735 AS_HELP_STRING([--disable-solaris],[Disable optional Solaris audio support]),
736 [
737 case "${enableval}" in
738 yes) solaris=yes ;;
739 no) solaris=no ;;
740 *) AC_MSG_ERROR(bad value ${enableval} for --disable-solaris) ;;
741 esac
742 ],
743 [solaris=auto])
744
745 if test "x${solaris}" != xno ; then
746 AC_CHECK_HEADERS([sys/audio.h],
747 [
748 HAVE_SOLARIS=1
749 AC_DEFINE([HAVE_SOLARIS], 1, [Have Solaris audio?])
750 ],
751 [
752 HAVE_SOLARIS=0
753 if test "x$solaris" = xyes ; then
754 AC_MSG_ERROR([*** Solaris audio support not found])
755 fi
756 ])
757 else
758 HAVE_SOLARIS=0
759 fi
760
761 AC_SUBST(HAVE_SOLARIS)
762 AM_CONDITIONAL([HAVE_SOLARIS], [test "x$HAVE_SOLARIS" = x1])
763
764 #### GLib 2 support (optional) ####
765
766 AC_ARG_ENABLE([glib2],
767 AS_HELP_STRING([--disable-glib2],[Disable optional GLib 2 support]),
768 [
769 case "${enableval}" in
770 yes) glib2=yes ;;
771 no) glib2=no ;;
772 *) AC_MSG_ERROR(bad value ${enableval} for --disable-glib2) ;;
773 esac
774 ],
775 [glib2=auto])
776
777 if test "x${glib2}" != xno ; then
778 PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ],
779 HAVE_GLIB20=1,
780 [
781 HAVE_GLIB20=0
782 if test "x$glib2" = xyes ; then
783 AC_MSG_ERROR([*** GLib 2 support not found])
784 fi
785 ])
786 else
787 HAVE_GLIB20=0
788 fi
789
790 AC_SUBST(GLIB20_CFLAGS)
791 AC_SUBST(GLIB20_LIBS)
792 AC_SUBST(HAVE_GLIB20)
793 AM_CONDITIONAL([HAVE_GLIB20], [test "x$HAVE_GLIB20" = x1])
794
795 if test "x$HAVE_GLIB20" = x1 ; then
796 AC_DEFINE([HAVE_GLIB], 1, [Have GLIB?])
797 fi
798
799 #### GTK2 support (optional) ####
800
801 AC_ARG_ENABLE([gtk2],
802 AS_HELP_STRING([--disable-gtk2],[Disable optional Gtk+ 2 support]),
803 [
804 case "${enableval}" in
805 yes) gtk2=yes ;;
806 no) gtk2=no ;;
807 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gtk2) ;;
808 esac
809 ],
810 [gtk2=auto])
811
812 if test "x${gtk2}" != xno ; then
813 PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.4.0 ],
814 HAVE_GTK20=1,
815 [
816 HAVE_GTK20=0
817 if test "x$gtk2" = xyes ; then
818 AC_MSG_ERROR([*** Gtk+ 2 support not found])
819 fi
820 ])
821 else
822 HAVE_GTK20=0
823 fi
824
825 AC_SUBST(GTK20_CFLAGS)
826 AC_SUBST(GTK20_LIBS)
827 AC_SUBST(HAVE_GTK20)
828 AM_CONDITIONAL([HAVE_GTK20], [test "x$HAVE_GTK20" = x1])
829
830 if test "x$HAVE_GTK20" = x1 ; then
831 AC_DEFINE([HAVE_GTK], 1, [Have GTK?])
832 fi
833
834 #### GConf support (optional) ####
835
836 AC_ARG_ENABLE([gconf],
837 AS_HELP_STRING([--disable-gconf],[Disable optional GConf support]),
838 [
839 case "${enableval}" in
840 yes) gconf=yes ;;
841 no) gconf=no ;;
842 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gconf) ;;
843 esac
844 ],
845 [gconf=auto])
846
847 if test "x${gconf}" != xno ; then
848 PKG_CHECK_MODULES(GCONF, [ gconf-2.0 >= 2.4.0 ],
849 HAVE_GCONF=1,
850 [
851 HAVE_GCONF=0
852 if test "x$gconf" = xyes ; then
853 AC_MSG_ERROR([*** GConf support not found])
854 fi
855 ])
856 else
857 HAVE_GCONF=0
858 fi
859
860 AC_SUBST(GCONF_CFLAGS)
861 AC_SUBST(GCONF_LIBS)
862 AC_SUBST(HAVE_GCONF)
863 AM_CONDITIONAL([HAVE_GCONF], [test "x$HAVE_GCONF" = x1])
864
865 #### Avahi support (optional) ####
866
867 AC_ARG_ENABLE([avahi],
868 AS_HELP_STRING([--disable-avahi],[Disable optional Avahi support]),
869 [
870 case "${enableval}" in
871 yes) avahi=yes ;;
872 no) avahi=no ;;
873 *) AC_MSG_ERROR(bad value ${enableval} for --disable-avahi) ;;
874 esac
875 ],
876 [avahi=auto])
877
878 if test "x${avahi}" != xno ; then
879 PKG_CHECK_MODULES(AVAHI, [ avahi-client >= 0.6.0 ],
880 HAVE_AVAHI=1,
881 [
882 HAVE_AVAHI=0
883 if test "x$avahi" = xyes ; then
884 AC_MSG_ERROR([*** Avahi support not found])
885 fi
886 ])
887 else
888 HAVE_AVAHI=0
889 fi
890
891 AC_SUBST(AVAHI_CFLAGS)
892 AC_SUBST(AVAHI_LIBS)
893 AC_SUBST(HAVE_AVAHI)
894 AM_CONDITIONAL([HAVE_AVAHI], [test "x$HAVE_AVAHI" = x1])
895
896 ### LIBOIL ####
897
898 PKG_CHECK_MODULES(LIBOIL, [ liboil-0.3 >= 0.3.0 ])
899 AC_SUBST(LIBOIL_CFLAGS)
900 AC_SUBST(LIBOIL_LIBS)
901
902 ### JACK (optional) ####
903
904 AC_ARG_ENABLE([jack],
905 AS_HELP_STRING([--disable-jack],[Disable optional JACK support]),
906 [
907 case "${enableval}" in
908 yes) jack=yes ;;
909 no) jack=no ;;
910 *) AC_MSG_ERROR(bad value ${enableval} for --disable-jack) ;;
911 esac
912 ],
913 [jack=auto])
914
915 if test "x${jack}" != xno ; then
916 PKG_CHECK_MODULES(JACK, [ jack >= 0.100 ],
917 HAVE_JACK=1,
918 [
919 HAVE_JACK=0
920 if test "x$jack" = xyes ; then
921 AC_MSG_ERROR([*** JACK support not found])
922 fi
923 ])
924 else
925 HAVE_JACK=0
926 fi
927
928 AC_SUBST(JACK_CFLAGS)
929 AC_SUBST(JACK_LIBS)
930 AC_SUBST(HAVE_JACK)
931 AM_CONDITIONAL([HAVE_JACK], [test "x$HAVE_JACK" = x1])
932
933 #### Async DNS support (optional) ####
934
935 AC_ARG_ENABLE([asyncns],
936 AS_HELP_STRING([--disable-asyncns],[Disable optional Async DNS support]),
937 [
938 case "${enableval}" in
939 yes) asyncns=yes ;;
940 no) asyncns=no ;;
941 *) AC_MSG_ERROR(bad value ${enableval} for --disable-asyncns) ;;
942 esac
943 ],
944 [asyncns=auto])
945
946 if test "x${asyncns}" != xno ; then
947 PKG_CHECK_MODULES(LIBASYNCNS, [ libasyncns >= 0.1 ],
948 HAVE_LIBASYNCNS=1,
949 [
950 HAVE_LIBASYNCNS=0
951 if test "x$asyncns" = xyes ; then
952 AC_MSG_ERROR([*** Async DNS support not found])
953 fi
954 ])
955 else
956 HAVE_LIBASYNCNS=0
957 fi
958
959 AC_SUBST(LIBASYNCNS_CFLAGS)
960 AC_SUBST(LIBASYNCNS_LIBS)
961 AC_SUBST(HAVE_LIBASYNCNS)
962 AM_CONDITIONAL([HAVE_LIBASYNCNS], [test "x$HAVE_LIBASYNCNS" = x1])
963
964 if test "x$HAVE_LIBASYNCNS" != "x0" ; then
965 AC_DEFINE([HAVE_LIBASYNCNS], 1, [Have libasyncns?])
966 fi
967
968 #### TCP wrappers (optional) ####
969
970 AC_ARG_ENABLE([tcpwrap],
971 AS_HELP_STRING([--disable-tcpwrap],[Disable optional TCP wrappers support]),
972 [
973 case "${enableval}" in
974 yes) tcpwrap=yes ;;
975 no) tcpwrap=no ;;
976 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tcpwrap) ;;
977 esac
978 ],
979 [tcpwrap=auto])
980
981 if test "x${tcpwrap}" != xno ; then
982 ACX_LIBWRAP
983 if test "x${LIBWRAP_LIBS}" = x && test "x$tcpwrap" = xyes ; then
984 AC_MSG_ERROR([*** TCP wrappers support not found])
985 fi
986 else
987 LIBWRAP_LIBS=
988 fi
989
990 AC_SUBST(LIBWRAP_LIBS)
991
992 #### LIRC support (optional) ####
993
994 AC_ARG_ENABLE([lirc],
995 AS_HELP_STRING([--disable-lirc],[Disable optional LIRC support]),
996 [
997 case "${enableval}" in
998 yes) lirc=yes ;;
999 no) lirc=no ;;
1000 *) AC_MSG_ERROR(bad value ${enableval} for --disable-lirc) ;;
1001 esac
1002 ],
1003 [lirc=auto])
1004
1005 if test "x${lirc}" != xno ; then
1006 ACX_LIRC
1007 if test "x${HAVE_LIRC}" = x0 && test "x$lirc" = xyes ; then
1008 AC_MSG_ERROR([*** LIRC support not found])
1009 fi
1010 else
1011 HAVE_LIRC=0
1012 fi
1013
1014 AC_SUBST(LIRC_CFLAGS)
1015 AC_SUBST(LIRC_LIBS)
1016 AM_CONDITIONAL([HAVE_LIRC], [test "x$HAVE_LIRC" = x1])
1017
1018 #### HAL support (optional) ####
1019
1020 AC_ARG_ENABLE([hal],
1021 AS_HELP_STRING([--disable-hal],[Disable optional HAL support]),
1022 [
1023 case "${enableval}" in
1024 yes) hal=yes ;;
1025 no) hal=no ;;
1026 *) AC_MSG_ERROR(bad value ${enableval} for --disable-hal) ;;
1027 esac
1028 ],
1029 [hal=auto])
1030 if test "x${hal}" != xno -a \( "x$HAVE_OSS" = "x1" -o "x$HAVE_ALSA" = "x1" \) ; then
1031 PKG_CHECK_MODULES(HAL, [ hal >= 0.5.11 ],
1032 [
1033 HAVE_HAL=1
1034 AC_DEFINE([HAVE_HAL], 1, [Have HAL.])
1035 ],
1036 [
1037 HAVE_HAL=0
1038 if test "x$hal" = xyes ; then
1039 AC_MSG_ERROR([*** HAL support not found])
1040 fi
1041 ])
1042 else
1043 HAVE_HAL=0
1044 fi
1045
1046 AC_SUBST(HAL_CFLAGS)
1047 AC_SUBST(HAL_LIBS)
1048 AC_SUBST(HAVE_HAL)
1049 AM_CONDITIONAL([HAVE_HAL], [test "x$HAVE_HAL" = x1])
1050
1051 #### UDEV support (optional) ####
1052
1053 AC_ARG_ENABLE([udev],
1054 AS_HELP_STRING([--disable-udev],[Disable optional UDEV support]),
1055 [
1056 case "${enableval}" in
1057 yes) udev=yes ;;
1058 no) udev=no ;;
1059 *) AC_MSG_ERROR(bad value ${enableval} for --disable-udev) ;;
1060 esac
1061 ],
1062 [udev=auto])
1063 if test "x${udev}" != xno -a \( "x$HAVE_OSS" = "x1" -o "x$HAVE_ALSA" = "x1" \) ; then
1064 PKG_CHECK_MODULES(UDEV, [ libudev >= 143 ],
1065 [
1066 HAVE_UDEV=1
1067 AC_DEFINE([HAVE_UDEV], 1, [Have UDEV.])
1068 ],
1069 [
1070 HAVE_UDEV=0
1071 if test "x$udev" = xyes ; then
1072 AC_MSG_ERROR([*** UDEV support not found])
1073 fi
1074 ])
1075 else
1076 HAVE_UDEV=0
1077 fi
1078
1079 AC_SUBST(UDEV_CFLAGS)
1080 AC_SUBST(UDEV_LIBS)
1081 AC_SUBST(HAVE_UDEV)
1082 AM_CONDITIONAL([HAVE_UDEV], [test "x$HAVE_UDEV" = x1])
1083
1084 AC_DEFINE([LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE], 1, [I know the API is subject to change.])
1085
1086 #### BlueZ support (optional) ####
1087
1088 AC_ARG_ENABLE([bluez],
1089 AS_HELP_STRING([--disable-bluez],[Disable optional BlueZ support]),
1090 [
1091 case "${enableval}" in
1092 yes) bluez=yes ;;
1093 no) bluez=no ;;
1094 *) AC_MSG_ERROR(bad value ${enableval} for --disable-bluez) ;;
1095 esac
1096 ],
1097 [bluez=auto])
1098 if test "x${bluez}" != xno ; then
1099 PKG_CHECK_MODULES(BLUEZ, [ bluez >= 3.0 ],
1100 HAVE_BLUEZ=1,
1101 [
1102 HAVE_BLUEZ=0
1103 if test "x$bluez" = xyes ; then
1104 AC_MSG_ERROR([*** BLUEZ support not found])
1105 fi
1106 ])
1107 else
1108 HAVE_BLUEZ=0
1109 fi
1110
1111 AC_SUBST(BLUEZ_CFLAGS)
1112 AC_SUBST(BLUEZ_LIBS)
1113 AC_SUBST(HAVE_BLUEZ)
1114 AM_CONDITIONAL([HAVE_BLUEZ], [test "x$HAVE_BLUEZ" = x1])
1115
1116 #### D-Bus support (optional) ####
1117
1118 AC_ARG_ENABLE([dbus],
1119 AS_HELP_STRING([--disable-dbus],[Disable optional D-Bus support]),
1120 [
1121 case "${enableval}" in
1122 yes) dbus=yes ;;
1123 no) dbus=no ;;
1124 *) AC_MSG_ERROR(bad value ${enableval} for --disable-dbus) ;;
1125 esac
1126 ],
1127 [dbus=auto])
1128
1129 if test "x$HAVE_HAL" = x1 ; then
1130 dbus=yes
1131 fi
1132
1133 if test "x${dbus}" != xno || test "x${bluez}" != xno || test "x${hal}" != xno ; then
1134
1135 PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 1.0.0 ],
1136 [
1137 HAVE_DBUS=1
1138 saved_LIBS="$LIBS"
1139 LIBS="$LIBS $DBUS_LIBS"
1140 AC_CHECK_FUNCS(dbus_watch_get_unix_fd)
1141 LIBS="$saved_LIBS"
1142 AC_DEFINE([HAVE_DBUS], 1, [Have D-Bus.])
1143 ],
1144 [
1145 HAVE_DBUS=0
1146 if test "x$dbus" = xyes ; then
1147 AC_MSG_ERROR([*** D-Bus support not found])
1148 fi
1149 ])
1150 else
1151 HAVE_DBUS=0
1152 fi
1153
1154 AC_SUBST(DBUS_CFLAGS)
1155 AC_SUBST(DBUS_LIBS)
1156 AC_SUBST(HAVE_DBUS)
1157 AM_CONDITIONAL([HAVE_DBUS], [test "x$HAVE_DBUS" = x1])
1158
1159 ### IPv6 connection support (optional) ###
1160
1161 AC_ARG_ENABLE([ipv6],
1162 AS_HELP_STRING([--disable-ipv6],[Disable optional IPv6 support]),
1163 [
1164 case "${enableval}" in
1165 yes) ipv6=yes ;;
1166 no) ipv6=no ;;
1167 *) AC_MSG_ERROR(bad value ${enableval} for --disable-ipv6) ;;
1168 esac
1169 ],
1170 [ipv6=auto])
1171
1172 if test "x${ipv6}" != xno ; then
1173 AC_DEFINE([HAVE_IPV6], [1], [Define this to enable IPv6 connection support])
1174 HAVE_IPV6=1
1175 else
1176 HAVE_IPV6=0
1177 fi
1178
1179 #### OpenSSL support (optional) ####
1180
1181 AC_ARG_ENABLE([openssl],
1182 AS_HELP_STRING([--disable-openssl],[Disable OpenSSL support (used for Airtunes/RAOP)]),
1183 [
1184 case "${enableval}" in
1185 yes) openssl=yes ;;
1186 no) openssl=no ;;
1187 *) AC_MSG_ERROR(bad value ${enableval} for --disable-openssl) ;;
1188 esac
1189 ],
1190 [openssl=auto])
1191
1192 if test "x${openssl}" != xno ; then
1193
1194 PKG_CHECK_MODULES(OPENSSL, [ openssl > 0.9 ],
1195 [
1196 HAVE_OPENSSL=1
1197 AC_DEFINE([HAVE_OPENSSL], 1, [Have OpenSSL])
1198 ],
1199 [
1200 HAVE_OPENSSL=0
1201 if test "x$openssl" = xyes ; then
1202 AC_MSG_ERROR([*** OpenSSL support not found])
1203 fi
1204 ])
1205 else
1206 HAVE_OPENSSL=0
1207 fi
1208
1209 AC_SUBST(OPENSSL_CFLAGS)
1210 AC_SUBST(OPENSSL_LIBS)
1211 AC_SUBST(HAVE_OPENSSL)
1212 AM_CONDITIONAL([HAVE_OPENSSL], [test "x$HAVE_OPENSSL" = x1])
1213
1214 ### Build and Install man pages ###
1215 AC_ARG_ENABLE(manpages,
1216 AS_HELP_STRING([--disable-manpages],[Disable building and installation of man pages]),
1217 [case "${enableval}" in
1218 yes) manpages=yes ;;
1219 no) manpages=no ;;
1220 *) AC_MSG_ERROR([bad value ${enableval} for --disable-manpages]) ;;
1221 esac],[manpages=yes])
1222
1223 AM_CONDITIONAL([BUILD_MANPAGES], [test "x$manpages" = xyes])
1224
1225 #### PulseAudio system group & user #####
1226
1227 AC_ARG_WITH(system_user, AS_HELP_STRING([--with-system-user=<user>],[User for running the PulseAudio daemon as a system-wide instance (pulse)]))
1228 if test -z "$with_system_user" ; then
1229 PA_SYSTEM_USER=pulse
1230 else
1231 PA_SYSTEM_USER=$with_system_user
1232 fi
1233 AC_SUBST(PA_SYSTEM_USER)
1234 AC_DEFINE_UNQUOTED(PA_SYSTEM_USER,"$PA_SYSTEM_USER", [User for running the PulseAudio system daemon])
1235
1236 AC_ARG_WITH(system_group,AS_HELP_STRING([--with-system-group=<group>],[Group for running the PulseAudio daemon as a system-wide instance (pulse)]))
1237 if test -z "$with_system_group" ; then
1238 PA_SYSTEM_GROUP=pulse
1239 else
1240 PA_SYSTEM_GROUP=$with_system_group
1241 fi
1242 AC_SUBST(PA_SYSTEM_GROUP)
1243 AC_DEFINE_UNQUOTED(PA_SYSTEM_GROUP,"$PA_SYSTEM_GROUP", [Group for the PulseAudio system daemon])
1244
1245 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)]))
1246 if test -z "$with_access_group" ; then
1247 PA_ACCESS_GROUP=pulse-access
1248 else
1249 PA_ACCESS_GROUP=$with_access_group
1250 fi
1251 AC_SUBST(PA_ACCESS_GROUP)
1252 AC_DEFINE_UNQUOTED(PA_ACCESS_GROUP,"$PA_ACCESS_GROUP", [Access group])
1253
1254 AC_ARG_ENABLE(
1255 per_user_esound_socket,
1256 AS_HELP_STRING([--disable-per-user-esound-socket], [Use global esound socket directory /tmp/.esd/socket.]),
1257 [
1258 case "${enableval}" in
1259 yes) per_user_esound_socket=1 ;;
1260 no) per_user_esound_socket=0 ;;
1261 *) AC_MSG_ERROR(bad value ${enableval} for --disable-per-user-esound-socket) ;;
1262 esac
1263 ],
1264 [per_user_esound_socket=1])
1265
1266 if test "x$per_user_esound_socket" = "x1"; then
1267 AC_DEFINE([USE_PER_USER_ESOUND_SOCKET], [1], [Define this if you want per-user esound socket directories])
1268 fi
1269
1270 #### PulseAudio system runtime dir ####
1271 PA_SYSTEM_RUNTIME_PATH="${localstatedir}/run/pulse"
1272 AC_SUBST(PA_SYSTEM_RUNTIME_PATH)
1273 PA_SYSTEM_CONFIG_PATH="${localstatedir}/lib/pulse"
1274 AC_SUBST(PA_SYSTEM_CONFIG_PATH)
1275 PA_SYSTEM_STATE_PATH="${localstatedir}/lib/pulse"
1276 AC_SUBST(PA_SYSTEM_STATE_PATH)
1277
1278 ###################################
1279 # Output #
1280 ###################################
1281
1282 AC_ARG_ENABLE([legacy-runtime-dir],
1283 AS_HELP_STRING([--disable-legacy-runtime-dir], [Try to connect on legacy (< 0.9.12) socket paths.]))
1284 if test "x$enable_legacy_runtime_dir" != "xno" ; then
1285 AC_DEFINE(ENABLE_LEGACY_RUNTIME_DIR, [1], [Legacy runtime dir])
1286 fi
1287
1288 AC_ARG_ENABLE(
1289 [static-bins],
1290 AS_HELP_STRING([--enable-static-bins],[Statically link executables.]),
1291 [STATIC_BINS=1], [STATIC_BINS=0])
1292 AM_CONDITIONAL([STATIC_BINS], [test "x$STATIC_BINS" = "x1"])
1293
1294 AC_ARG_WITH(
1295 [preopen-mods],
1296 AS_HELP_STRING([--with-preopen-mods],[Modules to preopen in daemon (default: all).]),
1297 [PREOPEN_MODS=$withval], [PREOPEN_MODS="all"])
1298 AM_CONDITIONAL([PREOPEN_MODS], [test "x$PREOPEN_MODS" != "xall"])
1299 if test "x$PREOPEN_MODS" != "xall" ; then
1300 tmpLIBS=""
1301 for mod in $PREOPEN_MODS; do
1302 tmpLIBS="$tmpLIBS module-$mod.la"
1303 done
1304 PREOPEN_MODS="$tmpLIBS"
1305 AC_SUBST(PREOPEN_MODS)
1306 fi
1307
1308 AC_ARG_WITH(
1309 [module-dir],
1310 AS_HELP_STRING([--with-module-dir],[Directory where to install the modules to (defaults to ${libdir}/pulse-${PA_MAJORMINORMICRO}/modules]),
1311 [modlibexecdir=$withval], [modlibexecdir="${libdir}/pulse-${PA_MAJORMINORMICRO}/modules"])
1312
1313 AC_SUBST(modlibexecdir)
1314
1315 AC_ARG_ENABLE(
1316 [force-preopen],
1317 AS_HELP_STRING([--enable-force-preopen],[Preopen modules, even when dlopen() is supported.]),
1318 [FORCE_PREOPEN=$enableval], [FORCE_PREOPEN=no])
1319 AM_CONDITIONAL([FORCE_PREOPEN], [test "x$FORCE_PREOPEN" = "xyes"])
1320
1321 AC_CONFIG_FILES([
1322 Makefile
1323 src/Makefile
1324 man/Makefile
1325 libpulse.pc
1326 libpulse-simple.pc
1327 libpulse-browse.pc
1328 libpulse-mainloop-glib.pc
1329 doxygen/Makefile
1330 doxygen/doxygen.conf
1331 src/pulse/version.h
1332 po/Makefile.in
1333 ])
1334
1335 AC_OUTPUT
1336
1337 # ==========================================================================
1338 ENABLE_X11=no
1339 if test "x$HAVE_X11" = "x1" ; then
1340 ENABLE_X11=yes
1341 fi
1342
1343 ENABLE_OSS=no
1344 if test "x$HAVE_OSS" = "x1" ; then
1345 ENABLE_OSS=yes
1346 fi
1347
1348 ENABLE_ALSA=no
1349 if test "x$HAVE_ALSA" = "x1" ; then
1350 ENABLE_ALSA=yes
1351 fi
1352
1353 ENABLE_SOLARIS=no
1354 if test "x$HAVE_SOLARIS" = "x1" ; then
1355 ENABLE_SOLARIS=yes
1356 fi
1357
1358 ENABLE_GTK20=no
1359 if test "x$HAVE_GTK20" = "x1" ; then
1360 ENABLE_GTK20=yes
1361 fi
1362
1363 ENABLE_GLIB20=no
1364 if test "x$HAVE_GLIB20" = "x1" ; then
1365 ENABLE_GLIB20=yes
1366 fi
1367
1368 ENABLE_GCONF=no
1369 if test "x$HAVE_GCONF" = "x1" ; then
1370 ENABLE_GCONF=yes
1371 fi
1372
1373 ENABLE_AVAHI=no
1374 if test "x$HAVE_AVAHI" = "x1" ; then
1375 ENABLE_AVAHI=yes
1376 fi
1377
1378 ENABLE_JACK=no
1379 if test "x$HAVE_JACK" = "x1" ; then
1380 ENABLE_JACK=yes
1381 fi
1382
1383 ENABLE_LIBASYNCNS=no
1384 if test "x$HAVE_LIBASYNCNS" = "x1" ; then
1385 ENABLE_LIBASYNCNS=yes
1386 fi
1387
1388 ENABLE_LIRC=no
1389 if test "x$HAVE_LIRC" = "x1" ; then
1390 ENABLE_LIRC=yes
1391 fi
1392
1393 ENABLE_HAL=no
1394 if test "x$HAVE_HAL" = "x1" ; then
1395 ENABLE_HAL=yes
1396 fi
1397
1398 ENABLE_UDEV=no
1399 if test "x$HAVE_UDEV" = "x1" ; then
1400 ENABLE_UDEV=yes
1401 fi
1402
1403 ENABLE_TCPWRAP=no
1404 if test "x${LIBWRAP_LIBS}" != x ; then
1405 ENABLE_TCPWRAP=yes
1406 fi
1407
1408 ENABLE_LIBSAMPLERATE=no
1409 if test "x${HAVE_LIBSAMPLERATE}" = "x1" ; then
1410 ENABLE_LIBSAMPLERATE=yes
1411 fi
1412
1413 ENABLE_BLUEZ=no
1414 if test "x${HAVE_BLUEZ}" = "x1" ; then
1415 ENABLE_BLUEZ=yes
1416 fi
1417
1418 ENABLE_GDBM=no
1419 if test "x${HAVE_GDBM}" = "x1" ; then
1420 ENABLE_GDBM=yes
1421 fi
1422
1423 ENABLE_TDB=no
1424 if test "x${HAVE_TDB}" = "x1" ; then
1425 ENABLE_TDB=yes
1426 fi
1427
1428 ENABLE_OPENSSL=no
1429 if test "x${HAVE_OPENSSL}" = "x1" ; then
1430 ENABLE_OPENSSL=yes
1431 fi
1432
1433 ENABLE_IPV6=no
1434 if test "x${HAVE_IPV6}" = "x1" ; then
1435 ENABLE_IPV6=yes
1436 fi
1437
1438 ENABLE_PER_USER_ESOUND_SOCKET=no
1439 if test "x$per_user_esound_socket" = "x1" ; then
1440 ENABLE_PER_USER_ESOUND_SOCKET=yes
1441 fi
1442
1443 echo "
1444 ---{ $PACKAGE_NAME $VERSION }---
1445
1446 prefix: ${prefix}
1447 sysconfdir: ${sysconfdir}
1448 localstatedir: ${localstatedir}
1449 System Runtime Path: ${PA_SYSTEM_RUNTIME_PATH}
1450 System State Path: ${PA_SYSTEM_STATE_PATH}
1451 System Config Path: ${PA_SYSTEM_CONFIG_PATH}
1452 Compiler: ${CC}
1453 CFLAGS: ${CFLAGS}
1454
1455 Have X11: ${ENABLE_X11}
1456 Enable OSS: ${ENABLE_OSS}
1457 Enable Alsa: ${ENABLE_ALSA}
1458 Enable Solaris: ${ENABLE_SOLARIS}
1459 Enable GLib 2.0: ${ENABLE_GLIB20}
1460 Enable Gtk+ 2.0: ${ENABLE_GTK20}
1461 Enable GConf: ${ENABLE_GCONF}
1462 Enable Avahi: ${ENABLE_AVAHI}
1463 Enable Jack: ${ENABLE_JACK}
1464 Enable Async DNS: ${ENABLE_LIBASYNCNS}
1465 Enable LIRC: ${ENABLE_LIRC}
1466 Enable HAL: ${ENABLE_HAL}
1467 Enable udev: ${ENABLE_UDEV}
1468 Enable BlueZ: ${ENABLE_BLUEZ}
1469 Enable TCP Wrappers: ${ENABLE_TCPWRAP}
1470 Enable libsamplerate: ${ENABLE_LIBSAMPLERATE}
1471 Enable IPv6: ${ENABLE_IPV6}
1472 Enable OpenSSL (for Airtunes): ${ENABLE_OPENSSL}
1473 Enable tdb: ${ENABLE_TDB}
1474 Enable gdbm: ${ENABLE_GDBM}
1475
1476 System User: ${PA_SYSTEM_USER}
1477 System Group: ${PA_SYSTEM_GROUP}
1478 Access Group: ${PA_ACCESS_GROUP}
1479 Enable per-user EsounD socket: ${ENABLE_PER_USER_ESOUND_SOCKET}
1480 Force preopen: ${FORCE_PREOPEN}
1481 Preopened modules: ${PREOPEN_MODS}
1482 "