+
+AC_HEADER_STDC
+
+AC_SEARCH_LIBS([glClear], [GL], [have_opengl=yes])
+if test ! "x${have_opengl}" = xyes
+then
+ AC_MSG_ERROR([libGL is required])
+fi
+
+AC_SEARCH_LIBS([SDL_Init], [SDL], [have_sdl=yes])
+if test ! "x${have_sdl}" = xyes
+then
+ AC_MSG_ERROR([libSDL is required])
+fi
+
+AC_SEARCH_LIBS([IMG_Load], [SDL_image], [have_sdlimage=yes])
+if test ! "x${have_sdlimage}" = xyes
+then
+ AC_MSG_ERROR([libSDL_image is required])
+fi
+
+AC_SEARCH_LIBS([clock_gettime], [rt], [have_librt=yes])
+if test "x${have_librt}" = xyes
+then
+ AC_DEFINE([HAVE_LIBRT], 1, [high-resolution timer enabled])
+fi
+