changeset 2937:8c48d6793b86

Improve detection of MIDI-enabled alsalib, hopefully.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 18 Sep 2008 08:19:49 +0300
parents 581bec6e2d33
children 597857a52f7c
files configure.ac
diffstat 1 files changed, 12 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Fri Aug 29 02:14:51 2008 +0300
+++ b/configure.ac	Thu Sep 18 08:19:49 2008 +0300
@@ -1024,20 +1024,10 @@
 )
 
 if test "x$enable_alsa" = "xyes"; then
-    PKG_CHECK_MODULES(ALSA, [alsa >= 1.0],
-[
-have_alsa=yes
-alsalib_available=yes
-],
-[
-have_alsa=no
-alsalib_available=no
-]
-    )
+    PKG_CHECK_MODULES([ALSA], [alsa >= 1.0], [have_alsa=yes], [have_alsa=no])
 else
     AC_MSG_RESULT([*** ALSA output plugin disabled per user request ***])
     have_alsa=no
-    alsalib_available=check
 fi
 
 if test "x$have_alsa" = "xyes"; then
@@ -1085,13 +1075,17 @@
   fi
 fi
 
+if test "x$have_alsa" = "xyes"; then
+  AUD_TRY_COMPILE([ALSA MIDI support], [alsalib_hasmidi],
+[#include <alsa/asoundlib.h>],
+[snd_seq_t *seq = NULL;],
+  [alsalib_midi=yes], [alsalib_midi=no])
+fi
+
+
 if test "x$enable_amidiplug" = "xcheck"; then
-  if test "x$alsalib_available" = "xcheck"; then
-    PKG_CHECK_MODULES(ALSA, [alsa >= 1.0],
-      [alsalib_available=yes],[alsalib_available=no])
-  fi
-  if test "x$alsalib_available" = "xyes"; then
-    AM_PATH_AMIDIPLUG_HWSYNTH(ap_have_hwsynth=yes, ap_have_hwsynth=no)
+  if test "x$alsalib_midi" = "xyes"; then
+    AM_PATH_AMIDIPLUG_HWSYNTH([ap_have_hwsynth=yes], [ap_have_hwsynth=no])
     if test "x$ap_have_hwsynth" = "xyes"; then
       enable_amidiplug=yes
       ap_disable_timidity=yes
@@ -1126,11 +1120,7 @@
   AMIDIPLUG_BACKEND_DIR=amidi-plug
   AC_SUBST(AMIDIPLUG_BACKEND_DIR)
   if test "x$enable_amidiplug_alsa" = "xauto" -o "x$enable_amidiplug_alsa" = "xyes"; then
-    if test "x$alsalib_available" = "xcheck"; then
-      PKG_CHECK_MODULES(ALSA, [alsa >= 1.0],
-        [alsalib_available=yes],[alsalib_available=no])
-    fi
-    if test "x$alsalib_available" = "xyes"; then
+    if test "x$alsalib_midi" = "xyes"; then
       AMIDIPLUG_BACKENDS="$AMIDIPLUG_BACKENDS backend-alsa"
       enable_amidiplug_alsa=yes
     else