Permalink
Browse files

Have TraceMonkey prefer the compiler that built Ruby

[Our version of] TraceMonkey won't build with clang. But then, nor will
Ruby 1.8.7, so there's a moderate chance it can tell us where to find a
"better" compiler.

This obviously doesn't help you if you're using a remotely modern Ruby.
The next best choice would seem to be that we go spelunking for a
suitable compiler by ourselves. :/

Also, have TraceMonkey skip its tests... there was another compile error
in there.
  • Loading branch information...
1 parent 51afedb commit 5d53a56f83ae435811939a1c9c9738ccea529ae1 @matthewd matthewd committed Dec 16, 2013
Showing with 16 additions and 1 deletion.
  1. +4 −0 CHANGELOG.rdoc
  2. +11 −0 Rakefile
  3. +1 −1 ext/tracemonkey/extconf.rb
View
@@ -1,3 +1,7 @@
+=== Pending
+
+* Have TraceMonkey prefer the compiler that built Ruby; TraceMonkey and clang don't get along
+
=== 2.0.0.pre3 / 2010-03-02
* convert/protect predicates so that exceptions don't cause stack-jumping SEGVs
View
@@ -13,6 +13,17 @@ INTERPRETERS = [ "tracemonkey" ]
SUFFIXES = {}
SUFFIXES[ "tracemonkey" ] = "cc"
+unless RbConfig::CONFIG['CC'].empty?
+ # Let's have TM use the same C compiler that our Ruby did.
+ ENV['CC'] = RbConfig::CONFIG['CC']
+
+ # Further, let's try to guess a "matching" C++ compiler. This is
+ # mostly about using c++-4.2, if available, on new Mac OS X; our TM
+ # won't build on gcc-clang... but nor will Ruby 1.8.7.
+ cxx_maybe = RbConfig::CONFIG['CC'].gsub(/gcc/, 'c++')
+ ENV['CXX'] = ENV['CCC'] = cxx_maybe if File.executable?(cxx_maybe)
+end
+
generated_nodes = []
INTERPRETERS.each do |interpreter|
@@ -24,7 +24,7 @@
system "autoconf213" or
system "autoconf-2.13" or
raise "could not run autoconf" if Dir["configure"].empty?
- system "./configure --enable-static" or raise "could not run configure" if Dir["Makefile"].empty?
+ system "./configure --disable-tests --enable-static" or raise "could not run configure" if Dir["Makefile"].empty?
system 'egrep -q '+%q('MOZ_DEBUG[[:space:]]*=[[:space:]]*1')+' config/autoconf.mk'
debug = ""
if $?.exitstatus == 0

0 comments on commit 5d53a56

Please sign in to comment.