abinfo "Removing bundled gtest ..."
rm -rv "$SRCDIR"/Source/ThirdParty/gtest/

abinfo "Appending /usr/include/openjpeg-2.3 to include dir ..."
export CFLAGS="${CFLAGS} -I/usr/include/openjpeg-2.3"
export CXXFLAGS="${CXXFLAGS} -I/usr/include/openjpeg-2.3"

# This should match the set in spec.
case "$(uname -m)" in
  mips*    ) NJOBS=8  ;;
# FIXME: see spec.
#  riscv64* ) NJOBS=32 ;;
  *        ) NJOBS=16 ;;
esac

abinfo "Limit the number of parallel jobs to ${NJOBS}"
export NINJA_FLAGS="-j${NJOBS}"
