diff --git a/Makefile.am b/Makefile.am index 554617d..5296977 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/configure.in b/configure.in index 59247ed..0facec4 100644 --- a/configure.in +++ b/configure.in @@ -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 ]) +AC_CHECK_HEADERS([alsa/mixer.h], [have_mixer="yes"], [have_mixer="no"], + [#include ]) +AC_CHECK_HEADERS([alsa/rawmidi.h], [have_rawmidi="yes"], [have_rawmidi="no"], + [#include ]) +AC_CHECK_HEADERS([alsa/seq.h], [have_seq="yes"], [have_seq="no"], + [#include ]) + +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