aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/mkmf.rb3
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index c2b4683e47..816440886c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Nov 8 17:30:50 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (cpp_command): remove multiple -arch flags since cpp
+ cannot work.
+
Tue Nov 8 14:50:55 2011 NAKAMURA Usaku <usa@ruby-lang.org>
* io.c (io_fwrite): call rb_w32_write_console() only if FMODE_TTY is
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 4ac6d944b0..5c688cfbec 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -418,6 +418,9 @@ def cpp_command(outfile, opt="")
conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote,
'arch_hdrdir' => $arch_hdrdir.quote,
'top_srcdir' => $top_srcdir.quote)
+ if $universal and (arch_flag = conf['ARCH_FLAG']) and !arch_flag.empty?
+ conf['ARCH_FLAG'] = arch_flag.gsub(/(?:\G|\s)-arch\s+\S+/, '')
+ end
RbConfig::expand("$(CPP) #$INCFLAGS #$CPPFLAGS #$CFLAGS #{opt} #{CONFTEST_C} #{outfile}",
conf)
end