+AC_SEARCH_LIBS([IMG_Load], [SDL_image],,
+ [missing="$missing SDL_image"])
+
+AC_SEARCH_LIBS([Sound_Init], [SDL_sound],,
+ [missing="$missing SDL_sound"])
+
+if test x$WIN32 == xyes
+then
+# autoconf library search macro doesn't find opengl32 on windows because it uses
+# different name hashing, but it links fine; assume it's there
+ LIBS="$LIBS -lglu32 -lopengl32"
+else
+ AC_SEARCH_LIBS([gluPerspective], [GLU MesaGLU],,
+ [missing="$missing GLU"])
+
+ AC_SEARCH_LIBS([glBegin], [GL MesaGL],,
+ [missing="$missing OpenGL"])
+fi
+
+AC_SEARCH_LIBS([alGenBuffers], [openal openal32],,
+ [missing="$missing OpenAL"])
+
+AC_SEARCH_LIBS([alutInit], [alut],,
+ [missing="$missing ALUT"])
+
+AC_SEARCH_LIBS([clock_gettime], [rt],
+ [AC_DEFINE([HAVE_CLOCK_GETTIME], 1,
+ [Define to 1 if you have the 'clock_gettime' function.])])
+
+if test "x$missing" != x
+then
+ echo "** One or more required libraries are missing:"
+ for library in $missing
+ do
+ echo "** $library"
+ done
+ AC_MSG_ERROR([please install missing dependencies])
+fi