3 ####################################################################################
4 # File : tcltk-8.3.3.sh
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-2007 CEA
11 # This script is the part of the SALOME installation procedure.
13 ####################################################################################
19 if [ -z "$TCLHOME" ]; then
20 echo "TCLHOME doesn't set"
25 tcl_cfg=${TCLHOME}/lib/tclConfig.sh
26 if [ ! -f ${tcl_cfg} ]; then tcl_cfg=${TCLHOME}/tcl${VERSION}/lib/tclConfig.sh; fi
27 if [ ! -f ${tcl_cfg} ]; then tcl_cfg=${TCLHOME}/lib/tcl${VERSION}/tclConfig.sh; fi
28 if [ ! -f ${tcl_cfg} ]; then tcl_cfg=${TCLHOME}/lib/tcl${VERSION}/lib/tclConfig.sh; fi
29 if [ -f ${tcl_cfg} ]; then
30 tcl_ver=`awk '/^TCL_VERSION=.*/ {gsub("TCL_VERSION=","",$1);print $1}' ${tcl_cfg} | cut -d "'" -f 2`
31 if [ "$tcl_ver" != ${VERSION} ] ; then
39 tk_cfg=${TCLHOME}/lib/tkConfig.sh
40 if [ ! -f ${tk_cfg} ]; then tk_cfg=${TCLHOME}/tk${VERSION}/tkConfig.sh; fi
41 if [ ! -f ${tk_cfg} ]; then tk_cfg=${TCLHOME}/lib/tk${VERSION}/tkConfig.sh; fi
42 if [ ! -f ${tk_cfg} ]; then tk_cfg=${TCLHOME}/lib/tk${VERSION}/lib/tkConfig.sh; fi
43 if [ -f ${tk_cfg} ]; then
44 tk_ver=`awk '/^TK_VERSION=.*/ {gsub("TK_VERSION=","",$1);print $1}' ${tk_cfg} | cut -d "'" -f 2`
45 if [ "$tk_ver" != ${VERSION} ] ; then
57 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
58 #$DELIM ${PRODUCT_TYPE} $DELIM
59 export TCLHOME=\${INSTALL_ROOT}/${PRODUCT}
60 export PATH=\${TCLHOME}/bin:\${PATH}
61 export LD_LIBRARY_PATH=\${TCLHOME}/lib:\${LD_LIBRARY_PATH}
62 export TCLLIBPATH="\${TCLHOME}/lib \${TCLHOME}/lib/tcl${VERSION} \${TCLHOME}/lib/tk${VERSION} \${TCLLIBPATH}"
65 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
66 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
71 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
72 #$DELIM ${PRODUCT_TYPE}_src $DELIM
76 (test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
77 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
81 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
82 try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
88 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
89 source ${INSTALL_WORK}/$SHRC
91 mkdir -p ${PRODUCT_DIR}_SRC
93 check_jb tar xfz ${SOURCE_DIR}/tcl-8.3.3.tar.gz -C ${PRODUCT_DIR}_SRC
94 check_jb tar xfz ${SOURCE_DIR}/tk-8.3.3.tar.gz -C ${PRODUCT_DIR}_SRC
95 check_jb tar xfz ${SOURCE_DIR}/tclx-8.3.tar.gz -C ${PRODUCT_DIR}_SRC
97 # to generate environment scripts
101 install_source_and_build()
107 makedir ${PRODUCT_DIR}
109 cd ${PRODUCT_DIR}_SRC/tcl-8.3.3_SRC/unix
110 cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
115 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --enable-gcc --enable-shared --enable-threads \
116 --prefix=${PRODUCT_DIR}
118 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
124 check_job ${PRODUCT_DIR}/MAKE.LOG make
125 cat >> ${PRODUCT_DIR}/MAKEINSTALL.LOG <<EOF
130 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
132 (cd ${PRODUCT_DIR}/bin; ln -s tclsh8.3 tclsh)
133 (cd ${PRODUCT_DIR}/lib; ln -s libtcl8.3.so libtcl.so)
134 (cd ${PRODUCT_DIR}/lib; ln -s libtclstub8.3.a libtclstub.a)
136 cd ${PRODUCT_DIR}_SRC/tk-8.3.3_SRC/unix
137 cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
142 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --enable-gcc --enable-shared --enable-threads \
143 --prefix=${PRODUCT_DIR}
144 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
149 check_job ${PRODUCT_DIR}/MAKE.LOG make
150 cat >> ${PRODUCT_DIR}/MAKEINSTALL.LOG <<EOF
155 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
157 (cd ${PRODUCT_DIR}/bin; ln -s wish8.3 wish)
158 (cd ${PRODUCT_DIR}/lib; ln -s libtk8.3.so libtk.so)
159 (cd ${PRODUCT_DIR}/lib; ln -s libtkstub8.3.a libtkstub.a)
161 cd ${PRODUCT_DIR}_SRC/tclx-8.3_SRC/unix
162 #VRV - bug in a tclx configure
164 echo -e '/test "$no_create" = yes || ${CONFIG_SHELL-\/bin\/sh} $CONFIG_STATUS || exit 1\ns/test "$no_create" = yes || ${CONFIG_SHELL-\/bin\/sh} $CONFIG_STATUS || exit 1/test "$no_create" = yes || ${CONFIG_SHELL-\/bin\/sh} $CONFIG_STATUS || exit 0\nwq' | ed - configure
166 #VRV - bug in a tclx configure
167 cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
172 check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
173 ./configure --enable-gcc --enable-shared --enable-threads \
174 --prefix=${PRODUCT_DIR}
175 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
180 check_job ${PRODUCT_DIR}/MAKE.LOG make
181 cat >> ${PRODUCT_DIR}/MAKEINSTALLEXEC.LOG <<EOF
186 check_job ${PRODUCT_DIR}/MAKEINSTALLEXEC.LOG make install-exec
188 (cd ${PRODUCT_DIR}/lib; ln -s libtclx8.3.so libtclx.so)
189 (cd ${PRODUCT_DIR}/lib; ln -s libtclx8.3.a libtclx.a)
190 (cd ${PRODUCT_DIR}/lib; ln -s libtkx8.3.so libtkx.so)
191 (cd ${PRODUCT_DIR}/lib; ln -s libtkx8.3.a libtkx.a)
193 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
196 # remove sources and temporary files after building
197 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
198 test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
201 # to generate environment scripts
207 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
208 source ${INSTALL_WORK}/$SHRC
210 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
212 # overriding installation path
213 cd ${PRODUCT_DIR}/lib
214 old_prefix=`grep -e "^TCL_PREFIX='.*'" tclConfig.sh | sed -e "s%^TCL_PREFIX='\(.*\)'%\1%g"`
215 sed -e "s%${old_prefix}%${PRODUCT_DIR}%g" tclConfig.sh > _tclConfig.sh
216 mv -f _tclConfig.sh tclConfig.sh
217 sed -e "s%${old_prefix}%${PRODUCT_DIR}%g" tkConfig.sh > _tkConfig.sh
218 mv -f _tkConfig.sh tkConfig.sh
220 # to generate environment scripts
225 export INSTALL_WORK=$2;
226 export SOURCE_DIR=$3;
227 export INSTALL_ROOT=$4;
228 export PRODUCT_SEQUENCE=$5;
229 export PRODUCT_TYPE=$6;
230 export INSTALL_PRODUCTS=$7;
233 export PRODUCT="tcltk-8.3.3"
234 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
235 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}