tizen 2.3.1 release
[external/alsa-lib.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.59)
3 AC_INIT(src/control/control.c)
4
5 AC_CONFIG_MACRO_DIR([m4])
6
7 dnl *************************************************
8 dnl current:revision:age
9 dnl change (without API) = c:r+1:a
10 dnl change API = c+1:0:a
11 dnl add API = c+1:0:a+1
12 dnl remove API = c+1:0:0
13 dnl *************************************************
14 AC_CANONICAL_HOST
15 AM_INIT_AUTOMAKE(alsa-lib, 1.0.25)
16 eval LIBTOOL_VERSION_INFO="2:0:0"
17 dnl *************************************************
18 AM_CONDITIONAL(INSTALL_M4, test -n "${ACLOCAL}")
19
20 # Test for new silent rules and enable only if they are available
21 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
22
23 AC_PREFIX_DEFAULT(/usr)
24
25 dnl Checks for programs.
26
27 dnl try to gues cross-compiler if not set
28 if test "x$host" != "x$build" -a -z "`echo $CC | grep -e '-gcc'`";
29 then
30   AC_MSG_CHECKING(for cross-compiler)
31
32   which ${program_prefix}gcc >/dev/null 2>&1 && CC=${program_prefix}gcc
33   which ${host_cpu}-${host_os}-gcc >/dev/null 2>&1 \
34   && CC=${host_cpu}-${host-os}-gcc
35   which ${host_cpu}-${host_vendor}-${host_os}-gcc >/dev/null 2>&1 \
36   && CC=${host_cpu}-${host_vendor}-${host_os}-gcc
37
38   AC_MSG_RESULT($CC)
39 fi
40             
41 CFLAGS="$CFLAGS -D_GNU_SOURCE"
42
43
44 AC_PROG_CC
45 AC_PROG_CPP
46 AC_PROG_INSTALL
47 AC_PROG_LN_S 
48 AC_DISABLE_STATIC
49 AC_LIBTOOL_DLOPEN
50 AM_PROG_LIBTOOL
51
52 CC_NOUNDEFINED
53
54 dnl Checks for header files.
55 AC_HEADER_STDC
56 AM_CONFIG_HEADER(include/config.h)
57
58 dnl Checks for typedefs, structures, and compiler characteristics.
59 AC_C_CONST
60 AC_C_INLINE
61 AC_HEADER_TIME
62
63 dnl Checks for library functions.
64 AC_PROG_GCC_TRADITIONAL
65 AC_CHECK_FUNC([hsearch_r], [HAVE_HSEARCH_R=yes])
66 AM_CONDITIONAL(ALSA_HSEARCH_R, [test "x$HAVE_HSEARCH_R" != xyes])
67 AC_CHECK_FUNCS([uselocale])
68
69 SAVE_LIBRARY_VERSION
70 AC_SUBST(LIBTOOL_VERSION_INFO)
71
72 test "x$prefix" = xNONE && prefix=$ac_default_prefix
73
74 dnl Do not build static and shared libraries together
75 if test "$enable_static" = "$enable_shared" -a "$enable_static" = "yes"; then
76 cat <<EOF
77   Please, do not try to compile static and shared libraries together.
78   See INSTALL file for more details (do not use --enable-shared=yes with
79   --enable-static=yes).
80 EOF
81   exit 1
82 fi
83
84 dnl ALSA configuration directory
85 AC_ARG_WITH(configdir,
86     AS_HELP_STRING([--with-configdir=dir],
87         [path where ALSA config files are stored]),
88     confdir="$withval", confdir="")
89 if test -z "$confdir"; then
90     eval dir="$datadir"
91     case "$dir" in
92     /*) ;;
93     *) dir="$prefix/share"
94     esac
95     confdir="$dir/alsa"
96 fi
97 ALSA_CONFIG_DIR="$confdir"
98 AC_DEFINE_UNQUOTED(ALSA_CONFIG_DIR, "$confdir", [directory containing ALSA configuration database])
99 AC_SUBST(ALSA_CONFIG_DIR)
100
101 dnl ALSA plugin directory
102 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
103
104 AC_ARG_WITH(plugindir,
105     AS_HELP_STRING([--with-plugindir=dir],
106         [path where ALSA plugin files are stored]),
107     plugindir="$withval", plugindir="")
108 if test -z "$plugindir"; then
109     eval dir="$libdir"
110     case "$dir" in
111     /*) ;;
112     *) dir="$dir"
113     esac
114     plugindir="$dir/$PACKAGE"
115 fi
116 AC_DEFINE_UNQUOTED(ALSA_PLUGIN_DIR, "$plugindir", [directory containing ALSA add-on modules])
117 ALSA_PLUGIN_DIR="$plugindir"
118 AC_SUBST(ALSA_PLUGIN_DIR)
119
120 AC_ARG_WITH(pkgconfdir,
121     AS_HELP_STRING([--with-pkgconfdir=dir],
122         [path where pkgconfig files are stored]),
123     pkgconfdir="$withval", pkgconfdir="")
124 if test -z "$pkgconfdir"; then
125     eval dir="$libdir"
126     case "$dir" in
127     /*) ;;
128     *) dir="$dir"
129     esac
130     pkgconfdir="$dir/pkgconfig"
131 fi
132 AC_DEFINE_UNQUOTED(ALSA_PKGCONF_DIR, "$pkgconfdir", [directory containing pkgconfig files])
133 ALSA_PKGCONF_DIR="$pkgconfdir"
134 AC_SUBST(ALSA_PKGCONF_DIR)
135
136 dnl Check for versioned symbols
137 AC_MSG_CHECKING(for versioned symbols)
138 AC_ARG_WITH(versioned,
139   AS_HELP_STRING([--with-versioned],
140     [shared library will be compiled with versioned symbols (default = yes)]),
141   versioned="$withval", versioned="yes")
142 if test "$versioned" = "yes"; then
143   # it seems that GNU ld versions since 2.10 are not broken
144   xres=`grep '^VERSION=' ${srcdir}/ltmain.sh | cut -d = -f 2 | cut -d \" -f 2`
145   major=`echo $xres | cut -d . -f 1`
146   minor=`echo $xres | cut -d . -f 2`
147   pass=0
148   if test $major -eq 1 && test $minor -gt 3; then
149     pass=1
150   else
151     if test $major -gt 1; then
152       pass=1
153     fi
154   fi
155   if test $pass -eq 1; then
156     AC_DEFINE(VERSIONED_SYMBOLS,,[compiled with versioned symbols])
157     AC_MSG_RESULT(yes)
158   else
159     AC_MSG_RESULT(broken libtool - use libtool v1.4+; no versions)
160   fi
161 else
162   AC_MSG_RESULT(no)
163 fi
164 AM_CONDITIONAL(VERSIONED_SYMBOLS, test x$versioned = xyes)
165
166 dnl Check for symbolic-functions
167 AC_MSG_CHECKING(for symbolic-functions)
168 AC_ARG_ENABLE(symbolic-functions,
169   AS_HELP_STRING([--enable-symbolic-functions],
170     [use -Bsymbolic-functions option if available (optmization for size and speed)]),
171   symfuncs="$enableval", symfuncs="no")
172 if test "$symfuncs" = "yes"; then
173   if ld --help | grep -q -- '-Bsymbolic-functions'; then
174     AC_MSG_RESULT(yes)
175   else
176     AC_MSG_RESULT(not supported by ld)
177     symfuncs="no"
178   fi
179 else
180   AC_MSG_RESULT(no)
181 fi
182 AM_CONDITIONAL(SYMBOLIC_FUNCTIONS, test x"$symfuncs" = xyes)
183
184 dnl See if toolchain has a custom prefix for symbols ...
185 AC_MSG_CHECKING(for custom symbol prefixes)
186 SYMBOL_PREFIX=` \
187         echo "PREFIX=__USER_LABEL_PREFIX__" \
188                 | ${CPP-${CC-gcc} -E} - 2>&1 \
189                 | ${EGREP-grep} "^PREFIX=" \
190                 | ${SED-sed} "s:^PREFIX=::"`
191 AC_DEFINE_UNQUOTED([__SYMBOL_PREFIX], "$SYMBOL_PREFIX", [Toolchain Symbol Prefix])
192 AC_SUBST(SYMBOL_PREFIX)
193 AC_MSG_RESULT($SYMBOL_PREFIX)
194
195 dnl Check for debug...
196 AC_MSG_CHECKING(for debug)
197 AC_ARG_WITH(debug,
198   AS_HELP_STRING([--with-debug],
199     [library will be compiled with asserts (default = yes)]),
200   debug="$withval", debug="yes")
201 if test "$debug" = "yes"; then
202   AC_MSG_RESULT(yes)
203 else
204   AC_DEFINE(NDEBUG,,[No assert debug])
205   AC_MSG_RESULT(no)
206 fi
207
208 if test "$debug" = "yes"; then
209   AC_MSG_CHECKING(for debug assert)
210   AC_ARG_ENABLE(debug-assert,
211     AS_HELP_STRING([--enable-debug],
212       [enable assert call at the default error message handler]),
213     debug_assert="$enableval", debug_assert="no")
214   if test "$debug_assert" = "yes"; then
215     AC_MSG_RESULT(yes)
216     AC_DEFINE(ALSA_DEBUG_ASSERT,,[Enable assert at error message handler])
217   else
218     AC_MSG_RESULT(no)
219   fi
220 fi
221
222 dnl Temporary directory
223 AC_MSG_CHECKING(for tmpdir)
224 AC_ARG_WITH(tmpdir,
225   AS_HELP_STRING([--with-tmpdir=directory],
226     [directory to put tmp socket files (/tmp)]),
227   tmpdir="$withval", tmpdir="/tmp")
228 AC_MSG_RESULT($tmpdir)
229 AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir", [directory to put tmp socket files])
230
231 dnl Check for softfloat...
232 AC_MSG_CHECKING(for softfloat)
233 AC_ARG_WITH(softfloat,
234   AS_HELP_STRING([--with-softfloat],
235     [do you have floating point unit on this machine? (optional)]),
236   [case "$withval" in
237         y|yes) softfloat=yes ;;
238         *) softfloat=no ;;
239    esac],)
240 if test "$softfloat" = "yes" ; then
241   AC_DEFINE(HAVE_SOFT_FLOAT, "1", [Avoid calculation in float])
242   AC_MSG_RESULT(yes)
243 else
244   AC_MSG_RESULT(no)
245 fi
246
247 ALSA_DEPLIBS=""
248 if test "$softfloat" != "yes"; then
249   ALSA_DEPLIBS="-lm"
250 fi
251
252 dnl Check for libdl
253 AC_MSG_CHECKING(for libdl)
254 AC_ARG_WITH(libdl,
255   AS_HELP_STRING([--with-libdl], [Use libdl for plugins (default = yes)]),
256   [ have_libdl="$withval" ], [ have_libdl="yes" ])
257 if test "$have_libdl" = "yes"; then
258   AC_CHECK_LIB([dl], [dlsym], [HAVE_LIBDL="yes"])
259   if test "$HAVE_LIBDL" = "yes" ; then
260     ALSA_DEPLIBS="$ALSA_DEPLIBS -ldl"
261     AC_DEFINE([HAVE_LIBDL], 1, [Have libdl])
262   fi
263 else
264   AC_MSG_RESULT(no)
265 fi
266 AM_CONDITIONAL(BUILD_MODULES, test "$HAVE_LIBDL"="yes")
267
268 dnl Check for pthread
269 AC_MSG_CHECKING(for pthread)
270 AC_ARG_WITH(pthread,
271   AS_HELP_STRING([--with-pthread], [Use pthread (default = yes)]),
272   [ have_pthread="$withval" ], [ have_pthread="yes" ])
273 if test "$have_pthread" = "yes"; then
274   AC_CHECK_LIB([pthread], [pthread_join], [HAVE_LIBPTHREAD="yes"])
275   if test "$HAVE_LIBPTHREAD" = "yes"; then
276     ALSA_DEPLIBS="$ALSA_DEPLIBS -lpthread"
277     AC_DEFINE([HAVE_LIBPTHREAD], 1, [Have libpthread])
278   fi
279 else
280   AC_MSG_RESULT(no)
281 fi
282
283 dnl Check for librt
284 AC_MSG_CHECKING(for librt)
285 AC_ARG_WITH(librt,
286   AS_HELP_STRING([--with-librt], [Use librt for monotonic clock (default = yes)]),
287   [ have_librt="$withval" ], [ have_librt="yes" ])
288 if test "$have_librt" = "yes"; then
289   AC_CHECK_LIB([rt], [clock_gettime], [HAVE_LIBRT="yes"])
290   if test "$HAVE_LIBRT" = "yes" ; then
291     ALSA_DEPLIBS="$ALSA_DEPLIBS -lrt"
292     AC_DEFINE([HAVE_LIBRT], 1, [Have librt])
293     AC_DEFINE([HAVE_CLOCK_GETTIME], 1, [Have clock gettime])
294   fi
295 else
296   AC_MSG_RESULT(no)
297 fi
298
299 AC_SUBST(ALSA_DEPLIBS)
300
301 dnl Check for architecture
302 AC_MSG_CHECKING(for architecture)
303 case "$host" in
304 i?86*)
305   AC_MSG_RESULT(x86)
306   ;;
307 x86_64*)
308   AC_MSG_RESULT(x86)
309   ;;
310 alpha*)
311   AC_MSG_RESULT(alpha)
312   ;;
313 powerpc*|ppc*)
314   AC_MSG_RESULT(ppc)
315   CPPFLAGS="$CPPFLAGS -D__ppc__"
316   ;;
317 ia64*)
318   AC_MSG_RESULT(ia64)
319   CPPFLAGS="$CPPFLAGS -D__ia64__"
320   ;;
321 mips*)
322   AC_MSG_RESULT(mips)
323   CPPFLAGS="$CPPFLAGS -D__mips__"
324   ;;
325 arm*)
326   AC_MSG_RESULT(arm)
327   CPPFLAGS="$CPPFLAGS -D__arm__"
328   ;;
329 *)
330   AC_MSG_RESULT($host_cpu)
331   echo "No atomic operations supported.." 
332   ;;
333 esac
334
335 dnl Check for wordexp.h
336 AC_CHECK_HEADERS([wordexp.h])
337
338 dnl Check for resmgr support...
339 AC_MSG_CHECKING(for resmgr support)
340 AC_ARG_ENABLE(resmgr,
341   AS_HELP_STRING([--enable-resmgr], [support resmgr (optional)]),
342   resmgr="$enableval", resmgr="no")
343 AC_MSG_RESULT($resmgr)
344 if test "$resmgr" = "yes"; then
345   AC_CHECK_LIB(resmgr, rsm_open_device,,
346     AC_ERROR([Cannot find libresmgr]))
347   AC_DEFINE(SUPPORT_RESMGR, "1", [Support resmgr with alsa-lib])
348 fi
349
350 dnl Check for aload* support...
351 AC_MSG_CHECKING(for aload* support)
352 AC_ARG_ENABLE(aload,
353   AS_HELP_STRING([--disable-aload], [disable reading /dev/aload*]),
354   aload="$enableval", aload="yes")
355 AC_MSG_RESULT($aload)
356 if test "$aload" = "yes"; then
357   AC_DEFINE(SUPPORT_ALOAD, "1", [Support /dev/aload* access for auto-loading])
358 fi
359
360 dnl Check for non-standard /dev directory
361 AC_MSG_CHECKING([for ALSA device file directory])
362 AC_ARG_WITH(alsa-devdir,
363   AS_HELP_STRING([--with-alsa-devdir=dir],
364     [directory with ALSA device files (default /dev/snd)]),
365   [alsa_dev_dir="$withval"],
366   [alsa_dev_dir="/dev/snd"])
367 dnl make sure it has a trailing slash
368 if echo "$alsa_dev_dir" | grep -v '/$' > /dev/null; then
369   alsa_dev_dir="$alsa_dev_dir/"
370 fi
371 AC_DEFINE_UNQUOTED(ALSA_DEVICE_DIRECTORY, "$alsa_dev_dir", [Directory with ALSA device files])
372 AC_MSG_RESULT([$alsa_dev_dir])
373
374 AC_MSG_CHECKING([for aload* device file directory])
375 AC_ARG_WITH(aload-devdir,
376   AS_HELP_STRING([--with-aload-devdir=dir],
377     [directory with aload* device files (default /dev)]),
378   [aload_dev_dir="$withval"],
379   [aload_dev_dir="/dev"])
380 if echo "$aload_dev_dir" | grep -v '/$' > /dev/null; then
381   aload_dev_dir="$aload_dev_dir/"
382 fi
383 AC_DEFINE_UNQUOTED(ALOAD_DEVICE_DIRECTORY, "$aload_dev_dir", [Directory with aload* device files])
384 AC_MSG_RESULT([$aload_dev_dir])
385
386 dnl Build conditions
387 AC_ARG_ENABLE(mixer,
388   AS_HELP_STRING([--disable-mixer], [disable the mixer component]),
389   [build_mixer="$enableval"], [build_mixer="yes"])
390 AC_ARG_ENABLE(pcm,
391   AS_HELP_STRING([--disable-pcm], [disable the PCM component]),
392   [build_pcm="$enableval"], [build_pcm="yes"])
393 AC_ARG_ENABLE(rawmidi,
394   AS_HELP_STRING([--disable-rawmidi], [disable the raw MIDI component]),
395   [build_rawmidi="$enableval"], [build_rawmidi="yes"])
396 AC_ARG_ENABLE(hwdep,
397   AS_HELP_STRING([--disable-hwdep], [disable the hwdep component]),
398   [build_hwdep="$enableval"], [build_hwdep="yes"])
399 AC_ARG_ENABLE(seq,
400   AS_HELP_STRING([--disable-seq], [disable the sequencer component]),
401   [build_seq="$enableval"], [build_seq="yes"])
402 AC_ARG_ENABLE(ucm,
403   AS_HELP_STRING([--disable-ucm], [disable the use-case-manager component]),
404   [build_ucm="$enableval"], [build_ucm="yes"])
405 AC_ARG_ENABLE(alisp,
406   AS_HELP_STRING([--disable-alisp], [disable the alisp component]),
407   [build_alisp="$enableval"], [build_alisp="yes"])
408 test "$softfloat" = "yes" && build_alisp="no"
409 AC_ARG_ENABLE(old-symbols,
410   AS_HELP_STRING([--disable-old-symbols], [disable old obsoleted symbols]),
411   [keep_old_symbols="$enableval"], [keep_old_symbols="yes"])
412 AM_CONDITIONAL(KEEP_OLD_SYMBOLS, test x$keep_old_symbols = xyes)
413
414 AC_ARG_ENABLE(python,
415   AS_HELP_STRING([--disable-python], [disable the python components]),
416   [build_python="$enableval"], [build_python="yes"])
417 PYTHON_LIBS=""
418 PYTHON_INCLUDES=""
419 if test "$build_python" = "yes"; then
420   AC_ARG_WITH(pythonlibs,
421     AS_HELP_STRING([--with-pythonlibs=ldflags],
422       [specify python libraries (-lpthread -lm -ldl -lpython2.4)]),
423     pythonlibs="$withval", pythonlibs=`python-config --libs`)
424   AC_ARG_WITH(pythonincludes,
425     AS_HELP_STRING([--with-pythonincludes=Cflags],
426       [specify python C header files (-I/usr/include/python)]),
427     pythonincludes="$withval", pythonincludes=`python-config --includes`)
428   if test -z "$pythonlibs"; then
429     echo "Unable to determine python libraries! Probably python-config is not"
430     echo "available on this system. Please, use --with-pythonlibs and"
431     echo "--with-pythonincludes options. Python components are disabled in this build."
432     build_python="no"
433   else
434     PYTHON_LIBS="$pythonlibs"
435     PYTHON_INCLUDES="$pythonincludes"
436   fi
437 fi
438 AC_SUBST(PYTHON_LIBS)
439 AC_SUBST(PYTHON_INCLUDES)
440
441 AM_CONDITIONAL(BUILD_MIXER, test x$build_mixer = xyes)
442 AM_CONDITIONAL(BUILD_PCM, test x$build_pcm = xyes)
443 AM_CONDITIONAL(BUILD_RAWMIDI, test x$build_rawmidi = xyes)
444 AM_CONDITIONAL(BUILD_HWDEP, test x$build_hwdep = xyes)
445 AM_CONDITIONAL(BUILD_SEQ, test x$build_seq = xyes)
446 AM_CONDITIONAL(BUILD_UCM, test x$build_ucm = xyes)
447 AM_CONDITIONAL(BUILD_ALISP, test x$build_alisp = xyes)
448 AM_CONDITIONAL(BUILD_PYTHON, test x$build_python = xyes)
449
450 if test "$build_mixer" = "yes"; then
451   AC_DEFINE([BUILD_MIXER], "1", [Build mixer component])
452 fi
453 if test "$build_pcm" = "yes"; then
454   AC_DEFINE([BUILD_PCM], "1", [Build PCM component])
455 fi
456 if test "$build_rawmidi" = "yes"; then
457   AC_DEFINE([BUILD_RAWMIDI], "1", [Build raw MIDI component])
458 fi
459 if test "$build_hwdep" = "yes"; then
460   AC_DEFINE([BUILD_HWDEP], "1", [Build hwdep component])
461 fi
462 if test "$build_seq" = "yes"; then
463   AC_DEFINE([BUILD_SEQ], "1", [Build sequencer component])
464 fi
465 if test "$build_ucm" = "yes"; then
466   AC_DEFINE([BUILD_UCM], "1", [Build UCM component])
467 fi
468
469 dnl PCM Plugins
470
471 if test "$build_pcm" = "yes"; then
472 AC_ARG_WITH(pcm-plugins,
473   AS_HELP_STRING([--with-pcm-plugins=<list>],
474     [build PCM plugins (default = all)]),
475   [pcm_plugins="$withval"], [pcm_plugins="all"])
476 else
477 pcm_plugins=""
478 fi
479
480 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"
481
482 build_pcm_plugin="no"
483 for t in $PCM_PLUGIN_LIST; do
484   eval build_pcm_$t="no"
485 done
486
487 pcm_plugins=`echo $pcm_plugins | sed 's/,/ /g'`
488 for p in $pcm_plugins; do
489   for t in $PCM_PLUGIN_LIST; do
490     if test "$p" = "$t" -o "$p" = "all"; then
491       eval build_pcm_$t="yes"
492       build_pcm_plugin="yes"
493     fi
494   done
495 done
496
497 dnl special dependencies
498 if test "$build_pcm_plug" = "yes"; then
499   build_pcm_linear="yes"
500   build_pcm_copy="yes"
501 fi
502
503 if test "$build_pcm_ioplug" = "yes"; then
504   build_pcm_extplug="yes"
505 fi
506
507 if test "$HAVE_LIBDL" != "yes"; then
508   build_pcm_meter="no"
509   build_pcm_ladspa="no"
510   build_pcm_pcm_ioplug="no"
511   build_pcm_pcm_extplug="no"
512 fi
513
514 if test "$HAVE_LIBPTHREAD" != "yes"; then
515   build_pcm_share="no"
516 fi
517
518 if test "$softfloat" = "yes"; then
519   build_pcm_lfloat="no"
520   build_pcm_ladspa="no"
521 fi
522
523 AM_CONDITIONAL(BUILD_PCM_PLUGIN, test x$build_pcm_plugin = xyes)
524 AM_CONDITIONAL(BUILD_PCM_PLUGIN_COPY, test x$build_pcm_copy = xyes)
525 AM_CONDITIONAL(BUILD_PCM_PLUGIN_LINEAR, test x$build_pcm_linear = xyes)
526 AM_CONDITIONAL(BUILD_PCM_PLUGIN_ROUTE, test x$build_pcm_route = xyes)
527 AM_CONDITIONAL(BUILD_PCM_PLUGIN_MULAW, test x$build_pcm_mulaw = xyes)
528 AM_CONDITIONAL(BUILD_PCM_PLUGIN_ALAW, test x$build_pcm_alaw = xyes)
529 AM_CONDITIONAL(BUILD_PCM_PLUGIN_ADPCM, test x$build_pcm_adpcm = xyes)
530 AM_CONDITIONAL(BUILD_PCM_PLUGIN_RATE, test x$build_pcm_rate = xyes)
531 AM_CONDITIONAL(BUILD_PCM_PLUGIN_PLUG, test x$build_pcm_plug = xyes)
532 AM_CONDITIONAL(BUILD_PCM_PLUGIN_MULTI, test x$build_pcm_multi = xyes)
533 AM_CONDITIONAL(BUILD_PCM_PLUGIN_SHM, test x$build_pcm_shm = xyes)
534 AM_CONDITIONAL(BUILD_PCM_PLUGIN_FILE, test x$build_pcm_file = xyes)
535 AM_CONDITIONAL(BUILD_PCM_PLUGIN_NULL, test x$build_pcm_null = xyes)
536 AM_CONDITIONAL(BUILD_PCM_PLUGIN_EMPTY, test x$build_pcm_empty = xyes)
537 AM_CONDITIONAL(BUILD_PCM_PLUGIN_SHARE, test x$build_pcm_share = xyes)
538 AM_CONDITIONAL(BUILD_PCM_PLUGIN_METER, test x$build_pcm_meter = xyes)
539 AM_CONDITIONAL(BUILD_PCM_PLUGIN_HOOKS, test x$build_pcm_hooks = xyes)
540 AM_CONDITIONAL(BUILD_PCM_PLUGIN_LFLOAT, test x$build_pcm_lfloat = xyes)
541 AM_CONDITIONAL(BUILD_PCM_PLUGIN_LADSPA, test x$build_pcm_ladspa = xyes)
542 AM_CONDITIONAL(BUILD_PCM_PLUGIN_DMIX, test x$build_pcm_dmix = xyes)
543 AM_CONDITIONAL(BUILD_PCM_PLUGIN_DSHARE, test x$build_pcm_dshare = xyes)
544 AM_CONDITIONAL(BUILD_PCM_PLUGIN_DSNOOP, test x$build_pcm_dsnoop = xyes)
545 AM_CONDITIONAL(BUILD_PCM_PLUGIN_ASYM, test x$build_pcm_asym = xyes)
546 AM_CONDITIONAL(BUILD_PCM_PLUGIN_IEC958, test x$build_pcm_iec958 = xyes)
547 AM_CONDITIONAL(BUILD_PCM_PLUGIN_SOFTVOL, test x$build_pcm_softvol = xyes)
548 AM_CONDITIONAL(BUILD_PCM_PLUGIN_EXTPLUG, test x$build_pcm_extplug = xyes)
549 AM_CONDITIONAL(BUILD_PCM_PLUGIN_IOPLUG, test x$build_pcm_ioplug = xyes)
550 AM_CONDITIONAL(BUILD_PCM_PLUGIN_MMAP_EMUL, test x$build_pcm_mmap_emul = xyes)
551
552 dnl Defines for plug plugin
553 if test "$build_pcm_rate" = "yes"; then
554   AC_DEFINE([BUILD_PCM_PLUGIN_RATE], "1", [Build PCM rate plugin])
555 fi
556 if test "$build_pcm_route" = "yes"; then
557   AC_DEFINE([BUILD_PCM_PLUGIN_ROUTE], "1", [Build PCM route plugin])
558 fi
559 if test "$build_pcm_lfloat" = "yes"; then
560   AC_DEFINE([BUILD_PCM_PLUGIN_LFLOAT], "1", [Build PCM lfloat plugin])
561 fi
562 if test "$build_pcm_adpcm" = "yes"; then
563   AC_DEFINE([BUILD_PCM_PLUGIN_ADPCM], "1", [Build PCM adpcm plugin])
564 fi
565 if test "$build_pcm_mulaw" = "yes"; then
566   AC_DEFINE([BUILD_PCM_PLUGIN_MULAW], "1", [Build PCM mulaw plugin])
567 fi
568 if test "$build_pcm_alaw" = "yes"; then
569   AC_DEFINE([BUILD_PCM_PLUGIN_ALAW], "1", [Build PCM alaw plugin])
570 fi
571 if test "$build_pcm_mmap_emul" = "yes"; then
572   AC_DEFINE([BUILD_PCM_PLUGIN_MMAP_EMUL], "1", [Build PCM mmap-emul plugin])
573 fi
574
575
576 dnl Create PCM plugin symbol list for static library
577 rm -f "$srcdir"/src/pcm/pcm_symbols_list.c
578 touch "$srcdir"/src/pcm/pcm_symbols_list.c
579 for t in $PCM_PLUGIN_LIST; do
580   if eval test \$build_pcm_$t = yes; then
581     echo \&_snd_module_pcm_$t, >> "$srcdir"/src/pcm/pcm_symbols_list.c
582   fi
583 done
584
585 dnl Control Plugins
586
587 AC_ARG_WITH(ctl-plugins,
588   AS_HELP_STRING([--with-ctl-plugins=<list>],
589     [build control plugins (default = all)]),
590   [ctl_plugins="$withval"], [ctl_plugins="all"])
591
592 CTL_PLUGIN_LIST="shm ext"
593
594 build_ctl_plugin="no"
595 for t in $CTL_PLUGIN_LIST; do
596   eval build_ctl_$t="no"
597 done
598
599 ctl_plugins=`echo $ctl_plugins | sed 's/,/ /g'`
600 for p in $ctl_plugins; do
601   for t in $CTL_PLUGIN_LIST; do
602     if test "$p" = "$t" -o "$p" = "all"; then
603       eval build_ctl_$t="yes"
604       build_ctl_plugin="yes"
605     fi
606   done
607 done
608
609 AM_CONDITIONAL(BUILD_CTL_PLUGIN, test x$build_ctl_plugin = xyes)
610 AM_CONDITIONAL(BUILD_CTL_PLUGIN_SHM, test x$build_ctl_shm = xyes)
611 AM_CONDITIONAL(BUILD_CTL_PLUGIN_EXT, test x$build_ctl_ext = xyes)
612
613 dnl Create ctl plugin symbol list for static library
614 rm -f "$srcdir"/src/control/ctl_symbols_list.c
615 touch "$srcdir"/src/control/ctl_symbols_list.c
616 for t in $CTL_PLUGIN_LIST; do
617   if eval test \$build_ctl_$t = yes; then
618     echo \&_snd_module_control_$t, >> "$srcdir"/src/control/ctl_symbols_list.c
619   fi
620 done
621
622 dnl Make a symlink for inclusion of alsa/xxx.h
623 if test ! -L "$srcdir"/include/alsa ; then
624   echo "Making a symlink include/alsa"
625   rm -f "$srcdir"/include/alsa
626   ln -sf . "$srcdir"/include/alsa
627 fi
628
629 AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
630           include/Makefile include/sound/Makefile src/Versions src/Makefile \
631           src/control/Makefile src/mixer/Makefile \
632           src/pcm/Makefile src/pcm/scopes/Makefile \
633           src/rawmidi/Makefile src/timer/Makefile \
634           src/hwdep/Makefile src/seq/Makefile src/ucm/Makefile \
635           src/compat/Makefile src/alisp/Makefile \
636           src/conf/Makefile src/conf/alsa.conf.d/Makefile \
637           src/conf/cards/Makefile \
638           src/conf/pcm/Makefile \
639           modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \
640           alsalisp/Makefile aserver/Makefile \
641           test/Makefile test/lsb/Makefile \
642           utils/Makefile utils/alsa-lib.spec utils/alsa.pc)
643
644 dnl Create asoundlib.h dynamically according to configure options
645 echo "Creating asoundlib.h..."
646 cp "$srcdir"/include/asoundlib-head.h include/asoundlib.h
647 test "$build_pcm" = "yes" && echo "#include <alsa/pcm.h>" >> include/asoundlib.h
648 test "$build_rawmidi" = "yes" && echo "#include <alsa/rawmidi.h>" >> include/asoundlib.h
649 test "$build_pcm" = "yes" && echo "#include <alsa/timer.h>" >> include/asoundlib.h
650 test "$build_hwdep" = "yes" && echo "#include <alsa/hwdep.h>" >> include/asoundlib.h
651 echo "#include <alsa/control.h>" >> include/asoundlib.h
652 test "$build_mixer" = "yes" && echo "#include <alsa/mixer.h>" >> include/asoundlib.h
653 test "$build_seq" = "yes" && echo "#include <alsa/seq_event.h>" >> include/asoundlib.h
654 test "$build_seq" = "yes" && echo "#include <alsa/seq.h>" >> include/asoundlib.h
655 test "$build_seq" = "yes" && echo "#include <alsa/seqmid.h>" >> include/asoundlib.h
656 test "$build_seq" = "yes" && echo "#include <alsa/seq_midi_event.h>" >> include/asoundlib.h
657 cat "$srcdir"/include/asoundlib-tail.h >> include/asoundlib.h
658