1998-08-13 15:42:56 +00:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
2006-03-21 16:56:16 +00:00
|
|
|
AC_PREREQ(2.59)
|
2023-05-04 09:16:16 +02:00
|
|
|
AC_INIT(alsa-lib, 1.2.9)
|
2008-11-21 01:08:42 +01:00
|
|
|
|
2014-02-25 12:40:21 +00:00
|
|
|
AC_CONFIG_SRCDIR([src/control/control.c])
|
2008-11-21 01:08:42 +01:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
|
2000-04-03 18:17:59 +00:00
|
|
|
dnl *************************************************
|
|
|
|
dnl current:revision:age
|
|
|
|
dnl change (without API) = c:r+1:a
|
|
|
|
dnl change API = c+1:0:a
|
|
|
|
dnl add API = c+1:0:a+1
|
|
|
|
dnl remove API = c+1:0:0
|
|
|
|
dnl *************************************************
|
2008-11-21 01:02:55 +01:00
|
|
|
AC_CANONICAL_HOST
|
2014-02-25 12:40:21 +00:00
|
|
|
AM_INIT_AUTOMAKE
|
2002-09-19 16:12:13 +00:00
|
|
|
eval LIBTOOL_VERSION_INFO="2:0:0"
|
2000-04-03 18:17:59 +00:00
|
|
|
dnl *************************************************
|
2012-12-07 09:27:11 +01:00
|
|
|
AM_CONDITIONAL([INSTALL_M4], [test -n "${ACLOCAL}"])
|
1998-08-13 15:42:56 +00:00
|
|
|
|
2013-05-15 19:05:58 +02:00
|
|
|
AM_MAINTAINER_MODE([enable])
|
|
|
|
|
2009-09-29 23:48:20 +02:00
|
|
|
# Test for new silent rules and enable only if they are available
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
|
1998-08-13 15:42:56 +00:00
|
|
|
AC_PREFIX_DEFAULT(/usr)
|
|
|
|
|
|
|
|
dnl Checks for programs.
|
2002-03-03 09:25:02 +00:00
|
|
|
|
1998-08-13 15:42:56 +00:00
|
|
|
AC_PROG_CC
|
2006-09-19 18:07:51 +02:00
|
|
|
AC_PROG_CPP
|
2015-10-09 17:47:40 -04:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
1998-08-13 15:42:56 +00:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
2001-10-24 14:13:24 +00:00
|
|
|
AC_DISABLE_STATIC
|
2001-07-30 11:56:46 +00:00
|
|
|
AC_LIBTOOL_DLOPEN
|
1998-11-18 20:42:09 +00:00
|
|
|
AM_PROG_LIBTOOL
|
1998-08-13 15:42:56 +00:00
|
|
|
|
2008-11-21 01:16:37 +01:00
|
|
|
CC_NOUNDEFINED
|
|
|
|
|
1998-08-13 15:42:56 +00:00
|
|
|
dnl Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
2013-05-16 04:32:58 -04:00
|
|
|
AC_CONFIG_HEADERS(include/config.h)
|
1998-08-13 15:42:56 +00:00
|
|
|
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_HEADER_TIME
|
|
|
|
|
|
|
|
dnl Checks for library functions.
|
|
|
|
AC_PROG_GCC_TRADITIONAL
|
2010-04-21 18:37:47 +02:00
|
|
|
AC_CHECK_FUNCS([uselocale])
|
2021-06-14 12:24:10 +08:00
|
|
|
AC_CHECK_FUNCS([eaccess])
|
1998-08-13 15:42:56 +00:00
|
|
|
|
1998-11-21 18:47:42 +00:00
|
|
|
SAVE_LIBRARY_VERSION
|
2000-03-11 11:08:08 +00:00
|
|
|
AC_SUBST(LIBTOOL_VERSION_INFO)
|
1998-08-13 15:42:56 +00:00
|
|
|
|
2001-06-26 10:35:39 +00:00
|
|
|
test "x$prefix" = xNONE && prefix=$ac_default_prefix
|
2001-07-01 17:31:39 +00:00
|
|
|
|
2011-03-30 17:30:09 +02:00
|
|
|
dnl Do not build static and shared libraries together
|
|
|
|
if test "$enable_static" = "$enable_shared" -a "$enable_static" = "yes"; then
|
|
|
|
cat <<EOF
|
|
|
|
Please, do not try to compile static and shared libraries together.
|
|
|
|
See INSTALL file for more details (do not use --enable-shared=yes with
|
|
|
|
--enable-static=yes).
|
|
|
|
EOF
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2007-05-03 20:55:54 +02:00
|
|
|
dnl ALSA configuration directory
|
|
|
|
AC_ARG_WITH(configdir,
|
|
|
|
AS_HELP_STRING([--with-configdir=dir],
|
|
|
|
[path where ALSA config files are stored]),
|
|
|
|
confdir="$withval", confdir="")
|
|
|
|
if test -z "$confdir"; then
|
|
|
|
eval dir="$datadir"
|
|
|
|
case "$dir" in
|
|
|
|
/*) ;;
|
|
|
|
*) dir="$prefix/share"
|
|
|
|
esac
|
|
|
|
confdir="$dir/alsa"
|
|
|
|
fi
|
|
|
|
ALSA_CONFIG_DIR="$confdir"
|
|
|
|
AC_DEFINE_UNQUOTED(ALSA_CONFIG_DIR, "$confdir", [directory containing ALSA configuration database])
|
|
|
|
AC_SUBST(ALSA_CONFIG_DIR)
|
2001-06-26 10:35:39 +00:00
|
|
|
|
2007-05-03 20:55:54 +02:00
|
|
|
dnl ALSA plugin directory
|
2003-03-05 19:56:55 +00:00
|
|
|
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
|
|
|
|
|
2007-05-03 20:55:54 +02:00
|
|
|
AC_ARG_WITH(plugindir,
|
|
|
|
AS_HELP_STRING([--with-plugindir=dir],
|
|
|
|
[path where ALSA plugin files are stored]),
|
|
|
|
plugindir="$withval", plugindir="")
|
|
|
|
if test -z "$plugindir"; then
|
|
|
|
eval dir="$libdir"
|
|
|
|
case "$dir" in
|
|
|
|
/*) ;;
|
|
|
|
*) dir="$dir"
|
|
|
|
esac
|
|
|
|
plugindir="$dir/$PACKAGE"
|
|
|
|
fi
|
2007-06-08 11:35:03 +02:00
|
|
|
AC_DEFINE_UNQUOTED(ALSA_PLUGIN_DIR, "$plugindir", [directory containing ALSA add-on modules])
|
2007-05-03 20:55:54 +02:00
|
|
|
ALSA_PLUGIN_DIR="$plugindir"
|
|
|
|
AC_SUBST(ALSA_PLUGIN_DIR)
|
2003-03-05 19:56:55 +00:00
|
|
|
|
2012-01-20 16:14:44 +01:00
|
|
|
AC_ARG_WITH(pkgconfdir,
|
|
|
|
AS_HELP_STRING([--with-pkgconfdir=dir],
|
|
|
|
[path where pkgconfig files are stored]),
|
|
|
|
pkgconfdir="$withval", pkgconfdir="")
|
|
|
|
if test -z "$pkgconfdir"; then
|
|
|
|
eval dir="$libdir"
|
|
|
|
case "$dir" in
|
|
|
|
/*) ;;
|
|
|
|
*) dir="$dir"
|
|
|
|
esac
|
|
|
|
pkgconfdir="$dir/pkgconfig"
|
|
|
|
fi
|
|
|
|
AC_DEFINE_UNQUOTED(ALSA_PKGCONF_DIR, "$pkgconfdir", [directory containing pkgconfig files])
|
|
|
|
ALSA_PKGCONF_DIR="$pkgconfdir"
|
|
|
|
AC_SUBST(ALSA_PKGCONF_DIR)
|
|
|
|
|
2002-09-17 12:33:05 +00:00
|
|
|
dnl Check for versioned symbols
|
|
|
|
AC_MSG_CHECKING(for versioned symbols)
|
|
|
|
AC_ARG_WITH(versioned,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--with-versioned],
|
|
|
|
[shared library will be compiled with versioned symbols (default = yes)]),
|
2002-09-17 12:33:05 +00:00
|
|
|
versioned="$withval", versioned="yes")
|
|
|
|
if test "$versioned" = "yes"; then
|
2002-10-23 13:06:49 +00:00
|
|
|
# it seems that GNU ld versions since 2.10 are not broken
|
2010-10-08 09:06:29 +01:00
|
|
|
xres=`grep '^VERSION=' ${srcdir}/ltmain.sh | cut -d = -f 2 | cut -d \" -f 2`
|
2002-10-23 13:06:49 +00:00
|
|
|
major=`echo $xres | cut -d . -f 1`
|
|
|
|
minor=`echo $xres | cut -d . -f 2`
|
|
|
|
pass=0
|
2010-10-08 09:06:58 +01:00
|
|
|
if test $major -eq 1 && test $minor -gt 3; then
|
2002-10-23 13:06:49 +00:00
|
|
|
pass=1
|
|
|
|
else
|
|
|
|
if test $major -gt 1; then
|
|
|
|
pass=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test $pass -eq 1; then
|
|
|
|
AC_DEFINE(VERSIONED_SYMBOLS,,[compiled with versioned symbols])
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(broken libtool - use libtool v1.4+; no versions)
|
|
|
|
fi
|
2002-09-17 12:33:05 +00:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
2012-12-07 09:27:11 +01:00
|
|
|
AM_CONDITIONAL([VERSIONED_SYMBOLS], [test x$versioned = xyes])
|
2002-09-17 12:33:05 +00:00
|
|
|
|
2007-04-10 13:24:52 +02:00
|
|
|
dnl Check for symbolic-functions
|
|
|
|
AC_MSG_CHECKING(for symbolic-functions)
|
|
|
|
AC_ARG_ENABLE(symbolic-functions,
|
|
|
|
AS_HELP_STRING([--enable-symbolic-functions],
|
|
|
|
[use -Bsymbolic-functions option if available (optmization for size and speed)]),
|
|
|
|
symfuncs="$enableval", symfuncs="no")
|
|
|
|
if test "$symfuncs" = "yes"; then
|
|
|
|
if ld --help | grep -q -- '-Bsymbolic-functions'; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(not supported by ld)
|
2007-06-04 15:22:04 +02:00
|
|
|
symfuncs="no"
|
2007-04-10 13:24:52 +02:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
2012-12-07 09:27:11 +01:00
|
|
|
AM_CONDITIONAL([SYMBOLIC_FUNCTIONS], [test x"$symfuncs" = xyes])
|
2007-04-10 13:24:52 +02:00
|
|
|
|
2006-09-19 18:07:51 +02:00
|
|
|
dnl See if toolchain has a custom prefix for symbols ...
|
|
|
|
AC_MSG_CHECKING(for custom symbol prefixes)
|
|
|
|
SYMBOL_PREFIX=` \
|
|
|
|
echo "PREFIX=__USER_LABEL_PREFIX__" \
|
|
|
|
| ${CPP-${CC-gcc} -E} - 2>&1 \
|
|
|
|
| ${EGREP-grep} "^PREFIX=" \
|
|
|
|
| ${SED-sed} "s:^PREFIX=::"`
|
|
|
|
AC_DEFINE_UNQUOTED([__SYMBOL_PREFIX], "$SYMBOL_PREFIX", [Toolchain Symbol Prefix])
|
2007-01-17 15:19:52 +01:00
|
|
|
AC_SUBST(SYMBOL_PREFIX)
|
2006-09-19 18:07:51 +02:00
|
|
|
AC_MSG_RESULT($SYMBOL_PREFIX)
|
|
|
|
|
2001-07-30 11:56:46 +00:00
|
|
|
dnl Check for debug...
|
|
|
|
AC_MSG_CHECKING(for debug)
|
|
|
|
AC_ARG_WITH(debug,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--with-debug],
|
|
|
|
[library will be compiled with asserts (default = yes)]),
|
2001-07-30 11:56:46 +00:00
|
|
|
debug="$withval", debug="yes")
|
|
|
|
if test "$debug" = "yes"; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
2002-08-16 17:28:34 +00:00
|
|
|
AC_DEFINE(NDEBUG,,[No assert debug])
|
2001-07-30 11:56:46 +00:00
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2007-10-24 12:53:08 +02:00
|
|
|
if test "$debug" = "yes"; then
|
|
|
|
AC_MSG_CHECKING(for debug assert)
|
|
|
|
AC_ARG_ENABLE(debug-assert,
|
|
|
|
AS_HELP_STRING([--enable-debug],
|
|
|
|
[enable assert call at the default error message handler]),
|
|
|
|
debug_assert="$enableval", debug_assert="no")
|
|
|
|
if test "$debug_assert" = "yes"; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(ALSA_DEBUG_ASSERT,,[Enable assert at error message handler])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2004-02-09 17:04:09 +00:00
|
|
|
dnl Temporary directory
|
|
|
|
AC_MSG_CHECKING(for tmpdir)
|
|
|
|
AC_ARG_WITH(tmpdir,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--with-tmpdir=directory],
|
|
|
|
[directory to put tmp socket files (/tmp)]),
|
2004-02-09 17:04:09 +00:00
|
|
|
tmpdir="$withval", tmpdir="/tmp")
|
|
|
|
AC_MSG_RESULT($tmpdir)
|
|
|
|
AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir", [directory to put tmp socket files])
|
|
|
|
|
2002-09-17 12:33:05 +00:00
|
|
|
dnl Check for softfloat...
|
|
|
|
AC_MSG_CHECKING(for softfloat)
|
2002-04-24 14:41:55 +00:00
|
|
|
AC_ARG_WITH(softfloat,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--with-softfloat],
|
|
|
|
[do you have floating point unit on this machine? (optional)]),
|
2009-11-16 11:14:54 +01:00
|
|
|
[case "$withval" in
|
|
|
|
y|yes) softfloat=yes ;;
|
|
|
|
*) softfloat=no ;;
|
|
|
|
esac],)
|
2007-08-15 15:54:47 +02:00
|
|
|
if test "$softfloat" = "yes" ; then
|
2009-11-16 11:14:54 +01:00
|
|
|
AC_DEFINE(HAVE_SOFT_FLOAT, "1", [Avoid calculation in float])
|
2002-09-17 12:33:05 +00:00
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
2002-04-24 14:41:55 +00:00
|
|
|
|
2007-03-22 00:48:18 +01:00
|
|
|
ALSA_DEPLIBS=""
|
|
|
|
if test "$softfloat" != "yes"; then
|
|
|
|
ALSA_DEPLIBS="-lm"
|
|
|
|
fi
|
|
|
|
|
2022-05-20 09:52:54 +02:00
|
|
|
dnl Check for scandir64
|
|
|
|
AC_MSG_CHECKING(for LFS calls)
|
2022-05-20 14:35:11 +02:00
|
|
|
AC_TRY_LINK([#include <dirent.h>],
|
2022-05-20 09:52:54 +02:00
|
|
|
[struct dirent64 a; ],
|
|
|
|
[have_lfs=yes],
|
|
|
|
[have_lfs=no])
|
|
|
|
if test "$have_lfs" = "yes"; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE([HAVE_LFS], 1, [Have LFS])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2007-03-22 00:48:18 +01:00
|
|
|
dnl Check for libdl
|
|
|
|
AC_MSG_CHECKING(for libdl)
|
|
|
|
AC_ARG_WITH(libdl,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--with-libdl], [Use libdl for plugins (default = yes)]),
|
2007-03-22 00:48:18 +01:00
|
|
|
[ have_libdl="$withval" ], [ have_libdl="yes" ])
|
2012-12-07 09:27:11 +01:00
|
|
|
HAVE_LIBDL=
|
2007-03-22 00:48:18 +01:00
|
|
|
if test "$have_libdl" = "yes"; then
|
2023-01-03 11:13:19 +09:00
|
|
|
AC_SEARCH_LIBS([dlsym], [dl], [HAVE_LIBDL="yes"])
|
2007-03-22 00:48:18 +01:00
|
|
|
if test "$HAVE_LIBDL" = "yes" ; then
|
|
|
|
AC_DEFINE([HAVE_LIBDL], 1, [Have libdl])
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
2012-12-07 09:27:11 +01:00
|
|
|
AM_CONDITIONAL([BUILD_MODULES], [test "$HAVE_LIBDL" = "yes"])
|
2007-03-22 00:48:18 +01:00
|
|
|
|
|
|
|
dnl Check for pthread
|
|
|
|
AC_MSG_CHECKING(for pthread)
|
|
|
|
AC_ARG_WITH(pthread,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--with-pthread], [Use pthread (default = yes)]),
|
2007-03-22 00:48:18 +01:00
|
|
|
[ have_pthread="$withval" ], [ have_pthread="yes" ])
|
|
|
|
if test "$have_pthread" = "yes"; then
|
|
|
|
AC_CHECK_LIB([pthread], [pthread_join], [HAVE_LIBPTHREAD="yes"])
|
|
|
|
if test "$HAVE_LIBPTHREAD" = "yes"; then
|
|
|
|
ALSA_DEPLIBS="$ALSA_DEPLIBS -lpthread"
|
|
|
|
AC_DEFINE([HAVE_LIBPTHREAD], 1, [Have libpthread])
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2017-05-16 16:02:59 +02:00
|
|
|
dnl Check for pthread
|
|
|
|
if test "$HAVE_LIBPTHREAD" = "yes"; then
|
|
|
|
AC_CHECK_DECL(PTHREAD_MUTEX_RECURSIVE,
|
|
|
|
AC_DEFINE(HAVE_PTHREAD_MUTEX_RECURSIVE, [],
|
|
|
|
[Define if your pthreads implementation have PTHREAD_MUTEX_RECURSIVE]),
|
|
|
|
,
|
|
|
|
[#include <pthread.h>])
|
|
|
|
fi
|
|
|
|
|
2013-01-31 15:47:23 +01:00
|
|
|
dnl Check for __thread
|
|
|
|
AC_MSG_CHECKING([for __thread])
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 1) || (__GNUC__ == 4 && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ < 2))
|
|
|
|
#error gcc has this bug: http://gcc.gnu.org/ml/gcc-bugs/2006-09/msg02275.html
|
|
|
|
#endif], [static __thread int p = 0])],
|
|
|
|
[AC_DEFINE(HAVE___THREAD, 1,
|
|
|
|
Define to 1 if compiler supports __thread)
|
|
|
|
AC_MSG_RESULT([yes])],
|
|
|
|
[AC_MSG_RESULT([no])])
|
|
|
|
|
2008-01-09 11:13:34 +01:00
|
|
|
dnl Check for librt
|
|
|
|
AC_MSG_CHECKING(for librt)
|
|
|
|
AC_ARG_WITH(librt,
|
|
|
|
AS_HELP_STRING([--with-librt], [Use librt for monotonic clock (default = yes)]),
|
|
|
|
[ have_librt="$withval" ], [ have_librt="yes" ])
|
|
|
|
if test "$have_librt" = "yes"; then
|
|
|
|
AC_CHECK_LIB([rt], [clock_gettime], [HAVE_LIBRT="yes"])
|
|
|
|
if test "$HAVE_LIBRT" = "yes" ; then
|
|
|
|
ALSA_DEPLIBS="$ALSA_DEPLIBS -lrt"
|
|
|
|
AC_DEFINE([HAVE_LIBRT], 1, [Have librt])
|
|
|
|
AC_DEFINE([HAVE_CLOCK_GETTIME], 1, [Have clock gettime])
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2007-03-22 00:48:18 +01:00
|
|
|
AC_SUBST(ALSA_DEPLIBS)
|
|
|
|
|
2017-07-14 18:47:05 +02:00
|
|
|
dnl Check for use of wordexp...
|
|
|
|
AC_MSG_CHECKING(for use of wordexp)
|
|
|
|
AC_ARG_WITH(wordexp,
|
|
|
|
AS_HELP_STRING([--with-wordexp],
|
|
|
|
[Use wordexp when expanding configs (default = no)]),
|
|
|
|
[case "$withval" in
|
|
|
|
y|yes) wordexp=yes ;;
|
|
|
|
*) wordexp=no ;;
|
|
|
|
esac],)
|
|
|
|
if test "$wordexp" = "yes" ; then
|
|
|
|
AC_DEFINE(HAVE_WORDEXP, "1", [Enable use of wordexp])
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_CHECK_HEADER([wordexp.h],[], [AC_MSG_ERROR([Couldn't find wordexp.h])])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2014-02-23 11:12:48 +00:00
|
|
|
dnl Check for headers
|
2022-07-10 11:03:00 +09:00
|
|
|
AC_CHECK_HEADERS([endian.h sys/endian.h sys/shm.h malloc.h])
|
2005-11-29 15:18:56 +00:00
|
|
|
|
2005-01-26 10:50:28 +00:00
|
|
|
dnl Check for resmgr support...
|
|
|
|
AC_MSG_CHECKING(for resmgr support)
|
2005-02-14 13:31:53 +00:00
|
|
|
AC_ARG_ENABLE(resmgr,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--enable-resmgr], [support resmgr (optional)]),
|
2005-02-14 13:52:00 +00:00
|
|
|
resmgr="$enableval", resmgr="no")
|
2005-01-26 10:50:28 +00:00
|
|
|
AC_MSG_RESULT($resmgr)
|
|
|
|
if test "$resmgr" = "yes"; then
|
|
|
|
AC_CHECK_LIB(resmgr, rsm_open_device,,
|
|
|
|
AC_ERROR([Cannot find libresmgr]))
|
|
|
|
AC_DEFINE(SUPPORT_RESMGR, "1", [Support resmgr with alsa-lib])
|
|
|
|
fi
|
|
|
|
|
2005-02-14 13:31:53 +00:00
|
|
|
dnl Check for aload* support...
|
|
|
|
AC_MSG_CHECKING(for aload* support)
|
|
|
|
AC_ARG_ENABLE(aload,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--disable-aload], [disable reading /dev/aload*]),
|
2005-02-14 13:31:53 +00:00
|
|
|
aload="$enableval", aload="yes")
|
|
|
|
AC_MSG_RESULT($aload)
|
|
|
|
if test "$aload" = "yes"; then
|
|
|
|
AC_DEFINE(SUPPORT_ALOAD, "1", [Support /dev/aload* access for auto-loading])
|
|
|
|
fi
|
|
|
|
|
2006-02-27 10:03:19 +00:00
|
|
|
dnl Check for non-standard /dev directory
|
|
|
|
AC_MSG_CHECKING([for ALSA device file directory])
|
|
|
|
AC_ARG_WITH(alsa-devdir,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--with-alsa-devdir=dir],
|
|
|
|
[directory with ALSA device files (default /dev/snd)]),
|
2006-02-27 10:03:19 +00:00
|
|
|
[alsa_dev_dir="$withval"],
|
|
|
|
[alsa_dev_dir="/dev/snd"])
|
|
|
|
dnl make sure it has a trailing slash
|
|
|
|
if echo "$alsa_dev_dir" | grep -v '/$' > /dev/null; then
|
|
|
|
alsa_dev_dir="$alsa_dev_dir/"
|
|
|
|
fi
|
|
|
|
AC_DEFINE_UNQUOTED(ALSA_DEVICE_DIRECTORY, "$alsa_dev_dir", [Directory with ALSA device files])
|
|
|
|
AC_MSG_RESULT([$alsa_dev_dir])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for aload* device file directory])
|
|
|
|
AC_ARG_WITH(aload-devdir,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--with-aload-devdir=dir],
|
|
|
|
[directory with aload* device files (default /dev)]),
|
2006-02-27 10:03:19 +00:00
|
|
|
[aload_dev_dir="$withval"],
|
|
|
|
[aload_dev_dir="/dev"])
|
|
|
|
if echo "$aload_dev_dir" | grep -v '/$' > /dev/null; then
|
|
|
|
aload_dev_dir="$aload_dev_dir/"
|
|
|
|
fi
|
|
|
|
AC_DEFINE_UNQUOTED(ALOAD_DEVICE_DIRECTORY, "$aload_dev_dir", [Directory with aload* device files])
|
|
|
|
AC_MSG_RESULT([$aload_dev_dir])
|
|
|
|
|
2005-11-30 11:38:24 +00:00
|
|
|
dnl Build conditions
|
|
|
|
AC_ARG_ENABLE(mixer,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--disable-mixer], [disable the mixer component]),
|
2005-11-30 11:38:24 +00:00
|
|
|
[build_mixer="$enableval"], [build_mixer="yes"])
|
|
|
|
AC_ARG_ENABLE(pcm,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--disable-pcm], [disable the PCM component]),
|
2005-11-30 11:38:24 +00:00
|
|
|
[build_pcm="$enableval"], [build_pcm="yes"])
|
|
|
|
AC_ARG_ENABLE(rawmidi,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--disable-rawmidi], [disable the raw MIDI component]),
|
2005-11-30 11:38:24 +00:00
|
|
|
[build_rawmidi="$enableval"], [build_rawmidi="yes"])
|
|
|
|
AC_ARG_ENABLE(hwdep,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--disable-hwdep], [disable the hwdep component]),
|
2005-11-30 11:38:24 +00:00
|
|
|
[build_hwdep="$enableval"], [build_hwdep="yes"])
|
|
|
|
AC_ARG_ENABLE(seq,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--disable-seq], [disable the sequencer component]),
|
2005-11-30 11:38:24 +00:00
|
|
|
[build_seq="$enableval"], [build_seq="yes"])
|
2010-09-07 15:35:14 +02:00
|
|
|
AC_ARG_ENABLE(ucm,
|
|
|
|
AS_HELP_STRING([--disable-ucm], [disable the use-case-manager component]),
|
|
|
|
[build_ucm="$enableval"], [build_ucm="yes"])
|
2015-07-29 17:45:23 +01:00
|
|
|
AC_ARG_ENABLE(topology,
|
|
|
|
AS_HELP_STRING([--disable-topology], [disable the DSP topology component]),
|
|
|
|
[build_topology="$enableval"], [build_topology="yes"])
|
2006-09-06 14:39:01 +02:00
|
|
|
AC_ARG_ENABLE(alisp,
|
2017-11-27 21:43:22 +01:00
|
|
|
AS_HELP_STRING([--enable-alisp], [enable the alisp component]),
|
|
|
|
[build_alisp="$enableval"], [build_alisp="no"])
|
2009-01-21 09:25:48 +01:00
|
|
|
test "$softfloat" = "yes" && build_alisp="no"
|
2007-10-30 12:31:55 +01:00
|
|
|
AC_ARG_ENABLE(old-symbols,
|
|
|
|
AS_HELP_STRING([--disable-old-symbols], [disable old obsoleted symbols]),
|
|
|
|
[keep_old_symbols="$enableval"], [keep_old_symbols="yes"])
|
2012-12-07 09:27:11 +01:00
|
|
|
AM_CONDITIONAL([KEEP_OLD_SYMBOLS], [test x$keep_old_symbols = xyes])
|
2007-10-30 12:31:55 +01:00
|
|
|
|
2017-11-27 21:38:18 +01:00
|
|
|
AC_ARG_ENABLE(mixer-modules,
|
|
|
|
AS_HELP_STRING([--enable-mixer-modules], [enable the additional mixer modules (experimental)]),
|
|
|
|
[build_mixer_modules="$enableval"], [build_mixer_modules="no"])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(mixer-pymods,
|
|
|
|
AS_HELP_STRING([--enable-mixer-pymods], [enable the mixer python modules (experimental)]),
|
|
|
|
[build_mixer_pymodules="$enableval"], [build_mixer_pymodules="no"])
|
|
|
|
|
2007-07-11 10:10:12 +02:00
|
|
|
AC_ARG_ENABLE(python,
|
|
|
|
AS_HELP_STRING([--disable-python], [disable the python components]),
|
|
|
|
[build_python="$enableval"], [build_python="yes"])
|
2018-03-27 14:50:36 +02:00
|
|
|
|
|
|
|
AC_ARG_ENABLE(python2,
|
|
|
|
AS_HELP_STRING([--enable-python2], [prefer python2]),
|
|
|
|
[build_python2="$enableval"], [build_python2="no"])
|
2007-07-11 10:10:12 +02:00
|
|
|
PYTHON_LIBS=""
|
2007-09-12 15:02:03 +02:00
|
|
|
PYTHON_INCLUDES=""
|
2017-11-27 21:38:18 +01:00
|
|
|
if test "$build_python" = "yes" -a "$build_mixer_pymodules" = "yes"; then
|
2018-03-27 14:50:36 +02:00
|
|
|
pythonlibs0=
|
|
|
|
pythoninc0=
|
|
|
|
if test "$build_python2" != "yes"; then
|
2020-03-04 11:27:12 +01:00
|
|
|
pythonlibs0=$(python3-config --libs --embed 2> /dev/null)
|
|
|
|
if test -z "$pythonlibs0"; then
|
|
|
|
pythonlibs0=$(python3-config --libs)
|
|
|
|
fi
|
2018-03-27 14:50:36 +02:00
|
|
|
pythoninc0=$(python3-config --includes)
|
|
|
|
fi
|
2017-11-27 21:38:18 +01:00
|
|
|
if test -z "$pythonlibs0"; then
|
|
|
|
pythonlibs0=$(python-config --libs)
|
|
|
|
pythoninc0=$(python-config --includes)
|
|
|
|
fi
|
2007-07-11 10:10:12 +02:00
|
|
|
AC_ARG_WITH(pythonlibs,
|
|
|
|
AS_HELP_STRING([--with-pythonlibs=ldflags],
|
|
|
|
[specify python libraries (-lpthread -lm -ldl -lpython2.4)]),
|
2017-11-27 21:38:18 +01:00
|
|
|
pythonlibs="$withval", pythonlibs=$pythonlibs0)
|
2007-08-31 15:22:26 +02:00
|
|
|
AC_ARG_WITH(pythonincludes,
|
2007-09-12 15:02:03 +02:00
|
|
|
AS_HELP_STRING([--with-pythonincludes=Cflags],
|
2007-08-31 15:22:26 +02:00
|
|
|
[specify python C header files (-I/usr/include/python)]),
|
2017-11-27 21:38:18 +01:00
|
|
|
pythonincludes="$withval", pythonincludes=$pythoninc0)
|
2007-08-31 16:41:19 +02:00
|
|
|
if test -z "$pythonlibs"; then
|
2007-07-11 10:10:12 +02:00
|
|
|
echo "Unable to determine python libraries! Probably python-config is not"
|
2007-08-31 15:22:26 +02:00
|
|
|
echo "available on this system. Please, use --with-pythonlibs and"
|
2007-09-12 15:02:03 +02:00
|
|
|
echo "--with-pythonincludes options. Python components are disabled in this build."
|
2007-08-22 11:41:58 +02:00
|
|
|
build_python="no"
|
|
|
|
else
|
|
|
|
PYTHON_LIBS="$pythonlibs"
|
2007-09-12 15:02:03 +02:00
|
|
|
PYTHON_INCLUDES="$pythonincludes"
|
2007-07-11 10:10:12 +02:00
|
|
|
fi
|
|
|
|
fi
|
2017-11-27 21:38:18 +01:00
|
|
|
if test "$build_python" != "yes"; then
|
|
|
|
build_mixer_pymodules=
|
|
|
|
fi
|
2007-07-11 10:10:12 +02:00
|
|
|
AC_SUBST(PYTHON_LIBS)
|
2007-09-12 15:02:03 +02:00
|
|
|
AC_SUBST(PYTHON_INCLUDES)
|
2005-11-30 11:38:24 +00:00
|
|
|
|
2012-12-07 09:27:11 +01:00
|
|
|
AM_CONDITIONAL([BUILD_MIXER], [test x$build_mixer = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM], [test x$build_pcm = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_RAWMIDI], [test x$build_rawmidi = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_HWDEP], [test x$build_hwdep = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_SEQ], [test x$build_seq = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_UCM], [test x$build_ucm = xyes])
|
2015-07-29 17:45:23 +01:00
|
|
|
AM_CONDITIONAL([BUILD_TOPOLOGY], [test x$build_topology = xyes])
|
2012-12-07 09:27:11 +01:00
|
|
|
AM_CONDITIONAL([BUILD_ALISP], [test x$build_alisp = xyes])
|
2017-11-27 21:38:18 +01:00
|
|
|
AM_CONDITIONAL([BUILD_MIXER_MODULES], [test x$build_mixer_modules = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_MIXER_PYMODULES], [test x$build_mixer_pymodules = xyes])
|
2005-11-30 11:38:24 +00:00
|
|
|
|
|
|
|
if test "$build_mixer" = "yes"; then
|
|
|
|
AC_DEFINE([BUILD_MIXER], "1", [Build mixer component])
|
|
|
|
fi
|
|
|
|
if test "$build_pcm" = "yes"; then
|
|
|
|
AC_DEFINE([BUILD_PCM], "1", [Build PCM component])
|
|
|
|
fi
|
|
|
|
if test "$build_rawmidi" = "yes"; then
|
|
|
|
AC_DEFINE([BUILD_RAWMIDI], "1", [Build raw MIDI component])
|
|
|
|
fi
|
2007-07-03 20:22:21 +02:00
|
|
|
if test "$build_hwdep" = "yes"; then
|
|
|
|
AC_DEFINE([BUILD_HWDEP], "1", [Build hwdep component])
|
|
|
|
fi
|
2005-11-30 11:38:24 +00:00
|
|
|
if test "$build_seq" = "yes"; then
|
|
|
|
AC_DEFINE([BUILD_SEQ], "1", [Build sequencer component])
|
|
|
|
fi
|
2011-01-27 14:40:31 +01:00
|
|
|
if test "$build_ucm" = "yes"; then
|
|
|
|
AC_DEFINE([BUILD_UCM], "1", [Build UCM component])
|
|
|
|
fi
|
2015-07-29 17:45:23 +01:00
|
|
|
if test "$build_topology" = "yes"; then
|
|
|
|
AC_DEFINE([BUILD_TOPOLOGY], "1", [Build DSP Topology component])
|
|
|
|
fi
|
2005-11-30 11:38:24 +00:00
|
|
|
|
|
|
|
dnl PCM Plugins
|
|
|
|
|
|
|
|
if test "$build_pcm" = "yes"; then
|
|
|
|
AC_ARG_WITH(pcm-plugins,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--with-pcm-plugins=<list>],
|
|
|
|
[build PCM plugins (default = all)]),
|
2005-11-30 11:38:24 +00:00
|
|
|
[pcm_plugins="$withval"], [pcm_plugins="all"])
|
|
|
|
else
|
|
|
|
pcm_plugins=""
|
|
|
|
fi
|
|
|
|
|
alsa-lib: heavy pcm atomics cleanup
The following patch comes from the realization that at least ARM code
for atomics is quite broken and nobody has cared for a decade.
A quick dive shows that only snd_atomic_{read,write}_{begin,end}
appear to be used widely. These are implemented using wmb/rmb.
Only other use of atomic functions is in pcm_meter.c.
The #SND_PCM_TYPE_METER plugin type appears rarely, if ever, used.
I presume these days anyone who wants a meter/scope will do in pulseaudio
layer instead of alsa.
It would seem better fit to have pcm_meter in alsa-plugins instead
of alsa-lib, but I guess that would be an ABI break...
So instead, I'm proposing here
1. Removal of all hand-crafted atomics from iatomic.h apart from barriers,
which are used in snd_atomic_{read,write}_{begin,end}.
2. Using __sync_synchronize as the default fallback for barriers. This
has been available since gcc 4.1, so it shouldn't be a problem.
3. Defining the few atomics used by pcm_meter.c withing pcm_meter.c
itself, using gcc atomic builtins[1].
4. Since gcc atomic builtins are available only since gcc 4.7, add a check for
that in gcc configure.in, and don't build pcm meter plugin if using
older gcc.
The last point has the impact, that if there actually is someone who 1)
uses the meter plugin 2) wants to upgrade to 2014 alsa-lib 3) but
does not want to use a 2012+ gcc - that someone will be inconvenienced.
Finally remove the unneeded configure check for cpu type. We can
trust the gcc to set right flags for us.
[1] http://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-07 15:38:58 +02:00
|
|
|
dnl check atomics for pcm_meter
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether GCC supports builtin atomic intrinsics])
|
|
|
|
if test -z "$gcc_have_atomics"; then
|
|
|
|
gcc_have_atomics=no
|
|
|
|
AC_TRY_LINK([],
|
|
|
|
[int i;
|
|
|
|
__atomic_load_n(&i, __ATOMIC_SEQ_CST);
|
|
|
|
__atomic_add_fetch(&i, 0, __ATOMIC_SEQ_CST);
|
|
|
|
],
|
|
|
|
[gcc_have_atomics=yes],
|
|
|
|
[gcc_have_atomics=no])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT($gcc_have_atomics)
|
|
|
|
|
2020-05-06 19:19:22 +02:00
|
|
|
dnl check mmx register for pcm_dmix_i386
|
|
|
|
|
|
|
|
AC_TRY_LINK([],
|
|
|
|
[__asm__ volatile ("" : : : "mm0");],
|
|
|
|
[AC_DEFINE([HAVE_MMX], "1", [MMX technology is enabled])],
|
|
|
|
[])
|
|
|
|
|
2007-07-11 17:44:09 +02:00
|
|
|
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"
|
2005-11-30 11:38:24 +00:00
|
|
|
|
|
|
|
build_pcm_plugin="no"
|
|
|
|
for t in $PCM_PLUGIN_LIST; do
|
|
|
|
eval build_pcm_$t="no"
|
|
|
|
done
|
|
|
|
|
|
|
|
pcm_plugins=`echo $pcm_plugins | sed 's/,/ /g'`
|
|
|
|
for p in $pcm_plugins; do
|
|
|
|
for t in $PCM_PLUGIN_LIST; do
|
|
|
|
if test "$p" = "$t" -o "$p" = "all"; then
|
|
|
|
eval build_pcm_$t="yes"
|
|
|
|
build_pcm_plugin="yes"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
dnl special dependencies
|
|
|
|
if test "$build_pcm_plug" = "yes"; then
|
|
|
|
build_pcm_linear="yes"
|
|
|
|
build_pcm_copy="yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$build_pcm_ioplug" = "yes"; then
|
|
|
|
build_pcm_extplug="yes"
|
|
|
|
fi
|
|
|
|
|
2007-03-22 00:48:18 +01:00
|
|
|
if test "$HAVE_LIBDL" != "yes"; then
|
|
|
|
build_pcm_meter="no"
|
|
|
|
build_pcm_ladspa="no"
|
|
|
|
build_pcm_pcm_ioplug="no"
|
|
|
|
build_pcm_pcm_extplug="no"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$HAVE_LIBPTHREAD" != "yes"; then
|
|
|
|
build_pcm_share="no"
|
|
|
|
fi
|
|
|
|
|
2007-06-28 13:26:25 +02:00
|
|
|
if test "$softfloat" = "yes"; then
|
2007-03-22 00:48:18 +01:00
|
|
|
build_pcm_lfloat="no"
|
2009-01-21 09:25:48 +01:00
|
|
|
build_pcm_ladspa="no"
|
2007-03-22 00:48:18 +01:00
|
|
|
fi
|
|
|
|
|
alsa-lib: heavy pcm atomics cleanup
The following patch comes from the realization that at least ARM code
for atomics is quite broken and nobody has cared for a decade.
A quick dive shows that only snd_atomic_{read,write}_{begin,end}
appear to be used widely. These are implemented using wmb/rmb.
Only other use of atomic functions is in pcm_meter.c.
The #SND_PCM_TYPE_METER plugin type appears rarely, if ever, used.
I presume these days anyone who wants a meter/scope will do in pulseaudio
layer instead of alsa.
It would seem better fit to have pcm_meter in alsa-plugins instead
of alsa-lib, but I guess that would be an ABI break...
So instead, I'm proposing here
1. Removal of all hand-crafted atomics from iatomic.h apart from barriers,
which are used in snd_atomic_{read,write}_{begin,end}.
2. Using __sync_synchronize as the default fallback for barriers. This
has been available since gcc 4.1, so it shouldn't be a problem.
3. Defining the few atomics used by pcm_meter.c withing pcm_meter.c
itself, using gcc atomic builtins[1].
4. Since gcc atomic builtins are available only since gcc 4.7, add a check for
that in gcc configure.in, and don't build pcm meter plugin if using
older gcc.
The last point has the impact, that if there actually is someone who 1)
uses the meter plugin 2) wants to upgrade to 2014 alsa-lib 3) but
does not want to use a 2012+ gcc - that someone will be inconvenienced.
Finally remove the unneeded configure check for cpu type. We can
trust the gcc to set right flags for us.
[1] http://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-07 15:38:58 +02:00
|
|
|
if test "$gcc_have_atomics" != "yes"; then
|
|
|
|
build_pcm_meter="no"
|
|
|
|
fi
|
|
|
|
|
2015-10-27 17:28:04 -04:00
|
|
|
if test "$ac_cv_header_sys_shm_h" != "yes"; then
|
|
|
|
build_pcm_dmix="no"
|
|
|
|
build_pcm_dshare="no"
|
|
|
|
build_pcm_dsnoop="no"
|
|
|
|
build_pcm_shm="no"
|
|
|
|
fi
|
|
|
|
|
2012-12-07 09:27:11 +01:00
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN], [test x$build_pcm_plugin = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_COPY], [test x$build_pcm_copy = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_LINEAR], [test x$build_pcm_linear = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_ROUTE], [test x$build_pcm_route = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_MULAW], [test x$build_pcm_mulaw = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_ALAW], [test x$build_pcm_alaw = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_ADPCM], [test x$build_pcm_adpcm = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_RATE], [test x$build_pcm_rate = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_PLUG], [test x$build_pcm_plug = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_MULTI], [test x$build_pcm_multi = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_SHM], [test x$build_pcm_shm = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_FILE], [test x$build_pcm_file = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_NULL], [test x$build_pcm_null = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_EMPTY], [test x$build_pcm_empty = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_SHARE], [test x$build_pcm_share = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_METER], [test x$build_pcm_meter = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_HOOKS], [test x$build_pcm_hooks = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_LFLOAT], [test x$build_pcm_lfloat = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_LADSPA], [test x$build_pcm_ladspa = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_DMIX], [test x$build_pcm_dmix = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_DSHARE], [test x$build_pcm_dshare = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_DSNOOP], [test x$build_pcm_dsnoop = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_ASYM], [test x$build_pcm_asym = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_IEC958], [test x$build_pcm_iec958 = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_SOFTVOL], [test x$build_pcm_softvol = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_EXTPLUG], [test x$build_pcm_extplug = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_IOPLUG], [test x$build_pcm_ioplug = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_PCM_PLUGIN_MMAP_EMUL], [test x$build_pcm_mmap_emul = xyes])
|
2005-11-30 11:38:24 +00:00
|
|
|
|
|
|
|
dnl Defines for plug plugin
|
|
|
|
if test "$build_pcm_rate" = "yes"; then
|
|
|
|
AC_DEFINE([BUILD_PCM_PLUGIN_RATE], "1", [Build PCM rate plugin])
|
|
|
|
fi
|
|
|
|
if test "$build_pcm_route" = "yes"; then
|
|
|
|
AC_DEFINE([BUILD_PCM_PLUGIN_ROUTE], "1", [Build PCM route plugin])
|
|
|
|
fi
|
|
|
|
if test "$build_pcm_lfloat" = "yes"; then
|
|
|
|
AC_DEFINE([BUILD_PCM_PLUGIN_LFLOAT], "1", [Build PCM lfloat plugin])
|
|
|
|
fi
|
|
|
|
if test "$build_pcm_adpcm" = "yes"; then
|
|
|
|
AC_DEFINE([BUILD_PCM_PLUGIN_ADPCM], "1", [Build PCM adpcm plugin])
|
|
|
|
fi
|
|
|
|
if test "$build_pcm_mulaw" = "yes"; then
|
|
|
|
AC_DEFINE([BUILD_PCM_PLUGIN_MULAW], "1", [Build PCM mulaw plugin])
|
|
|
|
fi
|
|
|
|
if test "$build_pcm_alaw" = "yes"; then
|
|
|
|
AC_DEFINE([BUILD_PCM_PLUGIN_ALAW], "1", [Build PCM alaw plugin])
|
|
|
|
fi
|
2008-06-06 17:10:41 +02:00
|
|
|
if test "$build_pcm_mmap_emul" = "yes"; then
|
|
|
|
AC_DEFINE([BUILD_PCM_PLUGIN_MMAP_EMUL], "1", [Build PCM mmap-emul plugin])
|
|
|
|
fi
|
2005-11-30 11:38:24 +00:00
|
|
|
|
2020-06-19 18:57:05 +02:00
|
|
|
if test "$build_pcm_dmix" = "yes"; then
|
|
|
|
AC_MSG_CHECKING(for default lockless dmix)
|
|
|
|
AC_ARG_ENABLE(lockless-dmix,
|
|
|
|
AS_HELP_STRING([--enable-lockless-dmix],
|
|
|
|
[use lockless dmix as default on x86]),
|
|
|
|
lockless_dmix="$enableval", lockless_dmix="no")
|
|
|
|
if test "$lockless_dmix" = "yes"; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE([LOCKLESS_DMIX_DEFAULT], "1", [Lockless dmix as default])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
fi
|
2005-11-30 11:38:24 +00:00
|
|
|
|
|
|
|
dnl Create PCM plugin symbol list for static library
|
2006-10-04 17:30:26 +02:00
|
|
|
rm -f "$srcdir"/src/pcm/pcm_symbols_list.c
|
2007-03-16 15:22:27 +01:00
|
|
|
touch "$srcdir"/src/pcm/pcm_symbols_list.c
|
2005-11-30 11:38:24 +00:00
|
|
|
for t in $PCM_PLUGIN_LIST; do
|
|
|
|
if eval test \$build_pcm_$t = yes; then
|
2006-10-04 17:30:26 +02:00
|
|
|
echo \&_snd_module_pcm_$t, >> "$srcdir"/src/pcm/pcm_symbols_list.c
|
2005-11-30 11:38:24 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2007-03-28 13:48:04 +02:00
|
|
|
dnl Control Plugins
|
|
|
|
|
|
|
|
AC_ARG_WITH(ctl-plugins,
|
2007-03-28 14:03:10 +02:00
|
|
|
AS_HELP_STRING([--with-ctl-plugins=<list>],
|
|
|
|
[build control plugins (default = all)]),
|
2007-03-28 13:48:04 +02:00
|
|
|
[ctl_plugins="$withval"], [ctl_plugins="all"])
|
|
|
|
|
2021-03-29 12:36:21 +02:00
|
|
|
CTL_PLUGIN_LIST="remap shm ext"
|
2007-03-28 13:48:04 +02:00
|
|
|
|
|
|
|
build_ctl_plugin="no"
|
|
|
|
for t in $CTL_PLUGIN_LIST; do
|
|
|
|
eval build_ctl_$t="no"
|
|
|
|
done
|
|
|
|
|
|
|
|
ctl_plugins=`echo $ctl_plugins | sed 's/,/ /g'`
|
|
|
|
for p in $ctl_plugins; do
|
|
|
|
for t in $CTL_PLUGIN_LIST; do
|
|
|
|
if test "$p" = "$t" -o "$p" = "all"; then
|
|
|
|
eval build_ctl_$t="yes"
|
|
|
|
build_ctl_plugin="yes"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
2015-10-27 17:28:04 -04:00
|
|
|
if test "$ac_cv_header_sys_shm_h" != "yes"; then
|
|
|
|
build_ctl_shm="no"
|
|
|
|
fi
|
|
|
|
|
2012-12-07 09:27:11 +01:00
|
|
|
AM_CONDITIONAL([BUILD_CTL_PLUGIN], [test x$build_ctl_plugin = xyes])
|
2021-03-29 12:36:21 +02:00
|
|
|
AM_CONDITIONAL([BUILD_CTL_PLUGIN_REMAP], [test x$build_ctl_remap = xyes])
|
2012-12-07 09:27:11 +01:00
|
|
|
AM_CONDITIONAL([BUILD_CTL_PLUGIN_SHM], [test x$build_ctl_shm = xyes])
|
|
|
|
AM_CONDITIONAL([BUILD_CTL_PLUGIN_EXT], [test x$build_ctl_ext = xyes])
|
2007-03-28 13:48:04 +02:00
|
|
|
|
|
|
|
dnl Create ctl plugin symbol list for static library
|
|
|
|
rm -f "$srcdir"/src/control/ctl_symbols_list.c
|
|
|
|
touch "$srcdir"/src/control/ctl_symbols_list.c
|
|
|
|
for t in $CTL_PLUGIN_LIST; do
|
|
|
|
if eval test \$build_ctl_$t = yes; then
|
|
|
|
echo \&_snd_module_control_$t, >> "$srcdir"/src/control/ctl_symbols_list.c
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2013-05-24 17:21:15 +02:00
|
|
|
dnl Max number of cards
|
|
|
|
AC_MSG_CHECKING(for max number of cards)
|
|
|
|
AC_ARG_WITH(max-cards,
|
|
|
|
AS_HELP_STRING([--with-max-cards], [Specify the max number of cards (default = 32)]),
|
|
|
|
[ max_cards="$withval" ], [ max_cards="32" ])
|
|
|
|
AC_MSG_RESULT([$max_cards])
|
|
|
|
|
|
|
|
if test "$max_cards" -lt 1; then
|
|
|
|
AC_ERROR([Invalid max cards $max_cards])
|
|
|
|
elif test "$max_cards" -gt 256; then
|
|
|
|
AC_ERROR([Invalid max cards $max_cards])
|
|
|
|
fi
|
|
|
|
AC_DEFINE_UNQUOTED(SND_MAX_CARDS, $max_cards, [Max number of cards])
|
|
|
|
|
pcm: Add thread-safety to PCM API
Traditionally, many of ALSA library functions are supposed to be
thread-unsafe, and applications are required to take care of thread
safety by themselves. However, people never be careful enough, and
almost all applications fail in this regard.
This patch is an attempt to harden the thread safety in exported PCM
functions in a simplistic way: just wrap some of exported functions
with the pthread mutex of each PCM object. Not all API functions are
wrapped by the mutex since it doesn't make sense. Instead, the
patchset covers only the functions that may be likely called
concurrently. The supposedly thread-safe API functions are marked in
the document.
For achieving the feature, two new fields are added snd_pcm_t when the
option is enabled: thread_safe and lock. The former indicates that
the plugin is thread-safe that doesn't need this workaround and the
latter is the pthread mutex. Currently only hw plugin have
thread_safe=1. So, the most of real-time sensitive apps won't be
influenced by this patchset.
Although the patch covers most of PCM ops, a few snd_pcm_fast_ops are
left without the extra mutex locking: namely, the ones that may have
blocking behavior, i.e. resume, drain, readi, writei, readn and
writen. These are supposed to handle own locking in the callbacks.
Also, if anyone wants to disable this new thread-safe API feature, it
can be still turned off via --disable-thread-safety configure option.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-06-30 15:32:40 +02:00
|
|
|
dnl Check for thread-safe API functions
|
|
|
|
if test "$HAVE_LIBPTHREAD" = "yes"; then
|
|
|
|
AC_MSG_CHECKING(for thread-safe API functions)
|
|
|
|
AC_ARG_ENABLE(thread-safety,
|
|
|
|
AS_HELP_STRING([--disable-thread-safety],
|
|
|
|
[disable thread-safe API functions]),
|
|
|
|
threadsafe="$enableval", threadsafe="yes")
|
|
|
|
if test "$threadsafe" = "yes"; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE([THREAD_SAFE_API], "1", [Disable thread-safe API functions])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2003-07-14 10:16:38 +00:00
|
|
|
dnl Make a symlink for inclusion of alsa/xxx.h
|
2006-10-04 17:30:26 +02:00
|
|
|
if test ! -L "$srcdir"/include/alsa ; then
|
2003-07-14 10:16:38 +00:00
|
|
|
echo "Making a symlink include/alsa"
|
2006-10-04 17:30:26 +02:00
|
|
|
rm -f "$srcdir"/include/alsa
|
|
|
|
ln -sf . "$srcdir"/include/alsa
|
2003-07-14 10:16:38 +00:00
|
|
|
fi
|
|
|
|
|
2008-02-25 14:56:51 +01:00
|
|
|
AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
|
2019-12-20 15:46:48 +01:00
|
|
|
include/Makefile include/sound/Makefile include/sound/uapi/Makefile \
|
|
|
|
src/Versions src/Makefile \
|
2005-08-22 12:07:55 +00:00
|
|
|
src/control/Makefile src/mixer/Makefile \
|
2005-06-01 12:31:52 +00:00
|
|
|
src/pcm/Makefile src/pcm/scopes/Makefile \
|
2000-09-26 09:46:05 +00:00
|
|
|
src/rawmidi/Makefile src/timer/Makefile \
|
2010-09-07 15:35:14 +02:00
|
|
|
src/hwdep/Makefile src/seq/Makefile src/ucm/Makefile \
|
2015-07-29 17:45:23 +01:00
|
|
|
src/alisp/Makefile src/topology/Makefile \
|
2018-04-10 08:57:07 +02:00
|
|
|
src/conf/Makefile \
|
2003-09-09 19:24:35 +00:00
|
|
|
src/conf/cards/Makefile \
|
2021-04-23 12:28:33 +02:00
|
|
|
src/conf/ctl/Makefile \
|
2003-09-09 19:24:35 +00:00
|
|
|
src/conf/pcm/Makefile \
|
2019-11-12 19:30:36 +01:00
|
|
|
modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \
|
2009-07-06 12:00:04 +02:00
|
|
|
alsalisp/Makefile aserver/Makefile \
|
|
|
|
test/Makefile test/lsb/Makefile \
|
2019-11-12 19:30:36 +01:00
|
|
|
utils/Makefile utils/alsa-lib.spec utils/alsa.pc utils/alsa-topology.pc)
|
2007-07-10 15:58:41 +02:00
|
|
|
|
|
|
|
dnl Create asoundlib.h dynamically according to configure options
|
|
|
|
echo "Creating asoundlib.h..."
|
|
|
|
cp "$srcdir"/include/asoundlib-head.h include/asoundlib.h
|
2022-07-12 20:37:44 +09:00
|
|
|
if test "$ac_cv_header_sys_endian_h" != "yes"; then
|
2014-02-23 11:12:48 +00:00
|
|
|
test "$ac_cv_header_endian_h" = "yes" && echo "#include <endian.h>" >> include/asoundlib.h
|
2022-07-12 20:37:44 +09:00
|
|
|
else
|
2014-02-23 11:12:48 +00:00
|
|
|
cat >> include/asoundlib.h <<EOF
|
|
|
|
#include <sys/endian.h>
|
|
|
|
#ifndef __BYTE_ORDER
|
|
|
|
#define __BYTE_ORDER BYTE_ORDER
|
|
|
|
#endif
|
|
|
|
#ifndef __LITTLE_ENDIAN
|
|
|
|
#define __LITTLE_ENDIAN LITTLE_ENDIAN
|
|
|
|
#endif
|
|
|
|
#ifndef __BIG_ENDIAN
|
|
|
|
#define __BIG_ENDIAN BIG_ENDIAN
|
|
|
|
#endif
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
cat >> include/asoundlib.h <<EOF
|
|
|
|
|
|
|
|
#ifndef __GNUC__
|
|
|
|
#define __inline__ inline
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <alsa/asoundef.h>
|
|
|
|
#include <alsa/version.h>
|
|
|
|
#include <alsa/global.h>
|
|
|
|
#include <alsa/input.h>
|
|
|
|
#include <alsa/output.h>
|
|
|
|
#include <alsa/error.h>
|
|
|
|
#include <alsa/conf.h>
|
|
|
|
EOF
|
2007-07-10 15:58:41 +02:00
|
|
|
test "$build_pcm" = "yes" && echo "#include <alsa/pcm.h>" >> include/asoundlib.h
|
|
|
|
test "$build_rawmidi" = "yes" && echo "#include <alsa/rawmidi.h>" >> include/asoundlib.h
|
2022-11-29 16:02:25 +01:00
|
|
|
test "$build_rawmidi" = "yes" && echo "#include <alsa/ump.h>" >> include/asoundlib.h
|
2007-07-10 15:58:41 +02:00
|
|
|
test "$build_pcm" = "yes" && echo "#include <alsa/timer.h>" >> include/asoundlib.h
|
|
|
|
test "$build_hwdep" = "yes" && echo "#include <alsa/hwdep.h>" >> include/asoundlib.h
|
|
|
|
echo "#include <alsa/control.h>" >> include/asoundlib.h
|
|
|
|
test "$build_mixer" = "yes" && echo "#include <alsa/mixer.h>" >> include/asoundlib.h
|
|
|
|
test "$build_seq" = "yes" && echo "#include <alsa/seq_event.h>" >> include/asoundlib.h
|
|
|
|
test "$build_seq" = "yes" && echo "#include <alsa/seq.h>" >> include/asoundlib.h
|
|
|
|
test "$build_seq" = "yes" && echo "#include <alsa/seqmid.h>" >> include/asoundlib.h
|
|
|
|
test "$build_seq" = "yes" && echo "#include <alsa/seq_midi_event.h>" >> include/asoundlib.h
|
|
|
|
cat "$srcdir"/include/asoundlib-tail.h >> include/asoundlib.h
|