3 ####################################################################################
5 # Created : Thu Dec 18 12:01:00 2002
6 # Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
8 # Module : Installation Wizard
9 # Copyright : 2002-2014 CEA
11 # This script is the part of the SALOME installation procedure.
13 ####################################################################################
16 export SHRC="salome.sh"
17 export CSHRC="salome.csh"
18 export CFGRC="salome.cfg"
20 #####################################################
21 # !WARNING! This is current SALOME version number
22 ####################################################
23 export SALOME_VERSION="7.4.0"
24 export YACSGEN_VERSION=${SALOME_VERSION}
26 # Name of the single directory for SALOME modules
27 export SDIR_NAME="SALOME_${SALOME_VERSION}"
29 #this function takes one parameter - path to module source folder
30 check_salome_src_version(){
33 if [ -n "${root_dir}" ]; then
35 if [ ! -f ${root_dir}/${cfg_file} ] ; then
36 cfg_file=configure.in.base
38 cfg_file=CMakeLists.txt
40 if [ -f ${root_dir}/${cfg_file} ] ; then
41 if [ "${cfg_file}" = "CMakeLists.txt" ] ; then
42 ver_maj=`cat ${root_dir}/${cfg_file} | grep SET\(VERSION_MAJOR | sed -e "s%[A-Z_() ]%%g"`
43 ver_min=`cat ${root_dir}/${cfg_file} | grep SET\(VERSION_MINOR | sed -e "s%[A-Z_() ]%%g"`
44 ver_maintenance=`cat ${root_dir}/${cfg_file} | grep SET\(VERSION_MAINTENANCE | sed -e "s%[A-Z_() ]%%g"`
45 ver="${ver_maj}.${ver_min}.${ver_maintenance}"
47 ver=`grep -e "^AC_INIT" ${root_dir}/${cfg_file} | sed -e "s%.*\[\([[:digit:].]*\)\].*%\1%g"`
50 if [ "${ver}" = "${SALOME_VERSION}" ]; then
58 #this function takes several parameters
59 #first parameter contains descriptor of output file
60 #next parameters is command for execution
61 #in case of bad result of execution ask user about furher steps
62 #(user can cancel installation procedure)
68 if [ -n "${INSTALL_WORK}" ] ; then errfile=${INSTALL_WORK}/errlog; fi
70 if [ "${out}" != "1" ] ; then cmd="${cmd} >> ${out}" ; fi
72 if [ "${out}" != "1" ] ; then
73 $* >> ${out} 2>${errfile}
77 if [ "$?" -ne "0" ] ; then
78 if [ ${out} != "1" ] ; then
81 cat ${errfile} >> ${out}
83 # VSR : 10/11/05: disable answer mode ==>
85 #echo -e "NOT DONE !!! => $*"
86 #echo -n "Would you like to continue to install this product: (Y,N) [Y] : "
88 #rep=`echo ${rep} | tr "[A-Z]" "[a-z]"`
89 #if test -z ${rep} || [ ${rep} = "y" ] ; then
92 # VSR : 10/11/05: disable answer mode <==
98 #invoke check_job function
99 #all output will be put into terminal
109 rm -rf "$1" > /dev/null
113 #create environment for sh and csh
116 install_root=$1; shift
119 for i in ${SHRC} ${CSHRC} ${CFGRC} ; do
120 if [ -e ${install_work}/${i} ]; then
121 rm ${install_work}/${i}
123 touch ${install_work}/${i}
126 if [ $# -eq 4 ] ; then
128 product_env=${install_work}/env_${product_name}.sh
129 (test -e ${product_env} && rm ${product_env} )
132 ### !!! writing salome.sh file !!! -> define INST_ROOT
133 cat >> ${install_work}/${SHRC} <<EOF
134 #${DELIM} Setting products installation directory ${DELIM}
135 export INST_ROOT=${install_root}
137 #${DELIM} Environment switch: 0 for SALOME building, 1 for SALOME launching ${DELIM}
138 export ENV_FOR_LAUNCH=1
140 #${DELIM} Setting numeric locale ${DELIM}
145 ### !!! writing salome.csh file !!! -> set inital variables
146 pre_vars="PATH LD_LIBRARY_PATH LD_RUN_PATH PYTHONPATH TCLLIBPATH"
147 for i in ${pre_vars} ; do
148 cat >> ${install_work}/${CSHRC} <<EOF
149 #${DELIM} setting initial ${i} ${DELIM}
150 if (! (\$?${i}) ) then
157 ### !!! writing salome.cfs file !!! -> set inital variables
158 cat >> ${install_work}/${CFGRC} <<EOF
159 [SALOME Configuration]
163 ### !!! writing salome.(c)sh files !!! -> dump products environment files, changing 'export' by 'setenv(a|p)' where necessary
164 ### Note, that for performance reasons temporary environment files used during installation procedure itself
165 ### are created without using setenv(a|p) aliases.
167 # 0. add /usr/lib or /usr/lib64 dir to the LD_LIBRARY_PATH
168 #if test `uname -m` = "x86_64" ; then
169 #echo 'export LD_LIBRARY_PATH=/usr/lib64:${LD_LIBRARY_PATH}' >> ${install_work}/${SHRC} 2>/dev/null
170 #echo '' >> ${install_work}/${SHRC} 2>/dev/null
172 #echo 'export LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH}' >> ${install_work}/${SHRC} 2>/dev/null
173 #echo '' >> ${install_work}/${SHRC} 2>/dev/null
176 # 1. first dump all environment files into the ${SHRC} file
177 product_sequence="$2"
178 install_products="$3"
179 for i in ${product_sequence} ; do
180 env_file=${install_work}/env_${i}.sh
181 _env_file=${install_work}/_env_${i}.sh
182 if [ -e ${_env_file} ] ; then
183 cat ${_env_file} >> ${install_work}/${SHRC} 2>/dev/null
184 elif [ -e ${env_file} ] ; then
185 echo ${install_products} | grep -q "\b${i}\b"
186 if [ $? -eq 1 ] ; then
187 cat ${env_file} | sed 's/^/## /' >> ${install_work}/${SHRC} 2>/dev/null
189 cat ${env_file} >> ${install_work}/${SHRC} 2>/dev/null
194 # 2. writing global functions to _salome.sh file
195 cat >> ${install_work}/_${SHRC} <<EOF
196 ##########################################################################
197 # Functions exporta and exportp are used to append/prepend correspondingly
198 # one directory or a set of directories separated by semicolon symbol (':')
199 # to the environment variables like PATH, LD_LIBRARY_PATH, PYTHONPATH,
201 # The main purpose is to replace default setenv command behavior:
202 # exporta, exportp also remove duplicated entries, shortening in that way
203 # the environment variables.
204 # If some directory being added is already included into the variable
205 # nothing is done for it.
206 # Note, that these functions work some slower that setenv command itself.
209 # appends/prepends set of directories (second parameter)
210 # to the another set of directories (first parameter) and
211 # removes duplicated entries;
212 # the third parameter defines the mode: 0 - append, 1 - prepend
214 out_var=\`echo \$1 \$2 | awk -v dir=\$3 '{ \\
215 na = split(\$2,a,":"); \\
219 if(\$1 != "<empty>") { \\
220 nb = split(\$1,b,":"); \\
221 for(i=1;i<=nb;i++) { \\
222 if(!(b[i] in ccc) ) { \\
230 for(i=1;i<=na;i++) { \\
231 if(!(a[i] in ccc)) { \\
238 for(i=1;i<k2;i++) { \\
241 for(i=1;i<k1;i++) { \\
246 for(i=1;i<k1;i++) { \\
249 for(i=1;i<k2;i++) { \\
253 }' | sed -e 's/\(.*\):/\1/g'\`
257 # appends directory or set of directories, separated by ':' (second parameter)
258 # to the variable (first parameter)
261 if [ -z "\${xenv}" ]; then xenv="<empty>"; fi
262 out_var=\`cleandup \${xenv} \$2 0\`
263 export \$1=\${out_var}
266 # prepends directory or set of directories, separated by ':' (second parameter)
267 # to the variable (first parameter)
270 if [ -z "\${xenv}" ]; then xenv="<empty>"; fi
271 out_var=\`cleandup \${xenv} \$2 1\`
272 export \$1=\${out_var}
274 ###########################################################################
278 # 3. writing global functions to _salome.csh file
279 cat >> ${install_work}/_${CSHRC} <<EOF
281 ###########################################################################
282 # Aliases setenva and setenvp are used to append/prepend correspondingly
283 # one directory or a set of directories separated by semicolon symbol (':')
284 # to the environment variables like PATH, LD_LIBRARY_PATH, PYTHONPATH,
286 # The main purpose is to replace default setenv command behavior:
287 # setenva, setenvp also remove duplicated entries, shortening in that way
288 # the environment variables.
289 # If some directory being added is already included into the variable
290 # nothing is done for it.
291 # Note, that these aliases work some slower that setenv command itself.
294 # appends/prepends set of directories (second parameter)
295 # to the another set of directories (first parameter) and
296 # removes duplicated entries;
297 # the third parameter defines the mode: 0 - append, 1 - prepend
298 alias cleandup "echo \!:1 \!:2 | awk -v dir=\!:3 \\\\
299 '"'{ na = split(\$2,a,":"); \\\\
303 if(\$1 != "<empty>") { \\\\
304 nb = split(\$1,b,":"); \\\\
305 for(i=1;i<=nb;i++) { \\\\
306 if(!(b[i] in ccc) ) { \\\\
314 for(i=1;i<=na;i++) { \\\\
315 if(!(a[i] in ccc)) { \\\\
322 for(i=1;i<k2;i++) { \\\\
325 for(i=1;i<k1;i++) { \\\\
330 for(i=1;i<k1;i++) { \\\\
333 for(i=1;i<k2;i++) { \\\\
337 }'"' | sed -e 's/\(.*\):/\1/g'"
339 # appends directory or set of directories, separated by ':' (second parameter)
340 # to the variable (first parameter)
341 alias setenva 'set a=\!:1 ; set b=\!:2 ; \\
342 set c=\`printenv \${a}\` ; \\
343 set b=\`cleandup \${c} \${b} 0\` ; \\
344 setenv \${a} \${b} ; \\
348 # prepends directory or set of directories, separated by ':' (second parameter)
349 # to the variable (first parameter)
350 alias setenvp 'set a=\!:1 ; set b=\!:2 ; \\
351 set c=\`printenv \${a}\` ; \\
352 set b=\`cleandup \${c} \${b} 1\` ; \\
353 setenv \${a} \${b} ; \\
355 ###########################################################################
358 cat ${install_work}/${CSHRC} >> ${install_work}/_${CSHRC}
360 # 4. put the contents of salome.sh to _salome.sh replacing export by export(a|p) aliases where necessary
361 sed -e 's%export\([[:blank:]]*\)PATH=\$[{]\?PATH[}]\?:\(.*\)%exporta\1PATH \2%g' -e 's%export\([[:blank:]]*\)PATH=\(.*\):\$[{]\?PATH[}]\?%exportp\1PATH \2%g' ${install_work}/${SHRC} > ${INSTALL_WORK}/_tmp1 2>/dev/null
362 sed -e 's%export\([[:blank:]]*\)LD_LIBRARY_PATH=\$[{]\?LD_LIBRARY_PATH[}]\?:\(.*\)%exporta\1LD_LIBRARY_PATH \2%g' -e 's%export\([[:blank:]]*\)LD_LIBRARY_PATH=\(.*\):\$[{]\?LD_LIBRARY_PATH[}]\?%exportp\1LD_LIBRARY_PATH \2%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2 2>/dev/null
363 sed -e 's%export\([[:blank:]]*\)PYTHONPATH=\$[{]\?PYTHONPATH[}]\?:\(.*\)%exporta\1PYTHONPATH \2%g' -e 's%export\([[:blank:]]*\)PYTHONPATH=\(.*\):\$[{]\?PYTHONPATH[}]\?%exportp\1PYTHONPATH \2%g' ${INSTALL_WORK}/_tmp2 > ${INSTALL_WORK}/_tmp1 2>/dev/null
364 sed -e 's%export\([[:blank:]]*\)LD_RUN_PATH=\$[{]\?LD_RUN_PATH[}]\?:\(.*\)%exporta\1LD_RUN_PATH \2%g' -e 's%export\([[:blank:]]*\)LD_RUN_PATH=\(.*\):\$[{]\?LD_RUN_PATH[}]\?%exportp\1LD_RUN_PATH \2%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2
366 cat ${INSTALL_WORK}/_tmp2 >> ${install_work}/_${SHRC}
368 # 5. Create a salome.csh file from salome.sh by replacing export by setenv, etc.
369 sed -e 's%export \([[:alnum:]_[:blank:]]*\)\=%setenv \1 %g' ${install_work}/${SHRC} > ${INSTALL_WORK}/_tmp1 2>/dev/null
370 cat ${INSTALL_WORK}/_tmp1 >> ${install_work}/${CSHRC}
372 # 6. Create a _salome.csh file from _salome.sh by replacing export by setenv, exporta by setenva, etc.
373 sed -e 's%export \([[:alnum:]_[:blank:]]*\)\=%setenv \1 %g' ${INSTALL_WORK}/_tmp2 > ${INSTALL_WORK}/_tmp1 2>/dev/null
374 sed -e 's%exporta \([[:alnum:]_[:blank:]]*\)%setenva \1%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2 2>/dev/null
375 sed -e 's%exportp \([[:alnum:]_[:blank:]]*\)%setenvp \1%g' ${INSTALL_WORK}/_tmp2 > ${INSTALL_WORK}/_tmp1 2>/dev/null
376 sed -e 's%if \[ -n "\${PYTHONPATH}" \] ; then%if ( ${?PYTHONPATH} ) then%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2 2>/dev/null
377 sed -e 's%if \[ -n "\${ENV_FOR_LAUNCH}" \] ; then%if ( ${?ENV_FOR_LAUNCH} ) then%g' ${INSTALL_WORK}/_tmp2 > ${INSTALL_WORK}/_tmp1 2>/dev/null
378 sed -e 's%if \[ "\${ENV_FOR_LAUNCH}" =\?= "1" \] ; then%if ( "\${ENV_FOR_LAUNCH}" == "1" ) then%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2 2>/dev/null
379 sed -e 's%^\([[:blank:]]*\)fi\([[:blank:]]*\)$%\1endif\2%g' ${INSTALL_WORK}/_tmp2 > ${INSTALL_WORK}/_tmp1 2>/dev/null
380 sed -e 's%var.sh%var.csh%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2 2>/dev/null
381 sed -e 's%if \[ -e "\${LICENSE_FILE}" \] ; then%if ( -e ${LICENSE_FILE} ) then%g' ${INSTALL_WORK}/_tmp2 > ${INSTALL_WORK}/_tmp1 2>/dev/null
383 cat ${INSTALL_WORK}/_tmp1 >> ${install_work}/_${CSHRC} 2>/dev/null
385 rm -f ${INSTALL_WORK}/_tmp1 ${INSTALL_WORK}/_tmp2
387 # 7. Create a salome.cfg file from salome.sh
388 cat ${install_work}/${SHRC} | grep -v -e "^## " | grep -v "PV_PLUGIN_PATH" | awk 'BEGIN {v=1} /if / {v=0;} /fi/ {v=1;} {if (match($0, "KERNEL")) exit 0; else if(v==1 && match($0, "^ *fi *$")==0) print $0;}' >> ${install_work}/${CFGRC}
389 sed -i "s%export PATH=\(.*\):\${\?PATH}\?%ADD_TO_PATH: \1%g" ${install_work}/${CFGRC}
390 sed -i "s%export LD_LIBRARY_PATH=\(.*\):\${\?LD_LIBRARY_PATH}\?%ADD_TO_LD_LIBRARY_PATH: \1%g" ${install_work}/${CFGRC}
391 sed -i "s%export PYTHONPATH=\(.*\):\${\?PYTHONPATH}\?%ADD_TO_PYTHONPATH: \1%g" ${install_work}/${CFGRC}
392 sed -i "s%export %%g" ${install_work}/${CFGRC}
393 sed -i "s%INST_ROOT%ROOT_SALOME%g" ${install_work}/${CFGRC}
394 sed -i "s%\${\?\([A-Za-z0-9_]\+\)}\?%\%(\1)s%g" ${install_work}/${CFGRC}
396 if [ $# -eq 5 ] ; then
398 if [ -d ${product_dir} ] ; then
399 test -e ${product_dir}/${SHRC} && mv ${product_dir}/${SHRC} ${product_dir}/${SHRC}_`date +%F_%T`
400 cp ${install_work}/_${SHRC} ${product_dir}/${SHRC}
401 test -e ${product_dir}/${CSHRC} && mv ${product_dir}/${CSHRC} ${product_dir}/${CSHRC}_`date +%F_%T`
402 cp ${install_work}/_${CSHRC} ${product_dir}/${CSHRC}
403 test -e ${product_dir}/${CFGRC} && mv ${product_dir}/${CFGRC} ${product_dir}/${CFGRC}_`date +%F_%T`
404 cp ${install_work}/${CFGRC} ${product_dir}/${CFGRC}
407 sed -e 's%setenv ENV_FOR_LAUNCH 1%setenv ENV_FOR_LAUNCH 0%' ${install_work}/_${CSHRC} > ${install_root}/env_build.csh
408 sed -e 's%export ENV_FOR_LAUNCH=1%export ENV_FOR_LAUNCH=0%' ${install_work}/_${SHRC} > ${install_root}/env_build.sh
410 cp -f ${install_work}/_${CSHRC} ${install_root}/env_products.csh
411 cp -f ${install_work}/_${SHRC} ${install_root}/env_products.sh
413 rm -f ${install_work}/_${SHRC} ${install_work}/_${CSHRC}
415 ### !!! copying build.csh and build.sh scripts
416 if [ -e ./build.csh ] && [ ! -e ${install_root}/build.csh ]; then
417 cp -f ./build.csh ${install_root}
419 if [ -e ./build.sh ] && [ ! -e ${install_root}/build.sh ]; then
420 cp -f ./build.sh ${install_root}
423 ### !!! copying release notes
424 for p in `ls ../` ; do
425 export pdf=`echo ${p} | sed s/[.]/" "/g | awk '{print $2}'`
426 if [ "${pdf}" = "pdf" ]; then
428 if [ ! -e ${install_root}/${RN} ]; then
429 cp -f ../${RN} ${install_root}
436 #try use already existing product
439 product_dir=$1; install_root=$2; install_work=$3;
440 product_sequence="$4"; installed_products="$5"; product_type=$6
441 env_file=${product_dir}/env_${product_type}.sh
442 if [ -f ${env_file} ] ; then
443 cp -f ${env_file} ${install_work}/_env_${product_type}.sh
444 make_env ${install_root} ${install_work} "${product_sequence}" "${installed_products}"
445 source ${install_work}/${SHRC}
447 if [ $? -eq 0 ] ; then
451 echo ${product_type} | grep -q '_src$'
452 if [ $? -eq 1 ] ; then
460 #check existance of lib passed as first parameter
461 #return 0 if lib exists
462 #if you pass second parameter search will be done in it
463 #otherwise search will be done in ${LD_LIBRARY_PATH}
464 #you should use : as dilimeter if you are going to pass second parameter
469 whereIs=${LD_LIBRARY_PATH}
471 for d in `echo ${whereIs} | sed -e"s%:% %g"` ; do
472 ret=`find ${d} -name $1 2>/dev/null`
473 if [ -n "${ret}" ] ; then
474 #echo "The $1 exists on yours system in a ${d} folder"
484 for i in `echo ${path} | sed -e"s%:% %g"` ; do
485 ret=`find ${i} -name ${file} -maxdepth 1 2>/dev/null`
486 if [ -n "${ret}" ] ; then
487 ret=`echo ${ret} | sed -e"s%/\${file}$%%g"`
496 arg1=$1; val1=$2; arg2=$3; val2=$4
497 tmp="^${val1}$|^${val1}:|:${val1}$|:${val1}:"
498 #echo ${val2} | grep -E "${tmp}" >/dev/null 2>&1
499 #if [ $? -eq 0 ] ; then
504 exclude_list="usr lib bin sbin etc"
505 for i in ${exclude_list} ; do
506 tmp="^/${i}/|^/${i}\$"
507 echo ${val1} | grep -E "${tmp}" >/dev/null 2>&1
508 if [ "$?" = "0" ] ; then to_tail=0; break; fi
510 if [ ${to_tail} -eq 0 ] ; then
519 maj_ver=`echo $1 | awk -F. '{if(NF>0) print $1; else print 0}'`
520 min_ver=`echo $1 | awk -F. '{if(NF>1) print $2; else print 0}'`
521 rel_ver=`echo $1 | awk -F. '{if(NF>2) print $3; else print 0}'`
522 let ver=${maj_ver}*10000+${min_ver}*100+${rel_ver}
525 for i in `echo ${PATH}:/usr/bin:/usr/local/bin | sed -e"s%:% %g"` ; do
526 ret=`find ${i} -name gcc -maxdepth 1 2>/dev/null`
527 if [ -n "${ret}" ] ; then
528 maj_ver=`${ret} -dumpversion | awk -F. '{if(NF>0) print $1; else print 0}'`
529 min_ver=`${ret} -dumpversion | awk -F. '{if(NF>1) print $2; else print 0}'`
530 rel_ver=`${ret} -dumpversion | awk -F. '{if(NF>2) print $3; else print 0}'`
531 let ver1=${maj_ver}*10000+${min_ver}*100+${rel_ver}
532 if [ ${ver1} -eq ${ver} ] ; then
533 ret=`echo ${ret} | sed -e"s%/gcc$%%g"`
537 if [ ${ver1} -gt ${ver} ] && [ ${ver1} -gt ${newerver} ] ; then
539 newer=`echo ${ret} | sed -e"s%/gcc$%%g"`
543 if [ -n "${newer}" ] ; then
551 if test -z "${TCLHOME}"; then
554 tclcfg=`find ${TCLHOME}/lib -name "tclConfig.sh" 2> /dev/null`
557 for f in ${tclcfg} ; do
558 ver=`cat ${f} | grep -e "TCL_VERSION=.*" | sed -e "s%TCL_VERSION=[\'|\"]\(.*\)[\'|\"]%\1%g" | awk -F. '{x=0;for(i=1;i<=3;i++){x=x*100;if(i<=NF)x+=$i;}print x;}'`
559 if [ ${maxver} -lt ${ver} ]; then
564 if test -n "${file}"; then
565 echo `dirname ${file}`
574 if test -z "${TCLHOME}"; then
577 tclcfg=`find ${TCLHOME}/lib -name "tkConfig.sh" 2> /dev/null`
580 for f in ${tclcfg} ; do
581 ver=`cat ${f} | grep -e "TK_VERSION=.*" | sed -e "s%TK_VERSION=[\'|\"]\(.*\)[\'|\"]%\1%g" | awk -F. '{x=0;for(i=1;i<=3;i++){x=x*100;if(i<=NF)x+=$i;}print x;}'`
582 if [ ${maxver} -lt ${ver} ]; then
587 if test -n "${file}"; then
588 echo `dirname ${file}`
597 if test -f /usr/X11R6/include/DPS/dpsconfig.h ; then
601 if test -f /usr/include/DPS/dpsconfig.h ; then
610 for d in /usr/X11R6/include /usr/include ; do
611 if [ -d ${d}/GL ] && [ -f ${d}/GL/gl.h ] ; then
623 local libdirs="/usr/X11R6/lib64 /usr/lib64 /usr/lib/`uname -m`-linux-gnu /usr/X11R6/lib /usr/lib"
625 # search libGL.so* file and correct libGL.la in the same directory
626 for d in ${libdirs} ; do
627 if [ "`ls ${d}/libGL.so* 2>/dev/null`" ] && [ -f ${d}/libGL.la ]; then
628 libdir=`grep "libdir=" ${d}/libGL.la | sed -e "s%libdir='\(.*\)'%\1%" -e "s%/*$%%g"`
629 if [ "${libdir}" = "${d}" ] ; then
635 # search libGL.la file and check if this file is correct
636 for d in ${libdirs} ; do
637 if [ -f ${d}/libGL.la ] ; then
638 libdir=`grep "libdir=" ${d}/libGL.la | sed -e "s%libdir='\(.*\)'%\1%"`
639 if [ "`ls ${libdir}/libGL.so* 2>/dev/null`" ] ; then
645 # then search libGL.so* file
646 for d in ${libdirs} ; do
647 if [ "`ls ${d}/libGL.so* 2>/dev/null`" ] ; then
657 local libdirs="/usr/X11R6/lib64 /usr/lib64 /usr/lib/`uname -m`-linux-gnu /usr/X11R6/lib /usr/lib"
659 for d in ${libdirs} ; do
660 if [ -f ${d}/libGL.so ] ; then
670 local gllibdir="`where_gl_libs`"
671 if [ "${gllibdir}" != "" ] ; then
672 #VSR: 02/04/2013 - next block is commented as it seems to be wrong :( libGL.la should not be ever mentioned
673 # if [ -f ${gllibdir}/libGL.la ] ; then
674 # libdir=`grep "libdir=" ${gllibdir}/libGL.la | sed -e "s%libdir='\(.*\)'%\1%"`
675 # if [ "`ls ${libdir}/libGL.so* 2>/dev/null`" ] ; then
676 # str_to_replace="${gllibdir}/libGL.la"
679 if [ "${str_to_replace}" = "" ] ; then
680 str_to_replace="-L${gllibdir} -lGL"
683 la_files=`find . -name "*.la"`
684 for la_file in ${la_files} XXX ; do
685 if [ "${la_file}" = "XXX" ] ; then continue; fi
686 grep -e "libGL.la" ${la_file} >& /dev/null || grep -e "-lGL\b" ${la_file} >& /dev/null && \
687 sed -e "s%-lGL\b%%g" \
688 -e "s%[^[:space:]']*libGL.la[[:space:]]%%g" \
689 -e "s%^dependency_libs='\(.*\)%dependency_libs='${str_to_replace} \1%" \
690 ${la_file} > ${la_file}.new && \
691 mv -f ${la_file}.new ${la_file}
697 # function: workaround on some platforms to use latest available version of gcc (e.g. gcc44 on CentOS 5.5)
701 local gcc_ver=`gcc -dumpversion | awk -F. '{a1=0;a2=0;a3=0;if(NF>0)a1=$1;if(NF>1)a2=$2;if(NF>2)a3=$3;printf("%02d%02d%02d",a1,a2,a3);}'`
704 if [ ${gcc_ver} -le ${gcc_min} ] ; then
705 local wheregcc=$(dirname `which gcc`)
706 local all_gcc=$(find ${wheregcc}/gcc*)
709 for gcc_alt in ${all_gcc} XXX ; do
710 if [ ${gcc_alt} = "XXX" ] ; then continue ; fi
711 gcc_ver=`${gcc_alt} -dumpversion 2>/dev/null | awk -F. '{a1=0;a2=0;a3=0;if(NF>0)a1=$1;if(NF>1)a2=$2;if(NF>2)a3=$3;printf("%02d%02d%02d",a1,a2,a3);}'`
712 if [ "${gcc_ver}" = "" ] ; then continue ; fi
713 if [ ${gcc_ver} -gt ${gcc_min} ] && [ ${gcc_ver} -gt ${gcc_max} ] ; then
716 gxx_found=`echo ${gcc_found} | sed -e "s%gcc%g++%"`
719 if [ "${gcc_found}" != "" ] ; then
720 echo "CC=${gcc_found} CXX=${gxx_found}"
729 if [ -z "${ldir}" ] || [ ! -d "${ldir}" ]; then return 1; fi
733 SALOME_MODULES="`env | awk -F_ '/[a-zA-Z0-9]*_ROOT_DIR/ { print $1 }'`"
737 la_files=`find . -name "*.la"`
740 netgendir=${NETGEN_ROOT_DIR}
742 freetypedir=${FREETYPE_ROOT_DIR}
744 ftgldir=${FTGL_ROOT_DIR}
746 gl2psdir=${GL2PS_ROOT_DIR}
748 freeimagedir=${FREEIMAGE_ROOT_DIR}
750 tbbbasedir=${TBB_ROOT_DIR}
751 TBBKERNEL='cc4.1.0_libc2.4_kernel2.6.16.21'
752 if test `uname -m` = "x86_64" ; then
753 export TBBMODE="intel64/${TBBKERNEL}"
755 export TBBMODE="ia32/${TBBKERNEL}"
757 tbbdir=${tbbbasedir}/lib/${TBBMODE}
759 cgnslibdir=${CGNS_ROOT_DIR}
761 casdir=${CAS_ROOT_DIR}/lib
762 if [ ! -d ${casdir} ] ; then casdir=${CAS_ROOT_DIR}/Linux/lib ; fi
763 if [ ! -d ${casdir} ] ; then casdir=${CAS_ROOT_DIR}/lin/lib ; fi
765 omnidir=${OMNIORB_ROOT_DIR}/lib
768 if [ `uname -m` = "x86_64" ] && [ -d ${vtkpath}/lib64 ] ; then
770 elif [ -d ${vtkpath}/lib ] ; then
775 vtkldir=${vtkpath}/lib${LIB_PREFIX}
776 vtkdir=${vtkldir}/vtk-5.0
778 hdfdir=${HDF5_ROOT_DIR}/lib
780 meddir=${MEDFILE_ROOT_DIR}/lib
782 qwtdir=`find_in_path libqwt.so ${LD_LIBRARY_PATH}`
784 where_python=`which python` # e.g. /usr/bin/python
785 if [ -n "${where_python}" ] ; then
786 where_python=`dirname ${where_python}` # --> /usr/bin
787 where_python=`dirname ${where_python}` # --> /usr
788 python_version=`python -c "import sys; print sys.version[:3]"`
789 pythondir=${where_python}/lib/python${python_version}
792 sipdir=`find_in_path sip.so ${LD_LIBRARY_PATH}`
794 pyqtdir=`find_in_path Qt.so ${LD_LIBRARY_PATH}`
796 tcldir=${TCLHOME}/lib
798 boostdir=${BOOST_ROOT_DIR}/lib
800 blsurfdir=${BLSURFHOME}/lib
802 libxmldir=${LIBXML2_ROOT_DIR}/lib
804 metisdir=${METIS_ROOT_DIR}
806 scotchbindir=${SCOTCH_ROOT_DIR}/bin
807 scotchlibdir=${SCOTCH_ROOT_DIR}/lib
809 if test `uname -m` = "x86_64" ; then
810 libGLpath=/usr/lib64/libGL.la
812 libGLpath=/usr/lib/libGL.la
815 graphvizdir=${GRAPHVIZ_ROOT_DIR}/lib
817 qscintilladir=${QSCINTILLA_ROOT_DIR}/lib
819 expatdir=${EXPAT_ROOT_DIR}/lib
821 paraviewdir=${PARAVIEW_ROOT_DIR}/lib
823 qtdir=${QT4_ROOT_DIR}/lib
824 # distene meshgems dir
825 if test `uname -m` = "x86_64" ; then
826 mgemsdir=${MESHGEMS_ROOT_DIR}/lib/Linux_64
828 mgemsdir=${MESHGEMS_ROOT_DIR}/lib/Linux
831 for l in X ${la_files}; do
833 if [ "${l}" != "X" ] ; then
838 # . process salome modules dependencies
839 for mod in ${SALOME_MODULES} ; do
840 moddir=${mod}_ROOT_DIR
842 if [ -n "${moddir}" ] ; then
843 sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*${mod}[1]\?/lib% \1${moddir}/lib%g" \
844 -e "s%[[:space:]]\(-L\)\?[^[:space:]]*${mod}WOGUI[1]\?/lib% \1${moddir}/lib%g" \
845 -e "s%^libdir='[^[:space:]]*${mod}[1]\?/\(lib.*\)'%libdir='${moddir}/\1'%g" \
846 -e "s%^libdir='[^[:space:]]*${mod}WOGUI[1]\?/\(lib.*\)'%libdir='${moddir}/\1'%g" ${l} > ${l}"_"
851 # . process netgen dependencies
852 if [ -n "${netgendir}" ] && [ -d "${netgendir}" ] ; then
853 sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*netgen-[0-9.]\+/lib% \1${netgendir}/lib%g" ${l}
856 # . process freetype dependencies
857 if [ -n "${freetypedir}" ] && [ -d "${freetypedir}" ] ; then
858 sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*freetype-[0-9.]\+/lib% \1${freetypedir}/lib%g" ${l}
861 # . process ftgl dependencies
862 if [ -n "${ftgldir}" ] && [ -d "${ftgldir}" ] ; then
863 sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*ftgl-[0-9.]\+/lib% \1${ftgldir}/lib%g" ${l}
866 # . process gl2ps dependencies
867 if [ -n "${gl2psdir}" ] && [ -d "${gl2psdir}" ] ; then
868 sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*gl2ps-[0-9.]\+/lib% \1${gl2psdir}/lib%g" ${l}
871 # . process freeimage dependencies
872 if [ -n "${freeimagedir}" ] && [ -d "${freeimagedir}" ] ; then
873 sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*freeimage-[0-9.]\+/lib% \1${freeimagedir}/lib%g" ${l}
876 # . process tbb dependencies
877 if [ -n "${tbbdir}" ] && [ -d "${tbbdir}" ] ; then
878 sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*tbb[^[:space:]]*/lib[^[:space:]]*% \1${tbbdir}%g" ${l}
881 # . process cgns dependencies
882 if [ -n "${cgnslibdir}" ] && [ -d "${cgnslibdir}" ] ; then
883 sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*cgnslib-[0-9.]\+/lib% \1${cgnslibdir}/lib%g" ${l}
886 # . process CAS.CADE dependencies
887 if [ -n "${CAS_ROOT_DIR}" ] && [ -d "${casdir}" ] ; then
888 sed -e "s%-L[^[:space:]]*OCCT[^[:space:]]*/install/lib%-L${casdir}%g" \
889 -e "s%[^[:space:]]*OCCT[^[:space:]]*/install/lib/%${casdir}/%g" \
890 -e "s%[[:space:]]-L[^[:space:]]*\(OCCT\|CAS\)[^[:space:]]*/lib\?% -L${CAS_ROOT_DIR}/lib%g" \
891 -e "s%[[:space:]][^[:space:]]*\(OCCT\|CAS\)[^[:space:]]*/lib/lib\?% ${CAS_ROOT_DIR}/lib/lib%g" ${l} > ${l}"_"
895 # . process omniORB dependencies
896 if [ -n "${OMNIORB_ROOT_DIR}" ] && [ -d "${omnidir}" ] ; then
897 sed -i "s%-L[^[:space:]]*omni[^[:space:]]*%-L${omnidir}%g;s%-R[^[:space:]]*omni[^[:space:]]*%-R${omnidir}%g" ${l}
900 # . process VTK dependencies
901 if [ -n "${VTK_DIR}" ] && [ -d "${vtkdir}" ] && [ -d "${vtkldir}" ] ; then
902 sed -i "s%-L[^[:space:]]*VTK[^[:space:]]*/\(lib\|lib64\)/vtk\-5\.0%-L${vtkdir}%g;s%-L[^[:space:]]*VTK[^[:space:]]*/\(lib\|lib64\)%-L${vtkldir}%g" ${l}
905 # . process HDF dependencies
906 if [ -n "${HDF5_ROOT_DIR}" ] && [ -d "${hdfdir}" ] ; then
907 sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*hdf[^[:space:]/]*/lib% \1${hdfdir}%g" ${l}
910 # . process MED dependencies
911 if [ -n "${MEDFILE_ROOT_DIR}" ] && [ -d "${meddir}" ] ; then
912 sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*med[^[:space:]/]*/lib% \1${meddir}%g" ${l}
915 # . process qwt dependencies
916 if [ -n "${qwtdir}" ] && [ -d "${qwtdir}" ] ; then
917 sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*qwt[^[:space:]/]*/lib% \1${qwtdir}%g" ${l}
920 # . process qt dependencies
921 if [ -n "${QT4_ROOT_DIR}" ] && [ -d "${qtdir}" ] ; then
922 sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*qt[^[:space:]/]*/lib% \1${qtdir}%g" ${l}
925 # . process python dependencies
926 if [ -n "${pythondir}" ] && [ -d "${pythondir}" ] ; then
927 sed -i "s%-L[^[:space:]]*python[0-9]\.[0-9]\([^[:space:]]*\)%-L${pythondir}\1%g" ${l}
930 # . process sip dependencies
931 if [ -n "${sipdir}" ] && [ -d "${sipdir}" ] ; then
932 sed -i "s%-L[^[:space:]]*sip[^[:space:]]*%-L${sipdir}%g" ${l}
935 # . process PyQt dependencies
936 if [ -n "${pyqtdir}" ] && [ -d "${pyqtdir}" ] ; then
937 sed -i "s%-L[^[:space:]]*PyQt[^[:space:]]*%-L${pyqtdir}%g" ${l}
940 # . process tcl/tk dependencies
941 if [ -n "${tcldir}" ] && [ -d "${tcldir}" ] ; then
942 sed -i "s%-L[^[:space:]]*tcltk[^[:space:]]*/lib%-L${tcldir}%g" ${l}
945 # . process boost dependencies
946 if [ -n "${boostdir}" ] && [ -d "${boostdir}" ] ; then
947 sed -i "s%-L[^[:space:]]*boost[^[:space:]]*/lib%-L${boostdir}%g" ${l}
950 # . process blsurf dependencies
951 if [ -n "${blsurfdir}" ] && [ -d "${blsurfdir}" ] ; then
952 sed -i "s%-L[^[:space:]]*BLSurf[^[:space:]]*/lib%-L${blsurfdir}%g" ${l}
955 # . process libxml dependencies
956 if [ -n "${libxmldir}" ] && [ -d "${libxmldir}" ] ; then
957 sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*libxml2-[0-9]\.[0-9]\.[0-9]/lib% \1${libxmldir}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*libxml2/lib% \1${libxmldir}%g" ${l}
960 # . process metis dependencies
961 if [ -n "${metisdir}" ] && [ -d "${metisdir}" ] ; then
962 sed -i "s%-L[^[:space:]]*metis[^[:space:]]*%-L${metisdir}%g" ${l}
965 # . process scotch dependencies
966 if [ -n "${scotchbindir}" ] && [ -d "${scotchbindir}" ] ; then
967 sed -i "s%-L[^[:space:]]*scotch[^[:space:]]*/bin%-L${scotchbindir}%g" ${l}
969 if [ -n "${scotchlibdir}" ] && [ -d "${scotchlibdir}" ] ; then
970 sed -i "s%-L[^[:space:]]*scotch[^[:space:]]*/lib%-L${scotchlibdir}%g" ${l}
973 # . process libGL.la dependencies
974 sed -i "s%${libGLpath}%""%g" ${l}
976 # . process graphviz dependencies
977 if [ -n "${graphvizdir}" ] && [ -d "${graphvizdir}" ] ; then
978 sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*graphviz-[0-9]\.[0-9]\+\.[0-9]/lib% \1${graphvizdir}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*graphviz/lib% \1${graphvizdir}%g" ${l}
981 # . process QScintilla dependencies
982 if [ -n "${qscintilladir}" ] && [ -d "${qscintilladir}" ] ; then
983 sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*QScintilla-[0-9]\.[0-9]\(\.[0-9]\)\?/lib% \1${qscintilladir}%g" ${l}
986 # . process expat-2.0.1 dependencies
987 if [ -n "${expatdir}" ] && [ -d "${expatdir}" ] ; then
988 sed -i "s%-L[^[:space:]]*expat[^[:space:]]*/lib%-L${expatdir}%g;s%[^[:space:]]*expat[^[:space:]]*/lib/libexpat.la%-lexpat%g" ${l}
991 # . process ParaView dependencies
992 if [ -n "${paraviewdir}" ] && [ -d "${paraviewdir}" ] ; then
993 sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*ParaView-[0-9]\.[0-9]\+\.[0-9]/lib% \1${paraviewdir}%g" ${l}
996 # . process DISTENE MeshGems dependencies
997 if [ -n "${mgemsdir}" ] && [ -d "${mgemsdir}" ] ; then
998 sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*MeshGems-[0-9.]\+/Products/lib/Linux\(_64\)\?% \1${mgemsdir}%g" ${l}
1010 if [ "${nf}" = "" ] || [ ! -e ${nf} ] ; then
1013 if [ "${PYTHON_ROOT_DIR}" != "" ] ; then
1014 sed -i "s%\([^/]*\)[^; ]*/Python-[0-9.]\+%\1${PYTHON_ROOT_DIR}%g" $1
1016 if [ "${SWIG_ROOT_DIR}" != "" ] ; then
1017 sed -i "s%\([^/]*\)[^; ]*/swig-[0-9.]\+%\1${SWIG_ROOT_DIR}%g" $1
1019 if [ "${OMNIORB_ROOT_DIR}" != "" ] ; then
1020 sed -i "s%\([^/]*\)[^; ]*/omniORB-[0-9.]\+%\1${OMNIORB_ROOT_DIR}%g" $1
1022 if [ "${HDF5_ROOT_DIR}" != "" ] ; then
1023 sed -i "s%\([^/]*\)[^; ]*/hdf5-[0-9.]\+%\1${HDF5_ROOT_DIR}%g" $1
1025 if [ "${BOOST_ROOT_DIR}" != "" ] ; then
1026 sed -i "s%\([^/]*\)[^; ]*/boost-[0-9.]\+%\1${BOOST_ROOT_DIR}%g" $1
1028 if [ "${MEDFILE_ROOT_DIR}" != "" ] ; then
1029 sed -i "s%\([^/]*\)[^; ]*/med-[0-9.]\+%\1${MEDFILE_ROOT_DIR}%g" $1
1031 if [ "${QT4_ROOT_DIR}" != "" ] ; then
1032 sed -i "s%\([^/]*\)[^; ]*/qt-[0-9.]\+%\1${QT4_ROOT_DIR}%g" $1
1034 if [ "${QWT_ROOT_DIR}" != "" ] ; then
1035 sed -i "s%\([^/]*\)[^; ]*/qwt-[0-9.]\+%\1${QWT_ROOT_DIR}%g" $1
1037 if [ "${SIP_ROOT_DIR}" != "" ] ; then
1038 sed -i "s%\([^/]*\)[^; ]*/sip-[0-9.]\+%\1${SIP_ROOT_DIR}%g" $1
1040 if [ "${PYQT4_ROOT_DIR}" != "" ] ; then
1041 sed -i "s%\([^/]*\)[^; ]*/PyQt-[0-9.]\+%\1${PYQT4_ROOT_DIR}%g" $1
1043 if [ "${QSCINTILLA_ROOT_DIR}" != "" ] ; then
1044 sed -i "s%\([^/]*\)[^; ]*/QScintilla-[0-9.]\+%\1${QSCINTILLA_ROOT_DIR}%g" $1
1046 if [ "${PARAVIEW_ROOT_DIR}" != "" ] ; then
1047 sed -i "s%\([^/]*\)[^; ]*/ParaView-[0-9.]\+%\1${PARAVIEW_ROOT_DIR}%g" $1
1049 if [ "${LIBXML2_ROOT_DIR}" != "" ] ; then
1050 sed -i "s%\([^/]*\)[^; ]*/libxml2-[0-9.]\+%\1${LIBXML2_ROOT_DIR}%g" $1
1052 if [ "${EXPAT_ROOT_DIR}" != "" ] ; then
1053 sed -i "s%\([^/]*\)[^; ]*/expat-[0-9.]\+%\1${EXPAT_ROOT_DIR}%g" $1
1055 if [ "${FREETYPE_ROOT_DIR}" != "" ] ; then
1056 sed -i "s%\([^/]*\)[^; ]*/freetype-[0-9.]\+%\1${FREETYPE_ROOT_DIR}%g" $1
1058 if [ "${FREEIMAGE_ROOT_DIR}" != "" ] ; then
1059 sed -i "s%\([^/]*\)[^; ]*/freeimage-[0-9.]\+%\1${FREEIMAGE_ROOT_DIR}%g" $1
1061 if [ "${GL2PS_ROOT_DIR}" != "" ] ; then
1062 sed -i "s%\([^/]*\)[^; ]*/gl2ps-[0-9.]\+%\1${GL2PS_ROOT_DIR}%g" $1
1064 if [ "${TBB_ROOT_DIR}" != "" ] ; then
1065 sed -i "s%\([^/]*\)[^; ]*/tbb[^/; \"]\+%\1${TBB_ROOT_DIR}%g" $1
1067 if [ "${CAS_ROOT_DIR}" != "" ] ; then
1068 sed -i "s%\([^/]*\)[^; ]*/OCCT[^/]*\(/[^ /;\"]*\)\?\(\"\|/inc\|/lib\)%\1${CAS_ROOT_DIR}\3%g" $1
1070 if [ "${NETGEN_ROOT_DIR}" != "" ] ; then
1071 sed -i "s%\([^/]*\)[^; ]*/netgen-[0-9.]\+%\1${NETGEN_ROOT_DIR}%g" $1
1073 if [ "${CGNS_ROOT_DIR}" != "" ] ; then
1074 sed -i "s%\([^/]*\)[^; ]*/cgnslib-[0-9.]\+%\1${CGNS_ROOT_DIR}%g" $1
1076 if [ "${NUMPY_ROOT_DIR}" != "" ] ; then
1077 sed -i "s%\([^/]*\)[^; ]*/numpy-[0-9.]\+%\1${NUMPY_ROOT_DIR}%g" $1
1079 if [ "${GRAPHVIZ_ROOT_DIR}" != "" ] ; then
1080 sed -i "s%\([^/]*\)[^; ]*/graphviz-[0-9.]\+%\1${GRAPHVIZ_ROOT_DIR}%g" $1
1082 if [ "${DOXYGEN_ROOT_DIR}" != "" ] ; then
1083 sed -i "s%\([^/]*\)[^; ]*/doxygen-[0-9.]\+%\1${DOXYGEN_ROOT_DIR}%g" $1
1085 if [ "${SPHINX_ROOT_DIR}" != "" ] ; then
1086 sed -i "s%\([^/]*\)[^; ]*/Sphinx-[0-9.]\+%\1${SPHINX_ROOT_DIR}%g" $1
1088 if [ "${WSO2_ROOT_DIR}" != "" ] ; then
1089 sed -i "s%\([^/]*\)[^; ]*/wso2-wsf-cpp-[0-9.]\+%\1${WSO2_ROOT_DIR}%g" $1
1091 if [ "${MESHGEMS_ROOT_DIR}" != "" ] ; then
1092 sed -i "s%\([^/]*\)[^; ]*/MeshGems-[0-9.]\+%\1${MESHGEMS_ROOT_DIR}%g" $1
1094 if [ "${METIS_ROOT_DIR}" != "" ] ; then
1095 sed -i "s%\([^/]*\)[^; ]*/metis-[0-9.]\+%\1${METIS_ROOT_DIR}%g" $1
1097 if [ "${SCOTCH_ROOT_DIR}" != "" ] ; then
1098 sed -i "s%\([^/]*\)[^; ]*/scotch-[0-9.]\+%\1${SCOTCH_ROOT_DIR}%g" $1
1100 local libglso=`where_libgl_so`
1103 for sm in LIBBATCH SIMANIO KERNEL GUI GEOM MED SMESH PARAVIS YACS HEXABLOCK HOMARD JOBMANAGER \
1104 NETGENPLUGIN BLSURFPLUGIN GHS3DPLUGIN GHS3DPRLPLUGIN HexoticPLUGIN HEXABLOCKPLUGIN \
1105 CALCULATOR PYCALCULATOR COMPONENT HELLO PYHELLO LIGHT PYLIGHT ATOMIC ATOMGEN ATOMSOLV RANDOMIZER SIERPINSKY ; do
1106 smvar=${sm}_ROOT_DIR
1107 if [ "${!smvar}" != "" ] ; then
1108 sed -i "s%\([; \"]\)/[^; \"]\+/${sm}\([; \"/]\)%\1${!smvar}\2%g" $1
1110 grep libGL.so $1 > /dev/null && sed -i "s%\([; \"]\)/[^; \"]\+/libGL.so[0-9.]*%\1${libglso}%g" $1