Re: [AD] ALSA 0.9 Patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> Attached is the version I just commited to mainline. Tested
> (configuration+compilation) against alsa-lib 0.9.7.

Wait a minute... the configure checks are really compile-time checks, not 
run-time checks. Reworked thusly.

-- 
Eric Botcazou
--- /home/eric/cvs/allegro/aclocal.m4	Thu Oct  9 15:19:58 2003
+++ allegro/aclocal.m4	Thu Oct  9 15:17:53 2003
@@ -362,12 +362,20 @@
 if test -n "$allegro_enable_alsadigi"; then
   AC_CACHE_CHECK(for supported ALSA version for digital sound,
   allegro_cv_support_alsadigi,
-  AC_TRY_RUN([#include <sys/asoundlib.h>
-    int main (void) { return SND_LIB_MAJOR != 0 || SND_LIB_MINOR != 5; }],
-  [allegro_cv_support_alsadigi=yes allegro_cv_alsa_version=5],
-  AC_TRY_RUN([#include <sys/asoundlib.h>
-    int main (void) { return SND_LIB_MAJOR != 0 || SND_LIB_MINOR != 9; }],
-  [allegro_cv_support_alsadigi=yes allegro_cv_alsa_version=9],
+  AC_TRY_COMPILE([#include <sys/asoundlib.h>
+                  #if SND_LIB_MAJOR == 0 && SND_LIB_MINOR == 5
+                  #else
+                  #error
+                  #endif],,
+  [allegro_cv_support_alsadigi=yes
+   allegro_cv_alsa_version=5],
+  AC_TRY_COMPILE([#include <sys/asoundlib.h>
+                  #if SND_LIB_MAJOR == 0 && SND_LIB_MINOR == 9
+                  #else
+                  #error
+                  #endif],,
+  [allegro_cv_support_alsadigi=yes
+   allegro_cv_alsa_version=9],
   allegro_cv_support_alsadigi=no)))
   if test "X$allegro_cv_support_alsadigi" = "Xyes" && 
      test -z "$allegro_support_modules"; then
@@ -391,12 +399,20 @@
 if test -n "$allegro_enable_alsamidi"; then
   AC_CACHE_CHECK(for supported ALSA version for MIDI,
   allegro_cv_support_alsamidi,
-  AC_TRY_RUN([#include <sys/asoundlib.h>
-    int main (void) { return SND_LIB_MAJOR != 0 || SND_LIB_MINOR != 5; }],
-  [allegro_cv_support_alsamidi=yes allegro_cv_alsa_version=5],
-  AC_TRY_RUN([#include <sys/asoundlib.h>
-    int main (void) { return SND_LIB_MAJOR != 0 || SND_LIB_MINOR != 9; }],
-  [allegro_cv_support_alsamidi=yes allegro_cv_alsa_version=9],
+  AC_TRY_COMPILE([#include <sys/asoundlib.h>
+                  #if SND_LIB_MAJOR == 0 && SND_LIB_MINOR == 5
+                  #else
+                  #error
+                  #endif],,
+  [allegro_cv_support_alsamidi=yes
+   allegro_cv_alsa_version=5],
+  AC_TRY_COMPILE([#include <sys/asoundlib.h>
+                  #if SND_LIB_MAJOR == 0 && SND_LIB_MINOR == 9
+                  #else
+                  #error
+                  #endif],,
+  [allegro_cv_support_alsamidi=yes
+   allegro_cv_alsa_version=9],
   allegro_cv_support_alsamidi=no)))
   if test "X$allegro_cv_support_alsamidi" = "Xyes" &&
      test "X$allegro_cv_support_alsadigi" != "Xyes" &&


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/