Commit 1aed35cf authored by Simon Brass's avatar Simon Brass
Browse files

added gcc-build.sh and gcc-install.sh

parent 4a494092
Pipeline #27 skipped
#!/bin/bash
#mv FC_LABEL=${FC_LABEL},HOST_LABEL=${HOST_LABEL}/* .
#for dir in */
#do
# rm -rf ${dir}
#done
set -x
TAR_FILE=`ls *.tar.bz2`
SRC=source
INST_DIR=${TAR_FILE/.tar.bz2/}
DEST_SUBDIR=$INST_DIR-$HOST_LABEL
DEST_DIR=$WORKSPACE/$DEST_SUBDIR
PREFIX=/var/lib/jenkins/slave/opt/$INST_DIR
set +x
# Workaround for Debian >7
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
export LD_LIBRARY_PATH
LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
export LIBRARY_PATH
C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
export C_INCLUDE_PATH
CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
export CPLUS_INCLUDE_PATH
tar jxvf $TAR_FILE
mv $INST_DIR $SRC
mkdir $INST_DIR
cd $INST_DIR
../$SRC/configure --enable-languages=c,c++,fortran --disable-multilib -prefix=$PREFIX
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi
make $HOST_MAKE_FLAGS
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi
mkdir -p $DEST_DIR/$PREFIX/lib
cd $DEST_DIR/$PREFIX
ln -s lib lib64
cd $WORKSPACE/$INST_DIR
make $HOST_MAKE_FLAGS DESTDIR=$DEST_DIR install
exit_code=$?
if [ $exit_code -ne 0 ]
then exit $exit_code
fi
cd ..
rm -rf $INST_DIR
rm -rf *.bz2
tar cjf $DEST_SUBDIR.tar.bz2 $DEST_SUBDIR
rm -rf $DEST_SUBDIR
#!/bin/bash
set -x
PREFIX=/var/lib/jenkins/slave/opt/
FILE_SUFFIX=tar.bz2
TAR_FILE=`ls $FC_LABEL*$HOST_LABEL.$FILE_SUFFIX`
TAR_STEM=${TAR_FILE/.tar.bz2/}
COMPONENTS=${TAR_STEM//-/ }
set +x
function parse_components {
FC_BIN=$1
FC_VERSION=$2
if [[ "$3" =~ [0-9]{6} ]]
then
FC_REVISION=$3
FC_FULL_VERSION=$FC_BIN-$FC_VERSION-$FC_REVISION
else
FC_REVISION=""
FC_FULL_VERSION=$FC_BIN-$FC_VERSION
fi
}
parse_components $COMPONENTS
tar xf $TAR_FILE
cd $TAR_STEM
mkdir -p $PREFIX
rm -rf $PREFIX$FC_FULL_VERSION
mv .$PREFIX$FC_FULL_VERSION $PREFIX
if [ -n "$FC_REVISION" ]
then
cd $PREFIX
rm -f $FC_BIN-$FC_VERSION-LATEST
echo "${FC_FULL_VERSION} -> ${FC_BIN}-${FC_VERSION}-LATEST"
ln -s $FC_FULL_VERSION $FC_BIN-$FC_VERSION-LATEST
fi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment