1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(alsa-lib, 1.1.2)
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.
32 AC_USE_SYSTEM_EXTENSIONS
41 dnl Checks for header files.
43 AC_CONFIG_HEADERS(include/config.h)
45 dnl Checks for typedefs, structures, and compiler characteristics.
50 dnl Checks for library functions.
51 AC_PROG_GCC_TRADITIONAL
52 AC_CHECK_FUNCS([uselocale])
55 AC_SUBST(LIBTOOL_VERSION_INFO)
57 test "x$prefix" = xNONE && prefix=$ac_default_prefix
59 dnl Do not build static and shared libraries together
60 if test "$enable_static" = "$enable_shared" -a "$enable_static" = "yes"; then
62 Please, do not try to compile static and shared libraries together.
63 See INSTALL file for more details (do not use --enable-shared=yes with
69 dnl ALSA configuration directory
70 AC_ARG_WITH(configdir,
71 AS_HELP_STRING([--with-configdir=dir],
72 [path where ALSA config files are stored]),
73 confdir="$withval", confdir="")
74 if test -z "$confdir"; then
78 *) dir="$prefix/share"
82 ALSA_CONFIG_DIR="$confdir"
83 AC_DEFINE_UNQUOTED(ALSA_CONFIG_DIR, "$confdir", [directory containing ALSA configuration database])
84 AC_SUBST(ALSA_CONFIG_DIR)
86 dnl ALSA plugin directory
87 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
89 AC_ARG_WITH(plugindir,
90 AS_HELP_STRING([--with-plugindir=dir],
91 [path where ALSA plugin files are stored]),
92 plugindir="$withval", plugindir="")
93 if test -z "$plugindir"; then
99 plugindir="$dir/$PACKAGE"
101 AC_DEFINE_UNQUOTED(ALSA_PLUGIN_DIR, "$plugindir", [directory containing ALSA add-on modules])
102 ALSA_PLUGIN_DIR="$plugindir"
103 AC_SUBST(ALSA_PLUGIN_DIR)
105 AC_ARG_WITH(pkgconfdir,
106 AS_HELP_STRING([--with-pkgconfdir=dir],
107 [path where pkgconfig files are stored]),
108 pkgconfdir="$withval", pkgconfdir="")
109 if test -z "$pkgconfdir"; then
115 pkgconfdir="$dir/pkgconfig"
117 AC_DEFINE_UNQUOTED(ALSA_PKGCONF_DIR, "$pkgconfdir", [directory containing pkgconfig files])
118 ALSA_PKGCONF_DIR="$pkgconfdir"
119 AC_SUBST(ALSA_PKGCONF_DIR)
121 dnl Check for versioned symbols
122 AC_MSG_CHECKING(for versioned symbols)
123 AC_ARG_WITH(versioned,
124 AS_HELP_STRING([--with-versioned],
125 [shared library will be compiled with versioned symbols (default = yes)]),
126 versioned="$withval", versioned="yes")
127 if test "$versioned" = "yes"; then
128 # it seems that GNU ld versions since 2.10 are not broken
129 xres=`grep '^VERSION=' ${srcdir}/ltmain.sh | cut -d = -f 2 | cut -d \" -f 2`
130 major=`echo $xres | cut -d . -f 1`
131 minor=`echo $xres | cut -d . -f 2`
133 if test $major -eq 1 && test $minor -gt 3; then
136 if test $major -gt 1; then
140 if test $pass -eq 1; then
141 AC_DEFINE(VERSIONED_SYMBOLS,,[compiled with versioned symbols])
144 AC_MSG_RESULT(broken libtool - use libtool v1.4+; no versions)
149 AM_CONDITIONAL([VERSIONED_SYMBOLS], [test x$versioned = xyes])
151 dnl Check for symbolic-functions
152 AC_MSG_CHECKING(for symbolic-functions)
153 AC_ARG_ENABLE(symbolic-functions,
154 AS_HELP_STRING([--enable-symbolic-functions],
155 [use -Bsymbolic-functions option if available (optmization for size and speed)]),
156 symfuncs="$enableval", symfuncs="no")
157 if test "$symfuncs" = "yes"; then
158 if ld --help | grep -q -- '-Bsymbolic-functions'; then
161 AC_MSG_RESULT(not supported by ld)
167 AM_CONDITIONAL([SYMBOLIC_FUNCTIONS], [test x"$symfuncs" = xyes])
169 dnl See if toolchain has a custom prefix for symbols ...
170 AC_MSG_CHECKING(for custom symbol prefixes)
172 echo "PREFIX=__USER_LABEL_PREFIX__" \
173 | ${CPP-${CC-gcc} -E} - 2>&1 \
174 | ${EGREP-grep} "^PREFIX=" \
175 | ${SED-sed} "s:^PREFIX=::"`
176 AC_DEFINE_UNQUOTED([__SYMBOL_PREFIX], "$SYMBOL_PREFIX", [Toolchain Symbol Prefix])
177 AC_SUBST(SYMBOL_PREFIX)
178 AC_MSG_RESULT($SYMBOL_PREFIX)
180 dnl Check for debug...
181 AC_MSG_CHECKING(for debug)
183 AS_HELP_STRING([--with-debug],
184 [library will be compiled with asserts (default = yes)]),
185 debug="$withval", debug="yes")
186 if test "$debug" = "yes"; then
189 AC_DEFINE(NDEBUG,,[No assert debug])
193 if test "$debug" = "yes"; then
194 AC_MSG_CHECKING(for debug assert)
195 AC_ARG_ENABLE(debug-assert,
196 AS_HELP_STRING([--enable-debug],
197 [enable assert call at the default error message handler]),
198 debug_assert="$enableval", debug_assert="no")
199 if test "$debug_assert" = "yes"; then
201 AC_DEFINE(ALSA_DEBUG_ASSERT,,[Enable assert at error message handler])
207 dnl Temporary directory
208 AC_MSG_CHECKING(for tmpdir)
210 AS_HELP_STRING([--with-tmpdir=directory],
211 [directory to put tmp socket files (/tmp)]),
212 tmpdir="$withval", tmpdir="/tmp")
213 AC_MSG_RESULT($tmpdir)
214 AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir", [directory to put tmp socket files])
216 dnl Check for softfloat...
217 AC_MSG_CHECKING(for softfloat)
218 AC_ARG_WITH(softfloat,
219 AS_HELP_STRING([--with-softfloat],
220 [do you have floating point unit on this machine? (optional)]),
222 y|yes) softfloat=yes ;;
225 if test "$softfloat" = "yes" ; then
226 AC_DEFINE(HAVE_SOFT_FLOAT, "1", [Avoid calculation in float])
233 if test "$softfloat" != "yes"; then
238 AC_MSG_CHECKING(for libdl)
240 AS_HELP_STRING([--with-libdl], [Use libdl for plugins (default = yes)]),
241 [ have_libdl="$withval" ], [ have_libdl="yes" ])
243 if test "$have_libdl" = "yes"; then
244 AC_CHECK_LIB([dl], [dlsym], [HAVE_LIBDL="yes"])
245 if test "$HAVE_LIBDL" = "yes" ; then
246 ALSA_DEPLIBS="$ALSA_DEPLIBS -ldl"
247 AC_DEFINE([HAVE_LIBDL], 1, [Have libdl])
252 AM_CONDITIONAL([BUILD_MODULES], [test "$HAVE_LIBDL" = "yes"])
254 dnl Check for pthread
255 AC_MSG_CHECKING(for pthread)
257 AS_HELP_STRING([--with-pthread], [Use pthread (default = yes)]),
258 [ have_pthread="$withval" ], [ have_pthread="yes" ])
259 if test "$have_pthread" = "yes"; then
260 AC_CHECK_LIB([pthread], [pthread_join], [HAVE_LIBPTHREAD="yes"])
261 if test "$HAVE_LIBPTHREAD" = "yes"; then
262 ALSA_DEPLIBS="$ALSA_DEPLIBS -lpthread"
263 AC_DEFINE([HAVE_LIBPTHREAD], 1, [Have libpthread])
269 dnl Check for __thread
270 AC_MSG_CHECKING([for __thread])
271 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))
272 #error gcc has this bug: http://gcc.gnu.org/ml/gcc-bugs/2006-09/msg02275.html
273 #endif], [static __thread int p = 0])],
274 [AC_DEFINE(HAVE___THREAD, 1,
275 Define to 1 if compiler supports __thread)
276 AC_MSG_RESULT([yes])],
277 [AC_MSG_RESULT([no])])
280 AC_MSG_CHECKING(for librt)
282 AS_HELP_STRING([--with-librt], [Use librt for monotonic clock (default = yes)]),
283 [ have_librt="$withval" ], [ have_librt="yes" ])
284 if test "$have_librt" = "yes"; then
285 AC_CHECK_LIB([rt], [clock_gettime], [HAVE_LIBRT="yes"])
286 if test "$HAVE_LIBRT" = "yes" ; then
287 ALSA_DEPLIBS="$ALSA_DEPLIBS -lrt"
288 AC_DEFINE([HAVE_LIBRT], 1, [Have librt])
289 AC_DEFINE([HAVE_CLOCK_GETTIME], 1, [Have clock gettime])
295 AC_SUBST(ALSA_DEPLIBS)
297 dnl Check for headers
298 AC_CHECK_HEADERS([wordexp.h endian.h sys/endian.h sys/shm.h])
300 dnl Check for resmgr support...
301 AC_MSG_CHECKING(for resmgr support)
302 AC_ARG_ENABLE(resmgr,
303 AS_HELP_STRING([--enable-resmgr], [support resmgr (optional)]),
304 resmgr="$enableval", resmgr="no")
305 AC_MSG_RESULT($resmgr)
306 if test "$resmgr" = "yes"; then
307 AC_CHECK_LIB(resmgr, rsm_open_device,,
308 AC_ERROR([Cannot find libresmgr]))
309 AC_DEFINE(SUPPORT_RESMGR, "1", [Support resmgr with alsa-lib])
312 dnl Check for aload* support...
313 AC_MSG_CHECKING(for aload* support)
315 AS_HELP_STRING([--disable-aload], [disable reading /dev/aload*]),
316 aload="$enableval", aload="yes")
317 AC_MSG_RESULT($aload)
318 if test "$aload" = "yes"; then
319 AC_DEFINE(SUPPORT_ALOAD, "1", [Support /dev/aload* access for auto-loading])
322 dnl Check for non-standard /dev directory
323 AC_MSG_CHECKING([for ALSA device file directory])
324 AC_ARG_WITH(alsa-devdir,
325 AS_HELP_STRING([--with-alsa-devdir=dir],
326 [directory with ALSA device files (default /dev/snd)]),
327 [alsa_dev_dir="$withval"],
328 [alsa_dev_dir="/dev/snd"])
329 dnl make sure it has a trailing slash
330 if echo "$alsa_dev_dir" | grep -v '/$' > /dev/null; then
331 alsa_dev_dir="$alsa_dev_dir/"
333 AC_DEFINE_UNQUOTED(ALSA_DEVICE_DIRECTORY, "$alsa_dev_dir", [Directory with ALSA device files])
334 AC_MSG_RESULT([$alsa_dev_dir])
336 AC_MSG_CHECKING([for aload* device file directory])
337 AC_ARG_WITH(aload-devdir,
338 AS_HELP_STRING([--with-aload-devdir=dir],
339 [directory with aload* device files (default /dev)]),
340 [aload_dev_dir="$withval"],
341 [aload_dev_dir="/dev"])
342 if echo "$aload_dev_dir" | grep -v '/$' > /dev/null; then
343 aload_dev_dir="$aload_dev_dir/"
345 AC_DEFINE_UNQUOTED(ALOAD_DEVICE_DIRECTORY, "$aload_dev_dir", [Directory with aload* device files])
346 AC_MSG_RESULT([$aload_dev_dir])
350 AS_HELP_STRING([--disable-mixer], [disable the mixer component]),
351 [build_mixer="$enableval"], [build_mixer="yes"])
353 AS_HELP_STRING([--disable-pcm], [disable the PCM component]),
354 [build_pcm="$enableval"], [build_pcm="yes"])
355 AC_ARG_ENABLE(rawmidi,
356 AS_HELP_STRING([--disable-rawmidi], [disable the raw MIDI component]),
357 [build_rawmidi="$enableval"], [build_rawmidi="yes"])
359 AS_HELP_STRING([--disable-hwdep], [disable the hwdep component]),
360 [build_hwdep="$enableval"], [build_hwdep="yes"])
362 AS_HELP_STRING([--disable-seq], [disable the sequencer component]),
363 [build_seq="$enableval"], [build_seq="yes"])
365 AS_HELP_STRING([--disable-ucm], [disable the use-case-manager component]),
366 [build_ucm="$enableval"], [build_ucm="yes"])
367 AC_ARG_ENABLE(topology,
368 AS_HELP_STRING([--disable-topology], [disable the DSP topology component]),
369 [build_topology="$enableval"], [build_topology="yes"])
371 AS_HELP_STRING([--disable-alisp], [disable the alisp component]),
372 [build_alisp="$enableval"], [build_alisp="yes"])
373 test "$softfloat" = "yes" && build_alisp="no"
374 AC_ARG_ENABLE(old-symbols,
375 AS_HELP_STRING([--disable-old-symbols], [disable old obsoleted symbols]),
376 [keep_old_symbols="$enableval"], [keep_old_symbols="yes"])
377 AM_CONDITIONAL([KEEP_OLD_SYMBOLS], [test x$keep_old_symbols = xyes])
379 AC_ARG_ENABLE(python,
380 AS_HELP_STRING([--disable-python], [disable the python components]),
381 [build_python="$enableval"], [build_python="yes"])
384 if test "$build_python" = "yes"; then
385 AC_ARG_WITH(pythonlibs,
386 AS_HELP_STRING([--with-pythonlibs=ldflags],
387 [specify python libraries (-lpthread -lm -ldl -lpython2.4)]),
388 pythonlibs="$withval", pythonlibs=`python-config --libs`)
389 AC_ARG_WITH(pythonincludes,
390 AS_HELP_STRING([--with-pythonincludes=Cflags],
391 [specify python C header files (-I/usr/include/python)]),
392 pythonincludes="$withval", pythonincludes=`python-config --includes`)
393 if test -z "$pythonlibs"; then
394 echo "Unable to determine python libraries! Probably python-config is not"
395 echo "available on this system. Please, use --with-pythonlibs and"
396 echo "--with-pythonincludes options. Python components are disabled in this build."
399 PYTHON_LIBS="$pythonlibs"
400 PYTHON_INCLUDES="$pythonincludes"
403 AC_SUBST(PYTHON_LIBS)
404 AC_SUBST(PYTHON_INCLUDES)
406 AM_CONDITIONAL([BUILD_MIXER], [test x$build_mixer = xyes])
407 AM_CONDITIONAL([BUILD_PCM], [test x$build_pcm = xyes])
408 AM_CONDITIONAL([BUILD_RAWMIDI], [test x$build_rawmidi = xyes])
409 AM_CONDITIONAL([BUILD_HWDEP], [test x$build_hwdep = xyes])
410 AM_CONDITIONAL([BUILD_SEQ], [test x$build_seq = xyes])
411 AM_CONDITIONAL([BUILD_UCM], [test x$build_ucm = xyes])
412 AM_CONDITIONAL([BUILD_TOPOLOGY], [test x$build_topology = xyes])
413 AM_CONDITIONAL([BUILD_ALISP], [test x$build_alisp = xyes])
414 AM_CONDITIONAL([BUILD_PYTHON], [test x$build_python = xyes])
416 if test "$build_mixer" = "yes"; then
417 AC_DEFINE([BUILD_MIXER], "1", [Build mixer component])
419 if test "$build_pcm" = "yes"; then
420 AC_DEFINE([BUILD_PCM], "1", [Build PCM component])
422 if test "$build_rawmidi" = "yes"; then
423 AC_DEFINE([BUILD_RAWMIDI], "1", [Build raw MIDI component])
425 if test "$build_hwdep" = "yes"; then
426 AC_DEFINE([BUILD_HWDEP], "1", [Build hwdep component])
428 if test "$build_seq" = "yes"; then
429 AC_DEFINE([BUILD_SEQ], "1", [Build sequencer component])
431 if test "$build_ucm" = "yes"; then
432 AC_DEFINE([BUILD_UCM], "1", [Build UCM component])
434 if test "$build_topology" = "yes"; then
435 AC_DEFINE([BUILD_TOPOLOGY], "1", [Build DSP Topology component])
440 if test "$build_pcm" = "yes"; then
441 AC_ARG_WITH(pcm-plugins,
442 AS_HELP_STRING([--with-pcm-plugins=<list>],
443 [build PCM plugins (default = all)]),
444 [pcm_plugins="$withval"], [pcm_plugins="all"])
449 dnl check atomics for pcm_meter
451 AC_MSG_CHECKING([whether GCC supports builtin atomic intrinsics])
452 if test -z "$gcc_have_atomics"; then
456 __atomic_load_n(&i, __ATOMIC_SEQ_CST);
457 __atomic_add_fetch(&i, 0, __ATOMIC_SEQ_CST);
459 [gcc_have_atomics=yes],
460 [gcc_have_atomics=no])
462 AC_MSG_RESULT($gcc_have_atomics)
464 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"
466 build_pcm_plugin="no"
467 for t in $PCM_PLUGIN_LIST; do
468 eval build_pcm_$t="no"
471 pcm_plugins=`echo $pcm_plugins | sed 's/,/ /g'`
472 for p in $pcm_plugins; do
473 for t in $PCM_PLUGIN_LIST; do
474 if test "$p" = "$t" -o "$p" = "all"; then
475 eval build_pcm_$t="yes"
476 build_pcm_plugin="yes"
481 dnl special dependencies
482 if test "$build_pcm_plug" = "yes"; then
483 build_pcm_linear="yes"
487 if test "$build_pcm_ioplug" = "yes"; then
488 build_pcm_extplug="yes"
491 if test "$HAVE_LIBDL" != "yes"; then
493 build_pcm_ladspa="no"
494 build_pcm_pcm_ioplug="no"
495 build_pcm_pcm_extplug="no"
498 if test "$HAVE_LIBPTHREAD" != "yes"; then
502 if test "$softfloat" = "yes"; then
503 build_pcm_lfloat="no"
504 build_pcm_ladspa="no"
507 if test "$gcc_have_atomics" != "yes"; then
511 if test "$ac_cv_header_sys_shm_h" != "yes"; then
513 build_pcm_dshare="no"
514 build_pcm_dsnoop="no"
518 AM_CONDITIONAL([BUILD_PCM_PLUGIN], [test x$build_pcm_plugin = xyes])
519 AM_CONDITIONAL([BUILD_PCM_PLUGIN_COPY], [test x$build_pcm_copy = xyes])
520 AM_CONDITIONAL([BUILD_PCM_PLUGIN_LINEAR], [test x$build_pcm_linear = xyes])
521 AM_CONDITIONAL([BUILD_PCM_PLUGIN_ROUTE], [test x$build_pcm_route = xyes])
522 AM_CONDITIONAL([BUILD_PCM_PLUGIN_MULAW], [test x$build_pcm_mulaw = xyes])
523 AM_CONDITIONAL([BUILD_PCM_PLUGIN_ALAW], [test x$build_pcm_alaw = xyes])
524 AM_CONDITIONAL([BUILD_PCM_PLUGIN_ADPCM], [test x$build_pcm_adpcm = xyes])
525 AM_CONDITIONAL([BUILD_PCM_PLUGIN_RATE], [test x$build_pcm_rate = xyes])
526 AM_CONDITIONAL([BUILD_PCM_PLUGIN_PLUG], [test x$build_pcm_plug = xyes])
527 AM_CONDITIONAL([BUILD_PCM_PLUGIN_MULTI], [test x$build_pcm_multi = xyes])
528 AM_CONDITIONAL([BUILD_PCM_PLUGIN_SHM], [test x$build_pcm_shm = xyes])
529 AM_CONDITIONAL([BUILD_PCM_PLUGIN_FILE], [test x$build_pcm_file = xyes])
530 AM_CONDITIONAL([BUILD_PCM_PLUGIN_NULL], [test x$build_pcm_null = xyes])
531 AM_CONDITIONAL([BUILD_PCM_PLUGIN_EMPTY], [test x$build_pcm_empty = xyes])
532 AM_CONDITIONAL([BUILD_PCM_PLUGIN_SHARE], [test x$build_pcm_share = xyes])
533 AM_CONDITIONAL([BUILD_PCM_PLUGIN_METER], [test x$build_pcm_meter = xyes])
534 AM_CONDITIONAL([BUILD_PCM_PLUGIN_HOOKS], [test x$build_pcm_hooks = xyes])
535 AM_CONDITIONAL([BUILD_PCM_PLUGIN_LFLOAT], [test x$build_pcm_lfloat = xyes])
536 AM_CONDITIONAL([BUILD_PCM_PLUGIN_LADSPA], [test x$build_pcm_ladspa = xyes])
537 AM_CONDITIONAL([BUILD_PCM_PLUGIN_DMIX], [test x$build_pcm_dmix = xyes])
538 AM_CONDITIONAL([BUILD_PCM_PLUGIN_DSHARE], [test x$build_pcm_dshare = xyes])
539 AM_CONDITIONAL([BUILD_PCM_PLUGIN_DSNOOP], [test x$build_pcm_dsnoop = xyes])
540 AM_CONDITIONAL([BUILD_PCM_PLUGIN_ASYM], [test x$build_pcm_asym = xyes])
541 AM_CONDITIONAL([BUILD_PCM_PLUGIN_IEC958], [test x$build_pcm_iec958 = xyes])
542 AM_CONDITIONAL([BUILD_PCM_PLUGIN_SOFTVOL], [test x$build_pcm_softvol = xyes])
543 AM_CONDITIONAL([BUILD_PCM_PLUGIN_EXTPLUG], [test x$build_pcm_extplug = xyes])
544 AM_CONDITIONAL([BUILD_PCM_PLUGIN_IOPLUG], [test x$build_pcm_ioplug = xyes])
545 AM_CONDITIONAL([BUILD_PCM_PLUGIN_MMAP_EMUL], [test x$build_pcm_mmap_emul = xyes])
547 dnl Defines for plug plugin
548 if test "$build_pcm_rate" = "yes"; then
549 AC_DEFINE([BUILD_PCM_PLUGIN_RATE], "1", [Build PCM rate plugin])
551 if test "$build_pcm_route" = "yes"; then
552 AC_DEFINE([BUILD_PCM_PLUGIN_ROUTE], "1", [Build PCM route plugin])
554 if test "$build_pcm_lfloat" = "yes"; then
555 AC_DEFINE([BUILD_PCM_PLUGIN_LFLOAT], "1", [Build PCM lfloat plugin])
557 if test "$build_pcm_adpcm" = "yes"; then
558 AC_DEFINE([BUILD_PCM_PLUGIN_ADPCM], "1", [Build PCM adpcm plugin])
560 if test "$build_pcm_mulaw" = "yes"; then
561 AC_DEFINE([BUILD_PCM_PLUGIN_MULAW], "1", [Build PCM mulaw plugin])
563 if test "$build_pcm_alaw" = "yes"; then
564 AC_DEFINE([BUILD_PCM_PLUGIN_ALAW], "1", [Build PCM alaw plugin])
566 if test "$build_pcm_mmap_emul" = "yes"; then
567 AC_DEFINE([BUILD_PCM_PLUGIN_MMAP_EMUL], "1", [Build PCM mmap-emul plugin])
571 dnl Create PCM plugin symbol list for static library
572 rm -f "$srcdir"/src/pcm/pcm_symbols_list.c
573 touch "$srcdir"/src/pcm/pcm_symbols_list.c
574 for t in $PCM_PLUGIN_LIST; do
575 if eval test \$build_pcm_$t = yes; then
576 echo \&_snd_module_pcm_$t, >> "$srcdir"/src/pcm/pcm_symbols_list.c
582 AC_ARG_WITH(ctl-plugins,
583 AS_HELP_STRING([--with-ctl-plugins=<list>],
584 [build control plugins (default = all)]),
585 [ctl_plugins="$withval"], [ctl_plugins="all"])
587 CTL_PLUGIN_LIST="shm ext"
589 build_ctl_plugin="no"
590 for t in $CTL_PLUGIN_LIST; do
591 eval build_ctl_$t="no"
594 ctl_plugins=`echo $ctl_plugins | sed 's/,/ /g'`
595 for p in $ctl_plugins; do
596 for t in $CTL_PLUGIN_LIST; do
597 if test "$p" = "$t" -o "$p" = "all"; then
598 eval build_ctl_$t="yes"
599 build_ctl_plugin="yes"
604 if test "$ac_cv_header_sys_shm_h" != "yes"; then
608 AM_CONDITIONAL([BUILD_CTL_PLUGIN], [test x$build_ctl_plugin = xyes])
609 AM_CONDITIONAL([BUILD_CTL_PLUGIN_SHM], [test x$build_ctl_shm = xyes])
610 AM_CONDITIONAL([BUILD_CTL_PLUGIN_EXT], [test x$build_ctl_ext = xyes])
612 dnl Create ctl plugin symbol list for static library
613 rm -f "$srcdir"/src/control/ctl_symbols_list.c
614 touch "$srcdir"/src/control/ctl_symbols_list.c
615 for t in $CTL_PLUGIN_LIST; do
616 if eval test \$build_ctl_$t = yes; then
617 echo \&_snd_module_control_$t, >> "$srcdir"/src/control/ctl_symbols_list.c
621 dnl Max number of cards
622 AC_MSG_CHECKING(for max number of cards)
623 AC_ARG_WITH(max-cards,
624 AS_HELP_STRING([--with-max-cards], [Specify the max number of cards (default = 32)]),
625 [ max_cards="$withval" ], [ max_cards="32" ])
626 AC_MSG_RESULT([$max_cards])
628 if test "$max_cards" -lt 1; then
629 AC_ERROR([Invalid max cards $max_cards])
630 elif test "$max_cards" -gt 256; then
631 AC_ERROR([Invalid max cards $max_cards])
633 AC_DEFINE_UNQUOTED(SND_MAX_CARDS, $max_cards, [Max number of cards])
635 dnl Check for thread-safe API functions
636 if test "$HAVE_LIBPTHREAD" = "yes"; then
637 AC_MSG_CHECKING(for thread-safe API functions)
638 AC_ARG_ENABLE(thread-safety,
639 AS_HELP_STRING([--disable-thread-safety],
640 [disable thread-safe API functions]),
641 threadsafe="$enableval", threadsafe="yes")
642 if test "$threadsafe" = "yes"; then
644 AC_DEFINE([THREAD_SAFE_API], "1", [Disable thread-safe API functions])
650 dnl Make a symlink for inclusion of alsa/xxx.h
651 if test ! -L "$srcdir"/include/alsa ; then
652 echo "Making a symlink include/alsa"
653 rm -f "$srcdir"/include/alsa
654 ln -sf . "$srcdir"/include/alsa
657 AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
658 include/Makefile include/sound/Makefile src/Versions src/Makefile \
659 src/control/Makefile src/mixer/Makefile \
660 src/pcm/Makefile src/pcm/scopes/Makefile \
661 src/rawmidi/Makefile src/timer/Makefile \
662 src/hwdep/Makefile src/seq/Makefile src/ucm/Makefile \
663 src/alisp/Makefile src/topology/Makefile \
664 src/conf/Makefile src/conf/alsa.conf.d/Makefile \
665 src/conf/cards/Makefile \
666 src/conf/pcm/Makefile \
667 src/conf/ucm/Makefile \
668 src/conf/ucm/DAISY-I2S/Makefile \
669 src/conf/ucm/PandaBoard/Makefile \
670 src/conf/ucm/PandaBoardES/Makefile \
671 src/conf/ucm/SDP4430/Makefile \
672 src/conf/ucm/tegraalc5632/Makefile \
673 src/conf/ucm/PAZ00/Makefile \
674 src/conf/ucm/GoogleNyan/Makefile \
675 src/conf/ucm/broadwell-rt286/Makefile \
676 src/conf/ucm/VEYRON-I2S/Makefile \
677 src/conf/ucm/chtrt5645/Makefile \
678 src/conf/ucm/DB410c/Makefile \
679 src/conf/topology/Makefile \
680 src/conf/topology/broadwell/Makefile \
681 modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \
682 src/conf/topology/sklrt286/data/Makefile \
683 src/conf/topology/sklrt286/Makefile \
684 alsalisp/Makefile aserver/Makefile \
685 test/Makefile test/lsb/Makefile \
686 utils/Makefile utils/alsa-lib.spec utils/alsa.pc)
688 dnl Create asoundlib.h dynamically according to configure options
689 echo "Creating asoundlib.h..."
690 cp "$srcdir"/include/asoundlib-head.h include/asoundlib.h
691 test "$ac_cv_header_endian_h" = "yes" && echo "#include <endian.h>" >> include/asoundlib.h
692 if test "$ac_cv_header_sys_endian_h" = "yes"; then
693 cat >> include/asoundlib.h <<EOF
694 #include <sys/endian.h>
696 #define __BYTE_ORDER BYTE_ORDER
698 #ifndef __LITTLE_ENDIAN
699 #define __LITTLE_ENDIAN LITTLE_ENDIAN
702 #define __BIG_ENDIAN BIG_ENDIAN
706 cat >> include/asoundlib.h <<EOF
709 #define __inline__ inline
712 #include <alsa/asoundef.h>
713 #include <alsa/version.h>
714 #include <alsa/global.h>
715 #include <alsa/input.h>
716 #include <alsa/output.h>
717 #include <alsa/error.h>
718 #include <alsa/conf.h>
720 test "$build_pcm" = "yes" && echo "#include <alsa/pcm.h>" >> include/asoundlib.h
721 test "$build_rawmidi" = "yes" && echo "#include <alsa/rawmidi.h>" >> include/asoundlib.h
722 test "$build_pcm" = "yes" && echo "#include <alsa/timer.h>" >> include/asoundlib.h
723 test "$build_hwdep" = "yes" && echo "#include <alsa/hwdep.h>" >> include/asoundlib.h
724 echo "#include <alsa/control.h>" >> include/asoundlib.h
725 test "$build_mixer" = "yes" && echo "#include <alsa/mixer.h>" >> include/asoundlib.h
726 test "$build_seq" = "yes" && echo "#include <alsa/seq_event.h>" >> include/asoundlib.h
727 test "$build_seq" = "yes" && echo "#include <alsa/seq.h>" >> include/asoundlib.h
728 test "$build_seq" = "yes" && echo "#include <alsa/seqmid.h>" >> include/asoundlib.h
729 test "$build_seq" = "yes" && echo "#include <alsa/seq_midi_event.h>" >> include/asoundlib.h
730 cat "$srcdir"/include/asoundlib-tail.h >> include/asoundlib.h