-if test "$enable_opengl" = "yes"; then
- AX_CHECK_GL
-fi
-if test "$no_gl" = "yes" -o "$enable_opengl" = "no"; then
- GL_AVAILABLE="no"
- AC_DEFINE([NOOPENGL],, [Define if opengl should not be used])
-else
- GL_AVAILABLE="yes"
+NP_FINDLIB([PHYSFS], [physfs], [physfs >= 1.0.0],
+ NP_LANG_PROGRAM([
+#include <stdio.h>
+#include <physfs.h>
+#if PHYSFS_VER_MAJOR < 1
+# error PHYSFS is too old
+#endif]),
+ [], [-lphysfs],
+ [],
+ [AC_MSG_ERROR([Please install physfs >= 1.0])])
+
+NP_FINDLIB([OPENAL], [OpenAL], [OpenAL],
+ NP_LANG_PROGRAM([#include <AL/al.h>],
+ [alcOpenDevice(0);]),
+ [], [-lopenal],
+ [],
+ [AC_MSG_ERROR([Please intall OpenAL])],
+ [], [])
+
+AX_CHECK_GL
+if test "$no_gl" = "yes"; then
+ AC_MSG_ERROR([Please install opengl libraries and headers])