Incase you were curious, xcode-select in Mac OS X 10.9 (Mavericks) comes with an --install flag that will prompt the user if xCode Command Line Tools is not installed. I had created a recursive script to check installation and continually attempt an install, but then realized that the latest version of Homebrew does this so much better. So you could attempt to install brew first and then have Homebrew install gcc via xCode. Just a thought.