build_bzip2() { HERE=`pwd` NAME=bzip2 VER=1.0.6 BUILDDEPS="compiletc.tcz" #DEPS= if [ ! -f bzip2-1.0.6.tar.gz ]; then wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz || exit 1 fi 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/localbin:$PATH" export PKG_CONFIG_PATH="$PKGPATH/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$PKGPATH/lib:$LD_LIBRARY_PATH" tar xvf bzip2-1.0.6.tar.gz || exit 1 cd bzip2-1.0.6 || exit 1 sed -e 's/^CFLAGS=\(.*\)$/CFLAGS=\1 \$(BIGFILES)/' -i ./Makefile-libbz2_so || exit 1 sed -i "s|-O2|${CFLAGS}|g" Makefile || exit 1 sed -i "s|-O2|${CFLAGS}|g" Makefile-libbz2_so || exit 1 #make -f Makefile-libbz2_so || exit 1 #make bzip2 bzip2recover libbz2.a || exit 1 make libbz2.a || exit 1 make || exit 1 mkdir -p $PKGPATH/include || exit 1 cp -a bzlib.h $PKGPATH/include || exit 1 chown root:root $PKGPATH/include/bzlib.h || exit 1 chmod 644 $PKGPATH/include/bzlib.h || exit 1 mkdir -p $PKGPATH/lib || exit 1 cp -a libbz2.a $PKGPATH/lib/libbz2.a || exit 1 #cp -a libbz2.so.* $PKGPATH/lib/ || exit 1 chmod 644 $PKGPATH/lib/libbz2.a || exit 1 #chmod 755 $PKGPATH/lib/libbz2.so.* || exit 1 #mkdir -p $PKGPATH/bin #cat bzip2-shared > $PKGPATH/bin/bzip2 || exit 1 #cat bzip2recover > $PKGPATH/bin/bzip2recover || exit 1 #chmod +x $PKGPATH/bin/bzip2* #cd $PKGPATH/lib #rm -f libbz2.so.1.0 libbz2.so.1 || exit 1 #ln -sf libbz2.so.1.0.6 libbz2.so.1.0 || exit 1 #ln -sf libbz2.so.1.0.6 libbz2.so.1 || exit 1 #ln -sf libbz2.so.1.0.6 libbz2.so || exit 1 cd "$HERE" touch "$TMPDIR"/bzip2 }