eh_frame_check_setup/setup_env.sh

63 lines
1.3 KiB
Bash
Raw Normal View History

2018-03-26 14:18:50 +02:00
#!/bin/bash
function status_update {
echo "### $1 ###"
}
2018-03-26 15:30:05 +02:00
function fail {
echo "An error has occured. Exiting."
exit 1
}
function gitclone {
if [ -d "$2" ] ; then
if [ -d "$2/.git" ] ; then
git -C "$2" pull || fail
else
>&2 echo "Directory "$2" is present and not git. Aborting."
fail
fi
else
git clone "$1" "$2" || fail
fi
}
2018-03-26 14:18:50 +02:00
base_dir="$(dirname "$(readlink -f "$0")")"
cd "$base_dir"
# First, clone Francesco's eh_frame_check
status_update "Cloning eh_frame_check"
2018-03-26 15:30:05 +02:00
gitclone \
https://github.com/francesco-zappa-nardelli/eh_frame_check/ eh_frame_check
2018-03-26 14:18:50 +02:00
# Then, clone glibc
status_update "Cloning glibc"
2018-03-26 15:30:05 +02:00
gitclone git://sourceware.org/git/glibc.git glibc
2018-03-26 14:18:50 +02:00
# Install a virtualenv with required pip packages
status_update "Installing python virtualenv"
2018-03-26 15:30:05 +02:00
virtualenv -p python3 venv || fail
2018-03-26 14:18:50 +02:00
source venv/bin/activate
2018-03-26 15:30:05 +02:00
pip install -r requirements.txt || fail
2018-03-26 14:18:50 +02:00
# Compiling glibc
status_update "Compiling base glibc"
(
mkdir -p glibc/build/install
cd glibc/build
2018-03-26 15:30:05 +02:00
../configure --prefix=install || exit 1
make || exit 1
) || fail
2018-03-26 14:18:50 +02:00
# Compiling testsuite
status_update "Compiling glibc testsuite"
status_update "Feel free to go and drink some coffee now. This will take some time."
(
cd glibc/build
2018-03-26 15:30:05 +02:00
make check || exit 1
) || fail
2018-03-26 14:18:50 +02:00
# Done!
status_update "All set!"