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