--- configure_orig	2006-11-22 05:35:27 -0600
+++ configure	2006-11-22 06:49:30 -0600
@@ -4886,6 +4886,20 @@
 echocheck "OpenAL"
 if test "$_openal" = auto ; then
   _openal=no
+  if darwin ; then
+    cat > $TMPC << EOF
+#include <al.h>
+int main(void) {
+  alSourceQueueBuffers(0, 0, 0);
+//  alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
+  return 0;
+}
+EOF
+    if cc_check -framework OpenAL ; then
+      _libs_mplayer="$_libs_mplayer -framework OpenAL"
+      _openal=yes
+    fi
+  else
 cat > $TMPC << EOF
 #include <AL/al.h>
 int main(void) {
@@ -4906,6 +4920,7 @@
 else
   _noaomodules="openal $_noaomodules"
 fi
+fi
 echores "$_openal"
 
 echocheck "ALSA audio"
--- ao_openal.c_orig	2006-11-01 23:48:13 -0600
+++ ao_openal.c	2006-11-22 06:42:00 -0600
@@ -10,8 +10,13 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <inttypes.h>
+#ifdef SYS_DARWIN
+#include <alc.h>
+#include <al.h>
+#else
 #include <AL/alc.h>
 #include <AL/al.h>
+#endif
 
 #include "config.h"
 #include "mp_msg.h"
