changeset 527:68f20f7ac954 trunk

[svn] in configure.ac, do not check for ALSA twice if it has been already detected (both alsa output plugin and amidi-plug check its availability)
author giacomo
date Fri, 27 Jan 2006 15:10:44 -0800
parents c41406418769
children 980261e29f97
files configure.ac m4/amidi-plug.m4
diffstat 2 files changed, 68 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Fri Jan 27 14:22:22 2006 -0800
+++ b/configure.ac	Fri Jan 27 15:10:44 2006 -0800
@@ -348,32 +348,6 @@
 AM_CONDITIONAL(ENABLE_AAC, test "$enable_aac" = "yes")
 
 
-dnl *** amidi-plug
-
-AC_ARG_ENABLE(amidiplug,
-    [  --disable-amidiplug     disable amidi-plug input plugin (default=check) ],
-    [enable_amidiplug=$enableval],
-    [enable_amidiplug=check]
-)
-
-if test "x$enable_amidiplug" = "xcheck"; then
-    AM_PATH_AMIDIPLUG(enable_amidiplug=yes, enable_amidiplug=no)
-    if test "x$enable_amidiplug" = "xyes"; then
-      ap_disable_timidity=yes
-    fi
-elif test "x$enable_amidiplug" = "xyes"; then
-    PKG_CHECK_MODULES(ALSA, [alsa >= 0.9.0],
-        [enable_amidiplug=yes],
-        [enable_amidiplug=no]
-    )
-else
-    AC_MSG_RESULT([*** amidi-plug disabled per user request ***])
-    enable_amidiplug=no
-fi
-
-AM_CONDITIONAL(ENABLE_AMIDIPLUG, test "x$enable_amidiplug" = "xyes")
-
-
 dnl *** sndfile
 
 AC_ARG_ENABLE(sndfile,
@@ -435,23 +409,6 @@
 AM_CONDITIONAL(ENABLE_WMA, test "$enable_wma" = "yes")
 
 
-dnl *** TiMidity
-
-AC_ARG_ENABLE(timidity,
-[  --disable-timidity      disable timidity plugin. (default=enabled)],
-[enable_timidity=$enableval],
-[
-  if test "x$ap_disable_timidity" = "xyes"; then
-    enable_timidity=no
-  else
-    enable_timidity=yes
-  fi
-]
-)
-
-AM_CONDITIONAL(ENABLE_TIMIDITY, test "$enable_timidity" = "yes")
-
-
 dnl *** Crossfader
 
 AC_ARG_ENABLE(crossfade,
@@ -578,17 +535,75 @@
 
 if test "$enable_alsa" = "yes"; then
     PKG_CHECK_MODULES(ALSA, [alsa >= 1.0],
-        [have_alsa=yes],
-        [have_alsa=no]
+[
+have_alsa=yes
+alsalib_available=yes
+],
+[
+have_alsa=no
+alsalib_available=no
+]
     )
 else
     AC_MSG_RESULT([*** ALSA output plugin disabled per user request ***])
     have_alsa=no
+    alsalib_available=check
 fi
 
 AM_CONDITIONAL(HAVE_ALSA, test "$have_alsa" = "yes")
 
 
+dnl *** amidi-plug (note: should appear somewhere after the alsa ouput plugin check)
+
+AC_ARG_ENABLE(amidiplug,
+    [  --disable-amidiplug     disable amidi-plug input plugin (default=check) ],
+    [enable_amidiplug=$enableval],
+    [enable_amidiplug=check]
+)
+
+if test "x$enable_amidiplug" = "xno"; then
+  AC_MSG_RESULT([*** amidi-plug disabled per user request ***])
+  enable_amidiplug=no
+else
+  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$enable_amidiplug" = "xcheck"; then
+        AM_PATH_AMIDIPLUG(enable_amidiplug=yes, enable_amidiplug=no)
+        if test "x$enable_amidiplug" = "xyes"; then
+          ap_disable_timidity=yes
+        fi
+    else
+      enable_amidiplug=yes
+    fi
+  else
+    AC_MSG_WARN([*** ALSA not found, amidi-plug won't be compiled ***])
+    enable_amidiplug=no
+  fi
+fi
+
+AM_CONDITIONAL(ENABLE_AMIDIPLUG, test "x$enable_amidiplug" = "xyes")
+
+
+dnl *** TiMidity input plugin (note: should appear somewhere after the amidi-plug check)
+
+AC_ARG_ENABLE(timidity,
+[  --disable-timidity      disable timidity plugin. (default=enabled)],
+[enable_timidity=$enableval],
+[
+  if test "x$ap_disable_timidity" = "xyes"; then
+    enable_timidity=no
+  else
+    enable_timidity=yes
+  fi
+]
+)
+
+AM_CONDITIONAL(ENABLE_TIMIDITY, test "$enable_timidity" = "yes")
+
+
 dnl FreeBSD newpcm driver detection
 
 AC_CACHE_CHECK(for FreeBSD newpcm driver, beep_cv_newpcm_driver,
--- a/m4/amidi-plug.m4	Fri Jan 27 14:22:22 2006 -0800
+++ b/m4/amidi-plug.m4	Fri Jan 27 15:10:44 2006 -0800
@@ -8,28 +8,20 @@
 
 AMIDIPLUG_EVERYTHINGOK="yes"
 
-dnl **** Check for ALSA ****
-PKG_CHECK_MODULES(ALSA, [alsa >= 0.9.0],
-  [ap_alsa_found=yes], [ap_alsa_found=no])
-
-if test "x$ap_alsa_found" = "xyes"; then
-  dnl **** Search for a hardware synth (ALSA managed)  ****
-  AC_CHECK_FILE([/proc/asound/card0/wavetableD1],
+dnl **** Search for a hardware synth (ALSA managed)  ****
+AC_CHECK_FILE([/proc/asound/card0/wavetableD1],
+  [ap_hwsynth_found=yes], [ap_hwsynth_found=no])
+if test "x$ap_hwsynth_found" = "xno"; then
+  AC_CHECK_FILE([/proc/asound/card1/wavetableD1],
     [ap_hwsynth_found=yes], [ap_hwsynth_found=no])
   if test "x$ap_hwsynth_found" = "xno"; then
-    AC_CHECK_FILE([/proc/asound/card1/wavetableD1],
+    AC_CHECK_FILE([/proc/asound/card2/wavetableD1],
       [ap_hwsynth_found=yes], [ap_hwsynth_found=no])
     if test "x$ap_hwsynth_found" = "xno"; then
-      AC_CHECK_FILE([/proc/asound/card2/wavetableD1],
-        [ap_hwsynth_found=yes], [ap_hwsynth_found=no])
-      if test "x$ap_hwsynth_found" = "xno"; then
-        AMIDIPLUG_EVERYTHINGOK="no"
-        AC_MSG_WARN([*** Could not find an ALSA-supported hardware synth, amidi-plug won't be compiled. If you wish to compile it anyway, use --enable-amidiplug in configure. ***])
-      fi
+      AMIDIPLUG_EVERYTHINGOK="no"
+      AC_MSG_WARN([*** Could not find an ALSA-supported hardware synth, amidi-plug won't be compiled. If you wish to compile it anyway, use --enable-amidiplug in configure. ***])
     fi
   fi
-else
-  AMIDIPLUG_EVERYTHINGOK="no"
 fi
 
 if test "x$AMIDIPLUG_EVERYTHINGOK" = "xyes"; then