なかだです。

  mingw32 で、ソースと別ドライブでコンパイルすると、miniruby
がスクリプトやソースにアクセスできなくて失敗します。拡張ライブ
ラリに関しても同様です(こちらは mswin32 も)。


Index: Makefile.in =================================================================== RCS file: /home/cvs/ruby/src/ruby/Makefile.in,v retrieving revision 1.25 diff -u -2 -p -r1.25 Makefile.in --- Makefile.in 2001/05/07 09:26:23 1.25 +++ Makefile.in 2001/06/01 19:44:37 @@ -1,3 +1,4 @@ SHELL = /bin/sh +RUBYOPT = #### Start of system configuration section. #### @@ -14,5 +15,5 @@ AUTOCONF = autoconf prefix = @prefix@ CFLAGS = @CFLAGS@ -CPPFLAGS = -I. -I$(srcdir) -I@includedir@ +CPPFLAGS = -I. -I$(srcdir) -I@includedir@ @CPPFLAGS@ LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@ XLDFLAGS = @XLDFLAGS@ @@ -113,11 +114,12 @@ clean:; @rm -f $(OBJS) $(LIBRUBY_A) $(L @rm -f $(PROGRAM) miniruby$(EXEEXT) -distclean:; @-@MINIRUBY@ -Cext extmk.rb distclean 2> /dev/null || true - $(MAKE) clean +extclean: @-@MINIRUBY@ -Cext extmk.rb distclean 2> /dev/null || true + +distclean: extclean clean @rm -f Makefile ext/extmk.rb config.h @rm -f ext/config.cache config.cache config.log config.status @rm -f *~ core *.core gmon.out y.tab.c y.output ruby.imp -realclean: distclean +realclean: distclean @rm -f parse.c @rm -f lex.c @@ -233,5 +235,5 @@ dl_os2.@OBJEXT@: $(srcdir)/missing/dl_os win32.@OBJEXT@: $(srcdir)/win32/win32.c - $(CC) $(CFLAGS) $(CPPFLAGS) -I$(srcdir)/win32 -c $(srcdir)/win32/win32.c + $(CC) $(CFLAGS) $(CPPFLAGS) -I$(srcdir)/missing -c $(srcdir)/win32/win32.c # Prevent GNU make v3 from overflowing arg limit on SysV. Index: configure.in =================================================================== RCS file: /home/cvs/ruby/src/ruby/configure.in,v retrieving revision 1.91 diff -u -2 -p -r1.91 configure.in --- configure.in 2001/06/01 02:25:28 1.91 +++ configure.in 2001/06/01 19:44:37 @@ -817,4 +817,5 @@ if test "$fat_binary" = yes ; then fi +CYGPATH='' if test x"$cross_compiling" = xyes; then MINIRUBY="ruby -I`pwd` -rfake" @@ -823,7 +824,13 @@ else MINIRUBY='./miniruby$(EXEEXT)' PREP='' + case $target_os in + mingw*) + CYGPATH=cygpath + ;; + esac fi AC_SUBST(MINIRUBY) AC_SUBST(PREP) +AC_SUBST(CYGPATH) FIRSTMAKEFILE="" @@ -854,5 +861,5 @@ if test "$enable_shared" = 'yes'; then LIBRUBY='$(LIBRUBY_SO)' LIBRUBYARG='-L. -l$(RUBY_INSTALL_NAME)' - CFLAGS="$CFLAGS $CCDLFLAGS" + test -z "$CCDLFLAGS" || CFLAGS="$CFLAGS $CCDLFLAGS" ENABLE_SHARED=yes if test "$rb_cv_binary_elf" = yes; then @@ -983,11 +990,17 @@ case "$target_os" in CCDLFLAGS=-DUSEIMPORTLIB ;; mingw*) + AC_DEFINE(NT, 1) LIBOBJS="$LIBOBJS win32.o" - CFLAGS="-DNT -D__MSVCRT__ $CFLAGS" + for flag in -D__MSVCRT__ -DNT -mthreads; do + case " $CFLAGS " in + *" $flag "*) ;; + *) CFLAGS="$flag $CFLAGS" + esac + done CCDLFLAGS=-DIMPORT ;; esac ;; *) - ;; + ;; esac Index: mkconfig.rb =================================================================== RCS file: /home/cvs/ruby/src/ruby/mkconfig.rb,v retrieving revision 1.15 diff -u -2 -p -r1.15 mkconfig.rb --- mkconfig.rb 2001/05/31 04:40:37 1.15 +++ mkconfig.rb 2001/06/01 19:44:37 @@ -4,5 +4,5 @@ require File.dirname($0)+"/lib/ftools" rbconfig_rb = ARGV[0] || 'rbconfig.rb' -srcdir = $srcdir if $srcdir +srcdir = $srcdir || '.' File.makedirs(File.dirname(rbconfig_rb), true) @@ -11,4 +11,10 @@ config = open(rbconfig_rb, "w") $stdout.reopen(config) +if /mingw|mswin/ =~ RUBY_PLATFORM + def File.expand_path(s) + `cygpath -w "#{s}"`.chomp.tr("\\", "/") + end +end + fast = {'prefix'=>TRUE, 'ruby_install_name'=>TRUE, 'INSTALL'=>TRUE, 'EXEEXT'=>TRUE} print %[ @@ -25,5 +31,5 @@ print " DESTDIR = '' if not defined? DE v_fast = [] v_others = [] -has_srcdir = false +cygpath = nil has_version = false File.foreach "config.status" do |line| @@ -39,4 +45,5 @@ File.foreach "config.status" do |line| next if $install_name and /^RUBY_INSTALL_NAME$/ =~ name next if $so_name and /^RUBY_SO_NAME$/ =~ name + cygpath = val if !val.empty? and 'CYGPATH' == name v = " CONFIG[\"" + name + "\"] = " + val.sub(/^\s*(.*)\s*$/, '"\1"').gsub(/\$\{?(\w+)\}?/) { @@ -50,6 +57,5 @@ File.foreach "config.status" do |line| has_version = true if name == "MAJOR" elsif /^(?:ac_given_)?srcdir=(.*)/ =~ line - v_fast << " CONFIG[\"srcdir\"] = \"" + File.expand_path($1) + "\"\n" - has_srcdir = true + srcdir = $1 elsif /^ac_given_INSTALL=(.*)/ =~ line v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n" @@ -58,7 +64,10 @@ File.foreach "config.status" do |line| end -if not has_srcdir - v_fast << " CONFIG[\"srcdir\"] = \"" + File.expand_path(srcdir || '.') + "\"\n" +if cygpath + srcdir = `#{cygpath} -w "#{srcdir}"`.chomp.tr("\\", "/") +else + srcdir = File.expand_path(srcdir) end +v_fast.unshift(" CONFIG[\"srcdir\"] = \"#{srcdir}\"\n") if not has_version Index: cygwin/GNUmakefile.in =================================================================== RCS file: /home/cvs/ruby/src/ruby/cygwin/GNUmakefile.in,v retrieving revision 1.19 diff -u -2 -p -r1.19 GNUmakefile.in --- cygwin/GNUmakefile.in 2001/05/28 16:07:34 1.19 +++ cygwin/GNUmakefile.in 2001/06/01 19:44:37 @@ -1,4 +1,10 @@ include Makefile +cygpath = @CYGPATH@ +ifneq ($(cygpath),) +winpath = $(subst \,/,$(shell $(cygpath) -w "$(1)")) +srcdir := $(call winpath,$(srcdir)) +endif + ENABLE_SHARED=@ENABLE_SHARED@ @@ -38,6 +44,10 @@ $(WPROGRAM): $(RUBYW_INSTALL_NAME).res.@ $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@ -$(RUBYDEF): $(LIBRUBY_A) - echo EXPORTS > $(RUBYDEF) +$(RUBYDEF): $(LIBRUBY_A) miniruby$(EXEEXT) + echo EXPORTS > $@ @NM@ --extern-only --defined-only $(LIBRUBY_A) | \ - @MINIRUBY@ -ne 'puts $$1 if / [CDT] _(.*)$$/' >> $(RUBYDEF) + @MINIRUBY@ -ne 'BEGIN{STDOUT.binmode}' -e 'puts $$1 if / [BCDT] _((?!yy).*)$$/' >> $@ + +ifeq (@target_os@,mingw32) +$(OBJS) $(MAINOBJ): win32/win32.h +endif Index: ext/extmk.rb.in =================================================================== RCS file: /home/cvs/ruby/src/ruby/ext/extmk.rb.in,v retrieving revision 1.46 diff -u -2 -p -r1.46 extmk.rb.in --- ext/extmk.rb.in 2001/05/28 13:25:34 1.46 +++ ext/extmk.rb.in 2001/06/01 19:44:37 @@ -28,4 +28,17 @@ $extlist = [] $includedir = "@includedir@".gsub(/\$\{prefix\}|\$\(prefix\)/,'@prefix@') +$CYGPATH = "@CYGPATH@" +class << File + if $CYGPATH.empty? + $CYGPATH = nil + def extern_path(s); s; end + def intern_path(s); s; end + else + def extern_path(s) `#{$CYGPATH} -w "#{s}"`.chomp.tr("\\", "/"); end + def intern_path(s) `#{$CYGPATH} -u "#{s}"`.chomp; end + alias expand_path extern_path + end +end + $top_srcdir = "@top_srcdir@" if $top_srcdir !~ "^/" @@ -64,13 +77,10 @@ def older(file1, file2) end -if RUBY_PLATFORM == "m68k-human" - CFLAGS = "@CFLAGS@".gsub(/-c..-stack=[0-9]+ */, '') -else - CFLAGS = "@CFLAGS@" -end +CFLAGS = "@CFLAGS@" +CFLAGS.gsub!(/-c..-stack=[0-9]+ */, '') if RUBY_PLATFORM == "m68k-human" LINK = "@CC@ -o conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir @LDFLAGS@ %s %s %s conftest.c %s %s @LIBS@" CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir %s %s %s conftest.c" -if FileTest.readable? 'nul' +if FileTest.exist? 'nul' $null = open('nul', 'w') elsif FileTest.readable? '/dev/null' @@ -100,6 +110,7 @@ def try_link0(src, opt="") cfile.close ldflags = $LDFLAGS - if /mswin32/ =~ RUBY_PLATFORM and !$LIBPATH.empty? - ENV['LIB'] = ($LIBPATH + [ORIG_LIBPATH]).compact.join(';') + if /mswin32/ =~ RUBY_PLATFORM + $LIBPATH.empty? or + ENV['LIB'] = ($LIBPATH.collect {|d| File.extern_path(d)} + [ORIG_LIBPATH]).compact.join(';') else $LDFLAGS = ldflags.dup @@ -386,5 +397,5 @@ def create_makefile(target) defflag = '' - if RUBY_PLATFORM =~ /cygwin|mingw/ and not $static + if RUBY_PLATFORM =~ /cygwin|mingw|mswin/ and not $static if not File.exist? target + '.def' open(target + '.def', 'wb') do |f| @@ -392,9 +403,11 @@ def create_makefile(target) end end - defflag = "--def=" + target + ".def" + defflag = "--def=" + target + ".def" unless RUBY_PLATFORM =~ /mswin/ end - if RUBY_PLATFORM =~ /mswin32/ - libpath = $LIBPATH.join(';') + case RUBY_PLATFORM + when /mswin/ + $local_flags << " -def:$(TARGET).def" + libpath = $LIBPATH.collect {|d| File.extern_path(d)}.join(';') else $LIBPATH.each {|d| $DLDFLAGS << " -L" << d} @@ -410,5 +423,5 @@ SHELL = /bin/sh srcdir = #{$srcdir} -VPATH = #{$srcdir} +VPATH = #{File.intern_path($srcdir)} topdir = #{$topdir} @@ -426,4 +439,12 @@ LDSHARED = @LDSHARED@ #{defflag} mfile.puts ".SUFFIXES: .@OBJEXT@" unless "@OBJEXT@" == "o" + if $CYGPATH and /mswin/ =~ RUBY_PLATFORM + mfile.print " +winpath = $(subst \\,/,$(shell #{$CYGPATH} -w \"$(1)\")) +srcdir := $(call winpath,$(srcdir)) + +" + end + mfile.printf "\ @@ -502,42 +523,48 @@ EOS mfile.printf "\n" + unless /mswin32/ =~ RUBY_PLATFORM + src = '$<' + copt = cxxopt = '' + else + src = '$(call winpath,$<)' + copt = '-Tc' + cxxopt = '-Tp' + end unless /nmake/i =~ $make - unless /mswin32/ =~ RUBY_PLATFORM - src = '$<' - else - src = '$(subst /,\\\\,$<)' - end mfile.puts " .cc.@OBJEXT@: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{src} + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} .cpp.@OBJEXT@: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{src} + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} .cxx.@OBJEXT@: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{src} + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} .C.@OBJEXT@: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{src} + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} .c.@OBJEXT@: - $(CC) $(CFLAGS) $(CPPFLAGS) -c #{src} + $(CC) $(CFLAGS) $(CPPFLAGS) -c #{copt}#{src} + " else + src = '$(<:\\=/)' mfile.print " {$(srcdir)}.c{}.@OBJEXT@: - $(CC) -I. -I$(<D) $(CFLAGS) $(CPPFLAGS) -c $(<:/=\\) + $(CC) -I. -I$(<D) $(CFLAGS) $(CPPFLAGS) -c #{copt}#{src} .c.@OBJEXT@: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(<:/=\\) + $(CC) $(CFLAGS) $(CPPFLAGS) -c #{copt}#{src} {$(srcdir)}.cc{}.@OBJEXT@: - $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\) + $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} .cc.@OBJEXT@: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} {$(srcdir)}.cpp{}.@OBJEXT@: - $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\) + $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} .cpp.@OBJEXT@: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} {$(srcdir)}.cxx{}.@OBJEXT@: - $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\) + $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} .cxx.@OBJEXT@: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} + " end @@ -560,10 +587,10 @@ $(DLLIB): $(OBJS) if /mswin32/ =~ RUBY_PLATFORM if /nmake/i =~ $make - mfile.print "\tset LIB=$(LIBPATH:/=\\);$(LIB)\n" + mfile.print "\tset LIB=$(LIBPATH);$(LIB)\n" else - mfile.print "\tenv LIB='$(subst /,\\\\,$(LIBPATH));$(LIB)' \\\n" + mfile.print "\tenv LIB='$(LIBPATH);$(LIB)' \\\n" end end - mfile.print "\t$(LDSHARED) $(DLDFLAGS) -o $(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)\n" + mfile.print "\t$(LDSHARED) $(DLDFLAGS) #{OUTFLAG}$(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)\n" elsif RUBY_PLATFORM == "m68k-human" mfile.printf "\ @@ -609,5 +636,5 @@ def extmake(target) if /mswin32/ =~ RUBY_PLATFORM $LIBEXT = "lib" - $local_flags = "-link /INCREMENTAL:no /EXPORT:Init_$(TARGET)" + $local_flags = "-link -incremental:no" end $LOCAL_LIBS = "" # to be assigned in extconf.rb Index: lib/mkmf.rb =================================================================== RCS file: /home/cvs/ruby/src/ruby/lib/mkmf.rb,v retrieving revision 1.53 diff -u -2 -p -r1.53 mkmf.rb --- lib/mkmf.rb 2001/05/30 09:10:26 1.53 +++ lib/mkmf.rb 2001/06/01 19:44:37 @@ -38,5 +38,5 @@ elsif RUBY_PLATFORM =~ /-nextstep|-rhaps end -if FileTest.readable? 'nul' +if FileTest.exist? 'nul' $null = open('nul', 'w') elsif FileTest.readable? '/dev/null' @@ -60,4 +60,16 @@ def rm_f(*files) end +if /mingw|mswin32/ =~ RUBY_PLATFORM + def File.extern_path(s) + `cygpath -w "#{s}"`.chomp.tr("\\", "/") + end + def File.intern_path(s) + `cygpath -u "#{s}"`.chomp + end +else + def File.extern_path(s); s; end + def File.intern_path(s); s; end +end + $orgerr = $stderr.dup $orgout = $stdout.dup @@ -388,5 +400,5 @@ def create_makefile(target, srcdir = Fil defflag = '' - if RUBY_PLATFORM =~ /cygwin|mingw/ + if RUBY_PLATFORM =~ /cygwin|mingw|mswin/ if not File.exist? target + '.def' open(target + '.def', 'wb') do |f| @@ -394,9 +406,10 @@ def create_makefile(target, srcdir = Fil end end - defflag = "--def=" + target + ".def" + defflag = "--def=" + target + ".def" unless RUBY_PLATFORM =~ /mswin/ end if RUBY_PLATFORM =~ /mswin32/ - libpath = $LIBPATH.join(';') + $local_flags << " -def:$(TARGET).def" + libpath = $LIBPATH.collect {|d| File.extern_path(d)}.join(';') else $LIBPATH.each {|d| $DLDFLAGS << " -L" << d} @@ -425,5 +438,5 @@ SHELL = /bin/sh #### Start of system configuration section. #### -srcdir = #{srcdir || $srcdir} +srcdir = #{File.intern_path(srcdir || $srcdir)} topdir = #{$topdir} hdrdir = #{$hdrdir} @@ -473,4 +486,6 @@ RM = $(RUBY) -r ftools -e 'File::rm_f(*D EXEEXT = #{CONFIG["EXEEXT"]} +.SUFFIXES: .#{$OBJEXT} + all: $(DLLIB) @@ -503,47 +518,48 @@ EOMF mfile.printf "\n" - if /mswin32/ !~ RUBY_PLATFORM + unless /mswin32/ =~ RUBY_PLATFORM + src = '$<' + copt = cxxopt = '' + else + src = '$(call winpath,$<)' + copt = '-Tc' + cxxopt = '-Tp' + end + unless /nmake/i =~ $make mfile.print " -.c.#{$OBJEXT}: - $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< - .cc.#{$OBJEXT}: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{OBJFLAG}$@ #{cxxopt}#{src} .cpp.#{$OBJEXT}: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{OBJFLAG}$@ #{cxxopt}#{src} .cxx.#{$OBJEXT}: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{OBJFLAG}$@ #{cxxopt}#{src} .C.#{$OBJEXT}: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{OBJFLAG}$@ #{cxxopt}#{src} + +.c.#{$OBJEXT}: + $(CC) $(CFLAGS) $(CPPFLAGS) -c #{OBJFLAG}$@ #{copt}#{src} + " - elsif /nmake/i =~ $make + else + src = '$(<:\\=/)' mfile.print " -{$(srcdir)}.c.#{$OBJEXT}: - $(CC) $(CFLAGS) -I$(<D) $(CPPFLAGS) -c $(<:/=\\) +{$(srcdir)}.c{}.#{$OBJEXT}: + $(CC) $(CFLAGS) -I$(<D) $(CPPFLAGS) -c #{copt}#{src} .c.#{$OBJEXT}: - $(CC) $(CFLAGS) -I$(<D) $(CPPFLAGS) -c $(<:/=\\) + $(CC) $(CFLAGS) -I$(<D) $(CPPFLAGS) -c #{copt}#{src} {$(srcdir)}.cc{}.#{$OBJEXT}: - $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\) + $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} .cc.#{$OBJEXT}: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} {$(srcdir)}.cpp{}.#{$OBJEXT}: - $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\) + $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} .cpp.#{$OBJEXT}: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} {$(srcdir)}.cxx{}.#{$OBJEXT}: - $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\) + $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} .cxx.#{$OBJEXT}: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\) -" - else - mfile.print " -.SUFFIXES: .#{$OBJEXT} - -.c.#{$OBJEXT}: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(subst /,\\\\,$<) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} -.cc.#{$OBJEXT} .cpp.#{$OBJEXT} .cxx.#{$OBJEXT} .C.#{$OBJEXT}: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(subst /,\\\\,$<) " end @@ -553,10 +569,10 @@ EOMF if /mswin32/ =~ RUBY_PLATFORM if /nmake/i =~ $make - mfile.print "\tset LIB=$(LIBPATH:/=\\);$(LIB)\n" + mfile.print "\tset LIB=$(LIBPATH);$(LIB)\n" else - mfile.print "\tenv LIB='$(subst /,\\\\,$(LIBPATH));$(LIB)' \\\n" + mfile.print "\tenv LIB='$(LIBPATH);$(LIB)' \\\n" end end - mfile.print "\t$(LDSHARED) $(DLDFLAGS) -o $(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)\n" + mfile.print "\t$(LDSHARED) $(DLDFLAGS) #{EXEFLAG}$(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)\n" elsif not File.exist?(target + ".c") and not File.exist?(target + ".cc") mfile.print "$(DLLIB): $(OBJS)\n" @@ -588,5 +604,5 @@ $local_flags = "" case RUBY_PLATFORM when /mswin32/ - $local_flags = "-link /INCREMENTAL:no /EXPORT:Init_$(TARGET)" + $local_flags = "-link -incremental:no" end $LOCAL_LIBS = "" Index: win32/Makefile.sub =================================================================== RCS file: /home/cvs/ruby/src/ruby/win32/Makefile.sub,v retrieving revision 1.11 diff -u -2 -p -r1.11 Makefile.sub --- win32/Makefile.sub 2001/04/14 04:38:19 1.11 +++ win32/Makefile.sub 2001/06/01 19:47:03 @@ -32,5 +32,5 @@ AUTOCONF = autoconf prefix = /usr CFLAGS = -nologo -DNT=1 -Zi -MD -O2b2xg- -G5 -CPPFLAGS = -I$(srcdir) -I$(srcdir)/missing +CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/missing -DLIBRUBY_SO=\"$(LIBRUBY_SO)\" LDFLAGS = $(CFLAGS) -Fm XLDFLAGS = @@ -111,4 +111,7 @@ lib: $(LIBRUBY) dll: $(LIBRUBY_SO) +config.h config.status: $(srcdir)/win32/$$@.in + @copy $(srcdir:/=\)\win32\$@.in $@ > nul + ext/extmk.rb: $(srcdir)/ext/extmk.rb.in config.status @echo Creating ext/extmk.rb @@ -122,13 +125,15 @@ miniruby$(EXEEXT): $(OBJS) $(MAINOBJ) $( @echo $(EXTOBJS) @echo $(LIBS) - $(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) $(EXTOBJS) $(OBJS) $(LIBS) -o $@ + $(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) $(EXTOBJS) $(OBJS) $(LIBS) -Fe$@ $(PROGRAM): $(MAINOBJ) $(LIBRUBY_SO) $*.res $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $*.res \ - -o $@ $(LIBRUBYARG) -link /STACK:$(STACK) + -Fe$@ $(LIBRUBYARG) -link -stack:$(STACK) -incremental:no $(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $*.res $(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) $(WINMAINOBJ) $*.res \ - -o $@ $(LIBRUBYARG) -link /STACK:$(STACK) /SUBSYSTEM:Windows + -Fe$@ $(LIBRUBYARG) -link -stack:$(STACK) -subsystem:Windows -incremental:no + +$(PROGRAM): $(WPROGRAM) $(LIBRUBY_A): $(OBJS) dmyext.obj @@ -141,5 +146,5 @@ $(LIBRUBY_SO): $(LIBRUBY_A) $(EXTOBJS) $ set LIB=./win32;$(ORGLIBPATH) $(CC) $(LDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBY_A) $@.res $(LIBS) \ - -o $@ -link /DLL /DEF:$(RUBYDEF) + -Fe$@ -link -dll -def:$(RUBYDEF) !if "$(LIBRUBY_SO)" != "rubymw.dll" @@ -154,19 +159,48 @@ install: rbconfig.rb .\miniruby.exe $(srcdir)/instruby.rb $(DESTDIR) -clean:; @rm -f $(OBJS) $(LIBRUBY_A) $(MAINOBJ) rbconfig.rb - @rm -f ext/extinit.c ext/extinit.obj ext/vc*.pdb *.obj *.res +clean: + @if exist $(LIBRUBY_A) del $(LIBRUBY_A) + @if exist $(MAINOBJ) del $(MAINOBJ) + @if exist rbconfig.rb del rbconfig.rb + @if exist ext\extinit.c del ext\extinit.c + @if exist ext\extinit.obj del ext\extinit.obj + @if exist ext\vc*.pdb del ext\vc*.pdb + @if exist *.obj del *.obj + @if exist *.res del *.res @-.\miniruby$(EXEEXT) -Cext extmk.rb clean distclean: clean - @rm -f Makefile ext/extmk.rb config.h - @rm -f ext/config.cache config.cache config.log config.status - @rm -f *~ core *.core gmon.out y.tab.c y.output ruby.imp - @rm -f *.map *.pdb *.ilk *.exp $(RUBYDEF) - @rm -f $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(LIBRUBY_SO).rc - @rm -f $(PROGRAM) $(WPROGRAM) $(LIBRUBY_SO) $(LIBRUBY) miniruby$(EXEEXT) + @if exist Makefile del Makefile + @if exist ext\extmk.rb del ext\extmk.rb + @if exist config.h del config.h + @if exist ext\config.cache del ext\config.cache + @if exist config.cache del config.cache + @if exist config.log del config.log + @if exist config.status del config.status + @if exist *~ del *~ + @if exist *.bak del *.bak + @if exist *.stackdump del *.stackdump + @if exist *.core del *.core + @if exist gmon.out del gmon.out + @if exist y.tab.c del y.tab.c + @if exist y.output del y.output + @if exist *.map del *.map + @if exist *.pdb del *.pdb + @if exist *.ilk del *.ilk + @if exist *.exp del *.exp + @if exist $(RUBYDEF) del $(RUBYDEF) + @if exist $(RUBY_INSTALL_NAME).rc del $(RUBY_INSTALL_NAME).rc + @if exist $(RUBYW_INSTALL_NAME).rc del $(RUBYW_INSTALL_NAME).rc + @if exist $(LIBRUBY_SO).rc del $(LIBRUBY_SO).rc + @if exist $(PROGRAM) del $(PROGRAM) + @if exist $(WPROGRAM) del $(WPROGRAM) + @if exist $(LIBRUBY_SO) del $(LIBRUBY_SO) + @if exist $(LIBRUBY) del $(LIBRUBY) + @if exist ext\nul if not exist ext\* rmdir ext + @if exist miniruby$(EXEEXT) del miniruby$(EXEEXT) realclean: distclean - @rm -f parse.c - @rm -f lex.c + @if exist parse.c del parse.c + @if exist lex.c del lex.c test: miniruby$(EXEEXT) @@ -189,14 +223,14 @@ $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_ {$(srcdir)/missing}.c.obj: - $(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c $(<:/=\) + $(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c -Tc$(<:\=/) {$(srcdir)/win32}.c.obj: - $(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c $(<:/=\) + $(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c -Tc$(<:\=/) {$(srcdir)}.c.obj: - $(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c $(<:/=\) + $(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c -Tc$(<:\=/) .c.obj: - $(CC) $(CFLAGS) -I. $(CPPFLAGS) -c $(<:/=\) + $(CC) $(CFLAGS) -I. $(CPPFLAGS) -c -Tc$(<:\=/) .rc.res: - $(RC) -I. -I$(<D) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $< + $(RC) -I. -I$(<D) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $(<:\=/) {$(srcdir)}.y.c: @@ -279,2 +313,3 @@ util.obj: $(srcdir)/util.c $(srcdir)/rub variable.obj: $(srcdir)/variable.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/env.h $(srcdir)/node.h $(srcdir)/st.h version.obj: $(srcdir)/version.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/version.h +$(OBJS) $(MAINOBJ) $(WINMAINOBJ): $(srcdir)/win32/win32.h Index: win32/mkexports.rb =================================================================== RCS file: /home/cvs/ruby/src/ruby/win32/mkexports.rb,v retrieving revision 1.1 diff -u -2 -p -r1.1 mkexports.rb --- win32/mkexports.rb 2000/08/03 09:55:54 1.1 +++ win32/mkexports.rb 2001/06/01 19:45:33 @@ -25,5 +25,5 @@ exports << "EXPORTS" << SYM.keys.sort if $output - open($output, 'w') {|f| f.puts exports} + open($output, 'wb') {|f| f.puts exports} else puts exports
-- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