export ARCH=$(uname -m) # do not use all cpus because my computer dies export JOBS=$(awk -v count=$(nproc) 'BEGIN { print ( int( count - 1 ) ) }') if [[ "$(uname)" == "Darwin" ]]; then export JOBS=$(awk -v count=$(sysctl -n hw.ncpu) 'BEGIN { print ( int ( count - 1 ) ) }') fi while [[ $# -gt 0 ]]; do case $1 in --arch) export ARCH=$2 shift 2 ;; *) echo "Usage: $0 --arch [arch]" exit 1 ;; esac done export workDir=$(pwd)/work export outDir=$(pwd)/out export PREFIX=$workDir/prefix export PKG_CONFIG_DIR=$PREFIX/lib/pkgconfig export PKG_CONFIG_PATH=$PKG_CONFIG_DIR rm -rf $PREFIX mkdir -p $PREFIX mkdir -p $workDir mkdir -p $outDir case $FFBUILD_PLATFORM in win) bash scripts/build-ffnvcodec.sh # disabled due to build error # bash scripts/build-libmfx.sh ;; esac bash scripts/build-openh264.sh bash scripts/build-ffmpeg.sh