third_party_alsa-lib/acinclude.m4
Jaroslav Kysela b9343e0834 - unified snd_pcm_hw_params_* functions
- added backward compatibility for older non-compatible functions
- added --with-compat-rc3 to configure script to build library
  backwards compatible with 0.9.0rc3
- added symbol versioning like libc.so.6
  - ALSA_0.9      - alsa base
  - ALSA_0.9.0rc4 - first set of new functions (snd_pcm_hw_params_*)
2002-09-17 12:33:05 +00:00

50 lines
1.7 KiB
Plaintext

dnl Check for ALSA driver package.
AC_DEFUN(ALSA_CHECK_DRIVER, [
AC_MSG_CHECKING(for alsa-driver package)
AC_TRY_COMPILE([
#include <sound/asound.h>
],[
void main(void)
{
#if !defined(SNDRV_PROTOCOL_VERSION) || !defined(SNDRV_PROTOCOL_INCOMPATIBLE)
#error not found
#else
#if !defined(SNDRV_PCM_IOCTL_REWIND)
#error wrong version
#endif
exit(0);
#endif
}
],
AC_MSG_RESULT(present),
[AC_MSG_RESULT(not found or wrong version);
AC_MSG_ERROR([Install alsa-driver v0.9.0 package first...])]
)
])
AC_DEFUN(SAVE_LIBRARY_VERSION, [
AC_MSG_CHECKING(for library version)
SND_LIB_VERSION=$VERSION
echo $VERSION > $srcdir/version
AC_DEFINE_UNQUOTED(VERSION, "$SND_LIB_VERSION")
AC_SUBST(SND_LIB_VERSION)
SND_LIB_MAJOR=`echo $VERSION | cut -d . -f 1`
AC_SUBST(SND_LIB_MAJOR)
SND_LIB_MINOR=`echo $VERSION | cut -d . -f 2`
AC_SUBST(SND_LIB_MINOR)
SND_LIB_SUBMINOR=`echo $VERSION | cut -d . -f 3 | sed -e 's/^\([[^[:alpha:]]]*\)\(.*\)$/\1/g'`
AC_SUBST(SND_LIB_SUBMINOR)
SND_LIB_EXTRASTR=`echo $VERSION | cut -d . -f 3 | sed -e 's/^\([[^[:alpha:]]]*\)\([[[:alpha:]]]*\)\([[[:digit:]]]*\)$/\2/g'`
SND_LIB_EXTRAVER=`echo $VERSION | cut -d . -f 3 | sed -e 's/^\([[^[:alpha:]]]*\)\([[[:alpha:]]]*\)\([[[:digit:]]]*\)$/\3/g'`
case "$SND_LIB_EXTRASTR" in
pre) SND_LIB_EXTRAVER=`expr $SND_LIB_EXTRAVER + 00000` ;;
alpha) SND_LIB_EXTRAVER=`expr $SND_LIB_EXTRAVER + 10000` ;;
beta) SND_LIB_EXTRAVER=`expr $SND_LIB_EXTRAVER + 20000` ;;
rc) SND_LIB_EXTRAVER=`expr $SND_LIB_EXTRAVER + 100000` ;;
*) SND_LIB_EXTRAVER=1000000 ;;
esac
AC_MSG_RESULT(major $SND_LIB_MAJOR minor $SND_LIB_MINOR subminor $SND_LIB_SUBMINOR extrastr $SND_LIB_EXTRASTR extraver $SND_LIB_EXTRAVER)
AC_SUBST(SND_LIB_EXTRAVER)
])