Making mesa opengl under linux.

Go to www.mesa3d.org
Go to their download page, which for me was:
http://sourceforge.net/project/showfiles.php?group_id=3&release_id=40500
I clicked on download | Stable release. For me that 3.4.2
That took me to this page http://sourceforge.net/projects/mesa3d
From there I clicked on the Download page, which took me to the page mentioned
before:
http://sourceforge.net/project/showfiles.php?group_id=3&release_id=40500

Then I untared the files: tar xvfz MesaDemos-3.4.2.tar.gz
And tar xvfz MesaLib-3.4.2.tar.gz

At this point I tried to configure with this command:

./configure --prefix=/usr

This did not work, because I was missing the GLUT files.
I got them by downloading a previous release, MesaLib-3.2.tar.gz,
which is Mesa 3.2. I copied the srcGLUT directory from from the Mesa-3.2 dir
to the Mesa-3.5 directory. Then I was able to run
configure and then after that make:

configure --prefix=/usr
make

Now become super user (su) and run:

make install

Check to see if the files are there in /usr/lib. do something like:

ls -lrt /usr/lib

The last files listed should /usr/lib/libGL*, such as:

/usr/lib/libGL.so
/usr/lib/libGL.so.1
/usr/lib/libGL.so.1.030402

When you are done, stop being superuser, and build the demos by running:

make check

On my system, there was one last thing I had to do. When I tried to run
my program, it could not find the vga lib file, which was in my /usr/local/lib
directory. This was not on my ld path. I decided to make this always on
my path by becoming root and editing /etc/ld.so.conf, and then running
ldconfig to update my /etc/ld.so.cache file.

I found this online:
http://www.cs.kuleuven.ac.be/cwis/research/graphics/3DOM/3dom_bugs.html

{ When the Mesa version gives you errors like 'can't resolve
  symbol 'XShmQueryVersion'', your X server does not support
  the shared memory extension. Go and get a better X server
  or compile your own Mesa shared lib without the -DSHM compile
  option. Some Redhat X servers have this feature (3.0.3 has it)
  }