2011-01-21 00:06:59 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Installation script to build the autotools toolchain.
|
|
|
|
# Christoph Niethammer <christoph.niethammer@web.de> (C) 2011
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
export ORIGDIR=`pwd`
|
|
|
|
export SIT_DIR=$(dirname "$ORIGDIR/$0")
|
|
|
|
echo $SIT_DIR
|
|
|
|
|
|
|
|
export SRC_POOL=${HOME}/src
|
2011-02-09 09:03:13 +00:00
|
|
|
export WORKDIR_BASE=${HOME}/work
|
2011-01-21 00:06:59 +00:00
|
|
|
|
2011-02-12 03:55:14 +00:00
|
|
|
#PREFIX=$HOME/bin/local
|
|
|
|
PREFIX=/opt/amtopt/autotools/local
|
2011-01-21 00:06:59 +00:00
|
|
|
MAKEOPTS="-j4"
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-02-09 09:03:13 +00:00
|
|
|
module load compiler/gnu/4.4.3
|
2011-01-21 00:06:59 +00:00
|
|
|
|
|
|
|
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_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() {
|
2011-02-09 09:03:13 +00:00
|
|
|
export WORKDIR=$WORKDIR_BASE/${P}
|
|
|
|
export SRCDIR=${WORKDIR}/${P}
|
|
|
|
export BUILDDIR=${WORKDIR}/build
|
2011-01-21 00:06:59 +00:00
|
|
|
if [ -d ${WORKDIR} ]
|
|
|
|
then
|
|
|
|
rm -rf ${WORKDIR}
|
|
|
|
fi
|
|
|
|
mkdir -p ${WORKDIR}
|
|
|
|
mkdir -p ${BUILDDIR}
|
|
|
|
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
|
|
|
|
|
2011-02-12 03:55:14 +00:00
|
|
|
export PATH=$PREFIX/bin:$PATH
|
|
|
|
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
|
2011-01-21 00:06:59 +00:00
|
|
|
# install automake
|
|
|
|
P=automake-${AUTOMAKE_VERSION}
|
|
|
|
A=${P}.tar.bz2
|
|
|
|
sit_auto_install
|
|
|
|
|
|
|
|
exit 0
|