Search for OpenGL. We search first for Mesa (a GPL'ed version of
Mesa) before a vendor's version of OpenGL, unless we were
specifically asked not to with `--with-Mesa=no' or `--without-Mesa'.
The four "standard" OpenGL libraries are searched for: "-lGL",
"-lGLU", "-lGLX" (or "-lMesaGL", "-lMesaGLU" as the case may be) and
"-lglut".
All of the libraries that are found (since "-lglut" or "-lGLX" might
be missing) are added to the shell output variable "GL_LIBS", along
with any other libraries that are necessary to successfully link an
OpenGL application (e.g. the X11 libraries). Care has been taken to
make sure that all of the libraries in "GL_LIBS" are listed in the
proper order.
Additionally, the shell output variable "GL_CFLAGS" is set to any
flags (e.g. "-I" flags) that are necessary to successfully compile
an OpenGL application.
The following shell variable (which are not output variables) are
also set to either "yes" or "no" (depending on which libraries were
found) to help you determine exactly what was found.
have_GL
have_GLU
have_GLX
have_glut
A complete little toy "Automake `make distcheck'" package of how to
use this macro is available at:
ftp://ftp.slac.stanford.edu/users/langston/autoconf/ac_opengl-0.01.tar.gz
Please note that as the ac_opengl macro and the toy example evolves,
the version number increases, so you may have to adjust the above
URL accordingly.
minor bugfix by ahmet inan <auto@ainan.org>