OSDN Git Service

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