Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubinius/rubinius
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4ae051b6d1f9
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 35425c686322
Choose a head ref
  • 6 commits
  • 1 file changed
  • 2 contributors

Commits on Jan 27, 2015

  1. Configure#macports? checks for MacPorts.

    New method adds the ability to check for MacPorts separately from
    Homebrew.
    todd-a-jacobs committed Jan 27, 2015
    Copy the full SHA
    4f74fe8 View commit details
  2. Configure#macports_llvm_config finds llvm-config.

    - MacPorts adds versioned binaries into the path, rather than a single
      binary named llvm-config.
    - This method queries MacPorts for the path to the latest installed
      version of llvm-config.
    todd-a-jacobs committed Jan 27, 2015
    Copy the full SHA
    ecbb46f View commit details

Commits on Jan 28, 2015

  1. Branch on MacPorts/Homebrew for llvm-config.

    If MacPorts is installed, query MacPorts for the correct llvm-config*
    binary to use. Otherwise, use the existing brew lookup.
    todd-a-jacobs committed Jan 28, 2015
    Copy the full SHA
    fc07f47 View commit details
  2. Rewrite Configure#macports_llvm_config.

    - Replace comments with descriptive temporary variables.
    - Limit selectable LLVM ports to those within the currently-supported
      range of llvm-3.0 to llvm-3.5.
    todd-a-jacobs committed Jan 28, 2015
    Copy the full SHA
    a970b35 View commit details
  3. Copy the full SHA
    8071ec1 View commit details
  4. Merge pull request #3297 from CodeGnome/feature/llvm-config_support_f…

    …or_macports
    
    Add support for automatic configuration of llvm-config under MacPorts.
    brixen committed Jan 28, 2015
    Copy the full SHA
    35425c6 View commit details
Showing with 25 additions and 2 deletions.
  1. +25 −2 configure
27 changes: 25 additions & 2 deletions configure
Original file line number Diff line number Diff line change
@@ -600,8 +600,12 @@ Unsupported language version requested: #{version}. Options are #{@supported_ver
if which
config = File.join(which, "llvm-config")
elsif @darwin
out = `brew list llvm | grep '/llvm-config$'`
config = out.chomp if $?.success?
if macports?
config = macports_llvm_config
else
out = `brew list llvm | grep '/llvm-config$'`
config = out.chomp if $?.success?
end
end
end

@@ -1989,6 +1993,25 @@ Available commands are:
message.index("\n") != nil
end
end

# Returns true if MacPorts is installed in its default location.
def macports?
File.exists? '/opt/local/bin/port'
end

# Query MacPorts for the path to the latest installed version of
# llvm-config that is within the range of supported LLVM versions.
def macports_llvm_config
supported_versions = (3.0 .. 3.5)
installed_ports = `port installed | egrep -o 'llvm-[^ ]+'`.split
latest_usable_port = installed_ports.sort.select do |fname|
version = fname.match(/-\K.*/)[0].to_f
supported_versions.include? version
end.last
avail_binaries = `port contents #{latest_usable_port} |
fgrep llvm-config`.split
avail_binaries.reject { |fname| fname.include? 'libexec' }.last
end
end

STDOUT.sync = true