6 if not 'go' in config.root.llvm_bindings:
7 config.unsupported = True
9 # Resolve certain symlinks in the first word of compiler.
11 # This is a Go-specific hack. cgo and other Go tools check $CC and $CXX for the
12 # substring 'clang' to determine if the compiler is Clang. This won't work if
13 # $CC is cc and cc is a symlink pointing to clang, as it is on Darwin.
14 def fixup_compiler_path(compiler):
15 args = shlex.split(compiler)
16 path = distutils.spawn.find_executable(args[0])
19 if path.endswith('/cc') and os.readlink(path) == 'clang':
20 args[0] = path[:len(path)-2] + 'clang'
25 if path.endswith('/c++') and os.readlink(path) == 'clang++':
26 args[0] = path[:len(path)-3] + 'clang++'
30 return ' '.join([pipes.quote(arg) for arg in args])
32 config.environment['CC'] = fixup_compiler_path(config.host_cc)
33 config.environment['CXX'] = fixup_compiler_path(config.host_cxx)