#!/usr/bin/env bash

# Translates output from MSYS2/MinGW-w64 llvm-config.exe to MSYS2 form.
# It may make sense to include this as part of the llvm packages?

MINGW_PREFIX_M=$(cygpath -m $(dirname $(dirname $(which llvm-config))))
# echo "input $*" >> /tmp/llvm-config.log
# echo "output " $(llvm-config.exe $*) | tr '\\' '/' | sed "s|${MINGW_PREFIX_M}|$(cygpath -u ${MINGW_PREFIX_M})|g" >> /tmp/llvm-config.log
echo $(llvm-config.exe $*) | tr '\\' '/' | sed "s|${MINGW_PREFIX_M}|$(cygpath -u ${MINGW_PREFIX_M})|g"
