- ALSA_REQUIRED=1.0.0
- ALSA_MODULES="alsa >= $ALSA_REQUIRED"
- PKG_CHECK_MODULES(ALSA, $ALSA_MODULES, HAVE_ALSA=yes, HAVE_ALSA=no)
- if test $HAVE_ALSA = yes; then
- SAVE_CFLAGS="$CFLAGS"
- SAVE_LIBS="$LIBS"
- CFLAGS="$ALSA_CFLAGS $CFLAGS"
- LIBS="$ALSA_LIBS $LIBS"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <asoundlib.h>]], [[snd_lib_error_set_handler (0);]])],
- emacs_alsa_normal=yes,
- emacs_alsa_normal=no)
- if test "$emacs_alsa_normal" != yes; then
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <alsa/asoundlib.h>]],
- [[snd_lib_error_set_handler (0);]])],
- emacs_alsa_subdir=yes,
- emacs_alsa_subdir=no)
- if test "$emacs_alsa_subdir" != yes; then
- AC_MSG_ERROR([pkg-config found alsa, but it does not compile. See config.log for error messages.])
+ if test "${with_sound}" = "alsa" || test "${with_sound}" = "yes"; then
+ ALSA_REQUIRED=1.0.0
+ ALSA_MODULES="alsa >= $ALSA_REQUIRED"
+ PKG_CHECK_MODULES(ALSA, $ALSA_MODULES, HAVE_ALSA=yes, HAVE_ALSA=no)
+ if test $HAVE_ALSA = yes; then
+ SAVE_CFLAGS="$CFLAGS"
+ SAVE_LIBS="$LIBS"
+ CFLAGS="$ALSA_CFLAGS $CFLAGS"
+ LIBS="$ALSA_LIBS $LIBS"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <asoundlib.h>]], [[snd_lib_error_set_handler (0);]])],
+ emacs_alsa_normal=yes,
+ emacs_alsa_normal=no)
+ if test "$emacs_alsa_normal" != yes; then
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <alsa/asoundlib.h>]],
+ [[snd_lib_error_set_handler (0);]])],
+ emacs_alsa_subdir=yes,
+ emacs_alsa_subdir=no)
+ if test "$emacs_alsa_subdir" != yes; then
+ AC_MSG_ERROR([pkg-config found alsa, but it does not compile. See config.log for error messages.])
+ fi
+ ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE"