6 if [ -z "$TCLHOME" ]; then
7 echo "TCLHOME doesn't set"
12 tcl_cfg=${TCLHOME}/lib/tclConfig.sh
13 if [ ! -f ${tcl_cfg} ]; then tcl_cfg=${TCLHOME}/tcl${VERSION}/lib/tclConfig.sh; fi
14 if [ ! -f ${tcl_cfg} ]; then tcl_cfg=${TCLHOME}/lib/tcl${VERSION}/tclConfig.sh; fi
15 if [ ! -f ${tcl_cfg} ]; then tcl_cfg=${TCLHOME}/lib/tcl${VERSION}/lib/tclConfig.sh; fi
16 if [ -f ${tcl_cfg} ]; then
17 tcl_ver=`awk '/^TCL_VERSION=.*/ {gsub("TCL_VERSION=","",$1);print $1}' ${tcl_cfg} | cut -d "'" -f 2`
18 if [ "$tcl_ver" != ${VERSION} ] ; then
26 tk_cfg=${TCLHOME}/lib/tkConfig.sh
27 if [ ! -f ${tk_cfg} ]; then tk_cfg=${TCLHOME}/tk${VERSION}/tkConfig.sh; fi
28 if [ ! -f ${tk_cfg} ]; then tk_cfg=${TCLHOME}/lib/tk${VERSION}/tkConfig.sh; fi
29 if [ ! -f ${tk_cfg} ]; then tk_cfg=${TCLHOME}/lib/tk${VERSION}/lib/tkConfig.sh; fi
30 if [ -f ${tk_cfg} ]; then
31 tk_ver=`awk '/^TK_VERSION=.*/ {gsub("TK_VERSION=","",$1);print $1}' ${tk_cfg} | cut -d "'" -f 2`
32 if [ "$tk_ver" != ${VERSION} ] ; then
44 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
45 #$DELIM ${PRODUCT_TYPE} $DELIM
46 export TCLHOME=\${INSTALL_ROOT}/${PRODUCT}
47 export PATH=\${TCLHOME}/bin:\${PATH}
48 export LD_LIBRARY_PATH=\${TCLHOME}/lib:\${LD_LIBRARY_PATH}
49 export TCLLIBPATH="\${TCLHOME}/lib \${TCLHOME}/lib/tcl8.3 \${TCLHOME}/lib/tk8.3 \${TCLLIBPATH}"
52 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
53 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
56 # looks for the native product and collects it's environment (used by make_env())
58 tclhome="`find_in_path tclsh ${PATH}`"
59 if [ -z "${tclhome}" ] ; then
60 tclhome="`find_in_path tclsh /usr/bin`"
62 if [ -n "${tclhome}" ] ; then
63 tclhome=`cd ${tclhome}/..; pwd`
64 tmp="\${TCLHOME}/bin ${tclhome}/bin \${PATH} ${PATH}";
65 path=`sort_path ${tmp}`
66 tmp="\${TCLHOME}/lib ${tclhome}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
67 ld_library_path=`sort_path ${tmp}`
68 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
69 #$DELIM ${PRODUCT_TYPE} $DELIM
70 export TCLHOME=${tclhome}
72 export LD_LIBRARY_PATH=${ld_library_path}
73 export TCLLIBPATH="\${TCLHOME}/lib \${TCLHOME}/lib/tcl8.3 \${TCLHOME}/lib/tk8.3 \${TCLLIBPATH}"
76 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
77 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
84 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
90 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
91 source ${INSTALL_WORK}/$SHRC
93 makedir ${PRODUCT_DIR}
95 check_jb tar xfz ${SOURCE_DIR}/tcl8.3.3.tar.gz -C ${INSTALL_WORK}
96 cd ${INSTALL_WORK}/tcl8.3.3/unix
97 cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
102 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --enable-gcc --enable-shared --enable-threads \
103 --prefix=${PRODUCT_DIR}
105 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
111 check_job ${PRODUCT_DIR}/MAKE.LOG make
112 cat >> ${PRODUCT_DIR}/MAKEINSTALL.LOG <<EOF
117 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
119 (cd ${PRODUCT_DIR}/bin; ln -s tclsh8.3 tclsh)
120 (cd ${PRODUCT_DIR}/lib; ln -s libtcl8.3.so libtcl.so)
121 (cd ${PRODUCT_DIR}/lib; ln -s libtclstub8.3.a libtclstub.a)
123 check_jb tar xfz ${SOURCE_DIR}/tk8.3.3.tar.gz -C ${INSTALL_WORK}
124 cd ${INSTALL_WORK}/tk8.3.3/unix
125 cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
130 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --enable-gcc --enable-shared --enable-threads \
131 --prefix=${PRODUCT_DIR}
132 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
137 check_job ${PRODUCT_DIR}/MAKE.LOG make
138 cat >> ${PRODUCT_DIR}/MAKEINSTALL.LOG <<EOF
143 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
145 (cd ${PRODUCT_DIR}/bin; ln -s wish8.3 wish)
146 (cd ${PRODUCT_DIR}/lib; ln -s libtk8.3.so libtk.so)
147 (cd ${PRODUCT_DIR}/lib; ln -s libtkstub8.3.a libtkstub.a)
149 check_jb tar xfz ${SOURCE_DIR}/tclx8.3.tar.gz -C ${INSTALL_WORK}
150 cd ${INSTALL_WORK}/tclx8.3/unix
151 #VRV - bug in a tclx configure
153 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
155 #VRV - bug in a tclx configure
156 cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
161 check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
162 ./configure --enable-gcc --enable-shared --enable-threads \
163 --prefix=${PRODUCT_DIR}
164 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
169 check_job ${PRODUCT_DIR}/MAKE.LOG make
170 cat >> ${PRODUCT_DIR}/MAKEINSTALLEXEC.LOG <<EOF
175 check_job ${PRODUCT_DIR}/MAKEINSTALLEXEC.LOG make install-exec
177 (cd ${PRODUCT_DIR}/lib; ln -s libtclx8.3.so libtclx.so)
178 (cd ${PRODUCT_DIR}/lib; ln -s libtclx8.3.a libtclx.a)
179 (cd ${PRODUCT_DIR}/lib; ln -s libtkx8.3.so libtkx.so)
180 (cd ${PRODUCT_DIR}/lib; ln -s libtkx8.3.a libtkx.a)
182 #du -sk ${INSTALL_WORK}/tcl8.3.3 > ${PRODUCT_DIR}/size.log
183 #du -sk ${INSTALL_WORK}/tk8.3.3 >> ${PRODUCT_DIR}/size.log
184 #du -sk ${INSTALL_WORK}/tclx8.3 >> ${PRODUCT_DIR}/size.log
186 rm -fr ${INSTALL_WORK}/tcl8.3.3 ${INSTALL_WORK}/tk8.3.3 ${INSTALL_WORK}/tclx8.3
192 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
193 source ${INSTALL_WORK}/$SHRC
195 check_jb tar xfz ${SOURCE_DIR}/tcltk-8.3.3.tar.gz -C ${INSTALL_ROOT}
197 # overriding installation path
198 cd ${PRODUCT_DIR}/lib
199 old_prefix=`grep -e "^TCL_PREFIX='.*'" tclConfig.sh | sed -e "s%^TCL_PREFIX='\(.*\)'%\1%g"`
200 sed -e "s%${old_prefix}%${PRODUCT_DIR}%g" tclConfig.sh > _tclConfig.sh
201 mv -f _tclConfig.sh tclConfig.sh
202 sed -e "s%${old_prefix}%${PRODUCT_DIR}%g" tkConfig.sh > _tkConfig.sh
203 mv -f _tkConfig.sh tkConfig.sh
209 export INSTALL_WORK=$2;
210 export SOURCE_DIR=$3;
211 export INSTALL_ROOT=$4;
212 export PRODUCT_SEQUENCE=$5;
213 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="tcl" ; fi
214 export PRODUCT="tcltk-8.3.3"
215 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
216 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}