Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

portindex: spoof compiler version #361

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions src/port/portindex.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,43 @@ set worker_init_script {
package require macports
package require Thread

# Spoof the compiler version
rename macports::get_compiler_version macports::__get_compiler_version
proc macports::get_compiler_version {compiler developer_dir} {
global port_options
if {![dict exists $port_options os.major]} {
return [macports::__get_compiler_version $compiler $developer_dir]
}
set os_major [dict get $port_options os.major]
switch -- [file tail ${compiler}] {
clang {
if {${os_major} >= 22} {
return "1500"
} elseif {${os_major} >= 17} {
return "1000.11.45.2"
} elseif {${os_major} >= 15} {
return "800.0.38"
} elseif {${os_major} >= 14} {
return "602.0.49"
} elseif {${os_major} >= 12} {
return "500.2.75"
} elseif {${os_major} >= 11} {
return "421.0.57"
} else {
return "1.0"
}
}
llvm-gcc-4.2 -
gcc-4.2 -
gcc-4.0 {
return "1.0"
}
default {
return -code error "don't know how to determine build number of compiler \"${compiler}\""
}
}
}

proc _read_index {idx} {
global qindex oldfd
set offset [dict get $qindex $idx]
Expand Down
Loading