3 ####################################################################################
4 # File : tcltk-8.4.14.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}/tcl8.4.14.tar.gz -C ${PRODUCT_DIR}_SRC
94 check_jb tar xfz ${SOURCE_DIR}/tk8.4.14.tar.gz -C ${PRODUCT_DIR}_SRC
95 check_jb tar xfz ${SOURCE_DIR}/tclx8.3.5.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/tcl8.4.14_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 -fs tclsh8.4 tclsh)
133 (cd ${PRODUCT_DIR}/lib; ln -fs libtcl8.4.so libtcl.so)
134 (cd ${PRODUCT_DIR}/lib; ln -fs libtclstub8.4.a libtclstub.a)
136 cd ${PRODUCT_DIR}_SRC/tk8.4.14_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} --with-tcl=${PRODUCT_DIR}/lib
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 -fs wish8.4 wish)
158 (cd ${PRODUCT_DIR}/lib; ln -fs libtk8.4.so libtk.so)
159 (cd ${PRODUCT_DIR}/lib; ln -fs libtkstub8.4.a libtkstub.a)
161 #vsr: patch tclx 8.3.5 to make it compiliable on Mandriva 2006.0
162 cd ${PRODUCT_DIR}_SRC/tclx8.3.5_SRC/unix
163 mv Common.mk.in Common.mk.in.orig
164 sed -e 's/@DEFS@/-DSTDC_HEADERS=1 -DNDEBUG=1 -DRETSIGTYPE=void/g' Common.mk.in.orig > Common.mk.in
165 cd ${PRODUCT_DIR}_SRC/tclx8.3.5_SRC/tcl/unix
166 mv tclxConfig.sh.in tclxConfig.sh.in.orig
167 sed -e 's/@DEFS@/ -DSTDC_HEADERS=1 -DNDEBUG=1 -DRETSIGTYPE=void /g' tclxConfig.sh.in.orig > tclxConfig.sh.in
168 cd ${PRODUCT_DIR}_SRC/tclx8.3.5_SRC/tk/unix
169 mv tkxConfig.sh.in tkxConfig.sh.in.orig
170 sed -e 's/@DEFS@/ -DSTDC_HEADERS=1 -DNDEBUG=1 -DRETSIGTYPE=void /g' tkxConfig.sh.in.orig > tkxConfig.sh.in
172 cd ${PRODUCT_DIR}_SRC/tclx8.3.5_SRC/unix
173 #VRV - bug in a tclx configure
175 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
176 #INV - bug in a tclx configure
177 cp configure configure.orig && sed "s/relid'/relid/" configure.orig > configure
178 chmod 755 ./configure
179 #VRV - bug in a tclx configure
180 cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
185 check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
186 ./configure --enable-gcc --enable-shared --enable-threads \
187 --prefix=${PRODUCT_DIR} --with-tcl=${PRODUCT_DIR}/lib --with-tk=${PRODUCT_DIR}/lib
188 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
193 check_job ${PRODUCT_DIR}/MAKE.LOG make
194 cat >> ${PRODUCT_DIR}/MAKEINSTALLEXEC.LOG <<EOF
199 check_job ${PRODUCT_DIR}/MAKEINSTALLEXEC.LOG make install-exec
201 (cd ${PRODUCT_DIR}/lib; ln -fs libtclx8.3.so libtclx.so)
202 (cd ${PRODUCT_DIR}/lib; ln -fs libtclx8.3.a libtclx.a)
203 (cd ${PRODUCT_DIR}/lib; ln -fs libtkx8.3.so libtkx.so)
204 (cd ${PRODUCT_DIR}/lib; ln -fs libtkx8.3.a libtkx.a)
206 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
209 # remove sources and temporary files after building
210 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
211 test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
214 # to generate environment scripts
220 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
221 source ${INSTALL_WORK}/$SHRC
223 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
225 # overriding installation path
226 cd ${PRODUCT_DIR}/lib
227 old_prefix=`grep -e "^TCL_PREFIX='.*'" tclConfig.sh | sed -e "s%^TCL_PREFIX='\(.*\)'%\1%g"`
228 sed -e "s%${old_prefix}%${PRODUCT_DIR}%g" tclConfig.sh > _tclConfig.sh
229 mv -f _tclConfig.sh tclConfig.sh
230 sed -e "s%${old_prefix}%${PRODUCT_DIR}%g" tkConfig.sh > _tkConfig.sh
231 mv -f _tkConfig.sh tkConfig.sh
233 # to generate environment scripts
238 export INSTALL_WORK=$2;
239 export SOURCE_DIR=$3;
240 export INSTALL_ROOT=$4;
241 export PRODUCT_SEQUENCE=$5;
242 export PRODUCT_TYPE=$6;
243 export INSTALL_PRODUCTS=$7;
246 export PRODUCT="tcltk-8.4.14"
247 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
248 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}