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
SUBDIRS = include alsactl utils m4 po
if ALSAMIXER
ALSAMIXER_DIR=alsamixer
else
ALSAMIXER_DIR=
SUBDIRS += alsamixer
endif
if HAVE_MIXER
SUBDIRS += amixer
endif
if HAVE_RAWMIDI
SUBDIRS += amidi
endif
if ALSACONF
ALSACONF_DIR=alsaconf
else
ALSACONF_DIR=
SUBDIRS += alsaconf
endif
SUBDIRS= include alsactl $(ALSACONF_DIR) $(ALSAMIXER_DIR) amidi amixer \
aplay iecset seq speaker-test utils m4 po
if HAVE_PCM
SUBDIRS += aplay iecset speaker-test
endif
if HAVE_SEQ
SUBDIRS += seq
endif
EXTRA_DIST= TODO gitcompile
AUTOMAKE_OPTIONS=foreign
ACLOCAL_AMFLAGS = -I m4

View file

@ -29,10 +29,27 @@ AC_PROG_INSTALL
AC_PROG_LN_S
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
CURSESINC=""
CURSESLIB=""
CURSES_CFLAGS=""
alsamixer=
if test "$have_mixer" = "yes"; then
AC_ARG_ENABLE(alsamixer,
[ --disable-alsamixer Disable alsamixer compilation],
[case "${enableval}" in
@ -40,6 +57,7 @@ AC_ARG_ENABLE(alsamixer,
no) alsamixer=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-alsamixer) ;;
esac],[alsamixer=true])
fi
AM_CONDITIONAL(ALSAMIXER, test x$alsamixer = xtrue)
dnl Disable alsaconf