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