From 6f54aa0e387a59f9092507782a866e39a0cce123 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Sun, 23 Mar 2008 23:37:57 +0000 Subject: [PATCH] Add a run-test for OpenAL. Originally committed to SVN as r2128. --- configure.in | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index d0b94723f..9245bad72 100644 --- a/configure.in +++ b/configure.in @@ -277,8 +277,6 @@ if test "$agi_with_pulseaudio" = "no" && test "$with_pulseaudio" = "yes"; then with_pulseaudio="no" fi - - AM_CONDITIONAL([HAVE_PULSEAUDIO], [test "$with_pulseaudio" != "no"]) if test "$with_pulseaudio" = "yes"; then AC_DEFINE(WITH_PULSEAUDIO, 1, [Enable PulseAudio support]) @@ -292,6 +290,28 @@ AC_ARG_WITH(openal,[ --without-openal build without OpenAL audio provide if test "x$with_openal" != xno; then PKG_CHECK_MODULES(OPENAL, openal >= 0.0.8, [found_audio=yes; with_openal=yes], [with_openal=no]) fi + +AC_AGI_COMPILE([OpenAL], [openal], [$OPENAL_CFLAGS], [$OPENAL_LIBS],[ +#if defined(__APPLE__) +#include +#include +#else +#include +#include +#endif +int main(void) { + ALCdevice *device = alcOpenDevice(0); + if (!device) return 1; + ALCcontext *context = alcCreateContext(device, 0); + if (!context) return 1; + return 0; +}]) + +if test "$agi_with_openal" = "no" && test "$with_openal" = "yes"; then + AC_MSG_WARN([OpenAL detected, but it doesn't work..]) + with_openal="no" +fi + AM_CONDITIONAL([HAVE_OPENAL], [test "$with_openal" != "no"]) if test "$with_openal" = "yes"; then AC_DEFINE(WITH_OPENAL, 1, [Enable OpenAL support]) @@ -299,7 +319,6 @@ fi - ################# # Video Providers #################