3 ####################################################################################
4 # File : tcltk-8.4.7.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}"
69 # looks for the native product and collects it's environment (used by make_env())
71 tclhome="`find_in_path tclsh ${PATH}`"
72 if [ -z "${tclhome}" ] ; then
73 tclhome="`find_in_path tclsh /usr/bin`"
75 if [ -n "${tclhome}" ] ; then
76 tclhome=`cd ${tclhome}/..; pwd`
77 tmp="\${TCLHOME}/bin ${tclhome}/bin \${PATH} ${PATH}";
78 path=`sort_path ${tmp}`
79 tmp="\${TCLHOME}/lib ${tclhome}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
80 ld_library_path=`sort_path ${tmp}`
81 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
82 #$DELIM ${PRODUCT_TYPE} $DELIM
83 export TCLHOME=${tclhome}
85 export LD_LIBRARY_PATH=${ld_library_path}
86 export TCLLIBPATH="\${TCLHOME}/lib \${TCLHOME}/lib/tcl${VERSION} \${TCLHOME}/lib/tk${VERSION} \${TCLLIBPATH}"
89 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
90 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
97 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
103 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
104 source ${INSTALL_WORK}/$SHRC
106 makedir ${PRODUCT_DIR}
108 check_jb tar xfz ${SOURCE_DIR}/tcl8.4.7.tar.gz -C ${INSTALL_WORK}
109 cd ${INSTALL_WORK}/tcl8.4.7/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 check_jb tar xfz ${SOURCE_DIR}/tk8.4.7.tar.gz -C ${INSTALL_WORK}
137 cd ${INSTALL_WORK}/tk8.4.7/unix
138 cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
143 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --enable-gcc --enable-shared --enable-threads \
144 --prefix=${PRODUCT_DIR} --with-tcl=${PRODUCT_DIR}/lib
145 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
150 check_job ${PRODUCT_DIR}/MAKE.LOG make
151 cat >> ${PRODUCT_DIR}/MAKEINSTALL.LOG <<EOF
156 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
158 (cd ${PRODUCT_DIR}/bin; ln -fs wish8.4 wish)
159 (cd ${PRODUCT_DIR}/lib; ln -fs libtk8.4.so libtk.so)
160 (cd ${PRODUCT_DIR}/lib; ln -fs libtkstub8.4.a libtkstub.a)
162 check_jb tar xfz ${SOURCE_DIR}/tclx8.3.5.tar.gz -C ${INSTALL_WORK}
164 #vsr: patch tclx 8.3.5 to make it compiliable on Mandriva 2006.0
165 cd ${INSTALL_WORK}/tclx8.3.5/unix
166 mv Common.mk.in Common.mk.in.orig
167 sed -e 's/@DEFS@/-DSTDC_HEADERS=1 -DNDEBUG=1 -DRETSIGTYPE=void/g' Common.mk.in.orig > Common.mk.in
168 cd ${INSTALL_WORK}/tclx8.3.5/tcl/unix
169 mv tclxConfig.sh.in tclxConfig.sh.in.orig
170 sed -e 's/@DEFS@/ -DSTDC_HEADERS=1 -DNDEBUG=1 -DRETSIGTYPE=void /g' tclxConfig.sh.in.orig > tclxConfig.sh.in
171 cd ${INSTALL_WORK}/tclx8.3.5/tk/unix
172 mv tkxConfig.sh.in tkxConfig.sh.in.orig
173 sed -e 's/@DEFS@/ -DSTDC_HEADERS=1 -DNDEBUG=1 -DRETSIGTYPE=void /g' tkxConfig.sh.in.orig > tkxConfig.sh.in
175 cd ${INSTALL_WORK}/tclx8.3.5/unix
176 #VRV - bug in a tclx configure
178 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
180 #VRV - bug in a tclx configure
181 cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
186 check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
187 ./configure --enable-gcc --enable-shared --enable-threads \
188 --prefix=${PRODUCT_DIR} --with-tcl=${PRODUCT_DIR}/lib --with-tk=${PRODUCT_DIR}/lib
189 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
194 check_job ${PRODUCT_DIR}/MAKE.LOG make
195 cat >> ${PRODUCT_DIR}/MAKEINSTALLEXEC.LOG <<EOF
200 check_job ${PRODUCT_DIR}/MAKEINSTALLEXEC.LOG make install-exec
202 (cd ${PRODUCT_DIR}/lib; ln -fs libtclx8.3.so libtclx.so)
203 (cd ${PRODUCT_DIR}/lib; ln -fs libtclx8.3.a libtclx.a)
204 (cd ${PRODUCT_DIR}/lib; ln -fs libtkx8.3.so libtkx.so)
205 (cd ${PRODUCT_DIR}/lib; ln -fs libtkx8.3.a libtkx.a)
207 #du -sk ${INSTALL_WORK}/tcl8.4.7 > ${PRODUCT_DIR}/size.log
208 #du -sk ${INSTALL_WORK}/tk8.4.7 >> ${PRODUCT_DIR}/size.log
209 #du -sk ${INSTALL_WORK}/tclx8.3.5 >> ${PRODUCT_DIR}/size.log
211 rm -fr ${INSTALL_WORK}/tcl8.4.7 ${INSTALL_WORK}/tk8.4.7 ${INSTALL_WORK}/tclx8.3.5
217 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
218 source ${INSTALL_WORK}/$SHRC
220 check_jb tar xfz ${SOURCE_DIR}/tcltk-8.4.7.tar.gz -C ${INSTALL_ROOT}
222 # overriding installation path
223 cd ${PRODUCT_DIR}/lib
224 old_prefix=`grep -e "^TCL_PREFIX='.*'" tclConfig.sh | sed -e "s%^TCL_PREFIX='\(.*\)'%\1%g"`
225 sed -e "s%${old_prefix}%${PRODUCT_DIR}%g" tclConfig.sh > _tclConfig.sh
226 mv -f _tclConfig.sh tclConfig.sh
227 sed -e "s%${old_prefix}%${PRODUCT_DIR}%g" tkConfig.sh > _tkConfig.sh
228 mv -f _tkConfig.sh tkConfig.sh
234 export INSTALL_WORK=$2;
235 export SOURCE_DIR=$3;
236 export INSTALL_ROOT=$4;
237 export PRODUCT_SEQUENCE=$5;
238 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="tcl" ; fi
239 export PRODUCT="tcltk-8.4.7"
240 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
241 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}