OSDN Git Service

pcm: remove extra NULL checks in snd_pcm_dsnoop_open()
[android-x86/external-alsa-lib.git] / configure.ac
index 1bf75e6..60271b8 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.59)
-AC_INIT(alsa-lib, 1.1.1)
+AC_INIT(alsa-lib, 1.2.5)
 
 AC_CONFIG_SRCDIR([src/control/control.c])
 AC_CONFIG_MACRO_DIR([m4])
@@ -266,6 +266,15 @@ else
   AC_MSG_RESULT(no)
 fi
 
+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
+
 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))
@@ -294,8 +303,25 @@ fi
 
 AC_SUBST(ALSA_DEPLIBS)
 
+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
+
 dnl Check for headers
-AC_CHECK_HEADERS([wordexp.h endian.h sys/endian.h sys/shm.h])
+AC_CHECK_HEADERS([endian.h sys/endian.h sys/shm.h])
 
 dnl Check for resmgr support...
 AC_MSG_CHECKING(for resmgr support)
@@ -368,28 +394,53 @@ AC_ARG_ENABLE(topology,
   AS_HELP_STRING([--disable-topology], [disable the DSP topology component]),
   [build_topology="$enableval"], [build_topology="yes"])
 AC_ARG_ENABLE(alisp,
-  AS_HELP_STRING([--disable-alisp], [disable the alisp component]),
-  [build_alisp="$enableval"], [build_alisp="yes"])
+  AS_HELP_STRING([--enable-alisp], [enable the alisp component]),
+  [build_alisp="$enableval"], [build_alisp="no"])
 test "$softfloat" = "yes" && build_alisp="no"
 AC_ARG_ENABLE(old-symbols,
   AS_HELP_STRING([--disable-old-symbols], [disable old obsoleted symbols]),
   [keep_old_symbols="$enableval"], [keep_old_symbols="yes"])
 AM_CONDITIONAL([KEEP_OLD_SYMBOLS], [test x$keep_old_symbols = xyes])
 
+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"])
+
 AC_ARG_ENABLE(python,
   AS_HELP_STRING([--disable-python], [disable the python components]),
   [build_python="$enableval"], [build_python="yes"])
+
+AC_ARG_ENABLE(python2,
+  AS_HELP_STRING([--enable-python2], [prefer python2]),
+  [build_python2="$enableval"], [build_python2="no"])
 PYTHON_LIBS=""
 PYTHON_INCLUDES=""
-if test "$build_python" = "yes"; then
+if test "$build_python" = "yes" -a "$build_mixer_pymodules" = "yes"; then
+  pythonlibs0=
+  pythoninc0=
+  if test "$build_python2" != "yes"; then
+    pythonlibs0=$(python3-config --libs --embed 2> /dev/null)
+    if test -z "$pythonlibs0"; then
+      pythonlibs0=$(python3-config --libs)
+    fi
+    pythoninc0=$(python3-config --includes)
+  fi
+  if test -z "$pythonlibs0"; then
+    pythonlibs0=$(python-config --libs)
+    pythoninc0=$(python-config --includes)
+  fi
   AC_ARG_WITH(pythonlibs,
     AS_HELP_STRING([--with-pythonlibs=ldflags],
       [specify python libraries (-lpthread -lm -ldl -lpython2.4)]),
-    pythonlibs="$withval", pythonlibs=`python-config --libs`)
+    pythonlibs="$withval", pythonlibs=$pythonlibs0)
   AC_ARG_WITH(pythonincludes,
     AS_HELP_STRING([--with-pythonincludes=Cflags],
       [specify python C header files (-I/usr/include/python)]),
-    pythonincludes="$withval", pythonincludes=`python-config --includes`)
+    pythonincludes="$withval", pythonincludes=$pythoninc0)
   if test -z "$pythonlibs"; then
     echo "Unable to determine python libraries! Probably python-config is not"
     echo "available on this system. Please, use --with-pythonlibs and"
@@ -400,6 +451,9 @@ if test "$build_python" = "yes"; then
     PYTHON_INCLUDES="$pythonincludes"
   fi
 fi
+if test "$build_python" != "yes"; then
+  build_mixer_pymodules=
+fi
 AC_SUBST(PYTHON_LIBS)
 AC_SUBST(PYTHON_INCLUDES)
 
@@ -411,7 +465,8 @@ AM_CONDITIONAL([BUILD_SEQ], [test x$build_seq = xyes])
 AM_CONDITIONAL([BUILD_UCM], [test x$build_ucm = xyes])
 AM_CONDITIONAL([BUILD_TOPOLOGY], [test x$build_topology = xyes])
 AM_CONDITIONAL([BUILD_ALISP], [test x$build_alisp = xyes])
