Changes conf path to /hal/share/alsa
[platform/upstream/alsa-lib.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.59)
3 AC_INIT(alsa-lib, 1.0.28)
4
5 AC_CONFIG_SRCDIR([src/control/control.c])
6 AC_CONFIG_MACRO_DIR([m4])
7
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 *************************************************
15 AC_CANONICAL_HOST
16 AM_INIT_AUTOMAKE
17 eval LIBTOOL_VERSION_INFO="2:0:0"
18 dnl *************************************************
19 AM_CONDITIONAL([INSTALL_M4], [test -n "${ACLOCAL}"])
20
21 AM_MAINTAINER_MODE([enable])
22
23 # Test for new silent rules and enable only if they are available
24 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
25
26 AC_PREFIX_DEFAULT(/usr)
27
28 dnl Checks for programs.
29
30 dnl try to gues cross-compiler if not set
31 if test "x$host" != "x$build" -a -z "`echo $CC | grep -e '-gcc'`";
32 then
33   AC_MSG_CHECKING(for cross-compiler)
34
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
40
41   AC_MSG_RESULT($CC)
42 fi
43             
44 CFLAGS="$CFLAGS -D_GNU_SOURCE"
45
46
47 AC_PROG_CC
48 AC_PROG_CPP
49 AC_PROG_INSTALL
50 AC_PROG_LN_S 
51 AC_DISABLE_STATIC
52 AC_LIBTOOL_DLOPEN
53 AM_PROG_LIBTOOL
54
55 CC_NOUNDEFINED
56
57 dnl Checks for header files.
58 AC_HEADER_STDC
59 AC_CONFIG_HEADERS(include/config.h)
60
61 dnl Checks for typedefs, structures, and compiler characteristics.
62 AC_C_CONST
63 AC_C_INLINE
64 AC_HEADER_TIME
65
66 dnl Checks for library functions.
67 AC_PROG_GCC_TRADITIONAL
68 AC_CHECK_FUNCS([uselocale])
69
70 SAVE_LIBRARY_VERSION
71 AC_SUBST(LIBTOOL_VERSION_INFO)
72
73 test "x$prefix" = xNONE && prefix=$ac_default_prefix
74
75 dnl Do not build static and shared libraries together
76 if test "$enable_static" = "$enable_shared" -a "$enable_static" = "yes"; then
77 cat <<EOF
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
80   --enable-static=yes).
81 EOF
82   exit 1
83 fi
84
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
91     eval dir="$datadir"
92     case "$dir" in
93     /*) ;;
94     *) dir="$prefix/share"
95     esac
96     confdir="$dir/alsa"
97 fi
98 ALSA_CONFIG_DIR="$confdir"
99 AC_DEFINE_UNQUOTED(ALSA_CONFIG_DIR, "$confdir", [directory containing ALSA configuration database])
100 AC_SUBST(ALSA_CONFIG_DIR)
101
102 dnl ALSA plugin directory
103 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
104
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
110     eval dir="$libdir"
111     case "$dir" in
112     /*) ;;
113     *) dir="$dir"
114     esac
115     plugindir="$dir/$PACKAGE"
116 fi
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)
120
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
126     eval dir="$libdir"
127     case "$dir" in
128     /*) ;;
129     *) dir="$dir"
130     esac
131     pkgconfdir="$dir/pkgconfig"
132 fi
133 AC_DEFINE_UNQUOTED(ALSA_PKGCONF_DIR, "$pkgconfdir", [directory containing pkgconfig files])
134 ALSA_PKGCONF_DIR="$pkgconfdir"
135 AC_SUBST(ALSA_PKGCONF_DIR)
136
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`
148   pass=0
149   if test $major -eq 1 && test $minor -gt 3; then
150     pass=1
151   else
152     if test $major -gt 1; then
153       pass=1
154     fi
155   fi
156   if test $pass -eq 1; then
157     AC_DEFINE(VERSIONED_SYMBOLS,,[compiled with versioned symbols])
158     AC_MSG_RESULT(yes)
159   else
160     AC_MSG_RESULT(broken libtool - use libtool v1.4+; no versions)
161   fi
162 else
163   AC_MSG_RESULT(no)
164 fi
165 AM_CONDITIONAL([VERSIONED_SYMBOLS], [test x$versioned = xyes])
166
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
175     AC_MSG_RESULT(yes)
176   else
177     AC_MSG_RESULT(not supported by ld)
178     symfuncs="no"
179   fi
180 else
181   AC_MSG_RESULT(no)
182 fi
183 AM_CONDITIONAL([SYMBOLIC_FUNCTIONS], [test x"$symfuncs" = xyes])
184
185 dnl See if toolchain has a custom prefix for symbols ...
186 AC_MSG_CHECKING(for custom symbol prefixes)
187 SYMBOL_PREFIX=` \
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)
195
196 dnl Check for debug...
197 AC_MSG_CHECKING(for debug)
198 AC_ARG_WITH(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
203   AC_MSG_RESULT(yes)
204 else
205   AC_DEFINE(NDEBUG,,[No assert debug])
206   AC_MSG_RESULT(no)
207 fi
208
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
216     AC_MSG_RESULT(yes)
217     AC_DEFINE(ALSA_DEBUG_ASSERT,,[Enable assert at error message handler])
218   else
219     AC_MSG_RESULT(no)
220   fi
221 fi
222
223 dnl Temporary directory
224 AC_MSG_CHECKING(for tmpdir)
225 AC_ARG_WITH(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])
231
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)]),
237   [case "$withval" in
238         y|yes) softfloat=yes ;;
239         *) softfloat=no ;;
240    esac],)
241 if test "$softfloat" = "yes" ; then
242   AC_DEFINE(HAVE_SOFT_FLOAT, "1", [Avoid calculation in float])
243   AC_MSG_RESULT(yes)
244 else
245   AC_MSG_RESULT(no)
246 fi
247
248 ALSA_DEPLIBS=""
249 if test "$softfloat" != "yes"; then
250   ALSA_DEPLIBS="-lm"
251 fi
252
253 dnl Check for libdl
254 AC_MSG_CHECKING(for libdl)
255 AC_ARG_WITH(libdl,
256   AS_HELP_STRING([--with-libdl], [Use libdl for plugins (default = yes)]),
257   [ have_libdl="$withval" ], [ have_libdl="yes" ])
258 HAVE_LIBDL=
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])
264   fi
265 else
266   AC_MSG_RESULT(no)
267 fi
268 AM_CONDITIONAL([BUILD_MODULES], [test "$HAVE_LIBDL" = "yes"])
269
270 dnl Check for pthread
271 AC_MSG_CHECKING(for pthread)
272 AC_ARG_WITH(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])
280   fi
281 else
282   AC_MSG_RESULT(no)
283 fi
284
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])])
294
295 dnl Check for librt
296 AC_MSG_CHECKING(for librt)
297 AC_ARG_WITH(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])
306   fi
307 else
308   AC_MSG_RESULT(no)
309 fi
310
311 AC_SUBST(ALSA_DEPLIBS)
312
313 dnl Check for headers
314 AC_CHECK_HEADERS([wordexp.h endian.h sys/endian.h])
315
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])
326 fi
327
328 dnl Check for aload* support...
329 AC_MSG_CHECKING(for aload* support)
330 AC_ARG_ENABLE(aload,
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])
336 fi
337
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/"
348 fi
349 AC_DEFINE_UNQUOTED(ALSA_DEVICE_DIRECTORY, "$alsa_dev_dir", [Directory with ALSA device files])
350 AC_MSG_RESULT([$alsa_dev_dir])
351
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/"
360 fi
361 AC_DEFINE_UNQUOTED(ALOAD_DEVICE_DIRECTORY, "$aload_dev_dir", [Directory with aload* device files])
362 AC_MSG_RESULT([$aload_dev_dir])
363
364 dnl Build conditions
365 AC_ARG_ENABLE(mixer,
366   AS_HELP_STRING([--disable-mixer], [disable the mixer component]),
367   [build_mixer="$enableval"], [build_mixer="yes"])
368 AC_ARG_ENABLE(pcm,
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"])
374 AC_ARG_ENABLE(hwdep,
375   AS_HELP_STRING([--disable-hwdep], [disable the hwdep component]),
376   [build_hwdep="$enableval"], [build_hwdep="yes"])
377 AC_ARG_ENABLE(seq,
378   AS_HELP_STRING([--disable-seq], [disable the sequencer component]),
379   [build_seq="$enableval"], [build_seq="yes"])
380 AC_ARG_ENABLE(ucm,
381   AS_HELP_STRING([--disable-ucm], [disable the use-case-manager component]),
382   [build_ucm="$enableval"], [build_ucm="yes"])
383 AC_ARG_ENABLE(alisp,
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])
391
392 AC_ARG_ENABLE(python,
393   AS_HELP_STRING([--disable-python], [disable the python components]),
394   [build_python="$enableval"], [build_python="yes"])
395 PYTHON_LIBS=""
396 PYTHON_INCLUDES=""
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."
410     build_python="no"
411   else
412     PYTHON_LIBS="$pythonlibs"
413     PYTHON_INCLUDES="$pythonincludes"
414   fi
415 fi
416 AC_SUBST(PYTHON_LIBS)
417 AC_SUBST(PYTHON_INCLUDES)
418
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])
427
428 if test "$build_mixer" = "yes"; then
429   AC_DEFINE([BUILD_MIXER], "1", [Build mixer component])
430 fi
431 if test "$build_pcm" = "yes"; then
432   AC_DEFINE([BUILD_PCM], "1", [Build PCM component])
433 fi
434 if test "$build_rawmidi" = "yes"; then
435   AC_DEFINE([BUILD_RAWMIDI], "1", [Build raw MIDI component])
436 fi
437 if test "$build_hwdep" = "yes"; then
438   AC_DEFINE([BUILD_HWDEP], "1", [Build hwdep component])
439 fi
440 if test "$build_seq" = "yes"; then
441   AC_DEFINE([BUILD_SEQ], "1", [Build sequencer component])
442 fi
443 if test "$build_ucm" = "yes"; then
444   AC_DEFINE([BUILD_UCM], "1", [Build UCM component])
445 fi
446
447 dnl PCM Plugins
448
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"])
454 else
455 pcm_plugins=""
456 fi
457
458 dnl check atomics for pcm_meter
459
460 AC_MSG_CHECKING([whether GCC supports builtin atomic intrinsics])
461 if test -z "$gcc_have_atomics"; then
462   gcc_have_atomics=no
463   AC_TRY_LINK([],
464     [int i;
465      __atomic_load_n(&i, __ATOMIC_SEQ_CST);
466      __atomic_add_fetch(&i, 0, __ATOMIC_SEQ_CST);
467     ],
468     [gcc_have_atomics=yes],
469     [gcc_have_atomics=no])
470 fi
471 AC_MSG_RESULT($gcc_have_atomics)
472
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"
474
475 build_pcm_plugin="no"
476 for t in $PCM_PLUGIN_LIST; do
477   eval build_pcm_$t="no"
478 done
479
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"
486     fi
487   done
488 done
489
490 dnl special dependencies
491 if test "$build_pcm_plug" = "yes"; then
492   build_pcm_linear="yes"
493   build_pcm_copy="yes"
494 fi
495
496 if test "$build_pcm_ioplug" = "yes"; then
497   build_pcm_extplug="yes"
498 fi
499
500 if test "$HAVE_LIBDL" != "yes"; then
501   build_pcm_meter="no"
502   build_pcm_ladspa="no"
503   build_pcm_pcm_ioplug="no"
504   build_pcm_pcm_extplug="no"
505 fi
506
507 if test "$HAVE_LIBPTHREAD" != "yes"; then
508   build_pcm_share="no"
509 fi
510
511 if test "$softfloat" = "yes"; then
512   build_pcm_lfloat="no"
513   build_pcm_ladspa="no"
514 fi
515
516 if test "$gcc_have_atomics" != "yes"; then
517   build_pcm_meter="no"
518 fi
519
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])
548
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])
552 fi
553 if test "$build_pcm_route" = "yes"; then
554   AC_DEFINE([BUILD_PCM_PLUGIN_ROUTE], "1", [Build PCM route plugin])
555 fi
556 if test "$build_pcm_lfloat" = "yes"; then
557   AC_DEFINE([BUILD_PCM_PLUGIN_LFLOAT], "1", [Build PCM lfloat plugin])
558 fi
559 if test "$build_pcm_adpcm" = "yes"; then
560   AC_DEFINE([BUILD_PCM_PLUGIN_ADPCM], "1", [Build PCM adpcm plugin])
561 fi
562 if test "$build_pcm_mulaw" = "yes"; then
563   AC_DEFINE([BUILD_PCM_PLUGIN_MULAW], "1", [Build PCM mulaw plugin])
564 fi
565 if test "$build_pcm_alaw" = "yes"; then
566   AC_DEFINE([BUILD_PCM_PLUGIN_ALAW], "1", [Build PCM alaw plugin])
567 fi
568 if test "$build_pcm_mmap_emul" = "yes"; then
569   AC_DEFINE([BUILD_PCM_PLUGIN_MMAP_EMUL], "1", [Build PCM mmap-emul plugin])
570 fi
571
572
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
579   fi
580 done
581
582 dnl Control Plugins
583
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"])
588
589 CTL_PLUGIN_LIST="shm ext"
590
591 build_ctl_plugin="no"
592 for t in $CTL_PLUGIN_LIST; do
593   eval build_ctl_$t="no"
594 done
595
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"
602     fi
603   done
604 done
605
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])
609
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
616   fi
617 done
618
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])
625
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])
630 fi
631 AC_DEFINE_UNQUOTED(SND_MAX_CARDS, $max_cards, [Max number of cards])
632
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
638 fi
639
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 \
646           src/alisp/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           modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \
657           alsalisp/Makefile aserver/Makefile \
658           test/Makefile test/lsb/Makefile \
659           utils/Makefile utils/alsa-lib.spec utils/alsa.pc)
660
661 dnl Create asoundlib.h dynamically according to configure options
662 echo "Creating asoundlib.h..."
663 cp "$srcdir"/include/asoundlib-head.h include/asoundlib.h
664 test "$ac_cv_header_endian_h" = "yes" && echo "#include <endian.h>" >> include/asoundlib.h
665 if test "$ac_cv_header_sys_endian_h" = "yes"; then
666 cat >> include/asoundlib.h <<EOF
667 #include <sys/endian.h>
668 #ifndef __BYTE_ORDER
669 #define __BYTE_ORDER BYTE_ORDER
670 #endif
671 #ifndef __LITTLE_ENDIAN
672 #define __LITTLE_ENDIAN LITTLE_ENDIAN
673 #endif
674 #ifndef __BIG_ENDIAN
675 #define __BIG_ENDIAN BIG_ENDIAN
676 #endif
677 EOF
678 fi
679 cat >> include/asoundlib.h <<EOF
680
681 #ifndef __GNUC__
682 #define __inline__ inline
683 #endif
684
685 #include <alsa/asoundef.h>
686 #include <alsa/version.h>
687 #include <alsa/global.h>
688 #include <alsa/input.h>
689 #include <alsa/output.h>
690 #include <alsa/error.h>
691 #include <alsa/conf.h>
692 EOF
693 test "$build_pcm" = "yes" && echo "#include <alsa/pcm.h>" >> include/asoundlib.h
694 test "$build_rawmidi" = "yes" && echo "#include <alsa/rawmidi.h>" >> include/asoundlib.h
695 test "$build_pcm" = "yes" && echo "#include <alsa/timer.h>" >> include/asoundlib.h
696 test "$build_hwdep" = "yes" && echo "#include <alsa/hwdep.h>" >> include/asoundlib.h
697 echo "#include <alsa/control.h>" >> include/asoundlib.h
698 test "$build_mixer" = "yes" && echo "#include <alsa/mixer.h>" >> include/asoundlib.h
699 test "$build_seq" = "yes" && echo "#include <alsa/seq_event.h>" >> include/asoundlib.h
700 test "$build_seq" = "yes" && echo "#include <alsa/seq.h>" >> include/asoundlib.h
701 test "$build_seq" = "yes" && echo "#include <alsa/seqmid.h>" >> include/asoundlib.h
702 test "$build_seq" = "yes" && echo "#include <alsa/seq_midi_event.h>" >> include/asoundlib.h
703 cat "$srcdir"/include/asoundlib-tail.h >> include/asoundlib.h
704