aboutsummaryrefslogtreecommitdiff
path: root/deps/config.sh
blob: 766991e3f1bed6bb121c06ef3cf49edb8e413fe6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

MYPWD=$(realpath $(dirname ${BASH_SOURCE[0]}))
echo ">>> ${MYPWD}"

export targ="i686-w64-mingw32"
echo "target  = ${targ}"

export MY_SYS_ROOT="${MYPWD}/sysroot"
echo "sysroot = ${MY_SYS_ROOT}"

if [[ $- =~ e ]]; then
	echo '>>> disabled bash exit on non-zero (set -e)'
	BASH_EXITONFAIL=1
	set +e
else
	BASH_EXITONFAIL=0
fi

echo "${PATH}" | grep -qoE ":${MY_SYS_ROOT}"
if [ $? -ne 0 ]; then
	export PATH="${MY_SYS_ROOT}/bin:${MY_SYS_ROOT}/${targ}/bin:${PATH}"
fi
echo "PATH    = ${PATH}"

if [ $BASH_EXITONFAIL -eq 1 ]; then
	set -e
	unset BASH_EXITONFAIL
fi