+dnl check for OpenAL libraries
+OPENAL_OK="no"
+case "${host}" in
+*-*-cygwin* | *-*-mingw32*)
+ dnl CygWin under Windoze.
+ INCLUDES="$INCLUDES -I/usr/local/include"
+ LIBS="$LIBS -L/usr/local/lib"
+ AC_SEARCH_LIBS(alGenBuffers, openal32)
+ AC_SEARCH_LIBS(alutInit, [ openal32 ALut ] )
+ LIBS="$LIBS -lwinmm -ldsound -ldxguid -lole32"
+ openal_LIBS="$LIBS"
+ OPENAL_OK="$ac_cv_search_alGenBuffers"
+ ;;
+
+*-apple-darwin*)
+ dnl Mac OS X
+
+ LIBS="$LIBS -framework IOKit -framework OpenAL"
+ openal_LIBS="$LIBS"
+ # not sure how to test if OpenAL exists on MacOS (does it come by default?)
+ OPENAL_OK="yes"
+ ;;
+
+*)
+ dnl default unix style machines
+
+ save_LIBS=$LIBS
+ LIBS="$LIBS $thread_LIBS"
+ AC_SEARCH_LIBS(alGenBuffers, openal)
+ OPENAL_OK="$ac_cv_search_alGenBuffers"
+ openal_LIBS="$LIBS"
+ LIBS=$save_LIBS
+ ;;
+
+esac
+
+if test "$OPENAL_OK" == "no"; then
+ echo
+ echo "You *must* have the openal library installed on your system to build"
+ echo "SimGear!"
+ echo
+ echo "Please see README.OpenAL for more details."
+ echo
+ echo "configure aborted."
+ exit
+fi
+
+LIBS="$base_LIBS"
+