sit/install_toolchain.sh

80 lines
1.3 KiB
Bash
Executable file

#!/usr/bin/env bash
# Installation script to build the autotools toolchain.
# Christoph Niethammer <niethammer@hlrs.de> (C) 2011
set -e
set -x
source "functions.sh"
export ORIGDIR=`pwd`
export SIT_DIR=$(dirname "$ORIGDIR/$0")
echo $SIT_DIR
export SRC_POOL=${HOME}/src
export WORKDIR_BASE=${HOME}/work
#PREFIX=$HOME/bin/local
PREFIX=/opt/amtopt/autotools/local
MAKEOPTS="-j4"
module load compiler/gnu/4.4.3
M4_VERSION=1.4.15
BISON_VERSION=2.4.2
LIBTOOL_VERSION=2.2.10
AUTOCONF_VERSION=2.65
AUTOMAKE_VERSION=1.11.1
function sit_auto_install() {
export WORKDIR=$WORKDIR_BASE/${P}
export SRCDIR=${WORKDIR}/${P}
export BUILDDIR=${WORKDIR}/build
if [ -d ${WORKDIR} ]
then
rm -rf ${WORKDIR}
fi
mkdir -p ${WORKDIR}
mkdir -p ${BUILDDIR}
mkdir -p ${PREFIX}
cd ${WORKDIR}
sit_unpack
sit_configure
sit_build
sit_install
}
# install m4
P=m4-${M4_VERSION}
A=${P}.tar.bz2
sit_auto_install
# install bison
P=bison-${BISON_VERSION}
A=${P}.tar.bz2
sit_auto_install
# install libtool
P=libtool-${LIBTOOL_VERSION}
A=${P}.tar.gz
sit_auto_install
# install autoconf
P=autoconf-${AUTOCONF_VERSION}
A=${P}.tar.gz
sit_auto_install
export PATH=$PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
# install automake
P=automake-${AUTOMAKE_VERSION}
A=${P}.tar.bz2
sit_auto_install
exit 0