> From what I understand you can do this.  The extensions used to require
> different DLLs, but no longer.  The new win32 dll is "msvcrt-ruby17.dll"
> and is the same for MinGW and VC++.

I see you are refering to ruby-1.7. This is not true for ruby-1.6.7:
I just built ruby-1.6.7 with both compilers. the dll created by msvc6
is named "mswin32-ruby16.dll". Mingw creates a statically linked
"ruby.exe", and the ruby library it creates is called
"libmingw32-ruby16.a".

> You would have to update the
> rbconfig.rb with your compiler/linker settings if  you build/deploy ruby
> with one compiler and want to use another one.  If someone could post a
> diff between the mingw generated rbconfig and the vc++ one, that's all I
> think would be necessary.

If it helps anyone, here are the two rbconfig.rb files for ruby-1.6.7.

MinGW-2.0.0-3 / MSYS-1.0.8-2002.09.07-1:
========================================

module Config

  RUBY_VERSION == "1.6.7" or
    raise "ruby lib version (1.6.7) doesn't match executable version (#{RUBY_VERSION})"

# This file was created by configrb when ruby was built. Any changes
# made to this file will be lost the next time ruby is built.
  DESTDIR = '' if not defined? DESTDIR
  CONFIG = {}
  TOPDIR = File.dirname(__FILE__).sub!(%r'/lib/ruby/1\.6/i686\-mingw32\Z', '')
  CONFIG["srcdir"] = "c:/ruby-builds/mingw/ruby-1.6.7"
  CONFIG["prefix"] = (TOPDIR || DESTDIR + "C:/PROGRA~1/Ruby")
  CONFIG["ruby_install_name"] = "ruby"
  CONFIG["EXEEXT"] = ".exe"
  CONFIG["SHELL"] = "/bin/sh"
  CONFIG["CFLAGS"] = "-DNT -D__MSVCRT__ -g -O2"
  CONFIG["CPPFLAGS"] = ""
  CONFIG["CXXFLAGS"] = ""
  CONFIG["FFLAGS"] = ""
  CONFIG["LDFLAGS"] = ""
  CONFIG["LIBS"] = "-lwsock32 -lmsvcrt"
  CONFIG["exec_prefix"] = "$(prefix)"
  CONFIG["bindir"] = "$(exec_prefix)/bin"
  CONFIG["sbindir"] = "$(exec_prefix)/sbin"
  CONFIG["libexecdir"] = "$(exec_prefix)/libexec"
  CONFIG["datadir"] = "$(prefix)/share"
  CONFIG["sysconfdir"] = "$(prefix)/etc"
  CONFIG["sharedstatedir"] = "$(prefix)/com"
  CONFIG["localstatedir"] = "$(prefix)/var"
  CONFIG["libdir"] = "$(exec_prefix)/lib"
  CONFIG["includedir"] = "$(prefix)/include"
  CONFIG["oldincludedir"] = "/usr/include"
  CONFIG["infodir"] = "$(prefix)/info"
  CONFIG["mandir"] = "$(prefix)/man"
  CONFIG["MAJOR"] = "1"
  CONFIG["MINOR"] = "6"
  CONFIG["TEENY"] = "7"
  CONFIG["host"] = "i686-pc-mingw32"
  CONFIG["host_alias"] = "i686-pc-mingw32"
  CONFIG["host_cpu"] = "i686"
  CONFIG["host_vendor"] = "pc"
  CONFIG["host_os"] = "mingw32"
  CONFIG["target"] = "i686-pc-mingw32"
  CONFIG["target_alias"] = "i686-pc-mingw32"
  CONFIG["target_cpu"] = "i686"
  CONFIG["target_vendor"] = "pc"
  CONFIG["target_os"] = "mingw32"
  CONFIG["build"] = "i686-pc-mingw32"
  CONFIG["build_alias"] = "i686-pc-mingw32"
  CONFIG["build_cpu"] = "i686"
  CONFIG["build_vendor"] = "pc"
  CONFIG["build_os"] = "mingw32"
  CONFIG["CC"] = "gcc"
  CONFIG["CPP"] = "gcc -E"
  CONFIG["YACC"] = "yacc"
  CONFIG["RANLIB"] = "ranlib"
  CONFIG["AR"] = "ar"
  CONFIG["NM"] = "nm"
  CONFIG["DLLWRAP"] = "dllwrap"
  CONFIG["AS"] = "as"
  CONFIG["DLLTOOL"] = "dlltool"
  CONFIG["WINDRES"] = "windres"
  CONFIG["LN_S"] = "ln"
  CONFIG["SET_MAKE"] = ""
  CONFIG["OBJEXT"] = "o"
  CONFIG["LIBOBJS"] = "crypt.o flock.o isinf.o win32.o"
  CONFIG["ALLOCA"] = ""
  CONFIG["XLDFLAGS"] = ""
  CONFIG["DLDFLAGS"] = ""
  CONFIG["STATIC"] = ""
  CONFIG["CCDLFLAGS"] = "-DIMPORT"
  CONFIG["LDSHARED"] = "dllwrap --target=mingw32 --as=as --dlltool-name=dlltool --driver-name=gcc --export-all -s"
  CONFIG["DLEXT"] = "so"
  CONFIG["DLEXT2"] = "dll"
  CONFIG["STRIP"] = "strip"
  CONFIG["EXTSTATIC"] = ""
  CONFIG["setup"] = "Setup"
  CONFIG["MINIRUBY"] = "./miniruby$(EXEEXT)"
  CONFIG["PREP"] = ""
  CONFIG["LIBRUBY_LDSHARED"] = "dllwrap --target=mingw32 --as=as --dlltool-name=dlltool --driver-name=gcc --export-all -s"
  CONFIG["LIBRUBY_DLDFLAGS"] = "--output-exp=$(RUBY_INSTALL_NAME).exp --dllname=$(RUBY_INSTALL_NAME)$(EXEEXT) --output-lib=$(LIBRUBY) --add-stdcall-alias --def=$(RUBYDEF)"
  CONFIG["RUBY_INSTALL_NAME"] = "ruby"
  CONFIG["RUBY_SO_NAME"] = "mingw32-$(RUBY_INSTALL_NAME)16"
  CONFIG["LIBRUBY_A"] = "lib$(RUBY_INSTALL_NAME)s.a"
  CONFIG["LIBRUBY_SO"] = "dummy"
  CONFIG["LIBRUBY_ALIASES"] = ""
  CONFIG["LIBRUBY"] = "lib$(RUBY_SO_NAME).a"
  CONFIG["LIBRUBYARG"] = "-L. -l$(RUBY_SO_NAME)"
  CONFIG["SOLIBS"] = "$(LIBS)"
  CONFIG["DLDLIBS"] = ""
  CONFIG["ENABLE_SHARED"] = "no"
  CONFIG["MAINLIBS"] = ""
  CONFIG["arch"] = "i686-mingw32"
  CONFIG["sitedir"] = "$(prefix)/lib/ruby/site_ruby"
  CONFIG["configure_args"] = "'--prefix=C:/PROGRA~1/Ruby'"
  CONFIG["ruby_version"] = "$(MAJOR).$(MINOR)"
  CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"
  CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
  CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
  CONFIG["sitearchdir"] = "$(sitelibdir)/$(arch)"
  CONFIG["compile_dir"] = "c:/ruby-builds/mingw/ruby-1.6.7"
  MAKEFILE_CONFIG = {}
  CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
  def Config::expand(val)
    val.gsub!(/\$\(([^()]+)\)/) do |var|
      key = $1
      if CONFIG.key? key
        Config::expand(CONFIG[key])
      else
	var
      end
    end
    val
  end
  CONFIG.each_value do |val|
    Config::expand(val)
  end
