diff -Naur ruby-2.3.0-cygwin/configure.in ruby-2.3.0/configure.in --- ruby-2.3.0-cygwin/configure.in 2016-03-10 16:39:24.281580600 +0300 +++ ruby-2.3.0/configure.in 2016-03-10 17:03:13.152209400 +0300 @@ -60,7 +60,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__ @@ -114,7 +114,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-" @@ -565,14 +565,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-/-/"` @@ -893,7 +893,7 @@ # comments. We bypass ANSI C mode for them. Otherwise # extension libs cannot include those headers. ], - [cygwin*|darwin*|netbsd*|nacl], [ + [cygwin*|msys*|darwin*|netbsd*|nacl], [ # need lgamma_r(), finite() ], [ @@ -1142,7 +1142,7 @@ [haiku*], [ LIBS="$LIBS" # m lib is include in root ], -[cygwin*], [ ac_cv_header_langinfo_h=yes +[cygwin*|msys*], [ ac_cv_header_langinfo_h=yes AC_CHECK_FUNCS(cygwin_conv_path) AC_LIBOBJ([langinfo]) ], @@ -2345,7 +2345,7 @@ rb_cv_getcwd_malloc=yes, rb_cv_getcwd_malloc=no, AS_CASE($target_os, - [linux*|darwin*|*bsd|cygwin*|mingw*|mswin*], + [linux*|darwin*|*bsd|cygwin*|msys*|mingw*|mswin*], [rb_cv_getcwd_malloc=yes], [rb_cv_getcwd_malloc=no]))]) AS_IF([test "$rb_cv_getcwd_malloc" = no], [AC_DEFINE(NO_GETCWD_MALLOC, 1)]) @@ -2520,7 +2520,7 @@ setjmp_prefix=_ setjmp_suffix= 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]) setjmp_suffix= else setjmp_prefix= @@ -3101,7 +3101,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*|cygwin*|mingw*|aix*|interix*], [ ], + [bsdi*|cygwin*|msys*|mingw*|aix*|interix*], [ ], [ RUBY_APPEND_OPTION(CCDLFLAGS, -fPIC)]) else @@ -3203,9 +3203,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=""} : ${PRELOADENV=""} @@ -3577,7 +3577,7 @@ SOLIBS= AS_CASE(["$target_os"], - [cygwin*|mingw*|haiku*|darwin*], [ + [cygwin*|msys*|mingw*|haiku*|darwin*], [ : ${DLDLIBS=""} ], [ @@ -3923,7 +3923,7 @@ CFLAGS="$CFLAGS -std" fi ], - [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"], @@ -3933,6 +3933,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 diff -Naur ruby-2.3.0-cygwin/cygwin/GNUmakefile.in ruby-2.3.0/cygwin/GNUmakefile.in --- ruby-2.3.0-cygwin/cygwin/GNUmakefile.in 2015-08-26 08:21:41.000000000 +0300 +++ ruby-2.3.0/cygwin/GNUmakefile.in 2016-03-10 16:47:46.285862100 +0300 @@ -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 @@ -104,6 +106,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.3.0-cygwin/ext/etc/extconf.rb ruby-2.3.0/ext/etc/extconf.rb --- ruby-2.3.0-cygwin/ext/etc/extconf.rb 2015-12-16 08:31:54.000000000 +0300 +++ ruby-2.3.0/ext/etc/extconf.rb 2016-03-10 16:49:32.065283100 +0300 @@ -34,7 +34,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.3.0-cygwin/ext/readline/extconf.rb ruby-2.3.0/ext/readline/extconf.rb --- ruby-2.3.0-cygwin/ext/readline/extconf.rb 2015-12-16 08:31:54.000000000 +0300 +++ ruby-2.3.0/ext/readline/extconf.rb 2016-03-10 16:47:46.344856200 +0300 @@ -30,7 +30,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.3.0-cygwin/ext/Setup.nt ruby-2.3.0/ext/Setup.nt --- ruby-2.3.0-cygwin/ext/Setup.nt 2015-12-20 14:54:54.000000000 +0300 +++ ruby-2.3.0/ext/Setup.nt 2016-03-10 17:04:34.109014800 +0300 @@ -1,4 +1,4 @@ -#option platform cygwin|mingw|mswin +#option platform cygwin|msys|mingw|mswin #option nodynamic Win32API diff -Naur ruby-2.3.0-cygwin/ext/socket/extconf.rb ruby-2.3.0/ext/socket/extconf.rb --- ruby-2.3.0-cygwin/ext/socket/extconf.rb 2015-12-16 08:31:54.000000000 +0300 +++ ruby-2.3.0/ext/socket/extconf.rb 2016-03-10 16:47:46.387851900 +0300 @@ -254,7 +254,7 @@ # [ruby-dev:44189] # http://bugs.ruby-lang.org/issues/5075 close_fds = false - when /cygwin/ + when /cygwin|msys/ # Cygwin doesn't support fd passing. # http://cygwin.com/ml/cygwin/2003-09/msg01808.html close_fds = false @@ -434,7 +434,7 @@ when /mswin(32|64)|mingw/ test_func = "WSACleanup" have_library("ws2_32", "WSACleanup", headers) -when /cygwin/ +when /cygwin|msys/ test_func = "socket(0,0,0)" when /haiku/ test_func = "socket(0,0,0)" diff -Naur ruby-2.3.0-cygwin/ext/tk/extconf.rb ruby-2.3.0/ext/tk/extconf.rb --- ruby-2.3.0-cygwin/ext/tk/extconf.rb 2016-03-10 16:39:24.024606300 +0300 +++ ruby-2.3.0/ext/tk/extconf.rb 2016-03-10 16:47:46.429847700 +0300 @@ -554,7 +554,7 @@ exts = [CONFIG['DLEXT']] exts.concat %w(dll) if is_win32? exts.concat %w(bundle dylib) if is_macosx? - exts.concat %w(dll.a) if /cygwin/ =~ RUBY_PLATFORM + exts.concat %w(dll.a) if /cygwin|msys/ =~ RUBY_PLATFORM if TkLib_Config["tcltk-stubs"] || TkLib_Config['enable-shared'] == false exts.unshift "lib" if is_win32? diff -Naur ruby-2.3.0-cygwin/ext/tk/lib/tk.rb ruby-2.3.0/ext/tk/lib/tk.rb --- ruby-2.3.0-cygwin/ext/tk/lib/tk.rb 2015-12-16 08:31:54.000000000 +0300 +++ ruby-2.3.0/ext/tk/lib/tk.rb 2016-03-10 16:47:46.462844400 +0300 @@ -1181,7 +1181,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.3.0-cygwin/ext/tk/old-extconf.rb ruby-2.3.0/ext/tk/old-extconf.rb --- ruby-2.3.0-cygwin/ext/tk/old-extconf.rb 2015-12-16 08:31:54.000000000 +0300 +++ ruby-2.3.0/ext/tk/old-extconf.rb 2016-03-10 16:47:46.517838900 +0300 @@ -3,7 +3,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") @@ -406,7 +406,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.3.0-cygwin/ext/win32/extconf.rb ruby-2.3.0/ext/win32/extconf.rb --- ruby-2.3.0-cygwin/ext/win32/extconf.rb 2015-12-16 08:31:54.000000000 +0300 +++ ruby-2.3.0/ext/win32/extconf.rb 2016-03-10 16:51:43.760946400 +0300 @@ -1,4 +1,4 @@ # frozen_string_literal: false -if compiled?('fiddle') and $mswin||$mingw||$cygwin +if compiled?('fiddle') and $mswin||$mingw||$cygwin||$msys create_makefile('win32') end diff -Naur ruby-2.3.0-cygwin/ext/win32ole/extconf.rb ruby-2.3.0/ext/win32ole/extconf.rb --- ruby-2.3.0-cygwin/ext/win32ole/extconf.rb 2015-12-16 08:31:54.000000000 +0300 +++ ruby-2.3.0/ext/win32ole/extconf.rb 2016-03-10 16:47:46.581832500 +0300 @@ -6,7 +6,7 @@ require 'mkmf' case RUBY_PLATFORM -when /cygwin/ +when /cygwin|msys/ inc = nil lib = '/usr/lib/w32api' end diff -Naur ruby-2.3.0-cygwin/gems/rake-10.4.2/lib/rake/application.rb ruby-2.3.0/gems/rake-10.4.2/lib/rake/application.rb --- ruby-2.3.0-cygwin/gems/rake-10.4.2/lib/rake/application.rb 2015-12-24 19:44:59.000000000 +0300 +++ ruby-2.3.0/gems/rake-10.4.2/lib/rake/application.rb 2016-03-10 17:05:30.300774200 +0300 @@ -346,7 +346,7 @@ def unix? # :nodoc: RbConfig::CONFIG['host_os'] =~ - /(aix|darwin|linux|(net|free|open)bsd|cygwin|solaris|irix|hpux)/i + /(aix|darwin|linux|(net|free|open)bsd|cygwin|msys|solaris|irix|hpux)/i end def windows? # :nodoc: diff -Naur ruby-2.3.0-cygwin/lib/mkmf.rb ruby-2.3.0/lib/mkmf.rb --- ruby-2.3.0-cygwin/lib/mkmf.rb 2015-12-16 12:25:48.000000000 +0300 +++ ruby-2.3.0/lib/mkmf.rb 2016-03-10 16:47:46.665824100 +0300 @@ -132,6 +132,7 @@ $bccwin = /bccwin/ =~ RUBY_PLATFORM $mingw = /mingw/ =~ RUBY_PLATFORM $cygwin = /cygwin/ =~ RUBY_PLATFORM + $msys = /msys/ =~ RUBY_PLATFORM $netbsd = /netbsd/ =~ RUBY_PLATFORM $haiku = /haiku/ =~ RUBY_PLATFORM $solaris = /solaris/ =~ RUBY_PLATFORM @@ -1876,6 +1877,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) @@ -1892,7 +1899,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.3.0-cygwin/lib/resolv.rb ruby-2.3.0/lib/resolv.rb --- ruby-2.3.0-cygwin/lib/resolv.rb 2015-11-10 14:48:14.000000000 +0300 +++ ruby-2.3.0/lib/resolv.rb 2016-03-10 16:53:23.147946400 +0300 @@ -168,7 +168,7 @@ class Hosts begin - raise LoadError unless /mswin|mingw|cygwin/ =~ RUBY_PLATFORM + raise LoadError unless /mswin/ =~ RUBY_PLATFORM require 'win32/resolv' DefaultFileName = Win32::Resolv.get_hosts_path rescue LoadError @@ -967,7 +967,7 @@ if File.exist? filename config_hash = Config.parse_resolv_conf(filename) else - if /mswin|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM + if /mswin|bccwin/ =~ RUBY_PLATFORM require 'win32/resolv' search, nameserver = Win32::Resolv.get_resolv_info config_hash = {} diff -Naur ruby-2.3.0-cygwin/lib/rubygems/platform.rb ruby-2.3.0/lib/rubygems/platform.rb --- ruby-2.3.0-cygwin/lib/rubygems/platform.rb 2015-12-16 08:07:31.000000000 +0300 +++ ruby-2.3.0/lib/rubygems/platform.rb 2016-03-10 16:53:23.194946400 +0300 @@ -79,6 +79,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.3.0-cygwin/test/dbm/test_dbm.rb.rej ruby-2.3.0/test/dbm/test_dbm.rb.rej --- ruby-2.3.0-cygwin/test/dbm/test_dbm.rb.rej 1970-01-01 03:00:00.000000000 +0300 +++ ruby-2.3.0/test/dbm/test_dbm.rb.rej 2016-03-10 16:53:23.242946400 +0300 @@ -0,0 +1,16 @@ +--- test/dbm/test_dbm.rb 2013-06-19 11:47:31.000000000 +0400 ++++ test/dbm/test_dbm.rb 2014-05-13 12:23:06.187800000 +0400 +@@ -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.3.0-cygwin/test/fiddle/helper.rb ruby-2.3.0/test/fiddle/helper.rb --- ruby-2.3.0-cygwin/test/fiddle/helper.rb 2015-12-16 08:07:31.000000000 +0300 +++ ruby-2.3.0/test/fiddle/helper.rb 2016-03-10 16:53:25.421946400 +0300 @@ -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.3.0-cygwin/test/gdbm/test_gdbm.rb ruby-2.3.0/test/gdbm/test_gdbm.rb --- ruby-2.3.0-cygwin/test/gdbm/test_gdbm.rb 2015-12-16 08:07:31.000000000 +0300 +++ ruby-2.3.0/test/gdbm/test_gdbm.rb 2016-03-10 16:57:18.358946400 +0300 @@ -15,6 +15,9 @@ case RbConfig::CONFIG['target_os'] when 'cygwin' require 'etc' + Etc.uname[:sysname + when 'msys' + require 'etc' Etc.uname[:sysname] else RbConfig::CONFIG['target_os'] diff -Naur ruby-2.3.0-cygwin/test/ruby/test_argf.rb ruby-2.3.0/test/ruby/test_argf.rb --- ruby-2.3.0-cygwin/test/ruby/test_argf.rb 2015-12-16 08:07:31.000000000 +0300 +++ ruby-2.3.0/test/ruby/test_argf.rb 2016-03-10 16:53:25.481946400 +0300 @@ -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.3.0-cygwin/test/ruby/test_file_exhaustive.rb ruby-2.3.0/test/ruby/test_file_exhaustive.rb --- ruby-2.3.0-cygwin/test/ruby/test_file_exhaustive.rb 2015-12-16 08:07:31.000000000 +0300 +++ ruby-2.3.0/test/ruby/test_file_exhaustive.rb 2016-03-10 16:58:18.691946400 +0300 @@ -6,8 +6,8 @@ class TestFileExhaustive < Test::Unit::TestCase DRIVE = Dir.pwd[%r'\A(?:[a-z]:|//[^/]+/[^/]+)'i] - POSIX = /cygwin|mswin|bccwin|mingw|emx/ !~ RUBY_PLATFORM - NTFS = !(/cygwin|mingw|mswin|bccwin/ !~ RUBY_PLATFORM) + POSIX = /cygwin|msys|mswin|bccwin|mingw|emx/ !~ RUBY_PLATFORM + NTFS = !(/cygwin|msys|mingw|mswin|bccwin/ !~ RUBY_PLATFORM) def assert_incompatible_encoding d = "\u{3042}\u{3044}".encode("utf-16le") @@ -1155,7 +1155,7 @@ assert_equal(true, test(?=, fn1, fn1)) assert_equal(false, test(?>, fn1, fn1)) assert_equal(false, test(?<, fn1, fn1)) - unless /cygwin/ =~ RUBY_PLATFORM + unless /cygwin|msys/ =~ RUBY_PLATFORM assert_equal(false, test(?=, fn1, fn2)) assert_equal(false, test(?>, fn1, fn2)) assert_equal(true, test(?>, fn2, fn1)) diff -Naur ruby-2.3.0-cygwin/test/ruby/test_path.rb ruby-2.3.0/test/ruby/test_path.rb --- ruby-2.3.0-cygwin/test/ruby/test_path.rb 2015-12-16 08:07:31.000000000 +0300 +++ ruby-2.3.0/test/ruby/test_path.rb 2016-03-10 16:53:25.561946400 +0300 @@ -48,7 +48,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')) @@ -104,7 +104,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')) @@ -138,7 +138,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')) @@ -194,7 +194,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.3.0-cygwin/test/ruby/test_require.rb ruby-2.3.0/test/ruby/test_require.rb --- ruby-2.3.0-cygwin/test/ruby/test_require.rb 2015-12-16 08:07:31.000000000 +0300 +++ ruby-2.3.0/test/ruby/test_require.rb 2016-03-10 16:53:25.589946400 +0300 @@ -75,7 +75,7 @@ end case RUBY_PLATFORM - when /cygwin/, /mswin/, /mingw/, /darwin/ + when /cygwin/, /msys/, /mswin/, /mingw/, /darwin/ def self.ospath_encoding(path) Encoding::UTF_8 end diff -Naur ruby-2.3.0-cygwin/test/rubygems/test_gem_platform.rb ruby-2.3.0/test/rubygems/test_gem_platform.rb --- ruby-2.3.0-cygwin/test/rubygems/test_gem_platform.rb 2015-12-16 08:07:31.000000000 +0300 +++ ruby-2.3.0/test/rubygems/test_gem_platform.rb 2016-03-10 16:53:25.617946400 +0300 @@ -46,6 +46,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.3.0-cygwin/test/socket/test_addrinfo.rb ruby-2.3.0/test/socket/test_addrinfo.rb --- ruby-2.3.0-cygwin/test/socket/test_addrinfo.rb 2015-11-14 16:15:33.000000000 +0300 +++ ruby-2.3.0/test/socket/test_addrinfo.rb 2016-03-10 16:53:25.654946400 +0300 @@ -8,7 +8,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.3.0-cygwin/test/socket/test_unix.rb ruby-2.3.0/test/socket/test_unix.rb --- ruby-2.3.0-cygwin/test/socket/test_unix.rb 2015-12-07 21:39:47.000000000 +0300 +++ ruby-2.3.0/test/socket/test_unix.rb 2016-03-10 17:08:29.841904600 +0300 @@ -699,4 +699,4 @@ assert_equal :wait_readable, serv.accept_nonblock(exception: false) } end -end if defined?(UNIXSocket) && /cygwin/ !~ RUBY_PLATFORM +end if defined?(UNIXSocket) && /cygwin|msys/ !~ RUBY_PLATFORM diff -Naur ruby-2.3.0-cygwin/test/webrick/test_cgi.rb ruby-2.3.0/test/webrick/test_cgi.rb --- ruby-2.3.0-cygwin/test/webrick/test_cgi.rb 2015-12-16 08:07:31.000000000 +0300 +++ ruby-2.3.0/test/webrick/test_cgi.rb 2016-03-10 17:00:29.907946400 +0300 @@ -21,7 +21,7 @@ end }, } - if RUBY_PLATFORM =~ /mswin|mingw|cygwin|bccwin32/ + if RUBY_PLATFORM =~ /mswin|mingw|cygwin|msys|bccwin32/ config[:CGIPathEnv] = ENV['PATH'] # runtime dll may not be in system dir. end TestWEBrick.start_httpserver(config, log_tester){|server, addr, port, log| @@ -38,7 +38,7 @@ http.request(req){|res| assert_equal("/path/info", res.body, log.call)} req = Net::HTTP::Get.new("/webrick.cgi/%3F%3F%3F?foo=bar") http.request(req){|res| assert_equal("/???", res.body, log.call)} - unless RUBY_PLATFORM =~ /mswin|mingw|cygwin|bccwin32/ + unless RUBY_PLATFORM =~ /mswin|mingw|cygwin|msys|bccwin32/ # Path info of res.body is passed via ENV. # ENV[] returns different value on Windows depending on locale. req = Net::HTTP::Get.new("/webrick.cgi/%A4%DB%A4%B2/%A4%DB%A4%B2") diff -Naur ruby-2.3.0-cygwin/tool/config.guess ruby-2.3.0/tool/config.guess --- ruby-2.3.0-cygwin/tool/config.guess 2015-12-24 19:38:18.000000000 +0300 +++ ruby-2.3.0/tool/config.guess 2016-03-10 16:53:25.762946400 +0300 @@ -881,6 +881,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.3.0-cygwin/win32/mkexports.rb ruby-2.3.0/win32/mkexports.rb --- ruby-2.3.0-cygwin/win32/mkexports.rb 2015-02-23 10:05:23.000000000 +0300 +++ ruby-2.3.0/win32/mkexports.rb 2016-03-10 16:53:25.790946400 +0300 @@ -160,6 +160,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