diff --git a/rakelib/builder.rb b/rakelib/builder.rb
index 054bd4f..bc34e94 100644
--- a/rakelib/builder.rb
+++ b/rakelib/builder.rb
@@ -20,6 +20,7 @@ def do_option(name, default)
 end
 
 USE_CLANG = do_option('use_clang', false)
+DEVTOOLS_PATH = do_option('dev_tools_path', '/Developer')
 RUBY_INSTALL_NAME = do_option('ruby_install_name', 'macruby')
 RUBY_SO_NAME = do_option('ruby_so_name', RUBY_INSTALL_NAME)
 ARCHS = 
@@ -86,11 +87,11 @@ INSTALL_NAME = File.join(FRAMEWORK_USR_LIB, 'lib' + RUBY_SO_NAME + '.dylib')
 ARCHFLAGS = ARCHS.map { |a| '-arch ' + a }.join(' ')
 LLVM_MODULES = "core jit nativecodegen interpreter bitwriter"
 if (USE_CLANG) and (`sw_vers -productVersion`.strip >= '10.6')
-  CC = '/usr/bin/clang'
-  CPP = '/usr/bin/llvm-g++-4.2'
+  CC = File.exists?('/usr/bin/clang') ? '/usr/bin/clang' : File.join(DEVTOOLS_PATH, 'usr/bin/clang')
+  CPP = File.exists?('/usr/bin/llvm-g++') ? '/usr/bin/llvm-g++' : File.join(DEVTOOLS_PATH, 'usr/bin/llvm-g++')
 else
-  CC = '/usr/bin/gcc'
-  CPP = '/usr/bin/g++'
+  CC = File.exists?('/usr/bin/gcc') ? '/usr/bin/gcc' : File.join(DEVTOOLS_PATH, 'usr/bin/gcc')
+  CPP = File.exists?('/usr/bin/g++') ? '/usr/bin/g++' : File.join(DEVTOOLS_PATH, 'usr/bin/g++')
 end
 CFLAGS = "-I. -I./include -I./onig -I/usr/include/libxml2 #{ARCHFLAGS} -fno-common -pipe -O3 -g -Wall -fexceptions"
 CFLAGS << " -Wno-parentheses -Wno-deprecated-declarations -Werror" if NO_WARN_BUILD
@@ -102,6 +103,16 @@ LDFLAGS = `#{LLVM_CONFIG} --ldflags --libs #{LLVM_MODULES}`.strip.gsub(/\n/, '')
 LDFLAGS << " -lpthread -ldl -lxml2 -lobjc -lauto -framework Foundation"
 DLDFLAGS = "-dynamiclib -undefined suppress -flat_namespace -install_name #{INSTALL_NAME} -current_version #{MACRUBY_VERSION} -compatibility_version #{MACRUBY_VERSION}"
 
+unless File.exists?(CC) and File.executable?(CC)
+  $stderr.puts "#{CC} either does not exist or is not executable"
+  exit 1
+end
+
+unless File.exists?(CPP) and File.executable?(CPP)
+  $stderr.puts "#{CPP} either does not exist or is not executable"
+  exit 1
+end
+
 # removed: marshal
 OBJS = %w{ 
   array bignum class compar complex enum enumerator error eval file load proc 
