aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-22 02:17:30 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-22 02:17:30 +0000
commit24513fe21eddef33d513413c0541d8935ec5ad80 (patch)
tree3d9c53793220b89421ce41bd90715d036051cd17 /lib/mkmf.rb
parentb1bdada158244e16bab6456e68b39ce48a2a2f58 (diff)
downloadruby-24513fe21eddef33d513413c0541d8935ec5ad80.tar.gz
workaround for mingw
* lib/mkmf.rb (try_link0, try_compile, try_cpp): check if the target file get created actually. workaround for the case that the exit status of a cygwin program seems lost on mingw. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 231091ee48..a0cd26a871 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -482,7 +482,7 @@ MSG
end
else
try_do(src, cmd, *opts, &b)
- end
+ end and File.executable?("conftest#{$EXEEXT}")
end
# Returns whether or not the +src+ can be compiled as a C source and linked
@@ -511,7 +511,8 @@ MSG
# [+src+] a String which contains a C source
# [+opt+] a String which contains compiler options
def try_compile(src, opt="", *opts, &b)
- with_werror(opt, *opts) {|_opt, *_opts| try_do(src, cc_command(_opt), *_opts, &b)}
+ with_werror(opt, *opts) {|_opt, *_opts| try_do(src, cc_command(_opt), *_opts, &b)} and
+ File.file?("conftest.#{$OBJEXT}")
ensure
MakeMakefile.rm_f "conftest*"
end
@@ -526,7 +527,8 @@ MSG
# [+src+] a String which contains a C source
# [+opt+] a String which contains preprocessor options
def try_cpp(src, opt="", *opts, &b)
- try_do(src, cpp_command(CPPOUTFILE, opt), *opts, &b)
+ try_do(src, cpp_command(CPPOUTFILE, opt), *opts, &b) and
+ File.file?("conftest.i")
ensure
MakeMakefile.rm_f "conftest*"
end
@@ -2242,6 +2244,7 @@ site-install-rb: install-rb
$DLDFLAGS = with_config("dldflags", arg_config("DLDFLAGS", config["DLDFLAGS"])).dup
$LIBEXT = config['LIBEXT'].dup
$OBJEXT = config["OBJEXT"].dup
+ $EXEEXT = config["EXEEXT"].dup
$LIBS = "#{config['LIBS']} #{config['DLDLIBS']}"
$LIBRUBYARG = ""
$LIBRUBYARG_STATIC = config['LIBRUBYARG_STATIC']