build_tcl() { HERE=`pwd` ARCH=x86_32 # change to match arch BUILDDEPS="compiletc.tcz" #DEPS= for I in `echo "$BUILDDEPS"`; do su tc -c "tce-load -i "$I"" || su tc -c "tce-load -iw "$I"" done PKGPATH=$1 export LDFLAGS="-L$PKGPATH/lib" export CPPFLAGS="-I$PKGPATH/include" export PATH="$PKGPATH/bin:$PATH" export PKG_CONFIG_PATH="$PKGPATH/lib/pkgconfig:$PKG_CONFIG_PATH" tar xvf tcl8.5.11-src.tar.gz || exit 1 cd tcl8.5.11/unix || exit 1 if [ "$ARCH" = "x86_64" ]; then ./configure --prefix="$PKGPATH" --bindir="$PKGPATH"/localbin --enable-threads --enable-64bit || exit 1 else ./configure --prefix="$PKGPATH" --bindir="$PKGPATH"/localbin --enable-threads --disable-64bit || exit 1 fi make || exit 1 make install install-private-headers || exit 1 sed -i \ -e "s,^TCL_BUILD_LIB_SPEC='-L.*/unix,TCL_BUILD_LIB_SPEC='-L"$PKGPATH"/lib," \ -e "s,^TCL_SRC_DIR='.*',TCL_SRC_DIR='/"$PKGPATH"/include'," \ -e "s,^TCL_BUILD_STUB_LIB_SPEC='-L.*/unix,TCL_BUILD_STUB_LIB_SPEC='-L"$PKGPATH"/lib," \ -e "s,^TCL_BUILD_STUB_LIB_PATH='.*/unix,TCL_BUILD_STUB_LIB_PATH='"$PKGPAH"/lib," \ -e "s,^TCL_LIB_FILE='libtcl8.5..TCL_DBGX..so',TCL_LIB_FILE=\"libtcl8.5\$\{TCL_DBGX\}.so\"," \ -e "s,^TCL_CC_SEARCH_FLAGS='\(.*\)',TCL_CC_SEARCH_FLAGS='\1:"$PKGPATH"/lib'," \ -e "s,^TCL_LD_SEARCH_FLAGS='\(.*\)',TCL_LD_SEARCH_FLAGS='\1:"$PKGPATH"/lib'," \ "$PKGPATH"/lib/tclConfig.sh cd "$PKGPATH"/localbin ln -s tclsh8.5 tclsh cd "$HERE" touch "$TMPDIR"/tcl }