-
Notifications
You must be signed in to change notification settings - Fork 254
/
env.source
30 lines (26 loc) · 915 Bytes
/
env.source
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
30
# Source this shell script to get the same environment as the build script
if [ -z "$ENV_ROOT" ]; then
if [ -f "./env.source" ]; then
ENV_ROOT=`pwd`
export ENV_ROOT
fi
fi
if [ -z "$ENV_ROOT" ]; then
echo "Missing ENV_ROOT variable" >&2
elif [ "${ENV_ROOT#/}" = "$ENV_ROOT" ]; then
echo "ENV_ROOT must be an absolute path" >&2
else
BUILD_DIR="${BUILD_DIR:-$ENV_ROOT/build}"
TARGET_DIR="${TARGET_DIR:-$ENV_ROOT/target}"
DOWNLOAD_DIR="${DOWNLOAD_DIR:-$ENV_ROOT/dl}"
BIN_DIR="${BIN_DIR:-$ENV_ROOT/bin}"
export LDFLAGS="-L${TARGET_DIR}/lib"
# FIXME: detect OS somehow
export DYLD_LIBRARY_PATH="${TARGET_DIR}/lib"
export PKG_CONFIG_PATH="$TARGET_DIR/lib/pkgconfig"
#export CFLAGS="-I${TARGET_DIR}/include $LDFLAGS -static-libgcc -Wl,-Bstatic -lc"
export CFLAGS="-I${TARGET_DIR}/include $LDFLAGS"
export PATH="${TARGET_DIR}/bin:${PATH}"
# Force PATH cache clearing
hash -r
fi