ruby-changes:23051
From: nobu <ko1@a...>
Date: Thu, 22 Mar 2012 11:17:39 +0900 (JST)
Subject: [ruby-changes:23051] nobu:r35101 (trunk): workaround for mingw
nobu 2012-03-22 11:17:30 +0900 (Thu, 22 Mar 2012) New Revision: 35101 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35101 Log: 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. Modified files: trunk/lib/mkmf.rb Index: lib/mkmf.rb =================================================================== --- lib/mkmf.rb (revision 35100) +++ lib/mkmf.rb (revision 35101) @@ -482,7 +482,7 @@ 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 @@ # [+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 @@ # [+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 @@ $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'] -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/