#!/bin/sh
set -e

OPTIONS=

if [ "$config_build_pic" = yes ]; then
    # No way to add just -fPIC without overriding the default flags, and crossc
    # is currently only usable on windows, where -fPIC is apparently not
    # required (according to rossy) even when building libmpv[-shared].
    true
fi
if [ "$config_build_host" ]; then
    OPTIONS="$OPTIONS CXX=$config_build_host-g++"
fi

set -x
make -C "$config_crossc_source" install-static prefix="$config_local_prefix" $OPTIONS "$@"

# crossc.pc file has "Libs: ... -lstdc++" when built as static, so no special
# mpv configure options are required to handle the static linkage.