-AM_CONDITIONAL([BUILD_PYTHON], [test x$build_python = xyes])
+AM_CONDITIONAL([BUILD_MIXER_MODULES], [test x$build_mixer_modules = xyes])
+AM_CONDITIONAL([BUILD_MIXER_PYMODULES], [test x$build_mixer_pymodules = xyes])
 
 if test "$build_mixer" = "yes"; then
   AC_DEFINE([BUILD_MIXER], "1", [Build mixer component])
@@ -461,6 +516,13 @@ if test -z "$gcc_have_atomics"; then
 fi
 AC_MSG_RESULT($gcc_have_atomics)
 
+dnl check mmx register for pcm_dmix_i386
+
+AC_TRY_LINK([],
+    [__asm__ volatile ("" : : : "mm0");],
+    [AC_DEFINE([HAVE_MMX], "1", [MMX technology is enabled])],
+    [])
+
 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"
 
 build_pcm_plugin="no"
@@ -567,6 +629,19 @@ if test "$build_pcm_mmap_emul" = "yes"; then
   AC_DEFINE([BUILD_PCM_PLUGIN_MMAP_EMUL], "1", [Build PCM mmap-emul plugin])
 fi
 
+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
 
 dnl Create PCM plugin symbol list for static library
 rm -f "$srcdir"/src/pcm/pcm_symbols_list.c
@@ -584,7 +659,7 @@ AC_ARG_WITH(ctl-plugins,
     [build control plugins (default = all)]),
   [ctl_plugins="$withval"], [ctl_plugins="all"])
 
-CTL_PLUGIN_LIST="shm ext"
+CTL_PLUGIN_LIST="remap shm ext"
 
 build_ctl_plugin="no"
 for t in $CTL_PLUGIN_LIST; do
@@ -606,6 +681,7 @@ if test "$ac_cv_header_sys_shm_h" != "yes"; then
 fi
 
 AM_CONDITIONAL([BUILD_CTL_PLUGIN], [test x$build_ctl_plugin = xyes])
+AM_CONDITIONAL([BUILD_CTL_PLUGIN_REMAP], [test x$build_ctl_remap = xyes])
 AM_CONDITIONAL([BUILD_CTL_PLUGIN_SHM], [test x$build_ctl_shm = xyes])
 AM_CONDITIONAL([BUILD_CTL_PLUGIN_EXT], [test x$build_ctl_ext = xyes])
 
@@ -632,6 +708,21 @@ elif test "$max_cards" -gt 256; then
 fi
 AC_DEFINE_UNQUOTED(SND_MAX_CARDS, $max_cards, [Max number of cards])
 
+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
+
 dnl Make a symlink for inclusion of alsa/xxx.h
 if test ! -L "$srcdir"/include/alsa ; then
   echo "Making a symlink include/alsa"
@@ -640,31 +731,21 @@ if test ! -L "$srcdir"/include/alsa ; then
 fi
 
 AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
-         include/Makefile include/sound/Makefile src/Versions src/Makefile \
+         include/Makefile include/sound/Makefile include/sound/uapi/Makefile \
+         src/Versions src/Makefile \
           src/control/Makefile src/mixer/Makefile \
          src/pcm/Makefile src/pcm/scopes/Makefile \
          src/rawmidi/Makefile src/timer/Makefile \
           src/hwdep/Makefile src/seq/Makefile src/ucm/Makefile \
           src/alisp/Makefile src/topology/Makefile \
-         src/conf/Makefile src/conf/alsa.conf.d/Makefile \
+         src/conf/Makefile \
          src/conf/cards/Makefile \
+         src/conf/ctl/Makefile \
          src/conf/pcm/Makefile \
-         src/conf/ucm/Makefile \
-         src/conf/ucm/DAISY-I2S/Makefile \
-         src/conf/ucm/PandaBoard/Makefile \
-         src/conf/ucm/PandaBoardES/Makefile \
-         src/conf/ucm/SDP4430/Makefile \
-         src/conf/ucm/tegraalc5632/Makefile \
-         src/conf/ucm/PAZ00/Makefile \
-         src/conf/ucm/GoogleNyan/Makefile \
-         src/conf/ucm/broadwell-rt286/Makefile \
-         src/conf/topology/Makefile \
-         src/conf/topology/broadwell/Makefile \
          modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \
-         src/conf/topology/sklrt286/Makefile \
          alsalisp/Makefile aserver/Makefile \
          test/Makefile test/lsb/Makefile \
-         utils/Makefile utils/alsa-lib.spec utils/alsa.pc)
+         utils/Makefile utils/alsa-lib.spec utils/alsa.pc utils/alsa-topology.pc)
 
 dnl Create asoundlib.h dynamically according to configure options
 echo "Creating asoundlib.h..."
@@ -709,4 +790,3 @@ 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
-