Fix build with partially-installed alsa-lib

Fix build of alsa-utils package with a partially installed alsa-lib,
e.g. without ramwidi or sequencer support.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2009-01-29 15:41:31 +01:00
parent 9662a167d8
commit d12fe105e3
2 changed files with 35 additions and 8 deletions

View file

@ -1,16 +1,25 @@
INCLUDES=-I$(top_srcdir)/include INCLUDES=-I$(top_srcdir)/include
SUBDIRS = include alsactl utils m4 po
if ALSAMIXER if ALSAMIXER
ALSAMIXER_DIR=alsamixer SUBDIRS += alsamixer
else endif
ALSAMIXER_DIR= if HAVE_MIXER
SUBDIRS += amixer
endif
if HAVE_RAWMIDI
SUBDIRS += amidi
endif endif
if ALSACONF if ALSACONF
ALSACONF_DIR=alsaconf SUBDIRS += alsaconf
else
ALSACONF_DIR=
endif endif
SUBDIRS= include alsactl $(ALSACONF_DIR) $(ALSAMIXER_DIR) amidi amixer \ if HAVE_PCM
aplay iecset seq speaker-test utils m4 po SUBDIRS += aplay iecset speaker-test
endif
if HAVE_SEQ
SUBDIRS += seq
endif
EXTRA_DIST= TODO gitcompile EXTRA_DIST= TODO gitcompile
AUTOMAKE_OPTIONS=foreign AUTOMAKE_OPTIONS=foreign
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4

View file

@ -29,10 +29,27 @@ AC_PROG_INSTALL
AC_PROG_LN_S AC_PROG_LN_S
AM_PATH_ALSA(1.0.16) AM_PATH_ALSA(1.0.16)
dnl Check components
AC_CHECK_HEADERS([alsa/pcm.h], [have_pcm="yes"], [have_pcm="no"],
[#include <alsa/asoundlib.h>])
AC_CHECK_HEADERS([alsa/mixer.h], [have_mixer="yes"], [have_mixer="no"],
[#include <alsa/asoundlib.h>])
AC_CHECK_HEADERS([alsa/rawmidi.h], [have_rawmidi="yes"], [have_rawmidi="no"],
[#include <alsa/asoundlib.h>])
AC_CHECK_HEADERS([alsa/seq.h], [have_seq="yes"], [have_seq="no"],
[#include <alsa/asoundlib.h>])
AM_CONDITIONAL(HAVE_PCM, test "$have_pcm" = "yes")
AM_CONDITIONAL(HAVE_MIXER, test "$have_mixer" = "yes")
AM_CONDITIONAL(HAVE_RAWMIDI, test "$have_rawmidi" = "yes")
AM_CONDITIONAL(HAVE_SEQ, test "$have_seq" = "yes")
dnl Disable alsamixer dnl Disable alsamixer
CURSESINC="" CURSESINC=""
CURSESLIB="" CURSESLIB=""
CURSES_CFLAGS="" CURSES_CFLAGS=""
alsamixer=
if test "$have_mixer" = "yes"; then
AC_ARG_ENABLE(alsamixer, AC_ARG_ENABLE(alsamixer,
[ --disable-alsamixer Disable alsamixer compilation], [ --disable-alsamixer Disable alsamixer compilation],
[case "${enableval}" in [case "${enableval}" in
@ -40,6 +57,7 @@ AC_ARG_ENABLE(alsamixer,
no) alsamixer=false ;; no) alsamixer=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-alsamixer) ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsamixer) ;;
esac],[alsamixer=true]) esac],[alsamixer=true])
fi
AM_CONDITIONAL(ALSAMIXER, test x$alsamixer = xtrue) AM_CONDITIONAL(ALSAMIXER, test x$alsamixer = xtrue)
dnl Disable alsaconf dnl Disable alsaconf