}
where_gl_libs(){
-# first search libGL.la file and check if this file is correct
+# search libGL.so* file and correct libGL.la in the same directory
+for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do
+ if [ "`ls ${d}/libGL.so* 2>/dev/null`" ] && [ -f ${d}/libGL.la ]; then
+ libdir=`grep "libdir=" ${d}/libGL.la | sed -e "s%libdir='\(.*\)'%\1%" -e "s%/*$%%g"`
+ if [ "$libdir" == "$d" ] ; then
+ echo "$d"
+ return 0
+ fi
+ fi
+done
+# search libGL.la file and check if this file is correct
for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do
if [ -f ${d}/libGL.la ] ; then
libdir=`grep "libdir=" ${d}/libGL.la | sed -e "s%libdir='\(.*\)'%\1%"`