#!/bin/sh # Built on TCL v3.6 # Required extensions: # compiletc # binutils # base-dev # bison # diffutils # file # findutils # flex # gawk # gcc # gcc_libs # cloog # ppl # gmp # mpfr # gperf # grep # m4 # make # patch # pkg-config # sed # squashfs-tools-4.x # tar # apr-dev # apr getTime.sh installExtension() { if [ ! -e /usr/local/tce.installed/$1 ]; then echo "Installing "$1" ..." if [ -e $TCEDIR/optional/$1.tcz ]; then tce-load -i $1 else tce-load -wi $1 fi [ ! -e /usr/local/tce.installed/$1 ] && echo "Error: Extension "$1" not installed! Aborting" && exit fi } createExtension() { mksquashfs $1 $1.tcz -noappend [ ! -e $1.tcz ] && echo "Error: "$1".tcz not created! Aborting" && exit } unpackSrc() { #unpack source if [ -e $1.tar.bz2 ]; then tar -jxf $1.tar.bz2 elif [ -e $1.tb2 ]; then tar -jxf $1.tb2 elif [ -e $1.tbz ]; then tar -jxf $1.tbz elif [ -e $1.tar.gz ]; then tar -zxf $1.tar.gz elif [ -e $1.tgz ]; then tar -zxf $1.tgz elif [ -e $1.tar.xz ]; then tar -Jxf $1.tar.xz elif [ -e $1.txz ]; then tar -Jxf $1.txz elif [ -e $1.tar.lzma ]; then tar -xf $1.tar.lzma --lzma elif [ -e $1.tlz ]; then tar -xf $1.tlz --lzma else echo "Source "$1" not found! Aborting" && exit fi } # Install these extensions automagically export EXTS="compiletc squashfs-tools-4.x tar apr-dev" export TCEDIR=`cat /opt/.tce_dir` export CFLAGS="-march=i486 -mtune=i686 -Os -pipe" export CXXFLAGS=$CFLAGS" -fno-exceptions -fno-rtti" export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig export EXTNAME="apr-iconv" export VER="-1.2.1" export DESTDIR=`pwd`/$EXTNAME export PKGNAME=$EXTNAME$VER for f in $EXTS; do installExtension $f done unpackSrc $PKGNAME mkdir -p $DESTDIR/usr/local/share/doc/License $DESTDIR-dev/usr/local/lib/iconv cd $PKGNAME ./configure --prefix=/usr/local --with-apr=/usr/local && make && make install || exit cp LICENSE $DESTDIR/share/doc/License/$EXTNAME.txt cd $DESTDIR sudo strip --strip-unneeded usr/local/bin/* sudo strip -g usr/local/lib/* sudo strip -g usr/local/lib/iconv/* mv usr/local/include $DESTDIR-dev/usr/local mv usr/local/lib/*.a $DESTDIR-dev/usr/local/lib mv usr/local/lib/*.la $DESTDIR-dev/usr/local/lib mv usr/local/lib/*.exp $DESTDIR-dev/usr/local/lib mv usr/local/lib/iconv/*.a $DESTDIR-dev/usr/local/lib/iconv mv usr/local/lib/iconv/*.la $DESTDIR-dev/usr/local/lib/iconv cd .. createExtension $EXTNAME createExtension $EXTNAME-dev rm -rf $EXTNAME $PKGNAME $EXTNAME-dev # Create extension support files and test installExtension "submitqc" submitqc