Skip to content

Instantly share code, notes, and snippets.

@jniemann66
Last active May 25, 2017 01:39
Show Gist options
  • Save jniemann66/2ecdc9e9799269c19b6b74acc50d83d4 to your computer and use it in GitHub Desktop.
Save jniemann66/2ecdc9e9799269c19b6b74acc50d83d4 to your computer and use it in GitHub Desktop.
Script to resolve the include search paths from minGW to something sensible
#!/usr/bin/env bash
# usage: resolve-path.sh "<some-stupid-path>"
# changes this: "e:\mingw\bin\../lib/gcc/mingw32/5.3.0/../../../../include"
# ... into this: /e/mingw/include
# first sed script replaces <letter><colon> with <forward-slash><letter>
# second sed script replaces back-slashes with forward-slashes
realpath $1 | sed -e 's/\([a-zA-Z]\):/\/\1/g' -e 's/\\/\//g'
# see http://www.mingw.org/wiki/IncludePathHOWTO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment