1d5ac70f0Sopenharmony_cidnl Process this file with autoconf to produce a configure script.
2d5ac70f0Sopenharmony_ciAC_PREREQ(2.59)
3d5ac70f0Sopenharmony_ciAC_INIT(alsa-lib, 1.2.11)
4d5ac70f0Sopenharmony_ci
5d5ac70f0Sopenharmony_ciAC_CONFIG_SRCDIR([src/control/control.c])
6d5ac70f0Sopenharmony_ciAC_CONFIG_MACRO_DIR([m4])
7d5ac70f0Sopenharmony_ci
8d5ac70f0Sopenharmony_cidnl *************************************************
9d5ac70f0Sopenharmony_cidnl current:revision:age
10d5ac70f0Sopenharmony_cidnl change (without API) = c:r+1:a
11d5ac70f0Sopenharmony_cidnl change API = c+1:0:a
12d5ac70f0Sopenharmony_cidnl add API = c+1:0:a+1
13d5ac70f0Sopenharmony_cidnl remove API = c+1:0:0
14d5ac70f0Sopenharmony_cidnl *************************************************
15d5ac70f0Sopenharmony_ciAC_CANONICAL_HOST
16d5ac70f0Sopenharmony_ciAM_INIT_AUTOMAKE
17d5ac70f0Sopenharmony_cieval LIBTOOL_VERSION_INFO="2:0:0"
18d5ac70f0Sopenharmony_cidnl *************************************************
19d5ac70f0Sopenharmony_ciAM_CONDITIONAL([INSTALL_M4], [test -n "${ACLOCAL}"])
20d5ac70f0Sopenharmony_ci
21d5ac70f0Sopenharmony_ciAM_MAINTAINER_MODE([enable])
22d5ac70f0Sopenharmony_ci
23d5ac70f0Sopenharmony_ci# Test for new silent rules and enable only if they are available
24d5ac70f0Sopenharmony_cim4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
25d5ac70f0Sopenharmony_ci
26d5ac70f0Sopenharmony_ciAC_PREFIX_DEFAULT(/usr)
27d5ac70f0Sopenharmony_ci
28d5ac70f0Sopenharmony_cidnl Checks for programs.
29d5ac70f0Sopenharmony_ci
30d5ac70f0Sopenharmony_ciAC_PROG_CC
31d5ac70f0Sopenharmony_ciAC_PROG_CPP
32d5ac70f0Sopenharmony_ciAC_USE_SYSTEM_EXTENSIONS
33d5ac70f0Sopenharmony_ciAC_PROG_INSTALL
34d5ac70f0Sopenharmony_ciAC_PROG_LN_S 
35d5ac70f0Sopenharmony_ciAC_DISABLE_STATIC
36d5ac70f0Sopenharmony_ciAC_LIBTOOL_DLOPEN
37d5ac70f0Sopenharmony_ciAM_PROG_LIBTOOL
38d5ac70f0Sopenharmony_ci
39d5ac70f0Sopenharmony_ciCC_NOUNDEFINED
40d5ac70f0Sopenharmony_ci
41d5ac70f0Sopenharmony_cidnl Checks for header files.
42d5ac70f0Sopenharmony_ciAC_HEADER_STDC
43d5ac70f0Sopenharmony_ciAC_CONFIG_HEADERS(include/config.h)
44d5ac70f0Sopenharmony_ci
45d5ac70f0Sopenharmony_cidnl Checks for typedefs, structures, and compiler characteristics.
46d5ac70f0Sopenharmony_ciAC_C_CONST
47d5ac70f0Sopenharmony_ciAC_C_INLINE
48d5ac70f0Sopenharmony_ciAC_HEADER_TIME
49d5ac70f0Sopenharmony_ciAC_CHECK_ATTRIBUTE_SYMVER
50d5ac70f0Sopenharmony_ci
51d5ac70f0Sopenharmony_cidnl Checks for library functions.
52d5ac70f0Sopenharmony_ciAC_PROG_GCC_TRADITIONAL
53d5ac70f0Sopenharmony_ciAC_CHECK_FUNCS([uselocale])
54d5ac70f0Sopenharmony_ciAC_CHECK_FUNCS([eaccess])
55d5ac70f0Sopenharmony_ci
56d5ac70f0Sopenharmony_cidnl Enable largefile support
57d5ac70f0Sopenharmony_ciAC_SYS_LARGEFILE
58d5ac70f0Sopenharmony_ci
59d5ac70f0Sopenharmony_ciSAVE_LIBRARY_VERSION
60d5ac70f0Sopenharmony_ciAC_SUBST(LIBTOOL_VERSION_INFO)
61d5ac70f0Sopenharmony_ci
62d5ac70f0Sopenharmony_citest "x$prefix" = xNONE && prefix=$ac_default_prefix
63d5ac70f0Sopenharmony_ci
64d5ac70f0Sopenharmony_cidnl Do not build static and shared libraries together
65d5ac70f0Sopenharmony_ciif test "$enable_static" = "$enable_shared" -a "$enable_static" = "yes"; then
66d5ac70f0Sopenharmony_cicat <<EOF
67d5ac70f0Sopenharmony_ci  Please, do not try to compile static and shared libraries together.
68d5ac70f0Sopenharmony_ci  See INSTALL file for more details (do not use --enable-shared=yes with
69d5ac70f0Sopenharmony_ci  --enable-static=yes).
70d5ac70f0Sopenharmony_ciEOF
71d5ac70f0Sopenharmony_ci  exit 1
72d5ac70f0Sopenharmony_cifi
73d5ac70f0Sopenharmony_ci
74d5ac70f0Sopenharmony_cidnl ALSA configuration directory
75d5ac70f0Sopenharmony_ciAC_ARG_WITH(configdir,
76d5ac70f0Sopenharmony_ci    AS_HELP_STRING([--with-configdir=dir],
77d5ac70f0Sopenharmony_ci	[path where ALSA config files are stored]),
78d5ac70f0Sopenharmony_ci    confdir="$withval", confdir="")
79d5ac70f0Sopenharmony_ciif test -z "$confdir"; then
80d5ac70f0Sopenharmony_ci    eval dir="$datadir"
81d5ac70f0Sopenharmony_ci    case "$dir" in
82d5ac70f0Sopenharmony_ci    /*) ;;
83d5ac70f0Sopenharmony_ci    *) dir="$prefix/share"
84d5ac70f0Sopenharmony_ci    esac
85d5ac70f0Sopenharmony_ci    confdir="$dir/alsa"
86d5ac70f0Sopenharmony_cifi
87d5ac70f0Sopenharmony_ciALSA_CONFIG_DIR="$confdir"
88d5ac70f0Sopenharmony_ciAC_DEFINE_UNQUOTED(ALSA_CONFIG_DIR, "$confdir", [directory containing ALSA configuration database])
89d5ac70f0Sopenharmony_ciAC_SUBST(ALSA_CONFIG_DIR)
90d5ac70f0Sopenharmony_ci
91d5ac70f0Sopenharmony_cidnl ALSA plugin directory
92d5ac70f0Sopenharmony_citest "x$exec_prefix" = xNONE && exec_prefix=$prefix
93d5ac70f0Sopenharmony_ci
94d5ac70f0Sopenharmony_ciAC_ARG_WITH(plugindir,
95d5ac70f0Sopenharmony_ci    AS_HELP_STRING([--with-plugindir=dir],
96d5ac70f0Sopenharmony_ci	[path where ALSA plugin files are stored]),
97d5ac70f0Sopenharmony_ci    plugindir="$withval", plugindir="")
98d5ac70f0Sopenharmony_ciif test -z "$plugindir"; then
99d5ac70f0Sopenharmony_ci    eval dir="$libdir"
100d5ac70f0Sopenharmony_ci    case "$dir" in
101d5ac70f0Sopenharmony_ci    /*) ;;
102d5ac70f0Sopenharmony_ci    *) dir="$dir"
103d5ac70f0Sopenharmony_ci    esac
104d5ac70f0Sopenharmony_ci    plugindir="$dir/$PACKAGE"
105d5ac70f0Sopenharmony_cifi
106d5ac70f0Sopenharmony_ciAC_DEFINE_UNQUOTED(ALSA_PLUGIN_DIR, "$plugindir", [directory containing ALSA add-on modules])
107d5ac70f0Sopenharmony_ciALSA_PLUGIN_DIR="$plugindir"
108d5ac70f0Sopenharmony_ciAC_SUBST(ALSA_PLUGIN_DIR)
109d5ac70f0Sopenharmony_ci
110d5ac70f0Sopenharmony_ciAC_ARG_WITH(pkgconfdir,
111d5ac70f0Sopenharmony_ci    AS_HELP_STRING([--with-pkgconfdir=dir],
112d5ac70f0Sopenharmony_ci	[path where pkgconfig files are stored]),
113d5ac70f0Sopenharmony_ci    pkgconfdir="$withval", pkgconfdir="")
114d5ac70f0Sopenharmony_ciif test -z "$pkgconfdir"; then
115d5ac70f0Sopenharmony_ci    eval dir="$libdir"
116d5ac70f0Sopenharmony_ci    case "$dir" in
117d5ac70f0Sopenharmony_ci    /*) ;;
118d5ac70f0Sopenharmony_ci    *) dir="$dir"
119d5ac70f0Sopenharmony_ci    esac
120d5ac70f0Sopenharmony_ci    pkgconfdir="$dir/pkgconfig"
121d5ac70f0Sopenharmony_cifi
122d5ac70f0Sopenharmony_ciAC_DEFINE_UNQUOTED(ALSA_PKGCONF_DIR, "$pkgconfdir", [directory containing pkgconfig files])
123d5ac70f0Sopenharmony_ciALSA_PKGCONF_DIR="$pkgconfdir"
124d5ac70f0Sopenharmony_ciAC_SUBST(ALSA_PKGCONF_DIR)
125d5ac70f0Sopenharmony_ci
126d5ac70f0Sopenharmony_cidnl Check for versioned symbols
127d5ac70f0Sopenharmony_ciAC_MSG_CHECKING(for versioned symbols)
128d5ac70f0Sopenharmony_ciAC_ARG_WITH(versioned,
129d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--with-versioned],
130d5ac70f0Sopenharmony_ci    [shared library will be compiled with versioned symbols (default = yes)]),
131d5ac70f0Sopenharmony_ci  versioned="$withval", versioned="yes")
132d5ac70f0Sopenharmony_ciif test "$versioned" = "yes"; then
133d5ac70f0Sopenharmony_ci  # it seems that GNU ld versions since 2.10 are not broken
134d5ac70f0Sopenharmony_ci  xres=`grep '^VERSION=' ${srcdir}/ltmain.sh | cut -d = -f 2 | cut -d \" -f 2`
135d5ac70f0Sopenharmony_ci  major=`echo $xres | cut -d . -f 1`
136d5ac70f0Sopenharmony_ci  minor=`echo $xres | cut -d . -f 2`
137d5ac70f0Sopenharmony_ci  pass=0
138d5ac70f0Sopenharmony_ci  if test $major -eq 1 && test $minor -gt 3; then
139d5ac70f0Sopenharmony_ci    pass=1
140d5ac70f0Sopenharmony_ci  else
141d5ac70f0Sopenharmony_ci    if test $major -gt 1; then
142d5ac70f0Sopenharmony_ci      pass=1
143d5ac70f0Sopenharmony_ci    fi
144d5ac70f0Sopenharmony_ci  fi
145d5ac70f0Sopenharmony_ci  if test $pass -eq 1; then
146d5ac70f0Sopenharmony_ci    AC_DEFINE(VERSIONED_SYMBOLS,,[compiled with versioned symbols])
147d5ac70f0Sopenharmony_ci    AC_MSG_RESULT(yes)
148d5ac70f0Sopenharmony_ci  else
149d5ac70f0Sopenharmony_ci    AC_MSG_RESULT(broken libtool - use libtool v1.4+; no versions)
150d5ac70f0Sopenharmony_ci  fi
151d5ac70f0Sopenharmony_cielse
152d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(no)
153d5ac70f0Sopenharmony_cifi
154d5ac70f0Sopenharmony_ciAM_CONDITIONAL([VERSIONED_SYMBOLS], [test x$versioned = xyes])
155d5ac70f0Sopenharmony_ci
156d5ac70f0Sopenharmony_cidnl Check for symbolic-functions
157d5ac70f0Sopenharmony_ciAC_MSG_CHECKING(for symbolic-functions)
158d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(symbolic-functions,
159d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--enable-symbolic-functions],
160d5ac70f0Sopenharmony_ci    [use -Bsymbolic-functions option if available (optmization for size and speed)]),
161d5ac70f0Sopenharmony_ci  symfuncs="$enableval", symfuncs="no")
162d5ac70f0Sopenharmony_ciif test "$symfuncs" = "yes"; then
163d5ac70f0Sopenharmony_ci  if ld --help | grep -q -- '-Bsymbolic-functions'; then
164d5ac70f0Sopenharmony_ci    AC_MSG_RESULT(yes)
165d5ac70f0Sopenharmony_ci  else
166d5ac70f0Sopenharmony_ci    AC_MSG_RESULT(not supported by ld)
167d5ac70f0Sopenharmony_ci    symfuncs="no"
168d5ac70f0Sopenharmony_ci  fi
169d5ac70f0Sopenharmony_cielse
170d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(no)
171d5ac70f0Sopenharmony_cifi
172d5ac70f0Sopenharmony_ciAM_CONDITIONAL([SYMBOLIC_FUNCTIONS], [test x"$symfuncs" = xyes])
173d5ac70f0Sopenharmony_ci
174d5ac70f0Sopenharmony_cidnl See if toolchain has a custom prefix for symbols ...
175d5ac70f0Sopenharmony_ciAC_MSG_CHECKING(for custom symbol prefixes)
176d5ac70f0Sopenharmony_ciSYMBOL_PREFIX=` \
177d5ac70f0Sopenharmony_ci	echo "PREFIX=__USER_LABEL_PREFIX__" \
178d5ac70f0Sopenharmony_ci		| ${CPP-${CC-gcc} -E} - 2>&1 \
179d5ac70f0Sopenharmony_ci		| ${EGREP-grep} "^PREFIX=" \
180d5ac70f0Sopenharmony_ci		| ${SED-sed} "s:^PREFIX=::"`
181d5ac70f0Sopenharmony_ciAC_DEFINE_UNQUOTED([__SYMBOL_PREFIX], "$SYMBOL_PREFIX", [Toolchain Symbol Prefix])
182d5ac70f0Sopenharmony_ciAC_SUBST(SYMBOL_PREFIX)
183d5ac70f0Sopenharmony_ciAC_MSG_RESULT($SYMBOL_PREFIX)
184d5ac70f0Sopenharmony_ci
185d5ac70f0Sopenharmony_cidnl Check for debug...
186d5ac70f0Sopenharmony_ciAC_MSG_CHECKING(for debug)
187d5ac70f0Sopenharmony_ciAC_ARG_WITH(debug,
188d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--with-debug],
189d5ac70f0Sopenharmony_ci    [library will be compiled with asserts (default = yes)]),
190d5ac70f0Sopenharmony_ci  debug="$withval", debug="yes")
191d5ac70f0Sopenharmony_ciif test "$debug" = "yes"; then
192d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(yes)
193d5ac70f0Sopenharmony_cielse
194d5ac70f0Sopenharmony_ci  AC_DEFINE(NDEBUG,,[No assert debug])
195d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(no)
196d5ac70f0Sopenharmony_cifi
197d5ac70f0Sopenharmony_ci
198d5ac70f0Sopenharmony_ciif test "$debug" = "yes"; then
199d5ac70f0Sopenharmony_ci  AC_MSG_CHECKING(for debug assert)
200d5ac70f0Sopenharmony_ci  AC_ARG_ENABLE(debug-assert,
201d5ac70f0Sopenharmony_ci    AS_HELP_STRING([--enable-debug],
202d5ac70f0Sopenharmony_ci      [enable assert call at the default error message handler]),
203d5ac70f0Sopenharmony_ci    debug_assert="$enableval", debug_assert="no")
204d5ac70f0Sopenharmony_ci  if test "$debug_assert" = "yes"; then
205d5ac70f0Sopenharmony_ci    AC_MSG_RESULT(yes)
206d5ac70f0Sopenharmony_ci    AC_DEFINE(ALSA_DEBUG_ASSERT,,[Enable assert at error message handler])
207d5ac70f0Sopenharmony_ci  else
208d5ac70f0Sopenharmony_ci    AC_MSG_RESULT(no)
209d5ac70f0Sopenharmony_ci  fi
210d5ac70f0Sopenharmony_cifi
211d5ac70f0Sopenharmony_ci
212d5ac70f0Sopenharmony_cidnl Temporary directory
213d5ac70f0Sopenharmony_ciAC_MSG_CHECKING(for tmpdir)
214d5ac70f0Sopenharmony_ciAC_ARG_WITH(tmpdir,
215d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--with-tmpdir=directory],
216d5ac70f0Sopenharmony_ci    [directory to put tmp socket files (/tmp)]),
217d5ac70f0Sopenharmony_ci  tmpdir="$withval", tmpdir="/tmp")
218d5ac70f0Sopenharmony_ciAC_MSG_RESULT($tmpdir)
219d5ac70f0Sopenharmony_ciAC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir", [directory to put tmp socket files])
220d5ac70f0Sopenharmony_ci
221d5ac70f0Sopenharmony_cidnl Check for softfloat...
222d5ac70f0Sopenharmony_ciAC_MSG_CHECKING(for softfloat)
223d5ac70f0Sopenharmony_ciAC_ARG_WITH(softfloat,
224d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--with-softfloat],
225d5ac70f0Sopenharmony_ci    [do you have floating point unit on this machine? (optional)]),
226d5ac70f0Sopenharmony_ci  [case "$withval" in
227d5ac70f0Sopenharmony_ci	y|yes) softfloat=yes ;;
228d5ac70f0Sopenharmony_ci	*) softfloat=no ;;
229d5ac70f0Sopenharmony_ci   esac],)
230d5ac70f0Sopenharmony_ciif test "$softfloat" = "yes" ; then
231d5ac70f0Sopenharmony_ci  AC_DEFINE(HAVE_SOFT_FLOAT, "1", [Avoid calculation in float])
232d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(yes)
233d5ac70f0Sopenharmony_cielse
234d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(no)
235d5ac70f0Sopenharmony_cifi
236d5ac70f0Sopenharmony_ci
237d5ac70f0Sopenharmony_ciALSA_DEPLIBS=""
238d5ac70f0Sopenharmony_ciif test "$softfloat" != "yes"; then
239d5ac70f0Sopenharmony_ci  ALSA_DEPLIBS="-lm"
240d5ac70f0Sopenharmony_cifi
241d5ac70f0Sopenharmony_ci
242d5ac70f0Sopenharmony_cidnl Check for scandir64
243d5ac70f0Sopenharmony_ciAC_MSG_CHECKING(for LFS calls)
244d5ac70f0Sopenharmony_ciAC_TRY_LINK([#include <dirent.h>],
245d5ac70f0Sopenharmony_ci    [struct dirent64 a; ],
246d5ac70f0Sopenharmony_ci    [have_lfs=yes],
247d5ac70f0Sopenharmony_ci    [have_lfs=no])
248d5ac70f0Sopenharmony_ciif test "$have_lfs" = "yes"; then
249d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(yes)
250d5ac70f0Sopenharmony_ci  AC_DEFINE([HAVE_LFS], 1, [Have LFS])
251d5ac70f0Sopenharmony_cielse
252d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(no)
253d5ac70f0Sopenharmony_cifi
254d5ac70f0Sopenharmony_ci
255d5ac70f0Sopenharmony_cidnl Check for libdl
256d5ac70f0Sopenharmony_ciAC_MSG_CHECKING(for libdl)
257d5ac70f0Sopenharmony_ciAC_ARG_WITH(libdl,
258d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--with-libdl], [Use libdl for plugins (default = yes)]),
259d5ac70f0Sopenharmony_ci  [ have_libdl="$withval" ], [ have_libdl="yes" ])
260d5ac70f0Sopenharmony_ciHAVE_LIBDL=
261d5ac70f0Sopenharmony_ciif test "$have_libdl" = "yes"; then
262d5ac70f0Sopenharmony_ci  AC_SEARCH_LIBS([dlsym], [dl], [HAVE_LIBDL="yes"])
263d5ac70f0Sopenharmony_ci  if test "$HAVE_LIBDL" = "yes" ; then
264d5ac70f0Sopenharmony_ci    AC_DEFINE([HAVE_LIBDL], 1, [Have libdl])
265d5ac70f0Sopenharmony_ci  fi
266d5ac70f0Sopenharmony_cielse
267d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(no)
268d5ac70f0Sopenharmony_cifi
269d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_MODULES], [test "$HAVE_LIBDL" = "yes"])
270d5ac70f0Sopenharmony_ci
271d5ac70f0Sopenharmony_cidnl Check for pthread
272d5ac70f0Sopenharmony_ciAC_MSG_CHECKING(for pthread)
273d5ac70f0Sopenharmony_ciAC_ARG_WITH(pthread,
274d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--with-pthread], [Use pthread (default = yes)]),
275d5ac70f0Sopenharmony_ci  [ have_pthread="$withval" ], [ have_pthread="yes" ])
276d5ac70f0Sopenharmony_ciif test "$have_pthread" = "yes"; then
277d5ac70f0Sopenharmony_ci  AC_CHECK_LIB([pthread], [pthread_join], [HAVE_LIBPTHREAD="yes"])
278d5ac70f0Sopenharmony_ci  if test "$HAVE_LIBPTHREAD" = "yes"; then
279d5ac70f0Sopenharmony_ci    ALSA_DEPLIBS="$ALSA_DEPLIBS -lpthread"
280d5ac70f0Sopenharmony_ci    AC_DEFINE([HAVE_LIBPTHREAD], 1, [Have libpthread])
281d5ac70f0Sopenharmony_ci  fi
282d5ac70f0Sopenharmony_cielse
283d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(no)
284d5ac70f0Sopenharmony_cifi
285d5ac70f0Sopenharmony_ci
286d5ac70f0Sopenharmony_cidnl Check for pthread
287d5ac70f0Sopenharmony_ciif test "$HAVE_LIBPTHREAD" = "yes"; then
288d5ac70f0Sopenharmony_ci  AC_CHECK_DECL(PTHREAD_MUTEX_RECURSIVE,
289d5ac70f0Sopenharmony_ci    AC_DEFINE(HAVE_PTHREAD_MUTEX_RECURSIVE, [],
290d5ac70f0Sopenharmony_ci      [Define if your pthreads implementation have PTHREAD_MUTEX_RECURSIVE]),
291d5ac70f0Sopenharmony_ci    ,
292d5ac70f0Sopenharmony_ci    [#include <pthread.h>])
293d5ac70f0Sopenharmony_cifi
294d5ac70f0Sopenharmony_ci
295d5ac70f0Sopenharmony_cidnl Check for __thread
296d5ac70f0Sopenharmony_ciAC_MSG_CHECKING([for __thread])
297d5ac70f0Sopenharmony_ciAC_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))
298d5ac70f0Sopenharmony_ci#error gcc has this bug: http://gcc.gnu.org/ml/gcc-bugs/2006-09/msg02275.html
299d5ac70f0Sopenharmony_ci#endif], [static __thread int p = 0])],
300d5ac70f0Sopenharmony_ci[AC_DEFINE(HAVE___THREAD, 1,
301d5ac70f0Sopenharmony_ciDefine to 1 if compiler supports __thread)
302d5ac70f0Sopenharmony_ciAC_MSG_RESULT([yes])],
303d5ac70f0Sopenharmony_ci[AC_MSG_RESULT([no])])
304d5ac70f0Sopenharmony_ci
305d5ac70f0Sopenharmony_cidnl Check for librt
306d5ac70f0Sopenharmony_ciAC_MSG_CHECKING(for librt)
307d5ac70f0Sopenharmony_ciAC_ARG_WITH(librt,
308d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--with-librt], [Use librt for monotonic clock (default = yes)]),
309d5ac70f0Sopenharmony_ci  [ have_librt="$withval" ], [ have_librt="yes" ])
310d5ac70f0Sopenharmony_ciif test "$have_librt" = "yes"; then
311d5ac70f0Sopenharmony_ci  AC_CHECK_LIB([rt], [clock_gettime], [HAVE_LIBRT="yes"])
312d5ac70f0Sopenharmony_ci  if test "$HAVE_LIBRT" = "yes" ; then
313d5ac70f0Sopenharmony_ci    ALSA_DEPLIBS="$ALSA_DEPLIBS -lrt"
314d5ac70f0Sopenharmony_ci    AC_DEFINE([HAVE_LIBRT], 1, [Have librt])
315d5ac70f0Sopenharmony_ci    AC_DEFINE([HAVE_CLOCK_GETTIME], 1, [Have clock gettime])
316d5ac70f0Sopenharmony_ci  fi
317d5ac70f0Sopenharmony_cielse
318d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(no)
319d5ac70f0Sopenharmony_cifi
320d5ac70f0Sopenharmony_ci
321d5ac70f0Sopenharmony_ciAC_SUBST(ALSA_DEPLIBS)
322d5ac70f0Sopenharmony_ci
323d5ac70f0Sopenharmony_cidnl Check for use of wordexp...
324d5ac70f0Sopenharmony_ciAC_MSG_CHECKING(for use of wordexp)
325d5ac70f0Sopenharmony_ciAC_ARG_WITH(wordexp,
326d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--with-wordexp],
327d5ac70f0Sopenharmony_ci    [Use wordexp when expanding configs (default = no)]),
328d5ac70f0Sopenharmony_ci  [case "$withval" in
329d5ac70f0Sopenharmony_ci	y|yes) wordexp=yes ;;
330d5ac70f0Sopenharmony_ci	*) wordexp=no ;;
331d5ac70f0Sopenharmony_ci   esac],)
332d5ac70f0Sopenharmony_ciif test "$wordexp" = "yes" ; then
333d5ac70f0Sopenharmony_ci  AC_DEFINE(HAVE_WORDEXP, "1", [Enable use of wordexp])
334d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(yes)
335d5ac70f0Sopenharmony_ci  AC_CHECK_HEADER([wordexp.h],[], [AC_MSG_ERROR([Couldn't find wordexp.h])])
336d5ac70f0Sopenharmony_cielse
337d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(no)
338d5ac70f0Sopenharmony_cifi
339d5ac70f0Sopenharmony_ci
340d5ac70f0Sopenharmony_cidnl Check for headers
341d5ac70f0Sopenharmony_ciAC_CHECK_HEADERS([endian.h sys/endian.h sys/shm.h malloc.h])
342d5ac70f0Sopenharmony_ci
343d5ac70f0Sopenharmony_cidnl Check for resmgr support...
344d5ac70f0Sopenharmony_ciAC_MSG_CHECKING(for resmgr support)
345d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(resmgr,
346d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--enable-resmgr], [support resmgr (optional)]),
347d5ac70f0Sopenharmony_ci  resmgr="$enableval", resmgr="no")
348d5ac70f0Sopenharmony_ciAC_MSG_RESULT($resmgr)
349d5ac70f0Sopenharmony_ciif test "$resmgr" = "yes"; then
350d5ac70f0Sopenharmony_ci  AC_CHECK_LIB(resmgr, rsm_open_device,,
351d5ac70f0Sopenharmony_ci    AC_ERROR([Cannot find libresmgr]))
352d5ac70f0Sopenharmony_ci  AC_DEFINE(SUPPORT_RESMGR, "1", [Support resmgr with alsa-lib])
353d5ac70f0Sopenharmony_cifi
354d5ac70f0Sopenharmony_ci
355d5ac70f0Sopenharmony_cidnl Check for aload* support...
356d5ac70f0Sopenharmony_ciAC_MSG_CHECKING(for aload* support)
357d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(aload,
358d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--disable-aload], [disable reading /dev/aload*]),
359d5ac70f0Sopenharmony_ci  aload="$enableval", aload="yes")
360d5ac70f0Sopenharmony_ciAC_MSG_RESULT($aload)
361d5ac70f0Sopenharmony_ciif test "$aload" = "yes"; then
362d5ac70f0Sopenharmony_ci  AC_DEFINE(SUPPORT_ALOAD, "1", [Support /dev/aload* access for auto-loading])
363d5ac70f0Sopenharmony_cifi
364d5ac70f0Sopenharmony_ci
365d5ac70f0Sopenharmony_cidnl Check for non-standard /dev directory
366d5ac70f0Sopenharmony_ciAC_MSG_CHECKING([for ALSA device file directory])
367d5ac70f0Sopenharmony_ciAC_ARG_WITH(alsa-devdir,
368d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--with-alsa-devdir=dir],
369d5ac70f0Sopenharmony_ci    [directory with ALSA device files (default /dev/snd)]),
370d5ac70f0Sopenharmony_ci  [alsa_dev_dir="$withval"],
371d5ac70f0Sopenharmony_ci  [alsa_dev_dir="/dev/snd"])
372d5ac70f0Sopenharmony_cidnl make sure it has a trailing slash
373d5ac70f0Sopenharmony_ciif echo "$alsa_dev_dir" | grep -v '/$' > /dev/null; then
374d5ac70f0Sopenharmony_ci  alsa_dev_dir="$alsa_dev_dir/"
375d5ac70f0Sopenharmony_cifi
376d5ac70f0Sopenharmony_ciAC_DEFINE_UNQUOTED(ALSA_DEVICE_DIRECTORY, "$alsa_dev_dir", [Directory with ALSA device files])
377d5ac70f0Sopenharmony_ciAC_MSG_RESULT([$alsa_dev_dir])
378d5ac70f0Sopenharmony_ci
379d5ac70f0Sopenharmony_ciAC_MSG_CHECKING([for aload* device file directory])
380d5ac70f0Sopenharmony_ciAC_ARG_WITH(aload-devdir,
381d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--with-aload-devdir=dir],
382d5ac70f0Sopenharmony_ci    [directory with aload* device files (default /dev)]),
383d5ac70f0Sopenharmony_ci  [aload_dev_dir="$withval"],
384d5ac70f0Sopenharmony_ci  [aload_dev_dir="/dev"])
385d5ac70f0Sopenharmony_ciif echo "$aload_dev_dir" | grep -v '/$' > /dev/null; then
386d5ac70f0Sopenharmony_ci  aload_dev_dir="$aload_dev_dir/"
387d5ac70f0Sopenharmony_cifi
388d5ac70f0Sopenharmony_ciAC_DEFINE_UNQUOTED(ALOAD_DEVICE_DIRECTORY, "$aload_dev_dir", [Directory with aload* device files])
389d5ac70f0Sopenharmony_ciAC_MSG_RESULT([$aload_dev_dir])
390d5ac70f0Sopenharmony_ci
391d5ac70f0Sopenharmony_cidnl Build conditions
392d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(mixer,
393d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--disable-mixer], [disable the mixer component]),
394d5ac70f0Sopenharmony_ci  [build_mixer="$enableval"], [build_mixer="yes"])
395d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(pcm,
396d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--disable-pcm], [disable the PCM component]),
397d5ac70f0Sopenharmony_ci  [build_pcm="$enableval"], [build_pcm="yes"])
398d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(rawmidi,
399d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--disable-rawmidi], [disable the raw MIDI component]),
400d5ac70f0Sopenharmony_ci  [build_rawmidi="$enableval"], [build_rawmidi="yes"])
401d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(hwdep,
402d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--disable-hwdep], [disable the hwdep component]),
403d5ac70f0Sopenharmony_ci  [build_hwdep="$enableval"], [build_hwdep="yes"])
404d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(seq,
405d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--disable-seq], [disable the sequencer component]),
406d5ac70f0Sopenharmony_ci  [build_seq="$enableval"], [build_seq="yes"])
407d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(ucm,
408d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--disable-ucm], [disable the use-case-manager component]),
409d5ac70f0Sopenharmony_ci  [build_ucm="$enableval"], [build_ucm="yes"])
410d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(topology,
411d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--disable-topology], [disable the DSP topology component]),
412d5ac70f0Sopenharmony_ci  [build_topology="$enableval"], [build_topology="yes"])
413d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(alisp,
414d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--enable-alisp], [enable the alisp component]),
415d5ac70f0Sopenharmony_ci  [build_alisp="$enableval"], [build_alisp="no"])
416d5ac70f0Sopenharmony_citest "$softfloat" = "yes" && build_alisp="no"
417d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(old-symbols,
418d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--disable-old-symbols], [disable old obsoleted symbols]),
419d5ac70f0Sopenharmony_ci  [keep_old_symbols="$enableval"], [keep_old_symbols="yes"])
420d5ac70f0Sopenharmony_ciAM_CONDITIONAL([KEEP_OLD_SYMBOLS], [test x$keep_old_symbols = xyes])
421d5ac70f0Sopenharmony_ci
422d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(mixer-modules,
423d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--enable-mixer-modules], [enable the additional mixer modules (experimental)]),
424d5ac70f0Sopenharmony_ci  [build_mixer_modules="$enableval"], [build_mixer_modules="no"])
425d5ac70f0Sopenharmony_ci
426d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(mixer-pymods,
427d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--enable-mixer-pymods], [enable the mixer python modules (experimental)]),
428d5ac70f0Sopenharmony_ci  [build_mixer_pymodules="$enableval"], [build_mixer_pymodules="no"])
429d5ac70f0Sopenharmony_ci
430d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(python,
431d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--disable-python], [disable the python components]),
432d5ac70f0Sopenharmony_ci  [build_python="$enableval"], [build_python="yes"])
433d5ac70f0Sopenharmony_ci
434d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(python2,
435d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--enable-python2], [prefer python2]),
436d5ac70f0Sopenharmony_ci  [build_python2="$enableval"], [build_python2="no"])
437d5ac70f0Sopenharmony_ciPYTHON_LIBS=""
438d5ac70f0Sopenharmony_ciPYTHON_INCLUDES=""
439d5ac70f0Sopenharmony_ciif test "$build_python" = "yes" -a "$build_mixer_pymodules" = "yes"; then
440d5ac70f0Sopenharmony_ci  pythonlibs0=
441d5ac70f0Sopenharmony_ci  pythoninc0=
442d5ac70f0Sopenharmony_ci  if test "$build_python2" != "yes"; then
443d5ac70f0Sopenharmony_ci    pythonlibs0=$(python3-config --libs --embed 2> /dev/null)
444d5ac70f0Sopenharmony_ci    if test -z "$pythonlibs0"; then
445d5ac70f0Sopenharmony_ci      pythonlibs0=$(python3-config --libs)
446d5ac70f0Sopenharmony_ci    fi
447d5ac70f0Sopenharmony_ci    pythoninc0=$(python3-config --includes)
448d5ac70f0Sopenharmony_ci  fi
449d5ac70f0Sopenharmony_ci  if test -z "$pythonlibs0"; then
450d5ac70f0Sopenharmony_ci    pythonlibs0=$(python-config --libs)
451d5ac70f0Sopenharmony_ci    pythoninc0=$(python-config --includes)
452d5ac70f0Sopenharmony_ci  fi
453d5ac70f0Sopenharmony_ci  AC_ARG_WITH(pythonlibs,
454d5ac70f0Sopenharmony_ci    AS_HELP_STRING([--with-pythonlibs=ldflags],
455d5ac70f0Sopenharmony_ci      [specify python libraries (-lpthread -lm -ldl -lpython2.4)]),
456d5ac70f0Sopenharmony_ci    pythonlibs="$withval", pythonlibs=$pythonlibs0)
457d5ac70f0Sopenharmony_ci  AC_ARG_WITH(pythonincludes,
458d5ac70f0Sopenharmony_ci    AS_HELP_STRING([--with-pythonincludes=Cflags],
459d5ac70f0Sopenharmony_ci      [specify python C header files (-I/usr/include/python)]),
460d5ac70f0Sopenharmony_ci    pythonincludes="$withval", pythonincludes=$pythoninc0)
461d5ac70f0Sopenharmony_ci  if test -z "$pythonlibs"; then
462d5ac70f0Sopenharmony_ci    echo "Unable to determine python libraries! Probably python-config is not"
463d5ac70f0Sopenharmony_ci    echo "available on this system. Please, use --with-pythonlibs and"
464d5ac70f0Sopenharmony_ci    echo "--with-pythonincludes options. Python components are disabled in this build."
465d5ac70f0Sopenharmony_ci    build_python="no"
466d5ac70f0Sopenharmony_ci  else
467d5ac70f0Sopenharmony_ci    PYTHON_LIBS="$pythonlibs"
468d5ac70f0Sopenharmony_ci    PYTHON_INCLUDES="$pythonincludes"
469d5ac70f0Sopenharmony_ci  fi
470d5ac70f0Sopenharmony_cifi
471d5ac70f0Sopenharmony_ciif test "$build_python" != "yes"; then
472d5ac70f0Sopenharmony_ci  build_mixer_pymodules=
473d5ac70f0Sopenharmony_cifi
474d5ac70f0Sopenharmony_ciAC_SUBST(PYTHON_LIBS)
475d5ac70f0Sopenharmony_ciAC_SUBST(PYTHON_INCLUDES)
476d5ac70f0Sopenharmony_ci
477d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_MIXER], [test x$build_mixer = xyes])
478d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM], [test x$build_pcm = xyes])
479d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_RAWMIDI], [test x$build_rawmidi = xyes])
480d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_HWDEP], [test x$build_hwdep = xyes])
481d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_SEQ], [test x$build_seq = xyes])
482d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_UCM], [test x$build_ucm = xyes])
483d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_TOPOLOGY], [test x$build_topology = xyes])
484d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_ALISP], [test x$build_alisp = xyes])
485d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_MIXER_MODULES], [test x$build_mixer_modules = xyes])
486d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_MIXER_PYMODULES], [test x$build_mixer_pymodules = xyes])
487d5ac70f0Sopenharmony_ci
488d5ac70f0Sopenharmony_ciif test "$build_mixer" = "yes"; then
489d5ac70f0Sopenharmony_ci  AC_DEFINE([BUILD_MIXER], "1", [Build mixer component])
490d5ac70f0Sopenharmony_cifi
491d5ac70f0Sopenharmony_ciif test "$build_pcm" = "yes"; then
492d5ac70f0Sopenharmony_ci  AC_DEFINE([BUILD_PCM], "1", [Build PCM component])
493d5ac70f0Sopenharmony_cifi
494d5ac70f0Sopenharmony_ciif test "$build_rawmidi" = "yes"; then
495d5ac70f0Sopenharmony_ci  AC_DEFINE([BUILD_RAWMIDI], "1", [Build raw MIDI component])
496d5ac70f0Sopenharmony_cifi
497d5ac70f0Sopenharmony_ciif test "$build_hwdep" = "yes"; then
498d5ac70f0Sopenharmony_ci  AC_DEFINE([BUILD_HWDEP], "1", [Build hwdep component])
499d5ac70f0Sopenharmony_cifi
500d5ac70f0Sopenharmony_ciif test "$build_seq" = "yes"; then
501d5ac70f0Sopenharmony_ci  AC_DEFINE([BUILD_SEQ], "1", [Build sequencer component])
502d5ac70f0Sopenharmony_cifi
503d5ac70f0Sopenharmony_ciif test "$build_ucm" = "yes"; then
504d5ac70f0Sopenharmony_ci  AC_DEFINE([BUILD_UCM], "1", [Build UCM component])
505d5ac70f0Sopenharmony_cifi
506d5ac70f0Sopenharmony_ciif test "$build_topology" = "yes"; then
507d5ac70f0Sopenharmony_ci  AC_DEFINE([BUILD_TOPOLOGY], "1", [Build DSP Topology component])
508d5ac70f0Sopenharmony_cifi
509d5ac70f0Sopenharmony_ci
510d5ac70f0Sopenharmony_cidnl PCM Plugins
511d5ac70f0Sopenharmony_ci
512d5ac70f0Sopenharmony_ciif test "$build_pcm" = "yes"; then
513d5ac70f0Sopenharmony_ciAC_ARG_WITH(pcm-plugins,
514d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--with-pcm-plugins=<list>],
515d5ac70f0Sopenharmony_ci    [build PCM plugins (default = all)]),
516d5ac70f0Sopenharmony_ci  [pcm_plugins="$withval"], [pcm_plugins="all"])
517d5ac70f0Sopenharmony_cielse
518d5ac70f0Sopenharmony_cipcm_plugins=""
519d5ac70f0Sopenharmony_cifi
520d5ac70f0Sopenharmony_ci
521d5ac70f0Sopenharmony_cidnl check atomics for pcm_meter
522d5ac70f0Sopenharmony_ci
523d5ac70f0Sopenharmony_ciAC_MSG_CHECKING([whether GCC supports builtin atomic intrinsics])
524d5ac70f0Sopenharmony_ciif test -z "$gcc_have_atomics"; then
525d5ac70f0Sopenharmony_ci  gcc_have_atomics=no
526d5ac70f0Sopenharmony_ci  AC_TRY_LINK([],
527d5ac70f0Sopenharmony_ci    [int i;
528d5ac70f0Sopenharmony_ci     __atomic_load_n(&i, __ATOMIC_SEQ_CST);
529d5ac70f0Sopenharmony_ci     __atomic_add_fetch(&i, 0, __ATOMIC_SEQ_CST);
530d5ac70f0Sopenharmony_ci    ],
531d5ac70f0Sopenharmony_ci    [gcc_have_atomics=yes],
532d5ac70f0Sopenharmony_ci    [gcc_have_atomics=no])
533d5ac70f0Sopenharmony_cifi
534d5ac70f0Sopenharmony_ciAC_MSG_RESULT($gcc_have_atomics)
535d5ac70f0Sopenharmony_ci
536d5ac70f0Sopenharmony_cidnl check mmx register for pcm_dmix_i386
537d5ac70f0Sopenharmony_ci
538d5ac70f0Sopenharmony_ciAC_TRY_LINK([],
539d5ac70f0Sopenharmony_ci    [__asm__ volatile ("" : : : "mm0");],
540d5ac70f0Sopenharmony_ci    [AC_DEFINE([HAVE_MMX], "1", [MMX technology is enabled])],
541d5ac70f0Sopenharmony_ci    [])
542d5ac70f0Sopenharmony_ci
543d5ac70f0Sopenharmony_ciPCM_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"
544d5ac70f0Sopenharmony_ci
545d5ac70f0Sopenharmony_cibuild_pcm_plugin="no"
546d5ac70f0Sopenharmony_cifor t in $PCM_PLUGIN_LIST; do
547d5ac70f0Sopenharmony_ci  eval build_pcm_$t="no"
548d5ac70f0Sopenharmony_cidone
549d5ac70f0Sopenharmony_ci
550d5ac70f0Sopenharmony_cipcm_plugins=`echo $pcm_plugins | sed 's/,/ /g'`
551d5ac70f0Sopenharmony_cifor p in $pcm_plugins; do
552d5ac70f0Sopenharmony_ci  for t in $PCM_PLUGIN_LIST; do
553d5ac70f0Sopenharmony_ci    if test "$p" = "$t" -o "$p" = "all"; then
554d5ac70f0Sopenharmony_ci      eval build_pcm_$t="yes"
555d5ac70f0Sopenharmony_ci      build_pcm_plugin="yes"
556d5ac70f0Sopenharmony_ci    fi
557d5ac70f0Sopenharmony_ci  done
558d5ac70f0Sopenharmony_cidone
559d5ac70f0Sopenharmony_ci
560d5ac70f0Sopenharmony_cidnl special dependencies
561d5ac70f0Sopenharmony_ciif test "$build_pcm_plug" = "yes"; then
562d5ac70f0Sopenharmony_ci  build_pcm_linear="yes"
563d5ac70f0Sopenharmony_ci  build_pcm_copy="yes"
564d5ac70f0Sopenharmony_cifi
565d5ac70f0Sopenharmony_ci
566d5ac70f0Sopenharmony_ciif test "$build_pcm_ioplug" = "yes"; then
567d5ac70f0Sopenharmony_ci  build_pcm_extplug="yes"
568d5ac70f0Sopenharmony_cifi
569d5ac70f0Sopenharmony_ci
570d5ac70f0Sopenharmony_ciif test "$HAVE_LIBDL" != "yes"; then
571d5ac70f0Sopenharmony_ci  build_pcm_meter="no"
572d5ac70f0Sopenharmony_ci  build_pcm_ladspa="no"
573d5ac70f0Sopenharmony_ci  build_pcm_pcm_ioplug="no"
574d5ac70f0Sopenharmony_ci  build_pcm_pcm_extplug="no"
575d5ac70f0Sopenharmony_cifi
576d5ac70f0Sopenharmony_ci
577d5ac70f0Sopenharmony_ciif test "$HAVE_LIBPTHREAD" != "yes"; then
578d5ac70f0Sopenharmony_ci  build_pcm_share="no"
579d5ac70f0Sopenharmony_cifi
580d5ac70f0Sopenharmony_ci
581d5ac70f0Sopenharmony_ciif test "$softfloat" = "yes"; then
582d5ac70f0Sopenharmony_ci  build_pcm_lfloat="no"
583d5ac70f0Sopenharmony_ci  build_pcm_ladspa="no"
584d5ac70f0Sopenharmony_cifi
585d5ac70f0Sopenharmony_ci
586d5ac70f0Sopenharmony_ciif test "$gcc_have_atomics" != "yes"; then
587d5ac70f0Sopenharmony_ci  build_pcm_meter="no"
588d5ac70f0Sopenharmony_cifi
589d5ac70f0Sopenharmony_ci
590d5ac70f0Sopenharmony_ciif test "$ac_cv_header_sys_shm_h" != "yes"; then
591d5ac70f0Sopenharmony_ci  build_pcm_dmix="no"
592d5ac70f0Sopenharmony_ci  build_pcm_dshare="no"
593d5ac70f0Sopenharmony_ci  build_pcm_dsnoop="no"
594d5ac70f0Sopenharmony_ci  build_pcm_shm="no"
595d5ac70f0Sopenharmony_cifi
596d5ac70f0Sopenharmony_ci
597d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN], [test x$build_pcm_plugin = xyes])
598d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_COPY], [test x$build_pcm_copy = xyes])
599d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_LINEAR], [test x$build_pcm_linear = xyes])
600d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_ROUTE], [test x$build_pcm_route = xyes])
601d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_MULAW], [test x$build_pcm_mulaw = xyes])
602d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_ALAW], [test x$build_pcm_alaw = xyes])
603d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_ADPCM], [test x$build_pcm_adpcm = xyes])
604d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_RATE], [test x$build_pcm_rate = xyes])
605d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_PLUG], [test x$build_pcm_plug = xyes])
606d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_MULTI], [test x$build_pcm_multi = xyes])
607d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_SHM], [test x$build_pcm_shm = xyes])
608d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_FILE], [test x$build_pcm_file = xyes])
609d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_NULL], [test x$build_pcm_null = xyes])
610d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_EMPTY], [test x$build_pcm_empty = xyes])
611d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_SHARE], [test x$build_pcm_share = xyes])
612d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_METER], [test x$build_pcm_meter = xyes])
613d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_HOOKS], [test x$build_pcm_hooks = xyes])
614d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_LFLOAT], [test x$build_pcm_lfloat = xyes])
615d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_LADSPA], [test x$build_pcm_ladspa = xyes])
616d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_DMIX], [test x$build_pcm_dmix = xyes])
617d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_DSHARE], [test x$build_pcm_dshare = xyes])
618d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_DSNOOP], [test x$build_pcm_dsnoop = xyes])
619d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_ASYM], [test x$build_pcm_asym = xyes])
620d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_IEC958], [test x$build_pcm_iec958 = xyes])
621d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_SOFTVOL], [test x$build_pcm_softvol = xyes])
622d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_EXTPLUG], [test x$build_pcm_extplug = xyes])
623d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_IOPLUG], [test x$build_pcm_ioplug = xyes])
624d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_PCM_PLUGIN_MMAP_EMUL], [test x$build_pcm_mmap_emul = xyes])
625d5ac70f0Sopenharmony_ci
626d5ac70f0Sopenharmony_cidnl Defines for plug plugin
627d5ac70f0Sopenharmony_ciif test "$build_pcm_rate" = "yes"; then
628d5ac70f0Sopenharmony_ci  AC_DEFINE([BUILD_PCM_PLUGIN_RATE], "1", [Build PCM rate plugin])
629d5ac70f0Sopenharmony_cifi
630d5ac70f0Sopenharmony_ciif test "$build_pcm_route" = "yes"; then
631d5ac70f0Sopenharmony_ci  AC_DEFINE([BUILD_PCM_PLUGIN_ROUTE], "1", [Build PCM route plugin])
632d5ac70f0Sopenharmony_cifi
633d5ac70f0Sopenharmony_ciif test "$build_pcm_lfloat" = "yes"; then
634d5ac70f0Sopenharmony_ci  AC_DEFINE([BUILD_PCM_PLUGIN_LFLOAT], "1", [Build PCM lfloat plugin])
635d5ac70f0Sopenharmony_cifi
636d5ac70f0Sopenharmony_ciif test "$build_pcm_adpcm" = "yes"; then
637d5ac70f0Sopenharmony_ci  AC_DEFINE([BUILD_PCM_PLUGIN_ADPCM], "1", [Build PCM adpcm plugin])
638d5ac70f0Sopenharmony_cifi
639d5ac70f0Sopenharmony_ciif test "$build_pcm_mulaw" = "yes"; then
640d5ac70f0Sopenharmony_ci  AC_DEFINE([BUILD_PCM_PLUGIN_MULAW], "1", [Build PCM mulaw plugin])
641d5ac70f0Sopenharmony_cifi
642d5ac70f0Sopenharmony_ciif test "$build_pcm_alaw" = "yes"; then
643d5ac70f0Sopenharmony_ci  AC_DEFINE([BUILD_PCM_PLUGIN_ALAW], "1", [Build PCM alaw plugin])
644d5ac70f0Sopenharmony_cifi
645d5ac70f0Sopenharmony_ciif test "$build_pcm_iec958" = "yes"; then
646d5ac70f0Sopenharmony_ci  AC_DEFINE([BUILD_PCM_PLUGIN_IEC958], "1", [Build PCM iec958 plugin])
647d5ac70f0Sopenharmony_cifi
648d5ac70f0Sopenharmony_ciif test "$build_pcm_mmap_emul" = "yes"; then
649d5ac70f0Sopenharmony_ci  AC_DEFINE([BUILD_PCM_PLUGIN_MMAP_EMUL], "1", [Build PCM mmap-emul plugin])
650d5ac70f0Sopenharmony_cifi
651d5ac70f0Sopenharmony_ci
652d5ac70f0Sopenharmony_ciif test "$build_pcm_dmix" = "yes"; then
653d5ac70f0Sopenharmony_ciAC_MSG_CHECKING(for default lockless dmix)
654d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(lockless-dmix,
655d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--enable-lockless-dmix],
656d5ac70f0Sopenharmony_ci    [use lockless dmix as default on x86]),
657d5ac70f0Sopenharmony_ci  lockless_dmix="$enableval", lockless_dmix="no")
658d5ac70f0Sopenharmony_ciif test "$lockless_dmix" = "yes"; then
659d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(yes)
660d5ac70f0Sopenharmony_ci  AC_DEFINE([LOCKLESS_DMIX_DEFAULT], "1", [Lockless dmix as default])
661d5ac70f0Sopenharmony_cielse
662d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(no)
663d5ac70f0Sopenharmony_cifi
664d5ac70f0Sopenharmony_cifi
665d5ac70f0Sopenharmony_ci
666d5ac70f0Sopenharmony_cidnl Create PCM plugin symbol list for static library
667d5ac70f0Sopenharmony_cirm -f "$srcdir"/src/pcm/pcm_symbols_list.c
668d5ac70f0Sopenharmony_citouch "$srcdir"/src/pcm/pcm_symbols_list.c
669d5ac70f0Sopenharmony_cifor t in $PCM_PLUGIN_LIST; do
670d5ac70f0Sopenharmony_ci  if eval test \$build_pcm_$t = yes; then
671d5ac70f0Sopenharmony_ci    echo \&_snd_module_pcm_$t, >> "$srcdir"/src/pcm/pcm_symbols_list.c
672d5ac70f0Sopenharmony_ci  fi
673d5ac70f0Sopenharmony_cidone
674d5ac70f0Sopenharmony_ci
675d5ac70f0Sopenharmony_cidnl Control Plugins
676d5ac70f0Sopenharmony_ci
677d5ac70f0Sopenharmony_ciAC_ARG_WITH(ctl-plugins,
678d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--with-ctl-plugins=<list>],
679d5ac70f0Sopenharmony_ci    [build control plugins (default = all)]),
680d5ac70f0Sopenharmony_ci  [ctl_plugins="$withval"], [ctl_plugins="all"])
681d5ac70f0Sopenharmony_ci
682d5ac70f0Sopenharmony_ciCTL_PLUGIN_LIST="remap shm ext"
683d5ac70f0Sopenharmony_ci
684d5ac70f0Sopenharmony_cibuild_ctl_plugin="no"
685d5ac70f0Sopenharmony_cifor t in $CTL_PLUGIN_LIST; do
686d5ac70f0Sopenharmony_ci  eval build_ctl_$t="no"
687d5ac70f0Sopenharmony_cidone
688d5ac70f0Sopenharmony_ci
689d5ac70f0Sopenharmony_cictl_plugins=`echo $ctl_plugins | sed 's/,/ /g'`
690d5ac70f0Sopenharmony_cifor p in $ctl_plugins; do
691d5ac70f0Sopenharmony_ci  for t in $CTL_PLUGIN_LIST; do
692d5ac70f0Sopenharmony_ci    if test "$p" = "$t" -o "$p" = "all"; then
693d5ac70f0Sopenharmony_ci      eval build_ctl_$t="yes"
694d5ac70f0Sopenharmony_ci      build_ctl_plugin="yes"
695d5ac70f0Sopenharmony_ci    fi
696d5ac70f0Sopenharmony_ci  done
697d5ac70f0Sopenharmony_cidone
698d5ac70f0Sopenharmony_ci
699d5ac70f0Sopenharmony_ciif test "$ac_cv_header_sys_shm_h" != "yes"; then
700d5ac70f0Sopenharmony_ci  build_ctl_shm="no"
701d5ac70f0Sopenharmony_cifi
702d5ac70f0Sopenharmony_ci
703d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_CTL_PLUGIN], [test x$build_ctl_plugin = xyes])
704d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_CTL_PLUGIN_REMAP], [test x$build_ctl_remap = xyes])
705d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_CTL_PLUGIN_SHM], [test x$build_ctl_shm = xyes])
706d5ac70f0Sopenharmony_ciAM_CONDITIONAL([BUILD_CTL_PLUGIN_EXT], [test x$build_ctl_ext = xyes])
707d5ac70f0Sopenharmony_ci
708d5ac70f0Sopenharmony_cidnl Create ctl plugin symbol list for static library
709d5ac70f0Sopenharmony_cirm -f "$srcdir"/src/control/ctl_symbols_list.c
710d5ac70f0Sopenharmony_citouch "$srcdir"/src/control/ctl_symbols_list.c
711d5ac70f0Sopenharmony_cifor t in $CTL_PLUGIN_LIST; do
712d5ac70f0Sopenharmony_ci  if eval test \$build_ctl_$t = yes; then
713d5ac70f0Sopenharmony_ci    echo \&_snd_module_control_$t, >> "$srcdir"/src/control/ctl_symbols_list.c
714d5ac70f0Sopenharmony_ci  fi
715d5ac70f0Sopenharmony_cidone
716d5ac70f0Sopenharmony_ci
717d5ac70f0Sopenharmony_cidnl Max number of cards
718d5ac70f0Sopenharmony_ciAC_MSG_CHECKING(for max number of cards)
719d5ac70f0Sopenharmony_ciAC_ARG_WITH(max-cards,
720d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--with-max-cards], [Specify the max number of cards (default = 32)]),
721d5ac70f0Sopenharmony_ci  [ max_cards="$withval" ], [ max_cards="32" ])
722d5ac70f0Sopenharmony_ciAC_MSG_RESULT([$max_cards])
723d5ac70f0Sopenharmony_ci
724d5ac70f0Sopenharmony_ciif test "$max_cards" -lt 1; then
725d5ac70f0Sopenharmony_ci   AC_ERROR([Invalid max cards $max_cards])
726d5ac70f0Sopenharmony_cielif test "$max_cards" -gt 256; then
727d5ac70f0Sopenharmony_ci   AC_ERROR([Invalid max cards $max_cards])
728d5ac70f0Sopenharmony_cifi
729d5ac70f0Sopenharmony_ciAC_DEFINE_UNQUOTED(SND_MAX_CARDS, $max_cards, [Max number of cards])
730d5ac70f0Sopenharmony_ci
731d5ac70f0Sopenharmony_cidnl Check for thread-safe API functions
732d5ac70f0Sopenharmony_ciif test "$HAVE_LIBPTHREAD" = "yes"; then
733d5ac70f0Sopenharmony_ciAC_MSG_CHECKING(for thread-safe API functions)
734d5ac70f0Sopenharmony_ciAC_ARG_ENABLE(thread-safety,
735d5ac70f0Sopenharmony_ci  AS_HELP_STRING([--disable-thread-safety],
736d5ac70f0Sopenharmony_ci    [disable thread-safe API functions]),
737d5ac70f0Sopenharmony_ci  threadsafe="$enableval", threadsafe="yes")
738d5ac70f0Sopenharmony_ciif test "$threadsafe" = "yes"; then
739d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(yes)
740d5ac70f0Sopenharmony_ci  AC_DEFINE([THREAD_SAFE_API], "1", [Disable thread-safe API functions])
741d5ac70f0Sopenharmony_cielse
742d5ac70f0Sopenharmony_ci  AC_MSG_RESULT(no)
743d5ac70f0Sopenharmony_cifi
744d5ac70f0Sopenharmony_cifi
745d5ac70f0Sopenharmony_ci
746d5ac70f0Sopenharmony_cidnl Make a symlink for inclusion of alsa/xxx.h
747d5ac70f0Sopenharmony_ciif test ! -L "$srcdir"/include/alsa ; then
748d5ac70f0Sopenharmony_ci  echo "Making a symlink include/alsa"
749d5ac70f0Sopenharmony_ci  rm -f "$srcdir"/include/alsa
750d5ac70f0Sopenharmony_ci  ln -sf . "$srcdir"/include/alsa
751d5ac70f0Sopenharmony_cifi
752d5ac70f0Sopenharmony_ci
753d5ac70f0Sopenharmony_ciAC_CONFIG_FILES(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
754d5ac70f0Sopenharmony_ci		include/Makefile include/sound/Makefile include/sound/uapi/Makefile \
755d5ac70f0Sopenharmony_ci		src/Versions.in src/Makefile \
756d5ac70f0Sopenharmony_ci		src/control/Makefile src/mixer/Makefile \
757d5ac70f0Sopenharmony_ci		src/pcm/Makefile src/pcm/scopes/Makefile \
758d5ac70f0Sopenharmony_ci		src/rawmidi/Makefile src/timer/Makefile \
759d5ac70f0Sopenharmony_ci		src/hwdep/Makefile src/seq/Makefile src/ucm/Makefile \
760d5ac70f0Sopenharmony_ci		src/alisp/Makefile src/topology/Makefile \
761d5ac70f0Sopenharmony_ci		src/conf/Makefile \
762d5ac70f0Sopenharmony_ci		src/conf/cards/Makefile \
763d5ac70f0Sopenharmony_ci		src/conf/ctl/Makefile \
764d5ac70f0Sopenharmony_ci		src/conf/pcm/Makefile \
765d5ac70f0Sopenharmony_ci		modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \
766d5ac70f0Sopenharmony_ci		alsalisp/Makefile aserver/Makefile \
767d5ac70f0Sopenharmony_ci		test/Makefile test/lsb/Makefile \
768d5ac70f0Sopenharmony_ci		utils/Makefile utils/alsa-lib.spec utils/alsa.pc utils/alsa-topology.pc)
769d5ac70f0Sopenharmony_ci
770d5ac70f0Sopenharmony_ciAC_OUTPUT()
771d5ac70f0Sopenharmony_ci
772d5ac70f0Sopenharmony_cidnl Create asoundlib.h dynamically according to configure options
773d5ac70f0Sopenharmony_ciecho "Creating asoundlib.h..."
774d5ac70f0Sopenharmony_cicp "$srcdir"/include/asoundlib-head.h include/asoundlib.h
775d5ac70f0Sopenharmony_ciif test "$ac_cv_header_sys_endian_h" != "yes"; then
776d5ac70f0Sopenharmony_citest "$ac_cv_header_endian_h" = "yes" && echo "#include <endian.h>" >> include/asoundlib.h
777d5ac70f0Sopenharmony_cielse
778d5ac70f0Sopenharmony_cicat >> include/asoundlib.h <<EOF
779d5ac70f0Sopenharmony_ci#include <sys/endian.h>
780d5ac70f0Sopenharmony_ci#ifndef __BYTE_ORDER
781d5ac70f0Sopenharmony_ci#define __BYTE_ORDER BYTE_ORDER
782d5ac70f0Sopenharmony_ci#endif
783d5ac70f0Sopenharmony_ci#ifndef __LITTLE_ENDIAN
784d5ac70f0Sopenharmony_ci#define __LITTLE_ENDIAN LITTLE_ENDIAN
785d5ac70f0Sopenharmony_ci#endif
786d5ac70f0Sopenharmony_ci#ifndef __BIG_ENDIAN
787d5ac70f0Sopenharmony_ci#define __BIG_ENDIAN BIG_ENDIAN
788d5ac70f0Sopenharmony_ci#endif
789d5ac70f0Sopenharmony_ciEOF
790d5ac70f0Sopenharmony_cifi
791d5ac70f0Sopenharmony_cicat >> include/asoundlib.h <<EOF
792d5ac70f0Sopenharmony_ci
793d5ac70f0Sopenharmony_ci#ifndef DOC_HIDDEN
794d5ac70f0Sopenharmony_ci#ifndef __GNUC__
795d5ac70f0Sopenharmony_ci#define __inline__ inline
796d5ac70f0Sopenharmony_ci#endif
797d5ac70f0Sopenharmony_ci#endif /* DOC_HIDDEN */
798d5ac70f0Sopenharmony_ci
799d5ac70f0Sopenharmony_ci#include <alsa/asoundef.h>
800d5ac70f0Sopenharmony_ci#include <alsa/version.h>
801d5ac70f0Sopenharmony_ci#include <alsa/global.h>
802d5ac70f0Sopenharmony_ci#include <alsa/input.h>
803d5ac70f0Sopenharmony_ci#include <alsa/output.h>
804d5ac70f0Sopenharmony_ci#include <alsa/error.h>
805d5ac70f0Sopenharmony_ci#include <alsa/conf.h>
806d5ac70f0Sopenharmony_ciEOF
807d5ac70f0Sopenharmony_citest "$build_pcm" = "yes" && echo "#include <alsa/pcm.h>" >> include/asoundlib.h
808d5ac70f0Sopenharmony_citest "$build_rawmidi" = "yes" && echo "#include <alsa/rawmidi.h>" >> include/asoundlib.h
809d5ac70f0Sopenharmony_citest "$build_rawmidi" = "yes" && echo "#include <alsa/ump.h>" >> include/asoundlib.h
810d5ac70f0Sopenharmony_citest "$build_pcm" = "yes" && echo "#include <alsa/timer.h>" >> include/asoundlib.h
811d5ac70f0Sopenharmony_citest "$build_hwdep" = "yes" && echo "#include <alsa/hwdep.h>" >> include/asoundlib.h
812d5ac70f0Sopenharmony_ciecho "#include <alsa/control.h>" >> include/asoundlib.h
813d5ac70f0Sopenharmony_citest "$build_mixer" = "yes" && echo "#include <alsa/mixer.h>" >> include/asoundlib.h
814d5ac70f0Sopenharmony_citest "$build_seq" = "yes" && echo "#include <alsa/seq_event.h>" >> include/asoundlib.h
815d5ac70f0Sopenharmony_citest "$build_seq" = "yes" && echo "#include <alsa/seq.h>" >> include/asoundlib.h
816d5ac70f0Sopenharmony_citest "$build_seq" = "yes" && echo "#include <alsa/seqmid.h>" >> include/asoundlib.h
817d5ac70f0Sopenharmony_citest "$build_seq" = "yes" && echo "#include <alsa/seq_midi_event.h>" >> include/asoundlib.h
818d5ac70f0Sopenharmony_cicat "$srcdir"/include/asoundlib-tail.h >> include/asoundlib.h
819