build_tk() { HERE=`pwd` ARCH=x86_32 # change to match arch BUILDDEPS="compiletc.tcz Xorg-7.6-dev.tcz Xorg-7.6-lib.tcz" #DEPS= . ./tcl-sc.inc || exit 1 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" if [ ! -f "$TMPDIR"/tcl ]; then build_tcl "$PKGPATH" || exit 1 fi tar xvf tk8.5.11-src.tar.gz || exit 1 cd tk8.5.11/unix || exit 1 if [ "$ARCH" = "x86_64" ]; then ./configure --prefix="$PKGPATH" --bindir="$PKGPATH"/localbin --with-tcl="$PKGPATH"/lib --enable-threads --enable-64bit || exit 1 else ./configure --prefix="$PKGPATH" --bindir="$PKGPATH"/localbin --with-tcl="$PKGPATH"/lib --enable-threads --disable-64bit || exit 1 fi make || exit 1 make install install-private-headers || exit 1 cd .. for dir in compat generic generic/ttk unix; do install -dm755 "$PKGPATH"/include/tk-private/$dir install -m644 -t "$PKGPATH"/include/tk-private/$dir $dir/*.h done sed -i \ -e "s,^TK_BUILD_LIB_SPEC='-L.*/unix,TK_BUILD_LIB_SPEC='-L"$PKGPATH"/lib," \ -e "s,^TK_SRC_DIR='.*',TK_SRC_DIR='"$PKGPATH"/include'," \ -e "s,^TK_BUILD_STUB_LIB_SPEC='-L.*/unix,TK_BUILD_STUB_LIB_SPEC='-L"$PKGPATH"/lib," \ -e "s,^TK_BUILD_STUB_LIB_PATH='.*/unix,TK_BUILD_STUB_LIB_PATH='"$PKGPATH"/lib," \ "$PKGPATH"/lib/tkConfig.sh cd "$PKGPATH"/localbin ln -sf wish8.5 wish cd "$HERE" touch "$TMPDIR"/tk }