Commit c0a2d90c by Sam Stephenson

Look for gcc-* anywhere in $PATH. Fixes #109

parent 8e6e2372
......@@ -252,9 +252,7 @@ require_gcc() {
locate_gcc() {
local gcc gccs
shopt -s nullglob
gccs=( /usr/bin/gcc-* )
shopt -u nullglob
IFS=: gccs=($(gccs_in_path))
verify_gcc "$CC" ||
verify_gcc "$(command -v gcc || true)" || {
......@@ -266,6 +264,22 @@ locate_gcc() {
return 1
}
gccs_in_path() {
local gcc path paths
local gccs=()
IFS=: paths=($PATH)
shopt -s nullglob
for path in "${paths[@]}"; do
for gcc in "$path"/gcc-*; do
gccs["${#gccs[@]}"]="$gcc"
done
done
shopt -u nullglob
printf :%s "${gccs[@]}"
}
verify_gcc() {
local gcc="$1"
if [ -z "$gcc" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment