eh_frame_check_setup/env
Théophile Bastian 461f3d3ef0 Add Makefile, fix multiple things
Makefile: useful to run in parallel at no cost
2018-03-26 17:20:29 +02:00

30 lines
1 KiB
Bash
Executable file

#!/bin/bash
base_dir="$(dirname "$(readlink -f "$0")")"
if [ ! -d "$base_dir/glibc" ] || [ ! -d "$base_dir/eh_frame_check" ] \
|| [ ! -d "$base_dir/venv" ]; then
>&2 echo "The environment is not yet configured. Please run " \
"\`setup_env.sh\` first."
exit 1
fi
glibc_base="$base_dir/glibc/build"
python_version="$(ls -1 "$base_dir/venv/lib/" | grep python | head -n 1)"
if [ -z "$python_version" ] ; then
>&2 echo "Virtualenv has no python installed. Exiting."
exit 1
fi
python_base="$base_dir/venv/lib/$python_version/site-packages"
export LIB_PATH="${glibc_base}:${glibc_base}/math:${glibc_base}/elf:${glibc_base}/dlfcn:${glibc_base}/nss:${glibc_base}/nis:${glibc_base}/rt:${glibc_base}/resolv:${glibc_base}/crypt:${glibc_base}/mathvec:${glibc_base}/support:${glibc_base}/nptl"
export GCONV_PATH=${glibc_base}/iconvdata
export LOCPATH=${glibc_base}/localedata
export LC_ALL=C
export PYTHONPATH="$PYTHONPATH:$python_base"
export PS1="(efc_env) $PS1"
unset glibc_base python_version python_base