#!/bin/bash
set -e

export CONFIG_SHELL=/C/tools/msys64/usr/bin/bash.exe
export CPPFLAGS=-D__USE_MINGW_ANSI_STDIO=1;
export AR=gcc-ar;
export RANLIB=gcc-ranlib;

$shell autoreconf -vfi

prefix=/C/tools/msys64/mingw64/

$shell ./configure \
    --prefix=$prefix \
    ${DIRECT_SHOW} \
    --without-gtk \
    --without-python \
    --without-qt --without-java \
    --without-imagemagick \
    --enable-pthread --disable-dependency-tracking

echo "Building"
$shell $MAKE

echo "Installing"

# Ignore errors here, as it won't be able to create some dirs
$shell $MAKE install || true

echo "Success!"
