Skip to content

Commit 737fee6

Browse files
committedJun 9, 2015
add missing macports? and macports_llvm_config methods to configure
1 parent b360672 commit 737fee6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
 

‎configure

+18
Original file line numberDiff line numberDiff line change
@@ -1987,6 +1987,24 @@ Available commands are:
19871987
message.index("\n") != nil
19881988
end
19891989
end
1990+
# Returns true if the *port* command is in the PATH and identifies
1991+
# itself with "MacPorts" when run interactively.
1992+
def macports?
1993+
`echo quit | port 2>&-`.start_with? 'MacPorts'
1994+
end
1995+
1996+
# Query MacPorts for the path to the latest installed version of
1997+
# llvm-config that is within the range of supported LLVM versions.
1998+
def macports_llvm_config
1999+
supported_versions = (3.0 .. 3.5)
2000+
installed_ports = `port installed | egrep -o 'llvm-[^ ]+'`.split
2001+
latest_usable_port = installed_ports.sort.select do |fname|
2002+
version = fname.match(/-\K.*/)[0].to_f
2003+
supported_versions.include? version
2004+
end.last
2005+
avail_binaries = `port contents #{latest_usable_port} | fgrep llvm-config`.split
2006+
avail_binaries.reject { |fname| fname.include? 'libexec' }.last
2007+
end
19902008
end
19912009

19922010
STDOUT.sync = true

0 commit comments

Comments
 (0)