where_gl_libs(){
local d
local libdir
+local libdirs="/usr/X11R6/lib64 /usr/lib64 /usr/lib/`uname -m`-linux-gnu /usr/X11R6/lib /usr/lib"
+
# 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
+for d in ${libdirs} ; 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
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
+for d in ${libdirs} ; do
if [ -f ${d}/libGL.la ] ; then
libdir=`grep "libdir=" ${d}/libGL.la | sed -e "s%libdir='\(.*\)'%\1%"`
if [ "`ls ${libdir}/libGL.so* 2>/dev/null`" ] ; then
fi
done
# then search libGL.so* file
-for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do
+for d in ${libdirs} ; do
if [ "`ls ${d}/libGL.so* 2>/dev/null`" ] ; then
echo "${d}"
return 0
return 1
}
+where_libgl_so(){
+local libdirs="/usr/X11R6/lib64 /usr/lib64 /usr/lib/`uname -m`-linux-gnu /usr/X11R6/lib /usr/lib"
+local d
+for d in ${libdirs} ; do
+ if [ -f ${d}/libGL.so ] ; then
+ echo ${d}/libGL.so
+ return 0
+ fi
+done
+echo ""
+return 1
+}
+
fix_gl_libs(){
local gllibdir="`where_gl_libs`"
if [ "${gllibdir}" != "" ] ; then
if [ "${SCOTCH_ROOT_DIR}" != "" ] ; then
sed -i "s%\([^/]*\)[^; ]*/scotch-[0-9.]\+%\1${SCOTCH_ROOT_DIR}%g" $1
fi
+ local libglso=`where_libgl_so`
local sm
local smvar
for sm in LIBBATCH SIMANIO KERNEL GUI GEOM MED SMESH PARAVIS YACS HEXABLOCK HOMARD JOBMANAGER \
if [ "${!smvar}" != "" ] ; then
sed -i "s%\([; \"]\)/[^; \"]\+/${sm}\([; \"/]\)%\1${!smvar}\2%g" $1
fi
+ grep libGL.so $1 > /dev/null && sed -i "s%\([; \"]\)/[^; \"]\+/libGL.so[0-9.]*%\1${libglso}%g" $1
done
}