Skip to content

Instantly share code, notes, and snippets.

@todd-a-jacobs
Created January 27, 2015 05:23
Show Gist options
  • Save todd-a-jacobs/063335d477f5f11f844e to your computer and use it in GitHub Desktop.
Save todd-a-jacobs/063335d477f5f11f844e to your computer and use it in GitHub Desktop.
Path to latest version of llvm-config.
#!/bin/sh
# Use standard location of port command to detect MacPorts.
if [ -x /opt/local/bin/port ]; then
# Query port for path to latest version of llvm-config. Selects
# latest version with tail if more than one version is installed
# with tail.
port contents $(port installed | egrep -o 'llvm-[^ ]+' | tail -1) |
# Uses head to avoid binaries in libexec rather than bin.
fgrep llvm-config | head -1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment