I know it was a long time ago, but I'm having the exact same problem that you had: I can't build gem on a fedora (core 3) because the configure script doesn't find opengl:
checking for glInitNames in -lGL... no checking for glInitNames in -lMesaGL... no OpenGL is mandatory
I know that the libraries are there. Did you ever fix the problem? Do you remember how?
Ya, for some reason nobody else on the PD list has this problem. Here is the solution:
My reported bug was that Gem,s configure script was trying to find GL by compiling conftest.c with the following command: gcc -o conftest -g -O2 -L/usr/X11R6/lib conftest.c -lGL -Wl,-shared -Wl,-export-dynamic -lXxf86vm -lXext -lX11 (as taken from configure) but my problems seem obvious to Jacub, read below!
------- Additional Comments From jakub@redhat.com 2004-03-18 05:18 ------- That is to be expected. Never use -Wl,-shared, but -shared. With -Wl,-shared, you don't tell the gcc driver that you are trying to build a shared library, so it throws in crt objects for executable etc., but you tell the linker to create a shared library with that. With -shared, you tell the gcc driver that you are linking a shared library and it will take care of the details (putting in correct crt files, libraries etc. and of course also passing -shared to ld).
So vi configure and grep for -Wl,shared and change it to -shared!
Good luck! -thewade