From 74c2549899e2d0c30a760fbbba758034fd98fe62 Mon Sep 17 00:00:00 2001 From: Christoph Niethammer Date: Wed, 23 Mar 2011 11:27:26 +0000 Subject: [PATCH] Use the functions from functions.sh in the install_toolchain script. --- functions.sh | 4 +++- install_toolchain.sh | 42 +++--------------------------------------- 2 files changed, 6 insertions(+), 40 deletions(-) diff --git a/functions.sh b/functions.sh index 38f1e19..e6c85d4 100644 --- a/functions.sh +++ b/functions.sh @@ -49,7 +49,9 @@ sit_unpack() { src_configure() { ${SRCDIR}/configure --prefix=$PREFIX $CONFIGURE_OPTS - cp config.log $LOGDIR + if [ ! -z $LOGDIR ] ; then + cp config.log $LOGDIR + fi } sit_configure() { sit_info "Configuring sources ..." diff --git a/install_toolchain.sh b/install_toolchain.sh index 3b634a1..805f761 100755 --- a/install_toolchain.sh +++ b/install_toolchain.sh @@ -6,6 +6,8 @@ set -e set -x +source "functions.sh" + export ORIGDIR=`pwd` export SIT_DIR=$(dirname "$ORIGDIR/$0") echo $SIT_DIR @@ -27,45 +29,6 @@ LIBTOOL_VERSION=2.2.10 AUTOCONF_VERSION=2.65 AUTOMAKE_VERSION=1.11.1 -function sit_fail() { - msg=$0 - echo "$msg" - exit 1 -} - -function sit_unpack() { - if [ ! -e ${SRC_POOL}/${A} ] - then - sit_fail "${SRC_POOL}/${A} doesn't exist" - fi - case "${A##*.}" in - bz2) - tar xfjv ${SRC_POOL}/${A} || sit_fail - ;; - gz|tgz) - tar xfzv ${SRC_POOL}/${A} || sit_fail - ;; - xz) - tar xfJv ${SRC_POOL}/${A} || sit_fail - ;; - *) - sit_fail "Archive format not recogized" - ;; - esac -} - -function sit_configure() { - cd ${BUILDDIR=} - ${SRCDIR}/configure --prefix=$PREFIX -} - -function sit_build() { - make $MAKEOPTS -} - -function sit_install() { - make install -} function sit_auto_install() { export WORKDIR=$WORKDIR_BASE/${P} @@ -77,6 +40,7 @@ function sit_auto_install() { fi mkdir -p ${WORKDIR} mkdir -p ${BUILDDIR} + mkdir -p ${PREFIX} cd ${WORKDIR} sit_unpack sit_configure