end





MS Visual C++ 6:
================

module Config

  RUBY_VERSION == "1.6.7" or
    raise "ruby lib version (1.6.7) doesn't match executable version (#{RUBY_VERSION})"

# This file was created by configrb when ruby was built. Any changes
# made to this file will be lost the next time ruby is built.
  DESTDIR = '' if not defined? DESTDIR
  CONFIG = {}
  CONFIG["MAJOR"] = "1"
  CONFIG["MINOR"] = "6"
  CONFIG["TEENY"] = "7"
  TOPDIR = File.dirname(__FILE__).sub!(%r'/lib/ruby/1\.6/i586\-mswin32\Z', '')
  CONFIG["prefix"] = (TOPDIR || DESTDIR + "")
  CONFIG["EXEEXT"] = ".exe"
  CONFIG["srcdir"] = "C:/ruby-builds/msvc6/ruby-1.6.7"
  CONFIG["ruby_install_name"] = "ruby"
  CONFIG["RUBY_INSTALL_NAME"] = "ruby"
  CONFIG["RUBY_SO_NAME"] = "mswin32-ruby16"
  CONFIG["SHELL"] = ""
  CONFIG["CFLAGS"] = "-nologo -DNT=1 -Zi -MD -O2b2xg- -G5"
  CONFIG["CPPFLAGS"] = ""
  CONFIG["CXXFLAGS"] = ""
  CONFIG["FFLAGS"] = ""
  CONFIG["LDFLAGS"] = "-nologo"
  CONFIG["LIBS"] = "user32.lib advapi32.lib wsock32.lib"
  CONFIG["exec_prefix"] = "$(prefix)"
  CONFIG["bindir"] = "$(exec_prefix)/bin"
  CONFIG["sbindir"] = "$(exec_prefix)/sbin"
  CONFIG["libexecdir"] = "$(exec_prefix)/libexec"
  CONFIG["datadir"] = "$(prefix)/share"
  CONFIG["sysconfdir"] = "$(prefix)/etc"
  CONFIG["sharedstatedir"] = "$(prefix)/com"
  CONFIG["localstatedir"] = "$(prefix)/var"
  CONFIG["libdir"] = "$(exec_prefix)/lib"
  CONFIG["includedir"] = "$(prefix)/include"
  CONFIG["oldincludedir"] = "/usr/include"
  CONFIG["infodir"] = "$(prefix)/info"
  CONFIG["mandir"] = "$(prefix)/man"
  CONFIG["host"] = "i586-pc-mswin32"
  CONFIG["host_alias"] = "i586-mswin32"
  CONFIG["host_cpu"] = "i586"
  CONFIG["host_vendor"] = "pc"
  CONFIG["host_os"] = "mswin32"
  CONFIG["CC"] = "cl"
  CONFIG["CPP"] = "cl -E"
  CONFIG["YACC"] = "byacc"
  CONFIG["RANLIB"] = "rem"
  CONFIG["AR"] = "lib -nologo"
  CONFIG["LN_S"] = ""
  CONFIG["SET_MAKE"] = ""
  CONFIG["LIBOBJS"] = "crypt.obj win32.obj isinf.obj isnan.obj"
  CONFIG["ALLOCA"] = ""
  CONFIG["DEFAULT_KCODE"] = ""
  CONFIG["OBJEXT"] = "obj"
  CONFIG["XLDFLAGS"] = ""
  CONFIG["DLDFLAGS"] = "$(CFLAGS)"
  CONFIG["STATIC"] = ""
  CONFIG["CCDLFLAGS"] = "-DIMPORT"
  CONFIG["LDSHARED"] = "cl -LD"
  CONFIG["DLEXT"] = "so"
  CONFIG["DLEXT2"] = "dll"
  CONFIG["STRIP"] = ""
  CONFIG["EXTSTATIC"] = ""
  CONFIG["setup"] = "Setup"
  CONFIG["LIBRUBY_LDSHARED"] = ""
  CONFIG["LIBRUBY_DLDFLAGS"] = ""
  CONFIG["LIBRUBY_A"] = "lib$(RUBY_INSTALL_NAME).lib"
  CONFIG["LIBRUBY_SO"] = "$(RUBY_SO_NAME).dll"
  CONFIG["LIBRUBY_ALIASES"] = ""
  CONFIG["LIBRUBY"] = "$(RUBY_SO_NAME).lib"
  CONFIG["LIBRUBYARG"] = "$(RUBY_SO_NAME).lib"
  CONFIG["SOLIBS"] = ""
  CONFIG["DLDLIBS"] = ""
  CONFIG["ENABLE_SHARED"] = "yes"
  CONFIG["arch"] = "i586-mswin32"
  CONFIG["sitedir"] = "$(prefix)/lib/ruby/site_ruby"
  CONFIG["configure_args"] = "--with-make-prog=nmake --enable-shared"
  CONFIG["ruby_version"] = "$(MAJOR).$(MINOR)"
  CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"
  CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
  CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
  CONFIG["sitearchdir"] = "$(sitelibdir)/$(arch)"
  CONFIG["compile_dir"] = "C:/ruby-builds/msvc6/ruby-1.6.7"
  MAKEFILE_CONFIG = {}
  CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
  def Config::expand(val)
    val.gsub!(/\$\(([^()]+)\)/) do |var|
      key = $1
      if CONFIG.key? key
        Config::expand(CONFIG[key])
      else
	var
      end
    end
    val
  end
  CONFIG.each_value do |val|
    Config::expand(val)
  end
end