]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Fix build with partially-installed alsa-lib
authorTakashi Iwai <tiwai@suse.de>
Thu, 29 Jan 2009 14:41:31 +0000 (15:41 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 29 Jan 2009 14:41:31 +0000 (15:41 +0100)
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>
Makefile.am
configure.in

index 554617d5bd4a62e8ff61f50de9a310e5f9c67913..52969774db5968abc3335575ba345af4d4a44086 100644 (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
index 59247ed0dc5f7fb33127aaeab1d238ecf2c0125b..0facec4e1c2a0106f4186847bcb74374df0c9071 100644 (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