]> SALOME platform Git repositories - tools/install.git/blob - config_files/tcltk8.4.5.sh
Salome HOME
Update for version 3.0.0
[tools/install.git] / config_files / tcltk8.4.5.sh
1 #!/bin/sh
2
3 check_version()
4 {
5 if [ -z "$TCLHOME" ]; then
6    echo "TCLHOME doesn't set"
7    return 1
8 fi
9
10 check_lib_version tclsh8.4 ${TCLHOME}/bin
11 if [ "$?" -ne "0" ]; then
12       return 1
13 fi
14
15 check_lib_version wish8.4 ${TCLHOME}/bin
16 if [ "$?" -ne "0" ]; then
17       return 1
18 fi
19
20 check_lib_version libtcl8.4.so
21 if [ "$?" -ne "0" ]; then
22       return 1
23 fi
24
25 check_lib_version libtk8.4.so
26 if [ "$?" -ne "0" ]; then
27       return 1
28 fi
29
30 echo "The product ${PRODUCT} has been already installed on yours system"
31 return 0
32 }
33
34 print_env()
35 {
36 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
37 #$DELIM ${PRODUCT_TYPE} $DELIM
38 export TCLHOME=\${INSTALL_ROOT}/${PRODUCT}
39 export PATH=\${TCLHOME}/bin:\${PATH}
40 export LD_LIBRARY_PATH=\${TCLHOME}/lib:\${LD_LIBRARY_PATH}
41 export TCLLIBPATH="\${TCLHOME}/lib \${TCLHOME}/lib/tcl8.4 \${TCLHOME}/lib/tk8.4 \${TCLLIBPATH}"
42 ##
43 EOF
44 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
45 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
46 }
47
48 # looks for the native product and collects it's environment (used by make_env())
49 try_native(){
50 tclhome="`find_in_path tclsh ${PATH}`"
51 if [ -z "${tclhome}" ] ; then
52     tclhome="`find_in_path tclsh /usr/bin`"
53 fi
54 if [ -n "${tclhome}" ] ; then
55     tclhome=`cd ${tclhome}/..; pwd`
56     tmp="\${TCLHOME}/bin ${tclhome}/bin \${PATH} ${PATH}";  
57     path=`sort_path ${tmp}`
58     tmp="\${TCLHOME}/lib ${tclhome}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";  
59     ld_library_path=`sort_path ${tmp}`
60     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
61 #$DELIM ${PRODUCT_TYPE} $DELIM
62 export TCLHOME=${tclhome}
63 export PATH=${path}
64 export LD_LIBRARY_PATH=${ld_library_path}
65 export TCLLIBPATH="\${TCLHOME}/lib \${TCLHOME}/lib/tcl8.4 \${TCLHOME}/lib/tk8.4 \${TCLLIBPATH}"
66 ##
67 EOF
68     (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
69     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
70     return 0
71 fi
72 return 1;
73 }
74
75 try_preinstalled(){
76 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
77 return $?
78 }
79
80 install_source()
81 {
82 echo "The installation of tcl/tk 8.4.5 from sources is not provided! Use native tcl/tk."
83 return 1
84 }
85
86 install_binary()
87 {
88 echo "The installation of tcl/tk 8.4.5 from binaries is not provided! Use native tcl/tk."
89 return 1
90 }
91
92 export PROCEDURE=$1;
93 export INSTALL_WORK=$2;
94 export SOURCE_DIR=$3;
95 export INSTALL_ROOT=$4;
96 export PRODUCT_SEQUENCE=$5;
97 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="tcl" ; fi
98 export PRODUCT="tcltk8.4.5"
99 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
100 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
101 source ./common.sh
102 $PROCEDURE