From 2f4ac7d3f7290c1036e378bbc7609c5dadb40e33 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 25 Dec 2013 07:57:12 +0000 Subject: [PATCH] Fix pb with libGL.so libraries --- config_files/common.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/config_files/common.sh b/config_files/common.sh index 9f7bb6d..02493b7 100755 --- a/config_files/common.sh +++ b/config_files/common.sh @@ -609,8 +609,10 @@ return 1 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 @@ -620,7 +622,7 @@ for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do 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 @@ -630,7 +632,7 @@ for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do 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 @@ -640,6 +642,19 @@ echo "" 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 @@ -1042,6 +1057,7 @@ modif_cfg_file(){ 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 \ @@ -1051,5 +1067,6 @@ modif_cfg_file(){ 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 } -- 2.39.2