-AC_CHECK_HEADERS([GL/gl.h GL/glu.h],,
- [missing=yes
- echo "***** Missing GL headers ($website) *****"])
-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([glEnable], [GL MesaGL],,
- [missing=yes
- echo "***** Missing libGL ($website) *****"])
- AC_SEARCH_LIBS([gluDisk], [GLU MesaGLU],,
- [missing=yes
- echo "***** Missing libGLU ($website) *****"])
-fi
-
-##### openal #####
-website="http://connect.creativelabs.com/openal/"
-AC_CHECK_HEADERS([AL/al.h AL/alc.h],,
- [missing=yes
- echo "***** Missing OpenAL headers ($website) *****"])
-AC_SEARCH_LIBS([alEnable], [openal OpenAL32],,
- [missing=yes
- echo "***** Missing libopenal ($website) *****"])
+PKG_CHECK_MODULES([OPENGL], [gl glu],
+ [LIBS="$LIBS $OPENGL_LIBS"
+ CFLAGS="$CFLAGS $OPENGL_CFLAGS"
+ CXXFLAGS="$CXXFLAGS $OPENGL_CFLAGS"],
+ [missing=yes
+ AC_MSG_WARN([Missing OpenGL ($website)])])