1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(alsa-lib, 1.0.28)
5 AC_CONFIG_SRCDIR([src/control/control.c])
6 AC_CONFIG_MACRO_DIR([m4])
8 dnl *************************************************
9 dnl current:revision:age
10 dnl change (without API) = c:r+1:a
11 dnl change API = c+1:0:a
12 dnl add API = c+1:0:a+1
13 dnl remove API = c+1:0:0
14 dnl *************************************************
17 eval LIBTOOL_VERSION_INFO="2:0:0"
18 dnl *************************************************
19 AM_CONDITIONAL([INSTALL_M4], [test -n "${ACLOCAL}"])
21 AM_MAINTAINER_MODE([enable])
23 # Test for new silent rules and enable only if they are available
24 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
26 AC_PREFIX_DEFAULT(/usr)
28 dnl Checks for programs.
30 dnl try to gues cross-compiler if not set
31 if test "x$host" != "x$build" -a -z "`echo $CC | grep -e '-gcc'`";
33 AC_MSG_CHECKING(for cross-compiler)
35 which ${program_prefix}gcc >/dev/null 2>&1 && CC=${program_prefix}gcc
36 which ${host_cpu}-${host_os}-gcc >/dev/null 2>&1 \
37 && CC=${host_cpu}-${host_os}-gcc
38 which ${host_cpu}-${host_vendor}-${host_os}-gcc >/dev/null 2>&1 \
39 && CC=${host_cpu}-${host_vendor}-${host_os}-gcc
44 CFLAGS="$CFLAGS -D_GNU_SOURCE"
57 dnl Checks for header files.
59 AC_CONFIG_HEADERS(include/config.h)
61 dnl Checks for typedefs, structures, and compiler characteristics.
66 dnl Checks for library functions.
67 AC_PROG_GCC_TRADITIONAL
68 AC_CHECK_FUNCS([uselocale])
71 AC_SUBST(LIBTOOL_VERSION_INFO)
73 test "x$prefix" = xNONE && prefix=$ac_default_prefix
75 dnl Do not build static and shared libraries together
76 if test "$enable_static" = "$enable_shared" -a "$enable_static" = "yes"; then
78 Please, do not try to compile static and shared libraries together.
79 See INSTALL file for more details (do not use --enable-shared=yes with
85 dnl ALSA configuration directory
86 AC_ARG_WITH(configdir,
87 AS_HELP_STRING([--with-configdir=dir],
88 [path where ALSA config files are stored]),
89 confdir="$withval", confdir="")
90 if test -z "$confdir"; then
94 *) dir="$prefix/share"
98 ALSA_CONFIG_DIR="$confdir"
99 AC_DEFINE_UNQUOTED(ALSA_CONFIG_DIR, "$confdir", [directory containing ALSA configuration database])
100 AC_SUBST(ALSA_CONFIG_DIR)
102 dnl ALSA plugin directory
103 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
105 AC_ARG_WITH(plugindir,
106 AS_HELP_STRING([--with-plugindir=dir],
107 [path where ALSA plugin files are stored]),
108 plugindir="$withval", plugindir="")
109 if test -z "$plugindir"; then
115 plugindir="$dir/$PACKAGE"
117 AC_DEFINE_UNQUOTED(ALSA_PLUGIN_DIR, "$plugindir", [directory containing ALSA add-on modules])
118 ALSA_PLUGIN_DIR="$plugindir"
119 AC_SUBST(ALSA_PLUGIN_DIR)
121 AC_ARG_WITH(pkgconfdir,
122 AS_HELP_STRING([--with-pkgconfdir=dir],
123 [path where pkgconfig files are stored]),
124 pkgconfdir="$withval", pkgconfdir="")
125 if test -z "$pkgconfdir"; then
131 pkgconfdir="$dir/pkgconfig"
133 AC_DEFINE_UNQUOTED(ALSA_PKGCONF_DIR, "$pkgconfdir", [directory containing pkgconfig files])
134 ALSA_PKGCONF_DIR="$pkgconfdir"
135 AC_SUBST(ALSA_PKGCONF_DIR)
137 dnl Check for versioned symbols
138 AC_MSG_CHECKING(for versioned symbols)
139 AC_ARG_WITH(versioned,
140 AS_HELP_STRING([--with-versioned],
141 [shared library will be compiled with versioned symbols (default = yes)]),
142 versioned="$withval", versioned="yes")
143 if test "$versioned" = "yes"; then
144 # it seems that GNU ld versions since 2.10 are not broken
145 xres=`grep '^VERSION=' ${srcdir}/ltmain.sh | cut -d = -f 2 | cut -d \" -f 2`
146 major=`echo $xres | cut -d . -f 1`
147 minor=`echo $xres | cut -d . -f 2`
149 if test $major -eq 1 && test $minor -gt 3; then
152 if test $major -gt 1; then
156 if test $pass -eq 1; then
157 AC_DEFINE(VERSIONED_SYMBOLS,,[compiled with versioned symbols])
160 AC_MSG_RESULT(broken libtool - use libtool v1.4+; no versions)
165 AM_CONDITIONAL([VERSIONED_SYMBOLS], [test x$versioned = xyes])
167 dnl Check for symbolic-functions
168 AC_MSG_CHECKING(for symbolic-functions)
169 AC_ARG_ENABLE(symbolic-functions,
170 AS_HELP_STRING([--enable-symbolic-functions],
171 [use -Bsymbolic-functions option if available (optmization for size and speed)]),
172 symfuncs="$enableval", symfuncs="no")
173 if test "$symfuncs" = "yes"; then
174 if ld --help | grep -q -- '-Bsymbolic-functions'; then
177 AC_MSG_RESULT(not supported by ld)
183 AM_CONDITIONAL([SYMBOLIC_FUNCTIONS], [test x"$symfuncs" = xyes])
185 dnl See if toolchain has a custom prefix for symbols ...
186 AC_MSG_CHECKING(for custom symbol prefixes)
188 echo "PREFIX=__USER_LABEL_PREFIX__" \
189 | ${CPP-${CC-gcc} -E} - 2>&1 \
190 | ${EGREP-grep} "^PREFIX=" \
191 | ${SED-sed} "s:^PREFIX=::"`
192 AC_DEFINE_UNQUOTED([__SYMBOL_PREFIX], "$SYMBOL_PREFIX", [Toolchain Symbol Prefix])
193 AC_SUBST(SYMBOL_PREFIX)
194 AC_MSG_RESULT($SYMBOL_PREFIX)
196 dnl Check for debug...
197 AC_MSG_CHECKING(for debug)
199 AS_HELP_STRING([--with-debug],
200 [library will be compiled with asserts (default = yes)]),
201 debug="$withval", debug="yes")
202 if test "$debug" = "yes"; then
205 AC_DEFINE(NDEBUG,,[No assert debug])
209 if test "$debug" = "yes"; then
210 AC_MSG_CHECKING(for debug assert)
211 AC_ARG_ENABLE(debug-assert,
212 AS_HELP_STRING([--enable-debug],
213 [enable assert call at the default error message handler]),
214 debug_assert="$enableval", debug_assert="no")
215 if test "$debug_assert" = "yes"; then
217 AC_DEFINE(ALSA_DEBUG_ASSERT,,[Enable assert at error message handler])
223 dnl Temporary directory
224 AC_MSG_CHECKING(for tmpdir)
226 AS_HELP_STRING([--with-tmpdir=directory],
227 [directory to put tmp socket files (/tmp)]),
228 tmpdir="$withval", tmpdir="/tmp")
229 AC_MSG_RESULT($tmpdir)
230 AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir", [directory to put tmp socket files])
232 dnl Check for softfloat...
233 AC_MSG_CHECKING(for softfloat)
234 AC_ARG_WITH(softfloat,
235 AS_HELP_STRING([--with-softfloat],
236 [do you have floating point unit on this machine? (optional)]),
238 y|yes) softfloat=yes ;;
241 if test "$softfloat" = "yes" ; then
242 AC_DEFINE(HAVE_SOFT_FLOAT, "1", [Avoid calculation in float])
249 if test "$softfloat" != "yes"; then
254 AC_MSG_CHECKING(for libdl)
256 AS_HELP_STRING([--with-libdl], [Use libdl for plugins (default = yes)]),
257 [ have_libdl="$withval" ], [ have_libdl="yes" ])
259 if test "$have_libdl" = "yes"; then
260 AC_CHECK_LIB([dl], [dlsym], [HAVE_LIBDL="yes"])
261 if test "$HAVE_LIBDL" = "yes" ; then
262 ALSA_DEPLIBS="$ALSA_DEPLIBS -ldl"
263 AC_DEFINE([HAVE_LIBDL], 1, [Have libdl])
268 AM_CONDITIONAL([BUILD_MODULES], [test "$HAVE_LIBDL" = "yes"])
270 dnl Check for pthread
271 AC_MSG_CHECKING(for pthread)
273 AS_HELP_STRING([--with-pthread], [Use pthread (default = yes)]),
274 [ have_pthread="$withval" ], [ have_pthread="yes" ])
275 if test "$have_pthread" = "yes"; then
276 AC_CHECK_LIB([pthread], [pthread_join], [HAVE_LIBPTHREAD="yes"])
277 if test "$HAVE_LIBPTHREAD" = "yes"; then
278 ALSA_DEPLIBS="$ALSA_DEPLIBS -lpthread"
279 AC_DEFINE([HAVE_LIBPTHREAD], 1, [Have libpthread])
285 dnl Check for __thread
286 AC_MSG_CHECKING([for __thread])
287 AC_LINK_IFELSE([AC_LANG_PROGRAM([#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 1) || (__GNUC__ == 4 && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ < 2))
288 #error gcc has this bug: http://gcc.gnu.org/ml/gcc-bugs/2006-09/msg02275.html
289 #endif], [static __thread int p = 0])],
290 [AC_DEFINE(HAVE___THREAD, 1,
291 Define to 1 if compiler supports __thread)
292 AC_MSG_RESULT([yes])],
293 [AC_MSG_RESULT([no])])
296 AC_MSG_CHECKING(for librt)
298 AS_HELP_STRING([--with-librt], [Use librt for monotonic clock (default = yes)]),
299 [ have_librt="$withval" ], [ have_librt="yes" ])
300 if test "$have_librt" = "yes"; then
301 AC_CHECK_LIB([rt], [clock_gettime], [HAVE_LIBRT="yes"])
302 if test "$HAVE_LIBRT" = "yes" ; then
303 ALSA_DEPLIBS="$ALSA_DEPLIBS -lrt"
304 AC_DEFINE([HAVE_LIBRT], 1, [Have librt])
305 AC_DEFINE([HAVE_CLOCK_GETTIME], 1, [Have clock gettime])
311 AC_SUBST(ALSA_DEPLIBS)
313 dnl Check for headers
314 AC_CHECK_HEADERS([wordexp.h endian.h sys/endian.h])
316 dnl Check for resmgr support...
317 AC_MSG_CHECKING(for resmgr support)
318 AC_ARG_ENABLE(resmgr,
319 AS_HELP_STRING([--enable-resmgr], [support resmgr (optional)]),
320 resmgr="$enableval", resmgr="no")
321 AC_MSG_RESULT($resmgr)
322 if test "$resmgr" = "yes"; then
323 AC_CHECK_LIB(resmgr, rsm_open_device,,
324 AC_ERROR([Cannot find libresmgr]))
325 AC_DEFINE(SUPPORT_RESMGR, "1", [Support resmgr with alsa-lib])
328 dnl Check for aload* support...
329 AC_MSG_CHECKING(for aload* support)
331 AS_HELP_STRING([--disable-aload], [disable reading /dev/aload*]),
332 aload="$enableval", aload="yes")
333 AC_MSG_RESULT($aload)
334 if test "$aload" = "yes"; then
335 AC_DEFINE(SUPPORT_ALOAD, "1", [Support /dev/aload* access for auto-loading])
338 dnl Check for non-standard /dev directory
339 AC_MSG_CHECKING([for ALSA device file directory])
340 AC_ARG_WITH(alsa-devdir,
341 AS_HELP_STRING([--with-alsa-devdir=dir],
342 [directory with ALSA device files (default /dev/snd)]),
343 [alsa_dev_dir="$withval"],
344 [alsa_dev_dir="/dev/snd"])
345 dnl make sure it has a trailing slash
346 if echo "$alsa_dev_dir" | grep -v '/$' > /dev/null; then
347 alsa_dev_dir="$alsa_dev_dir/"
349 AC_DEFINE_UNQUOTED(ALSA_DEVICE_DIRECTORY, "$alsa_dev_dir", [Directory with ALSA device files])
350 AC_MSG_RESULT([$alsa_dev_dir])
352 AC_MSG_CHECKING([for aload* device file directory])
353 AC_ARG_WITH(aload-devdir,
354 AS_HELP_STRING([--with-aload-devdir=dir],
355 [directory with aload* device files (default /dev)]),
356 [aload_dev_dir="$withval"],
357 [aload_dev_dir="/dev"])
358 if echo "$aload_dev_dir" | grep -v '/$' > /dev/null; then
359 aload_dev_dir="$aload_dev_dir/"
361 AC_DEFINE_UNQUOTED(ALOAD_DEVICE_DIRECTORY, "$aload_dev_dir", [Directory with aload* device files])
362 AC_MSG_RESULT([$aload_dev_dir])
366 AS_HELP_STRING([--disable-mixer], [disable the mixer component]),
367 [build_mixer="$enableval"], [build_mixer="yes"])
369 AS_HELP_STRING([--disable-pcm], [disable the PCM component]),
370 [build_pcm="$enableval"], [build_pcm="yes"])
371 AC_ARG_ENABLE(rawmidi,
372 AS_HELP_STRING([--disable-rawmidi], [disable the raw MIDI component]),
373 [build_rawmidi="$enableval"], [build_rawmidi="yes"])
375 AS_HELP_STRING([--disable-hwdep], [disable the hwdep component]),
376 [build_hwdep="$enableval"], [build_hwdep="yes"])
378 AS_HELP_STRING([--disable-seq], [disable the sequencer component]),
379 [build_seq="$enableval"], [build_seq="yes"])
381 AS_HELP_STRING([--disable-ucm], [disable the use-case-manager component]),
382 [build_ucm="$enableval"], [build_ucm="yes"])
384 AS_HELP_STRING([--disable-alisp], [disable the alisp component]),
385 [build_alisp="$enableval"], [build_alisp="yes"])
386 test "$softfloat" = "yes" && build_alisp="no"
387 AC_ARG_ENABLE(old-symbols,
388 AS_HELP_STRING([--disable-old-symbols], [disable old obsoleted symbols]),
389 [keep_old_symbols="$enableval"], [keep_old_symbols="yes"])
390 AM_CONDITIONAL([KEEP_OLD_SYMBOLS], [test x$keep_old_symbols = xyes])
392 AC_ARG_ENABLE(python,
393 AS_HELP_STRING([--disable-python], [disable the python components]),
394 [build_python="$enableval"], [build_python="yes"])
397 if test "$build_python" = "yes"; then
398 AC_ARG_WITH(pythonlibs,
399 AS_HELP_STRING([--with-pythonlibs=ldflags],
400 [specify python libraries (-lpthread -lm -ldl -lpython2.4)]),
401 pythonlibs="$withval", pythonlibs=`python-config --libs`)
402 AC_ARG_WITH(pythonincludes,
403 AS_HELP_STRING([--with-pythonincludes=Cflags],
404 [specify python C header files (-I/usr/include/python)]),
405 pythonincludes="$withval", pythonincludes=`python-config --includes`)
406 if test -z "$pythonlibs"; then
407 echo "Unable to determine python libraries! Probably python-config is not"
408 echo "available on this system. Please, use --with-pythonlibs and"
409 echo "--with-pythonincludes options. Python components are disabled in this build."
412 PYTHON_LIBS="$pythonlibs"
413 PYTHON_INCLUDES="$pythonincludes"
416 AC_SUBST(PYTHON_LIBS)
417 AC_SUBST(PYTHON_INCLUDES)
419 AM_CONDITIONAL([BUILD_MIXER], [test x$build_mixer = xyes])
420 AM_CONDITIONAL([BUILD_PCM], [test x$build_pcm = xyes])
421 AM_CONDITIONAL([BUILD_RAWMIDI], [test x$build_rawmidi = xyes])
422 AM_CONDITIONAL([BUILD_HWDEP], [test x$build_hwdep = xyes])
423 AM_CONDITIONAL([BUILD_SEQ], [test x$build_seq = xyes])
424 AM_CONDITIONAL([BUILD_UCM], [test x$build_ucm = xyes])
425 AM_CONDITIONAL([BUILD_ALISP], [test x$build_alisp = xyes])
426 AM_CONDITIONAL([BUILD_PYTHON], [test x$build_python = xyes])
428 if test "$build_mixer" = "yes"; then
429 AC_DEFINE([BUILD_MIXER], "1", [Build mixer component])
431 if test "$build_pcm" = "yes"; then
432 AC_DEFINE([BUILD_PCM], "1", [Build PCM component])
434 if test "$build_rawmidi" = "yes"; then
435 AC_DEFINE([BUILD_RAWMIDI], "1", [Build raw MIDI component])
437 if test "$build_hwdep" = "yes"; then
438 AC_DEFINE([BUILD_HWDEP], "1", [Build hwdep component])
440 if test "$build_seq" = "yes"; then
441 AC_DEFINE([BUILD_SEQ], "1", [Build sequencer component])
443 if test "$build_ucm" = "yes"; then
444 AC_DEFINE([BUILD_UCM], "1", [Build UCM component])
449 if test "$build_pcm" = "yes"; then
450 AC_ARG_WITH(pcm-plugins,
451 AS_HELP_STRING([--with-pcm-plugins=<list>],
452 [build PCM plugins (default = all)]),
453 [pcm_plugins="$withval"], [pcm_plugins="all"])
458 dnl check atomics for pcm_meter
460 AC_MSG_CHECKING([whether GCC supports builtin atomic intrinsics])
461 if test -z "$gcc_have_atomics"; then
465 __atomic_load_n(&i, __ATOMIC_SEQ_CST);
466 __atomic_add_fetch(&i, 0, __ATOMIC_SEQ_CST);
468 [gcc_have_atomics=yes],
469 [gcc_have_atomics=no])
471 AC_MSG_RESULT($gcc_have_atomics)
473 PCM_PLUGIN_LIST="copy linear route mulaw alaw adpcm rate plug multi shm file null empty share meter hooks lfloat ladspa dmix dshare dsnoop asym iec958 softvol extplug ioplug mmap_emul"
475 build_pcm_plugin="no"
476 for t in $PCM_PLUGIN_LIST; do
477 eval build_pcm_$t="no"
480 pcm_plugins=`echo $pcm_plugins | sed 's/,/ /g'`
481 for p in $pcm_plugins; do
482 for t in $PCM_PLUGIN_LIST; do
483 if test "$p" = "$t" -o "$p" = "all"; then
484 eval build_pcm_$t="yes"
485 build_pcm_plugin="yes"
490 dnl special dependencies
491 if test "$build_pcm_plug" = "yes"; then
492 build_pcm_linear="yes"
496 if test "$build_pcm_ioplug" = "yes"; then
497 build_pcm_extplug="yes"
500 if test "$HAVE_LIBDL" != "yes"; then
502 build_pcm_ladspa="no"
503 build_pcm_pcm_ioplug="no"
504 build_pcm_pcm_extplug="no"
507 if test "$HAVE_LIBPTHREAD" != "yes"; then
511 if test "$softfloat" = "yes"; then
512 build_pcm_lfloat="no"
513 build_pcm_ladspa="no"
516 if test "$gcc_have_atomics" != "yes"; then
520 AM_CONDITIONAL([BUILD_PCM_PLUGIN], [test x$build_pcm_plugin = xyes])
521 AM_CONDITIONAL([BUILD_PCM_PLUGIN_COPY], [test x$build_pcm_copy = xyes])
522 AM_CONDITIONAL([BUILD_PCM_PLUGIN_LINEAR], [test x$build_pcm_linear = xyes])
523 AM_CONDITIONAL([BUILD_PCM_PLUGIN_ROUTE], [test x$build_pcm_route = xyes])
524 AM_CONDITIONAL([BUILD_PCM_PLUGIN_MULAW], [test x$build_pcm_mulaw = xyes])
525 AM_CONDITIONAL([BUILD_PCM_PLUGIN_ALAW], [test x$build_pcm_alaw = xyes])
526 AM_CONDITIONAL([BUILD_PCM_PLUGIN_ADPCM], [test x$build_pcm_adpcm = xyes])
527 AM_CONDITIONAL([BUILD_PCM_PLUGIN_RATE], [test x$build_pcm_rate = xyes])
528 AM_CONDITIONAL([BUILD_PCM_PLUGIN_PLUG], [test x$build_pcm_plug = xyes])
529 AM_CONDITIONAL([BUILD_PCM_PLUGIN_MULTI], [test x$build_pcm_multi = xyes])
530 AM_CONDITIONAL([BUILD_PCM_PLUGIN_SHM], [test x$build_pcm_shm = xyes])
531 AM_CONDITIONAL([BUILD_PCM_PLUGIN_FILE], [test x$build_pcm_file = xyes])
532 AM_CONDITIONAL([BUILD_PCM_PLUGIN_NULL], [test x$build_pcm_null = xyes])
533 AM_CONDITIONAL([BUILD_PCM_PLUGIN_EMPTY], [test x$build_pcm_empty = xyes])
534 AM_CONDITIONAL([BUILD_PCM_PLUGIN_SHARE], [test x$build_pcm_share = xyes])
535 AM_CONDITIONAL([BUILD_PCM_PLUGIN_METER], [test x$build_pcm_meter = xyes])
536 AM_CONDITIONAL([BUILD_PCM_PLUGIN_HOOKS], [test x$build_pcm_hooks = xyes])
537 AM_CONDITIONAL([BUILD_PCM_PLUGIN_LFLOAT], [test x$build_pcm_lfloat = xyes])
538 AM_CONDITIONAL([BUILD_PCM_PLUGIN_LADSPA], [test x$build_pcm_ladspa = xyes])
539 AM_CONDITIONAL([BUILD_PCM_PLUGIN_DMIX], [test x$build_pcm_dmix = xyes])
540 AM_CONDITIONAL([BUILD_PCM_PLUGIN_DSHARE], [test x$build_pcm_dshare = xyes])
541 AM_CONDITIONAL([BUILD_PCM_PLUGIN_DSNOOP], [test x$build_pcm_dsnoop = xyes])
542 AM_CONDITIONAL([BUILD_PCM_PLUGIN_ASYM], [test x$build_pcm_asym = xyes])
543 AM_CONDITIONAL([BUILD_PCM_PLUGIN_IEC958], [test x$build_pcm_iec958 = xyes])
544 AM_CONDITIONAL([BUILD_PCM_PLUGIN_SOFTVOL], [test x$build_pcm_softvol = xyes])
545 AM_CONDITIONAL([BUILD_PCM_PLUGIN_EXTPLUG], [test x$build_pcm_extplug = xyes])
546 AM_CONDITIONAL([BUILD_PCM_PLUGIN_IOPLUG], [test x$build_pcm_ioplug = xyes])
547 AM_CONDITIONAL([BUILD_PCM_PLUGIN_MMAP_EMUL], [test x$build_pcm_mmap_emul = xyes])
549 dnl Defines for plug plugin
550 if test "$build_pcm_rate" = "yes"; then
551 AC_DEFINE([BUILD_PCM_PLUGIN_RATE], "1", [Build PCM rate plugin])
553 if test "$build_pcm_route" = "yes"; then
554 AC_DEFINE([BUILD_PCM_PLUGIN_ROUTE], "1", [Build PCM route plugin])
556 if test "$build_pcm_lfloat" = "yes"; then
557 AC_DEFINE([BUILD_PCM_PLUGIN_LFLOAT], "1", [Build PCM lfloat plugin])
559 if test "$build_pcm_adpcm" = "yes"; then
560 AC_DEFINE([BUILD_PCM_PLUGIN_ADPCM], "1", [Build PCM adpcm plugin])
562 if test "$build_pcm_mulaw" = "yes"; then
563 AC_DEFINE([BUILD_PCM_PLUGIN_MULAW], "1", [Build PCM mulaw plugin])
565 if test "$build_pcm_alaw" = "yes"; then
566 AC_DEFINE([BUILD_PCM_PLUGIN_ALAW], "1", [Build PCM alaw plugin])
568 if test "$build_pcm_mmap_emul" = "yes"; then
569 AC_DEFINE([BUILD_PCM_PLUGIN_MMAP_EMUL], "1", [Build PCM mmap-emul plugin])
573 dnl Create PCM plugin symbol list for static library
574 rm -f "$srcdir"/src/pcm/pcm_symbols_list.c
575 touch "$srcdir"/src/pcm/pcm_symbols_list.c
576 for t in $PCM_PLUGIN_LIST; do
577 if eval test \$build_pcm_$t = yes; then
578 echo \&_snd_module_pcm_$t, >> "$srcdir"/src/pcm/pcm_symbols_list.c
584 AC_ARG_WITH(ctl-plugins,
585 AS_HELP_STRING([--with-ctl-plugins=<list>],
586 [build control plugins (default = all)]),
587 [ctl_plugins="$withval"], [ctl_plugins="all"])
589 CTL_PLUGIN_LIST="shm ext"
591 build_ctl_plugin="no"
592 for t in $CTL_PLUGIN_LIST; do
593 eval build_ctl_$t="no"
596 ctl_plugins=`echo $ctl_plugins | sed 's/,/ /g'`
597 for p in $ctl_plugins; do
598 for t in $CTL_PLUGIN_LIST; do
599 if test "$p" = "$t" -o "$p" = "all"; then
600 eval build_ctl_$t="yes"
601 build_ctl_plugin="yes"
606 AM_CONDITIONAL([BUILD_CTL_PLUGIN], [test x$build_ctl_plugin = xyes])
607 AM_CONDITIONAL([BUILD_CTL_PLUGIN_SHM], [test x$build_ctl_shm = xyes])
608 AM_CONDITIONAL([BUILD_CTL_PLUGIN_EXT], [test x$build_ctl_ext = xyes])
610 dnl Create ctl plugin symbol list for static library
611 rm -f "$srcdir"/src/control/ctl_symbols_list.c
612 touch "$srcdir"/src/control/ctl_symbols_list.c
613 for t in $CTL_PLUGIN_LIST; do
614 if eval test \$build_ctl_$t = yes; then
615 echo \&_snd_module_control_$t, >> "$srcdir"/src/control/ctl_symbols_list.c
619 dnl Max number of cards
620 AC_MSG_CHECKING(for max number of cards)
621 AC_ARG_WITH(max-cards,
622 AS_HELP_STRING([--with-max-cards], [Specify the max number of cards (default = 32)]),
623 [ max_cards="$withval" ], [ max_cards="32" ])
624 AC_MSG_RESULT([$max_cards])
626 if test "$max_cards" -lt 1; then
627 AC_ERROR([Invalid max cards $max_cards])
628 elif test "$max_cards" -gt 256; then
629 AC_ERROR([Invalid max cards $max_cards])
631 AC_DEFINE_UNQUOTED(SND_MAX_CARDS, $max_cards, [Max number of cards])
633 dnl Make a symlink for inclusion of alsa/xxx.h
634 if test ! -L "$srcdir"/include/alsa ; then
635 echo "Making a symlink include/alsa"
636 rm -f "$srcdir"/include/alsa
637 ln -sf . "$srcdir"/include/alsa
640 AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
641 include/Makefile include/sound/Makefile src/Versions src/Makefile \
642 src/control/Makefile src/mixer/Makefile \
643 src/pcm/Makefile src/pcm/scopes/Makefile \
644 src/rawmidi/Makefile src/timer/Makefile \
645 src/hwdep/Makefile src/seq/Makefile src/ucm/Makefile \
647 src/conf/Makefile src/conf/alsa.conf.d/Makefile \
648 src/conf/cards/Makefile \
649 src/conf/pcm/Makefile \
650 src/conf/ucm/Makefile \
651 src/conf/ucm/DAISY-I2S/Makefile \
652 src/conf/ucm/PandaBoard/Makefile \
653 src/conf/ucm/PandaBoardES/Makefile \
654 src/conf/ucm/SDP4430/Makefile \
655 src/conf/ucm/tegraalc5632/Makefile \
656 src/conf/ucm/PAZ00/Makefile \
657 src/conf/ucm/GoogleNyan/Makefile \
658 modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \
659 alsalisp/Makefile aserver/Makefile \
660 test/Makefile test/lsb/Makefile \
661 utils/Makefile utils/alsa-lib.spec utils/alsa.pc)
663 dnl Create asoundlib.h dynamically according to configure options
664 echo "Creating asoundlib.h..."
665 cp "$srcdir"/include/asoundlib-head.h include/asoundlib.h
666 test "$ac_cv_header_endian_h" = "yes" && echo "#include <endian.h>" >> include/asoundlib.h
667 if test "$ac_cv_header_sys_endian_h" = "yes"; then
668 cat >> include/asoundlib.h <<EOF
669 #include <sys/endian.h>
671 #define __BYTE_ORDER BYTE_ORDER
673 #ifndef __LITTLE_ENDIAN
674 #define __LITTLE_ENDIAN LITTLE_ENDIAN
677 #define __BIG_ENDIAN BIG_ENDIAN
681 cat >> include/asoundlib.h <<EOF
684 #define __inline__ inline
687 #include <alsa/asoundef.h>
688 #include <alsa/version.h>
689 #include <alsa/global.h>
690 #include <alsa/input.h>
691 #include <alsa/output.h>
692 #include <alsa/error.h>
693 #include <alsa/conf.h>
695 test "$build_pcm" = "yes" && echo "#include <alsa/pcm.h>" >> include/asoundlib.h
696 test "$build_rawmidi" = "yes" && echo "#include <alsa/rawmidi.h>" >> include/asoundlib.h
697 test "$build_pcm" = "yes" && echo "#include <alsa/timer.h>" >> include/asoundlib.h
698 test "$build_hwdep" = "yes" && echo "#include <alsa/hwdep.h>" >> include/asoundlib.h
699 echo "#include <alsa/control.h>" >> include/asoundlib.h
700 test "$build_mixer" = "yes" && echo "#include <alsa/mixer.h>" >> include/asoundlib.h
701 test "$build_seq" = "yes" && echo "#include <alsa/seq_event.h>" >> include/asoundlib.h
702 test "$build_seq" = "yes" && echo "#include <alsa/seq.h>" >> include/asoundlib.h
703 test "$build_seq" = "yes" && echo "#include <alsa/seqmid.h>" >> include/asoundlib.h
704 test "$build_seq" = "yes" && echo "#include <alsa/seq_midi_event.h>" >> include/asoundlib.h
705 cat "$srcdir"/include/asoundlib-tail.h >> include/asoundlib.h