forked from zimbatm/ffmpeg-static
-
Notifications
You must be signed in to change notification settings - Fork 4
/
env.source
27 lines (23 loc) · 777 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
# 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}"
export LDFLAGS="-L${TARGET_DIR}/lib"
# FIXME: detect OS somehow
export DYLD_LIBRARY_PATH="${TARGET_DIR}/lib"
#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