diff -Naur ruby-2.0.0-p195-orig/configure ruby-2.0.0-p195/configure --- ruby-2.0.0-p195-orig/configure 2013-05-14 12:02:28.000000000 +0000 +++ ruby-2.0.0-p195/configure 2013-05-22 06:32:23.706054700 +0000 @@ -3171,7 +3171,7 @@ nacl_cv_os_nick=linux ;; #( darwin*) : nacl_cv_os_nick=mac ;; #( - cygwin*|mingw*) : + cygwin*|msys*|mingw*) : nacl_cv_os_nick=win ;; #( *) : nacl_cv_os_nick=$build_os ;; @@ -4615,7 +4615,7 @@ case "$host_os" in #( - cygwin*) : + cygwin*|msys*) : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mingw32 environment" >&5 $as_echo_n "checking for mingw32 environment... " >&6; } @@ -5649,7 +5649,7 @@ case "$target_os" in #( - cygwin*|mingw*) : + cygwin*|msys*|mingw*) : ac_cv_prog_ac_ct_OBJCOPY=":" ;; #( *) : ;; @@ -5858,7 +5858,7 @@ case "$target_os" in #( - cygwin*|mingw*) : + cygwin*|msys*|mingw*) : if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. @@ -7514,7 +7514,7 @@ # comments. We bypass ANSI C mode for them. Otherwise # extension libs cannot include those headers. ;; #( - cygwin*|darwin*|netbsd*) : + cygwin*|msys*|darwin*|netbsd*) : # need lgamma_r(), finite() ;; #( @@ -8170,7 +8170,7 @@ esac LIBS="$LIBS" # m lib is include in root under BeOS/Haiku ;; #( - cygwin*) : + cygwin*|msys*) : ac_cv_header_langinfo_h=yes for ac_func in cygwin_conv_path do : @@ -15822,7 +15822,7 @@ setjmp_prefix=_ elif test "$ac_cv_func_sigsetjmp" = yes; then case $target_os in #( - solaris*|cygwin*) : + solaris*|cygwin*|msys*) : setjmp_prefix= ;; #( *) : setjmp_prefix=sig ;; @@ -17334,7 +17334,7 @@ *) : CCDLFLAGS="$CCDLFLAGS -fno-common" ;; esac ;; #( - bsdi*|beos*|haiku*|cygwin*|mingw*|aix*|interix*) : + bsdi*|beos*|haiku*|cygwin*|msys*|mingw*|aix*|interix*) : ;; #( *) : @@ -17521,10 +17521,10 @@ : ${LDSHARED='$(LD) -Bshareable -x'} LDFLAGS="$LDFLAGS -L/lib -L/usr/lib -L/usr/local/lib" rb_cv_dlopen=yes ;; #( - cygwin*|mingw*) : + cygwin*|msys*|mingw*) : : ${LDSHARED='$(CC) -shared $(if $(filter-out -g -g0,$(debugflags)),,-s)'} - XLDFLAGS="$XLDFLAGS -Wl,--stack,0x00200000,--enable-auto-import" + XLDFLAGS="$XLDFLAGS -Xlinker --stack -Xlinker 0x00200000,0x00040000 -Xlinker --enable-auto-import" DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import" : ${LIBPATHENV=""} rb_cv_dlopen=yes ;; #( @@ -17829,7 +17829,7 @@ LOAD_RELATIVE=1 DLEXT=dll ;; #( - cygwin*|mingw*|*djgpp*) : + cygwin*|msys*|mingw*|*djgpp*) : LOAD_RELATIVE=1 DLEXT=so ;; #( @@ -18109,7 +18109,7 @@ SOLIBS= case "$target_os" in #( - cygwin*|mingw*|beos*|haiku*|darwin*|os2-emx*) : + cygwin*|msys*|mingw*|beos*|haiku*|darwin*|os2-emx*) : : ${DLDLIBS=""} ;; #( @@ -18334,7 +18334,7 @@ LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)' ;; #( - mingw*|cygwin*|mswin*) : + mingw*|cygwin*|msys*|mswin*) : LIBRUBY_RELATIVE=yes ;; #( @@ -18791,7 +18791,7 @@ esac CPPFLAGS="$CPPFLAGS -I/boot/home/config/include" ;; #( - cygwin*|mingw*) : + cygwin*|msys*|mingw*) : RUBY_SO_NAME="${RUBY_SO_NAME}"'$(MAJOR)$(MINOR)$(TEENY)' LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)' @@ -18803,6 +18803,13 @@ LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)' fi ;; #( + msys*) : + + if test x"$enable_shared" = xyes; then + LIBRUBY_SO='msys-$(RUBY_SO_NAME)'.dll + LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)' + fi + ;; #( mingw*) : RUBY_SO_NAME="${rb_cv_msvcrt}-${RUBY_SO_NAME}" @@ -19145,7 +19152,7 @@ RUBY_INSTALL_NAME="${ri_prefix}"'$(RUBY_BASE_NAME)'"${ri_suffix}" case "$target_os" in #( - cygwin*|mingw*) : + cygwin*|msys*|mingw*) : RUBYW_INSTALL_NAME="${ri_prefix}"'$(RUBYW_BASE_NAME)'"${ri_suffix}" rubyw_install_name='$(RUBYW_INSTALL_NAME)' diff -Naur ruby-2.0.0-p195-orig/configure.in ruby-2.0.0-p195/configure.in --- ruby-2.0.0-p195-orig/configure.in 2013-05-11 18:12:02.000000000 +0000 +++ ruby-2.0.0-p195/configure.in 2013-05-22 06:41:23.862304700 +0000 @@ -48,7 +48,7 @@ AC_DEFUN([RUBY_MINGW32], [AS_CASE(["$host_os"], -[cygwin*], [ +[cygwin*|msys*], [ AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32, [AC_TRY_CPP([ #ifndef __MINGW32__ @@ -95,7 +95,7 @@ AS_CASE(["$build_os"], [linux*], [nacl_cv_os_nick=linux], [darwin*], [nacl_cv_os_nick=mac], - [cygwin*|mingw*], [nacl_cv_os_nick=win], + [cygwin*|msys*|mingw*], [nacl_cv_os_nick=win], [nacl_cv_os_nick=$build_os]) host="$host_cpu-chromium-$host_os-" @@ -460,14 +460,14 @@ ASFLAGS=$ASFLAGS AC_SUBST(ASFLAGS) -AS_CASE(["$target_os"],[cygwin*|mingw*], [ac_cv_prog_ac_ct_OBJCOPY=":"]) +AS_CASE(["$target_os"],[cygwin*|msys*|mingw*], [ac_cv_prog_ac_ct_OBJCOPY=":"]) # BSD's ports and MacPorts prefix GNU binutils with 'g' AC_CHECK_TOOLS(OBJDUMP, [objdump gobjdump]) AC_CHECK_TOOLS(OBJCOPY, [objcopy gobjcopy]) AS_CASE(["$target_os"], -[cygwin*|mingw*], [ +[cygwin*|msys*|mingw*], [ AC_CHECK_TOOL(WINDRES, windres) AC_CHECK_TOOL(DLLWRAP, dllwrap) target=`echo $target | sed "s/^$target_cpu-/-/"` @@ -711,7 +711,7 @@ # comments. We bypass ANSI C mode for them. Otherwise # extension libs cannot include those headers. ], - [cygwin*|darwin*|netbsd*], [ + [cygwin*|msys*|darwin*|netbsd*], [ # need lgamma_r(), finite() ], [haiku], [ @@ -887,7 +887,7 @@ [haiku*], [ ac_cv_func_shutdown=no]) LIBS="$LIBS" # m lib is include in root under BeOS/Haiku ], -[cygwin*], [ ac_cv_header_langinfo_h=yes +[cygwin*|msys*], [ ac_cv_header_langinfo_h=yes AC_CHECK_FUNCS(cygwin_conv_path) AC_LIBOBJ([langinfo]) ], @@ -1678,7 +1678,7 @@ elif test "$ac_cv_func__setjmp" = yes; then setjmp_prefix=_ elif test "$ac_cv_func_sigsetjmp" = yes; then - AS_CASE([$target_os],[solaris*|cygwin*],[setjmp_prefix=],[setjmp_prefix=sig]) + AS_CASE([$target_os],[solaris*|cygwin*|msys*],[setjmp_prefix=],[setjmp_prefix=sig]) else setjmp_prefix= fi @@ -2248,7 +2248,7 @@ # mkmf.rb's have_header() to fail if the desired resource happens to be # installed in the /usr/local tree. RUBY_APPEND_OPTION(CCDLFLAGS, -fno-common)], - [bsdi*|beos*|haiku*|cygwin*|mingw*|aix*|interix*], [ ], + [bsdi*|beos*|haiku*|cygwin*|msys*|mingw*|aix*|interix*], [ ], [ RUBY_APPEND_OPTION(CCDLFLAGS, -fPIC)]) else @@ -2383,9 +2383,9 @@ : ${LDSHARED='$(LD) -Bshareable -x'} LDFLAGS="$LDFLAGS -L/lib -L/usr/lib -L/usr/local/lib" rb_cv_dlopen=yes], - [cygwin*|mingw*], [ + [cygwin*|msys*|mingw*], [ : ${LDSHARED='$(CC) -shared $(if $(filter-out -g -g0,$(debugflags)),,-s)'} - XLDFLAGS="$XLDFLAGS -Wl,--stack,0x00200000,--enable-auto-import" + XLDFLAGS="$XLDFLAGS -Xlinker --stack -Xlinker 0x00200000,0x00040000 -Xlinker --enable-auto-import" DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import" : ${LIBPATHENV=""} rb_cv_dlopen=yes], @@ -2500,9 +2500,9 @@ [os2-emx*], [ LOAD_RELATIVE=1 DLEXT=dll], - [cygwin*|mingw*|*djgpp*], [ + [cygwin*|msys*|mingw*|*djgpp*], [ LOAD_RELATIVE=1 - DLEXT=so], + DLEXT=dll], [ DLEXT=so]) fi @@ -2637,7 +2637,7 @@ SOLIBS= AS_CASE(["$target_os"], - [cygwin*|mingw*|beos*|haiku*|darwin*|os2-emx*], [ + [cygwin*|msys*|mingw*|beos*|haiku*|darwin*|os2-emx*], [ : ${DLDLIBS=""} ], [ @@ -2770,7 +2770,7 @@ [interix*], [ LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)' ], - [mingw*|cygwin*|mswin*], [ + [mingw*|cygwin*|msys*|mswin*], [ LIBRUBY_RELATIVE=yes ]) ], [ @@ -2965,7 +2965,7 @@ AS_CASE(["$target_cpu"],[powerpc*], [CFLAGS="$CFLAGS -relax_pointers"]) CPPFLAGS="$CPPFLAGS -I/boot/home/config/include" ], - [cygwin*|mingw*], [ + [cygwin*|msys*|mingw*], [ RUBY_SO_NAME="${RUBY_SO_NAME}"'$(MAJOR)$(MINOR)$(TEENY)' LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)' AS_CASE(["$target_os"], @@ -2975,6 +2975,12 @@ LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)' fi ], + [msys*], [ + if test x"$enable_shared" = xyes; then + LIBRUBY_SO='msys-$(RUBY_SO_NAME)'.dll + LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)' + fi + ], [mingw*], [ RUBY_SO_NAME="${rb_cv_msvcrt}-${RUBY_SO_NAME}" if test x"${target_cpu}" != xi386; then @@ -3200,7 +3206,7 @@ RUBY_INSTALL_NAME="${ri_prefix}"'$(RUBY_BASE_NAME)'"${ri_suffix}" AS_CASE(["$target_os"], - [cygwin*|mingw*], [ + [cygwin*|msys*|mingw*], [ RUBYW_INSTALL_NAME="${ri_prefix}"'$(RUBYW_BASE_NAME)'"${ri_suffix}" rubyw_install_name='$(RUBYW_INSTALL_NAME)' ]) diff -Naur ruby-2.0.0-p195-orig/cygwin/GNUmakefile.in ruby-2.0.0-p195/cygwin/GNUmakefile.in --- ruby-2.0.0-p195-orig/cygwin/GNUmakefile.in 2012-11-05 14:00:35.000000000 +0000 +++ ruby-2.0.0-p195/cygwin/GNUmakefile.in 2013-05-22 06:32:23.752929700 +0000 @@ -6,6 +6,8 @@ ifeq (@target_os@,cygwin) DLL_BASE_NAME := $(LIBRUBY_SO:.dll=) +else ifeq (@target_os@,msys) + DLL_BASE_NAME := $(LIBRUBY_SO:.dll=) else DLL_BASE_NAME := $(RUBY_SO_NAME) DLLWRAP += -mno-cygwin @@ -103,6 +105,12 @@ $(ECHO) generating $@ $(Q) @DLLWRAP@ -s --def=$(RUBYDEF) -o $@ endif + +ifeq (@target_os@,msys) +msys2-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)$(TEENY).dll: $(LIBRUBY_A) $(RUBYDEF) + $(ECHO) generating $@ + $(Q) @DLLWRAP@ -s --def=$(RUBYDEF) -o $@ +endif clean-local:: @$(RM) $(RUBY_EXP) $(RCFILES:.rc=.res.@OBJEXT@) diff -Naur ruby-2.0.0-p195-orig/ext/dl/win32/extconf.rb ruby-2.0.0-p195/ext/dl/win32/extconf.rb --- ruby-2.0.0-p195-orig/ext/dl/win32/extconf.rb 2012-12-11 03:02:04.000000000 +0000 +++ ruby-2.0.0-p195/ext/dl/win32/extconf.rb 2013-05-22 06:32:23.768554700 +0000 @@ -1,3 +1,3 @@ -if compiled?('dl') and !compiled?('fiddle') and $mswin||$bccwin||$mingw||$cygwin +if compiled?('dl') and !compiled?('fiddle') and $mswin||$bccwin||$mingw||$cygwin||$msys create_makefile('win32') end diff -Naur ruby-2.0.0-p195-orig/ext/etc/extconf.rb ruby-2.0.0-p195/ext/etc/extconf.rb --- ruby-2.0.0-p195-orig/ext/etc/extconf.rb 2010-09-15 23:27:48.000000000 +0000 +++ ruby-2.0.0-p195/ext/etc/extconf.rb 2013-05-22 06:32:23.768554700 +0000 @@ -22,7 +22,7 @@ $defs.push("-DPW_AGE2VAL="+f) end have_struct_member('struct passwd', 'pw_class', 'pwd.h') - have_struct_member('struct passwd', 'pw_comment', 'pwd.h') unless /cygwin/ === RUBY_PLATFORM + have_struct_member('struct passwd', 'pw_comment', 'pwd.h') unless /cygwin|msys/ === RUBY_PLATFORM have_struct_member('struct passwd', 'pw_expire', 'pwd.h') have_struct_member('struct passwd', 'pw_passwd', 'pwd.h') have_struct_member('struct group', 'gr_passwd', 'grp.h') diff -Naur ruby-2.0.0-p195-orig/ext/fiddle/win32/extconf.rb ruby-2.0.0-p195/ext/fiddle/win32/extconf.rb --- ruby-2.0.0-p195-orig/ext/fiddle/win32/extconf.rb 2012-12-10 09:03:17.000000000 +0000 +++ ruby-2.0.0-p195/ext/fiddle/win32/extconf.rb 2013-05-22 06:32:23.768554700 +0000 @@ -1,3 +1,3 @@ -if compiled?('fiddle') and $mswin||$mingw||$cygwin +if compiled?('fiddle') and $mswin||$mingw||$cygwin||$msys create_makefile('win32') end diff -Naur ruby-2.0.0-p195-orig/ext/readline/extconf.rb ruby-2.0.0-p195/ext/readline/extconf.rb --- ruby-2.0.0-p195-orig/ext/readline/extconf.rb 2013-02-01 05:37:29.000000000 +0000 +++ ruby-2.0.0-p195/ext/readline/extconf.rb 2013-05-22 06:32:23.784179700 +0000 @@ -25,7 +25,7 @@ dir_config("readline") enable_libedit = enable_config("libedit") -have_library("user32", nil) if /cygwin/ === RUBY_PLATFORM +have_library("user32", nil) if /cygwin|msys/ === RUBY_PLATFORM have_library("ncurses", "tgetnum") || have_library("termcap", "tgetnum") || have_library("curses", "tgetnum") diff -Naur ruby-2.0.0-p195-orig/ext/socket/extconf.rb ruby-2.0.0-p195/ext/socket/extconf.rb --- ruby-2.0.0-p195-orig/ext/socket/extconf.rb 2013-01-26 02:31:40.000000000 +0000 +++ ruby-2.0.0-p195/ext/socket/extconf.rb 2013-05-22 06:32:23.784179700 +0000 @@ -6,7 +6,7 @@ when /(ms|bcc)win(32|64)|mingw/ test_func = "WSACleanup" have_library("ws2_32", "WSACleanup") -when /cygwin/ +when /cygwin|msys/ test_func = "socket" when /beos/ test_func = "socket" @@ -35,7 +35,7 @@ end ipv6 = false -default_ipv6 = /cygwin|beos|haiku/ !~ RUBY_PLATFORM +default_ipv6 = /cygwin|msys|beos|haiku/ !~ RUBY_PLATFORM if enable_config("ipv6", default_ipv6) if checking_for("ipv6") {try_link(< @@ -110,7 +110,7 @@ $defs[-1] = "-DHAVE_SA_LEN " end -have_header("netinet/tcp.h") if /cygwin/ !~ RUBY_PLATFORM # for cygwin 1.1.5 +have_header("netinet/tcp.h") if /cygwin|msys/ !~ RUBY_PLATFORM # for cygwin 1.1.5 have_header("netinet/udp.h") if !have_macro("IPPROTO_IPV6", headers) && have_const("IPPROTO_IPV6", headers) diff -Naur ruby-2.0.0-p195-orig/ext/tk/extconf.rb ruby-2.0.0-p195/ext/tk/extconf.rb --- ruby-2.0.0-p195-orig/ext/tk/extconf.rb 2013-01-10 07:47:20.000000000 +0000 +++ ruby-2.0.0-p195/ext/tk/extconf.rb 2013-05-22 06:29:49.268554700 +0000 @@ -106,7 +106,7 @@ # fuctions ############################################################## def is_win32? - /mswin|mingw|cygwin|bccwin/ =~ RUBY_PLATFORM + /mswin|mingw|bccwin/ =~ RUBY_PLATFORM end def is_macosx? @@ -602,7 +602,7 @@ #puts "check #{file} #{$1} #{tclfunc} #{tcldir}" #find_library($1, tclfunc, tcldir) if (tclconf && tclconf["TCL_SHARED_BUILD"] == "0") || - (ext != CONFIG['DLEXT'] && ext == CONFIG['LIBEXT']) || ext == "a" + (!tclconf && ((ext != CONFIG['DLEXT'] && ext == CONFIG['LIBEXT']) || ext == "a")) # static link tcllibs = $libs + " -DSTATIC_BUILD " + file.quote @@ -645,7 +645,7 @@ #puts "check #{file} #{$1} #{tkfunc} #{tkdir}" # find_library($1, tkfunc, tkdir) if (tkconf && tkconf["TCL_SHARED_BUILD"] == "0") || - (ext != CONFIG['DLEXT'] && ext == CONFIG['LIBEXT']) || ext == "a" + (!tkconf && ((ext != CONFIG['DLEXT'] && ext == CONFIG['LIBEXT']) || ext == "a")) # static link tklibs = " -DSTATIC_BUILD " + file.quote @@ -1784,7 +1784,6 @@ print("\n") # progress end $CPPFLAGS ||= "" -$CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM # Does ruby have nativethread ? TkLib_Config["ruby_with_thread"] = diff -Naur ruby-2.0.0-p195-orig/ext/tk/lib/tk.rb ruby-2.0.0-p195/ext/tk/lib/tk.rb --- ruby-2.0.0-p195-orig/ext/tk/lib/tk.rb 2011-05-26 23:36:33.000000000 +0000 +++ ruby-2.0.0-p195/ext/tk/lib/tk.rb 2013-05-22 06:32:23.815429700 +0000 @@ -1180,7 +1180,7 @@ if WITH_RUBY_VM ### check Ruby 1.9 !!!!!!! # *** NEED TO FIX *** case RUBY_PLATFORM - when /cygwin/ + when /cygwin|msys/ RUN_EVENTLOOP_ON_MAIN_THREAD = true when /darwin/ # MacOS X =begin diff -Naur ruby-2.0.0-p195-orig/ext/tk/old-extconf.rb ruby-2.0.0-p195/ext/tk/old-extconf.rb --- ruby-2.0.0-p195-orig/ext/tk/old-extconf.rb 2009-07-13 02:43:44.000000000 +0000 +++ ruby-2.0.0-p195/ext/tk/old-extconf.rb 2013-05-22 06:32:23.815429700 +0000 @@ -2,7 +2,7 @@ require 'mkmf' -is_win32 = (/mswin|mingw|cygwin|bccwin/ =~ RUBY_PLATFORM) +is_win32 = (/mswin|mingw|cygwin|msys|bccwin/ =~ RUBY_PLATFORM) #is_macosx = (/darwin/ =~ RUBY_PLATFORM) have_func("ruby_native_thread_p", "ruby.h") @@ -405,7 +405,7 @@ find_tcl(tcllib, stubs, tclver, *tcl_ldir_list) && find_tk(tklib, stubs, tkver, *tk_ldir_list) ) ) $CPPFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS' if stubs - $CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM + $CPPFLAGS += ' -D_WIN32' if /cygwin|msys/ =~ RUBY_PLATFORM if tcltk_framework if tcl_framework_header diff -Naur ruby-2.0.0-p195-orig/ext/tk/stubs.c ruby-2.0.0-p195/ext/tk/stubs.c --- ruby-2.0.0-p195-orig/ext/tk/stubs.c 2012-07-09 15:52:49.000000000 +0000 +++ ruby-2.0.0-p195/ext/tk/stubs.c 2013-05-22 06:29:49.284179700 +0000 @@ -71,7 +71,7 @@ #if defined USE_TCL_STUBS && defined USE_TK_STUBS -#if defined _WIN32 || defined __CYGWIN__ +#if defined _WIN32 # ifdef HAVE_RUBY_RUBY_H # include "ruby/util.h" # else @@ -100,6 +100,10 @@ # undef DLEXT # define DLEXT ".dylib" # endif +# if defined(__CYGWIN__) +# undef DLEXT +# define DLEXT ".dll" +# endif #endif static DL_HANDLE tcl_dll = (DL_HANDLE)0; diff -Naur ruby-2.0.0-p195-orig/ext/win32ole/extconf.rb ruby-2.0.0-p195/ext/win32ole/extconf.rb --- ruby-2.0.0-p195-orig/ext/win32ole/extconf.rb 2013-01-18 02:23:37.000000000 +0000 +++ ruby-2.0.0-p195/ext/win32ole/extconf.rb 2013-05-22 06:32:23.831054700 +0000 @@ -5,7 +5,7 @@ require 'mkmf' case RUBY_PLATFORM -when /cygwin/ +when /cygwin|msys/ inc = nil lib = '/usr/lib/w32api' end diff -Naur ruby-2.0.0-p195-orig/file.c ruby-2.0.0-p195/file.c --- ruby-2.0.0-p195-orig/file.c 2013-04-24 15:43:05.000000000 +0000 +++ ruby-2.0.0-p195/file.c 2013-05-22 06:31:57.424804700 +0000 @@ -4181,7 +4181,6 @@ #ifdef __CYGWIN__ #include -extern unsigned long __attribute__((stdcall)) GetLastError(void); #endif static VALUE diff -Naur ruby-2.0.0-p195-orig/lib/fileutils.rb ruby-2.0.0-p195/lib/fileutils.rb --- ruby-2.0.0-p195-orig/lib/fileutils.rb 2013-04-11 17:00:49.000000000 +0000 +++ ruby-2.0.0-p195/lib/fileutils.rb 2013-05-22 06:32:23.831054700 +0000 @@ -539,7 +539,7 @@ OPT_TABLE['move'] = [:force, :noop, :verbose, :secure] def rename_cannot_overwrite_file? #:nodoc: - /cygwin|mswin|mingw|bccwin|emx/ =~ RUBY_PLATFORM + /cygwin|msys|mswin|mingw|bccwin|emx/ =~ RUBY_PLATFORM end private_module_function :rename_cannot_overwrite_file? diff -Naur ruby-2.0.0-p195-orig/lib/mkmf.rb ruby-2.0.0-p195/lib/mkmf.rb --- ruby-2.0.0-p195-orig/lib/mkmf.rb 2013-04-14 14:55:53.000000000 +0000 +++ ruby-2.0.0-p195/lib/mkmf.rb 2013-05-22 06:32:23.831054700 +0000 @@ -121,6 +121,7 @@ $bccwin = /bccwin/ =~ RUBY_PLATFORM $mingw = /mingw/ =~ RUBY_PLATFORM $cygwin = /cygwin/ =~ RUBY_PLATFORM + $cygwin = /msys/ =~ RUBY_PLATFORM $netbsd = /netbsd/ =~ RUBY_PLATFORM $os2 = /os2/ =~ RUBY_PLATFORM $beos = /beos/ =~ RUBY_PLATFORM @@ -1761,6 +1762,12 @@ IO.popen(["cygpath", "-u", path], &:read).chomp end end + when 'msys' + if CONFIG['target_os'] != 'msys' + def mkintpath(path) + IO.popen(["cygpath", "-u", path], &:read).chomp + end + end end end unless method_defined?(:mkintpath) @@ -1777,7 +1784,7 @@ SHELL = /bin/sh # V=0 quiet, V=1 verbose. other values don't work. -V = 0 +V = 1 Q1 = $(V:1=) Q = $(Q1:0=@) ECHO1 = $(V:1=@#{CONFIG['NULLCMD']}) diff -Naur ruby-2.0.0-p195-orig/lib/rake/application.rb ruby-2.0.0-p195/lib/rake/application.rb --- ruby-2.0.0-p195-orig/lib/rake/application.rb 2012-11-29 19:16:46.000000000 +0000 +++ ruby-2.0.0-p195/lib/rake/application.rb 2013-05-22 06:32:23.846679700 +0000 @@ -291,7 +291,7 @@ end def unix? - RbConfig::CONFIG['host_os'] =~ /(aix|darwin|linux|(net|free|open)bsd|cygwin|solaris|irix|hpux)/i + RbConfig::CONFIG['host_os'] =~ /(aix|darwin|linux|(net|free|open)bsd|cygwin|msys|solaris|irix|hpux)/i end def windows? diff -Naur ruby-2.0.0-p195-orig/lib/resolv.rb ruby-2.0.0-p195/lib/resolv.rb --- ruby-2.0.0-p195-orig/lib/resolv.rb 2011-10-31 12:03:49.000000000 +0000 +++ ruby-2.0.0-p195/lib/resolv.rb 2013-05-22 06:32:23.846679700 +0000 @@ -923,7 +923,7 @@ if File.exist? filename config_hash = Config.parse_resolv_conf(filename) else - if /mswin|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM + if /mswin|cygwin|msys|mingw|bccwin/ =~ RUBY_PLATFORM require 'win32/resolv' search, nameserver = Win32::Resolv.get_resolv_info config_hash = {} diff -Naur ruby-2.0.0-p195-orig/lib/rubygems/platform.rb ruby-2.0.0-p195/lib/rubygems/platform.rb --- ruby-2.0.0-p195-orig/lib/rubygems/platform.rb 2012-11-29 06:52:18.000000000 +0000 +++ ruby-2.0.0-p195/lib/rubygems/platform.rb 2013-05-22 06:32:23.846679700 +0000 @@ -68,6 +68,7 @@ @os, @version = case os when /aix(\d+)?/ then [ 'aix', $1 ] when /cygwin/ then [ 'cygwin', nil ] + when /msys/ then [ 'msys', nil ] when /darwin(\d+)?/ then [ 'darwin', $1 ] when /^macruby$/ then [ 'macruby', nil ] when /freebsd(\d+)?/ then [ 'freebsd', $1 ] diff -Naur ruby-2.0.0-p195-orig/lib/rubygems.rb ruby-2.0.0-p195/lib/rubygems.rb --- ruby-2.0.0-p195-orig/lib/rubygems.rb 2013-03-17 15:07:00.000000000 +0000 +++ ruby-2.0.0-p195/lib/rubygems.rb 2013-05-22 06:32:23.862304700 +0000 @@ -120,6 +120,7 @@ WIN_PATTERNS = [ /bccwin/i, /cygwin/i, + /msys/i, /djgpp/i, /mingw/i, /mswin/i, diff -Naur ruby-2.0.0-p195-orig/test/dbm/test_dbm.rb ruby-2.0.0-p195/test/dbm/test_dbm.rb --- ruby-2.0.0-p195-orig/test/dbm/test_dbm.rb 2012-02-19 14:44:36.000000000 +0000 +++ ruby-2.0.0-p195/test/dbm/test_dbm.rb 2013-05-22 06:32:23.862304700 +0000 @@ -21,6 +21,13 @@ raise 'cannot get system name' if uname.call(utsname) == -1 utsname.unpack('A20' * 5)[0] + when 'msys' + require 'Win32API' + uname = Win32API.new('msys-2.0', 'uname', 'P', 'I') + utsname = ' ' * 100 + raise 'cannot get system name' if uname.call(utsname) == -1 + + utsname.unpack('A21' * 5)[0] else RbConfig::CONFIG['target_os'] end diff -Naur ruby-2.0.0-p195-orig/test/dl/test_base.rb ruby-2.0.0-p195/test/dl/test_base.rb --- ruby-2.0.0-p195-orig/test/dl/test_base.rb 2012-11-29 02:58:34.000000000 +0000 +++ ruby-2.0.0-p195/test/dl/test_base.rb 2013-05-22 06:32:23.877929700 +0000 @@ -9,6 +9,9 @@ when /cygwin/ libc_so = "cygwin1.dll" libm_so = "cygwin1.dll" +when /msys/ + libc_so = "msys-2.0.dll" + libm_so = "msys-2.0.dll" when /x86_64-linux/ libc_so = "/lib64/libc.so.6" libm_so = "/lib64/libm.so.6" diff -Naur ruby-2.0.0-p195-orig/test/fiddle/helper.rb ruby-2.0.0-p195/test/fiddle/helper.rb --- ruby-2.0.0-p195-orig/test/fiddle/helper.rb 2012-11-27 19:54:50.000000000 +0000 +++ ruby-2.0.0-p195/test/fiddle/helper.rb 2013-05-22 06:32:23.877929700 +0000 @@ -10,6 +10,9 @@ when /cygwin/ libc_so = "cygwin1.dll" libm_so = "cygwin1.dll" +when /msys/ + libc_so = "msys-2.0.dll" + libm_so = "msys-2.0.dll" when /x86_64-linux/ libc_so = "/lib64/libc.so.6" libm_so = "/lib64/libm.so.6" diff -Naur ruby-2.0.0-p195-orig/test/gdbm/test_gdbm.rb ruby-2.0.0-p195/test/gdbm/test_gdbm.rb --- ruby-2.0.0-p195-orig/test/gdbm/test_gdbm.rb 2012-07-25 06:49:35.000000000 +0000 +++ ruby-2.0.0-p195/test/gdbm/test_gdbm.rb 2013-05-22 06:32:23.877929700 +0000 @@ -21,6 +21,13 @@ raise 'cannot get system name' if uname.call(utsname) == -1 utsname.unpack('A20' * 5)[0] + when 'msys' + require 'Win32API' + uname = Win32API.new('msys-2.0', 'uname', 'P', 'I') + utsname = ' ' * 100 + raise 'cannot get system name' if uname.call(utsname) == -1 + + utsname.unpack('A21' * 5)[0] else RbConfig::CONFIG['target_os'] end diff -Naur ruby-2.0.0-p195-orig/test/ruby/test_argf.rb ruby-2.0.0-p195/test/ruby/test_argf.rb --- ruby-2.0.0-p195-orig/test/ruby/test_argf.rb 2012-12-24 00:45:26.000000000 +0000 +++ ruby-2.0.0-p195/test/ruby/test_argf.rb 2013-05-22 06:32:23.877929700 +0000 @@ -54,7 +54,7 @@ end def no_safe_rename - /cygwin|mswin|mingw|bccwin/ =~ RUBY_PLATFORM + /cygwin|msys|mswin|mingw|bccwin/ =~ RUBY_PLATFORM end def assert_src_expected(line, src, args = nil) diff -Naur ruby-2.0.0-p195-orig/test/ruby/test_file_exhaustive.rb ruby-2.0.0-p195/test/ruby/test_file_exhaustive.rb --- ruby-2.0.0-p195-orig/test/ruby/test_file_exhaustive.rb 2013-04-11 16:47:45.000000000 +0000 +++ ruby-2.0.0-p195/test/ruby/test_file_exhaustive.rb 2013-05-22 06:32:23.909179700 +0000 @@ -128,7 +128,7 @@ assert_nothing_raised { File.stat(File.basename(prefix)) } end end - end if /mswin|mingw|cygwin/ =~ RUBY_PLATFORM + end if /mswin|mingw|cygwin|msys/ =~ RUBY_PLATFORM def test_directory_p assert(File.directory?(@dir)) @@ -176,7 +176,7 @@ end def test_readable_p - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM return if Process.euid == 0 File.chmod(0200, @file) assert(!(File.readable?(@file))) @@ -186,7 +186,7 @@ end def test_readable_real_p - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM return if Process.euid == 0 File.chmod(0200, @file) assert(!(File.readable_real?(@file))) @@ -196,7 +196,7 @@ end def test_world_readable_p - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM File.chmod(0006, @file) assert(File.world_readable?(@file)) File.chmod(0060, @file) @@ -207,7 +207,7 @@ end def test_writable_p - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM return if Process.euid == 0 File.chmod(0400, @file) assert(!(File.writable?(@file))) @@ -217,7 +217,7 @@ end def test_writable_real_p - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM return if Process.euid == 0 File.chmod(0400, @file) assert(!(File.writable_real?(@file))) @@ -227,7 +227,7 @@ end def test_world_writable_p - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM File.chmod(0006, @file) assert(File.world_writable?(@file)) File.chmod(0060, @file) @@ -238,7 +238,7 @@ end def test_executable_p - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM File.chmod(0100, @file) assert(File.executable?(@file)) File.chmod(0600, @file) @@ -247,7 +247,7 @@ end def test_executable_real_p - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM File.chmod(0100, @file) assert(File.executable_real?(@file)) File.chmod(0600, @file) @@ -276,7 +276,7 @@ end def test_owned_p ## xxx - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM assert(File.owned?(@file)) assert(File.grpowned?(@file)) end @@ -337,7 +337,7 @@ end def test_chmod - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM assert_equal(1, File.chmod(0444, @file)) assert_equal(0444, File.stat(@file).mode % 01000) assert_equal(0, File.open(@file) {|f| f.chmod(0222)}) @@ -347,7 +347,7 @@ end def test_lchmod - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM assert_equal(1, File.lchmod(0444, @file)) assert_equal(0444, File.stat(@file).mode % 01000) File.lchmod(0600, @file) @@ -406,7 +406,7 @@ end def test_umask - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM prev = File.umask(0777) assert_equal(0777, File.umask) open(@nofile, "w") { } @@ -418,7 +418,7 @@ def test_expand_path assert_equal(@file, File.expand_path(File.basename(@file), File.dirname(@file))) - if /cygwin|mingw|mswin|bccwin/ =~ RUBY_PLATFORM + if /cygwin|msys|mingw|mswin|bccwin/ =~ RUBY_PLATFORM assert_equal(@file, File.expand_path(@file + " ")) assert_equal(@file, File.expand_path(@file + ".")) assert_equal(@file, File.expand_path(@file + "::$DATA")) @@ -715,7 +715,7 @@ assert_equal("foo", File.basename("foo", ".ext")) assert_equal("foo", File.basename("foo.ext", ".ext")) assert_equal("foo", File.basename("foo.ext", ".*")) - if /cygwin|mingw|mswin|bccwin/ =~ RUBY_PLATFORM + if /cygwin|msys|mingw|mswin|bccwin/ =~ RUBY_PLATFORM basename = File.basename(@file) assert_equal(basename, File.basename(@file + " ")) assert_equal(basename, File.basename(@file + ".")) @@ -764,7 +764,7 @@ infixes = ["", " ", "."] infixes2 = infixes + [".ext "] appendixes = [""] - if /cygwin|mingw|mswin|bccwin/ =~ RUBY_PLATFORM + if /cygwin|msys|mingw|mswin|bccwin/ =~ RUBY_PLATFORM appendixes << " " << "." << "::$DATA" << "::$DATA.bar" end prefixes.each do |prefix| @@ -898,7 +898,7 @@ assert_equal(true, test(?=, @file, @file)) assert_equal(false, test(?>, @file, @file)) assert_equal(false, test(?<, @file, @file)) - unless /cygwin/ =~ RUBY_PLATFORM + unless /cygwin|msys/ =~ RUBY_PLATFORM assert_equal(false, test(?=, @file, @file + "2")) assert_equal(false, test(?>, @file, @file + "2")) assert_equal(true, test(?>, @file + "2", @file)) @@ -992,7 +992,7 @@ end def test_stat_readable_p - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM return if Process.euid == 0 File.chmod(0200, @file) assert(!(File::Stat.new(@file).readable?)) @@ -1001,7 +1001,7 @@ end def test_stat_readable_real_p - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM return if Process.euid == 0 File.chmod(0200, @file) assert(!(File::Stat.new(@file).readable_real?)) @@ -1010,7 +1010,7 @@ end def test_stat_world_readable_p - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM File.chmod(0006, @file) assert(File::Stat.new(@file).world_readable?) File.chmod(0060, @file) @@ -1020,7 +1020,7 @@ end def test_stat_writable_p - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM return if Process.euid == 0 File.chmod(0400, @file) assert(!(File::Stat.new(@file).writable?)) @@ -1029,7 +1029,7 @@ end def test_stat_writable_real_p - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM return if Process.euid == 0 File.chmod(0400, @file) assert(!(File::Stat.new(@file).writable_real?)) @@ -1038,7 +1038,7 @@ end def test_stat_world_writable_p - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM File.chmod(0006, @file) assert(File::Stat.new(@file).world_writable?) File.chmod(0060, @file) @@ -1048,7 +1048,7 @@ end def test_stat_executable_p - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM File.chmod(0100, @file) assert(File::Stat.new(@file).executable?) File.chmod(0600, @file) @@ -1056,7 +1056,7 @@ end def test_stat_executable_real_p - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM File.chmod(0100, @file) assert(File::Stat.new(@file).executable_real?) File.chmod(0600, @file) @@ -1081,7 +1081,7 @@ end def test_stat_owned_p ## xxx - return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM + return if /cygwin|msys|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM assert(File::Stat.new(@file).owned?) assert(File::Stat.new(@file).grpowned?) end diff -Naur ruby-2.0.0-p195-orig/test/ruby/test_path.rb ruby-2.0.0-p195/test/ruby/test_path.rb --- ruby-2.0.0-p195-orig/test/ruby/test_path.rb 2011-10-26 06:24:29.000000000 +0000 +++ ruby-2.0.0-p195/test/ruby/test_path.rb 2013-05-22 06:32:23.909179700 +0000 @@ -47,7 +47,7 @@ end def test_dirname - if /(bcc|ms)win\d|mingw|cygwin|emx/ =~ RUBY_PLATFORM + if /(bcc|ms)win\d|mingw|cygwin|msys|emx/ =~ RUBY_PLATFORM # DOSISH_DRIVE_LETTER assert_equal('C:.', File.dirname('C:')) assert_equal('C:.', File.dirname('C:a')) @@ -103,7 +103,7 @@ assert_equal('/', File.dirname('/a/')) assert_equal('/a', File.dirname('/a/b')) - if /(bcc|ms|cyg)win|mingw|emx/ =~ RUBY_PLATFORM + if /(bcc|ms|cyg)win|msys|mingw|emx/ =~ RUBY_PLATFORM # DOSISH_UNC assert_equal('//', File.dirname('//')) assert_equal('//a', File.dirname('//a')) @@ -137,7 +137,7 @@ end def test_basename - if /(bcc|ms)win\d|mingw|cygwin|emx/ =~ RUBY_PLATFORM + if /(bcc|ms)win\d|mingw|cygwin|msys|emx/ =~ RUBY_PLATFORM # DOSISH_DRIVE_LETTER assert_equal('', File.basename('C:')) assert_equal('a', File.basename('C:a')) @@ -193,7 +193,7 @@ assert_equal("..", File.basename("..", ".*")) - if /(bcc|ms|cyg)win|mingw|emx/ =~ RUBY_PLATFORM + if /(bcc|ms|cyg)win|msys|mingw|emx/ =~ RUBY_PLATFORM # DOSISH_UNC assert_equal('/', File.basename('//')) assert_equal('/', File.basename('//a')) diff -Naur ruby-2.0.0-p195-orig/test/rubygems/test_gem_platform.rb ruby-2.0.0-p195/test/rubygems/test_gem_platform.rb --- ruby-2.0.0-p195-orig/test/rubygems/test_gem_platform.rb 2012-11-29 06:52:18.000000000 +0000 +++ ruby-2.0.0-p195/test/rubygems/test_gem_platform.rb 2013-05-22 06:32:23.909179700 +0000 @@ -45,6 +45,7 @@ 'universal-darwin9' => ['universal', 'darwin', '9'], 'universal-macruby' => ['universal', 'macruby', nil], 'i386-cygwin' => ['x86', 'cygwin', nil], + 'i386-msys' => ['x86', 'msys', nil], 'i686-darwin' => ['x86', 'darwin', nil], 'i686-darwin8.4.1' => ['x86', 'darwin', '8'], 'i386-freebsd4.11' => ['x86', 'freebsd', '4'], diff -Naur ruby-2.0.0-p195-orig/test/socket/test_addrinfo.rb ruby-2.0.0-p195/test/socket/test_addrinfo.rb --- ruby-2.0.0-p195-orig/test/socket/test_addrinfo.rb 2012-10-30 00:40:54.000000000 +0000 +++ ruby-2.0.0-p195/test/socket/test_addrinfo.rb 2013-05-22 06:32:23.909179700 +0000 @@ -6,7 +6,7 @@ require "test/unit" class TestSocketAddrinfo < Test::Unit::TestCase - HAS_UNIXSOCKET = defined?(UNIXSocket) && /cygwin/ !~ RUBY_PLATFORM + HAS_UNIXSOCKET = defined?(UNIXSocket) && /cygwin|msys/ !~ RUBY_PLATFORM def tcp_unspecified_to_loopback(addrinfo) if addrinfo.ipv4? && addrinfo.ip_address == "0.0.0.0" diff -Naur ruby-2.0.0-p195-orig/test/socket/test_unix.rb ruby-2.0.0-p195/test/socket/test_unix.rb --- ruby-2.0.0-p195-orig/test/socket/test_unix.rb 2013-01-31 04:59:31.000000000 +0000 +++ ruby-2.0.0-p195/test/socket/test_unix.rb 2013-05-22 06:32:23.924804700 +0000 @@ -598,4 +598,4 @@ assert(s0.closed?) end -end if defined?(UNIXSocket) && /cygwin/ !~ RUBY_PLATFORM +end if defined?(UNIXSocket) && /cygwin|msys/ !~ RUBY_PLATFORM diff -Naur ruby-2.0.0-p195-orig/test/webrick/test_cgi.rb ruby-2.0.0-p195/test/webrick/test_cgi.rb --- ruby-2.0.0-p195-orig/test/webrick/test_cgi.rb 2012-11-06 00:49:57.000000000 +0000 +++ ruby-2.0.0-p195/test/webrick/test_cgi.rb 2013-05-22 06:32:23.940429700 +0000 @@ -20,7 +20,7 @@ end }, } - if RUBY_PLATFORM =~ /mswin32|mingw|cygwin|bccwin32/ + if RUBY_PLATFORM =~ /mswin32|mingw|cygwin|msys|bccwin32/ config[:CGIPathEnv] = ENV['PATH'] # runtime dll may not be in system dir. end TestWEBrick.start_httpserver(config){|server, addr, port, log| @@ -40,7 +40,7 @@ req = Net::HTTP::Get.new("/webrick.cgi/%A4%DB%A4%B2/%A4%DB%A4%B2") # Path info of res.body is passed via ENV. # ENV[] returns different value on Windows depending on locale. - unless RUBY_PLATFORM =~ /mswin32|mingw|cygwin|bccwin32/ && + unless RUBY_PLATFORM =~ /mswin32|mingw|cygwin|msys|bccwin32/ && Encoding.find("locale") != Encoding.find("filesystem") http.request(req){|res| assert_equal("/\xA4\xDB\xA4\xB2/\xA4\xDB\xA4\xB2", res.body, log.call)} diff -Naur ruby-2.0.0-p195-orig/tool/config.guess ruby-2.0.0-p195/tool/config.guess --- ruby-2.0.0-p195-orig/tool/config.guess 2012-01-29 13:50:18.000000000 +0000 +++ ruby-2.0.0-p195/tool/config.guess 2013-05-22 06:32:23.940429700 +0000 @@ -846,6 +846,9 @@ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; + amd64:MSYS*:*:* | x86_64:MSYS*:*:*) + echo x86_64-unknown-msys + exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; diff -Naur ruby-2.0.0-p195-orig/win32/mkexports.rb ruby-2.0.0-p195/win32/mkexports.rb --- ruby-2.0.0-p195-orig/win32/mkexports.rb 2012-11-12 05:29:52.000000000 +0000 +++ ruby-2.0.0-p195/win32/mkexports.rb 2013-05-22 06:32:23.940429700 +0000 @@ -158,6 +158,30 @@ end end +class Exports::Msys < Exports + def self.nm + @@nm ||= RbConfig::CONFIG["NM"] + end + + def exports(*) + super() + end + + def each_line(objs, &block) + IO.foreach("|#{self.class.nm} --extern --defined #{objs.join(' ')}", &block) + end + + def each_export(objs) + symprefix = RbConfig::CONFIG["SYMBOL_PREFIX"] + symprefix.strip! if symprefix + re = /\s(?:(T)|[[:upper:]])\s#{symprefix}((?!Init_|.*_threadptr_|DllMain\b).*)$/ + objdump(objs) do |l| + next if /@.*@/ =~ l + yield $2, !$1 if re =~ l + end + end +end + class Exports::Mingw < Exports::Cygwin def each_export(objs) super