]> git.sesse.net Git - casparcg/blobdiff - dependencies64/ffmpeg/ffmpeg-build-linux/env.source
[build] Added the modified build script based on an old version of https://github...
[casparcg] / dependencies64 / ffmpeg / ffmpeg-build-linux / env.source
diff --git a/dependencies64/ffmpeg/ffmpeg-build-linux/env.source b/dependencies64/ffmpeg/ffmpeg-build-linux/env.source
new file mode 100644 (file)
index 0000000..b08d880
--- /dev/null
@@ -0,0 +1,28 @@
+# 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 PKG_CONFIG_PATH="$TARGET_DIR/lib/pkgconfig:$TARGET_DIR/lib64/pkgconfig:$TARGET_DIR/usr/local/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