Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Provide both --cc and --cxx in configure.

Most versions of GCC are smart enough to understand when we are compiling/linking
C++ code. However, the GCC 4.5 in MingW is apparently not one of the smart ones
so the tr1/hash detection code fails on Windows. On the other hand, C++ changed
the C prototype for ANYARGS functions, so e.g. BigDecimal C ext will not compile
properly with g++. So, we provide options for both in configure.
  • Loading branch information...
commit 6596ed773ba010b0cfdb55accd194c180b1b609d 1 parent 6c3282c
@brixen brixen authored
Showing with 16 additions and 10 deletions.
  1. +3 −3 Rakefile
  2. +13 −7 configure
View
6 Rakefile
@@ -27,7 +27,7 @@ end
require config_rb
BUILD_CONFIG = Rubinius::BUILD_CONFIG
-unless BUILD_CONFIG[:config_version] == 23
+unless BUILD_CONFIG[:config_version] == 24
STDERR.puts "Your configuration is outdated, please run ./configure first"
exit 1
end
@@ -52,8 +52,8 @@ end
# Set the build compiler to the configured compiler unless
# the compiler is set via CC environment variable.
-ENV['CC'] = BUILD_CONFIG[:compiler] unless ENV['CC']
-ENV['CXX'] = BUILD_CONFIG[:compiler] unless ENV['CXX']
+ENV['CC'] = BUILD_CONFIG[:cc] unless ENV['CC']
+ENV['CXX'] = BUILD_CONFIG[:cxx] unless ENV['CXX']
$dlext = RbConfig::CONFIG["DLEXT"]
View
20 configure
@@ -32,7 +32,8 @@ class Configure
@windows = @host =~ /mingw|mswin/
# Compiler / build settings
- @compiler = ENV['CC'] || 'gcc'
+ @cc = ENV['CC'] || 'gcc'
+ @cxx = ENV['CXX'] || 'g++'
@rake = ENV['RAKE'] || 'rake'
@install = false
@version_19 = false
@@ -75,7 +76,7 @@ class Configure
@libversion = "1.2"
@version = "#{@libversion}.0dev"
@release_date = "xxxx-xx-xx"
- @config_version = 23
+ @config_version = 24
if !ENV['RELEASE'] and File.directory?(root + "/.git")
@buildrev = `git rev-list --max-count=1 --all`.chomp
@@ -121,8 +122,12 @@ class Configure
o.doc "\n Compiler settings"
- o.on "--cc", "COMPILER", "Compiler to use (eg gcc, clang)" do |cc|
- @compiler = cc
+ o.on "--cc", "COMPILER", "Compiler to use for C code (eg gcc, clang)" do |cc|
+ @cc = cc
+ end
+
+ o.on "--cxx", "COMPILER", "Compiler to use C++ code (eg g++, clang++)" do |cxx|
+ @cxx = cxx
end
o.doc "\n LLVM settings"
@@ -525,7 +530,7 @@ class Configure
yield f
end
- system "#{@compiler} #{env('CFLAGS')} -lstdc++ -lm -o #{basename} #{source} >>#{@log.path} 2>&1"
+ system "#{@cxx} #{env('CFLAGS')} -lstdc++ -lm -o #{basename} #{source} >>#{@log.path} 2>&1"
return $?.exitstatus unless run
unless $?.exitstatus == 0
@@ -600,7 +605,7 @@ int main() { X x; return 0; }
tf.close
- system "#{@compiler} -S -o - -x c #{c_includes} #{env('CFLAGS')} #{tf.path} >>#{@log.path} 2>&1"
+ system "#{@cxx} -S -o - -x c #{c_includes} #{env('CFLAGS')} #{tf.path} >>#{@log.path} 2>&1"
status = ($?.exitstatus == 0)
tf.unlink
@@ -686,7 +691,8 @@ module Rubinius
:build_rake => "#{@rake}",
:llvm => :#{@llvm},
:llvm_configure => "#{@llvm_configure}",
- :compiler => "#{@compiler}",
+ :cc => "#{@cc}",
+ :cxx => "#{@cxx}",
:defines => #{@defines.inspect},
:host => "#{@host}",
:cpu => "#{@cpu}",
Please sign in to comment.
Something went wrong with that request. Please try again.