For example, when looking for gcc-4.4, use --cc=gcc-4.4 or set HOMEBREW_GCC=gcc-4.4 and gcc-4.4 must be in environmental variable PATH, and its name CANNOT be gcc44 or anything else. You could do something like this