Permalink
Browse files

matz - nakada win32 patch

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent bb70bf1 commit 8884ab5e392549c34d79bcb8b32c13c9166626d4 matz committed Aug 3, 2000
Showing with 213 additions and 133 deletions.
  1. +11 −6 MANIFEST
  2. +53 −53 Makefile.in
  3. +12 −2 configure.in
  4. +24 −1 cygwin/GNUmakefile.in
  5. +3 −3 eval.c
  6. +16 −3 ext/extmk.rb.in
  7. +2 −2 instruby.rb
  8. +20 −6 lib/mkmf.rb
  9. +23 −3 mkconfig.rb
  10. +1 −1 random.c
  11. +45 −50 ruby.c
  12. +3 −3 rubytest.rb
View
@@ -82,7 +82,7 @@ ext/Setup.dj
ext/Setup.emx
ext/Setup.x68
ext/aix_mksym.rb
-ext/mswin32_extmk.rb
+ext/configsub.rb
ext/extmk.rb.in
lib/English.rb
lib/Env.rb
@@ -127,6 +127,7 @@ lib/mkmf.rb
lib/monitor.rb
lib/mutex_m.rb
lib/net/ftp.rb
+lib/net/http.rb
lib/net/pop.rb
lib/net/protocol.rb
lib/net/smtp.rb
@@ -231,13 +232,17 @@ sample/time.rb
sample/trojan.rb
sample/tsvr.rb
sample/uumerge.rb
-win32/Makefile
-win32/config.h
-win32/config.status
-win32/ntsetup.bat
-win32/ruby.def
+win32/Makefile.sub
+win32/README.win32
+win32/config.h.in
+win32/config.status.in
+win32/configure.bat
+win32/mkexports.rb
+win32/resource.rb
+win32/setup.mak
win32/win32.c
win32/win32.h
+win32/winmain.c
x68/fconvert.c
x68/select.c
x68/_dtos18.c
View
@@ -3,7 +3,7 @@ SHELL = /bin/sh
#### Start of system configuration section. ####
srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/missing
+VPATH = $(srcdir):$(srcdir)/missing
CC = @CC@
YACC = @YACC@
@@ -13,7 +13,7 @@ AUTOCONF = autoconf
prefix = @prefix@
CFLAGS = @CFLAGS@
-CPPFLAGS = -I. -I@srcdir@ -I@includedir@
+CPPFLAGS = -I. -I$(srcdir) -I@includedir@
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
XLDFLAGS = @XLDFLAGS@
EXTLIBS =
@@ -148,88 +148,88 @@ $(srcdir)/configure: $(srcdir)/configure.in
$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
lex.c: keywords
- gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ @srcdir@/keywords > lex.c
+ gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $(srcdir)/keywords > lex.c
parse.c: parse.y
$(YACC) $<
mv -f y.tab.c parse.c
parse.@OBJEXT@: parse.c
-alloca.@OBJEXT@: @srcdir@/missing/alloca.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/alloca.c
+alloca.@OBJEXT@: $(srcdir)/missing/alloca.c
+ $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/alloca.c
-crypt.@OBJEXT@: @srcdir@/missing/crypt.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/crypt.c
+crypt.@OBJEXT@: $(srcdir)/missing/crypt.c
+ $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/crypt.c
-dup2.@OBJEXT@: @srcdir@/missing/dup2.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/dup2.c
+dup2.@OBJEXT@: $(srcdir)/missing/dup2.c
+ $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/dup2.c
-finite.@OBJEXT@: @srcdir@/missing/finite.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/finite.c
+finite.@OBJEXT@: $(srcdir)/missing/finite.c
+ $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/finite.c
-flock.@OBJEXT@: @srcdir@/missing/flock.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/flock.c
+flock.@OBJEXT@: $(srcdir)/missing/flock.c
+ $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/flock.c
-isinf.@OBJEXT@: @srcdir@/missing/isinf.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/isinf.c
+isinf.@OBJEXT@: $(srcdir)/missing/isinf.c
+ $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/isinf.c
-isnan.@OBJEXT@: @srcdir@/missing/isnan.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/isnan.c
+isnan.@OBJEXT@: $(srcdir)/missing/isnan.c
+ $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/isnan.c
-fnmatch.@OBJEXT@: @srcdir@/missing/fnmatch.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/fnmatch.c
+fnmatch.@OBJEXT@: $(srcdir)/missing/fnmatch.c
+ $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/fnmatch.c
-memcmp.@OBJEXT@: @srcdir@/missing/memcmp.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/memcmp.c
+memcmp.@OBJEXT@: $(srcdir)/missing/memcmp.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/memcmp.c
-memmove.@OBJEXT@: @srcdir@/missing/memmove.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/memmove.c
+memmove.@OBJEXT@: $(srcdir)/missing/memmove.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/memmove.c
-mkdir.@OBJEXT@: @srcdir@/missing/mkdir.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/mkdir.c
+mkdir.@OBJEXT@: $(srcdir)/missing/mkdir.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/mkdir.c
-vsnprintf.@OBJEXT@: @srcdir@/missing/vsnprintf.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/vsnprintf.c
+vsnprintf.@OBJEXT@: $(srcdir)/missing/vsnprintf.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/vsnprintf.c
-strcasecmp.@OBJEXT@: @srcdir@/missing/strcasecmp.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strcasecmp.c
+strcasecmp.@OBJEXT@: $(srcdir)/missing/strcasecmp.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strcasecmp.c
-strncasecmp.@OBJEXT@: @srcdir@/missing/strncasecmp.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strncasecmp.c
+strncasecmp.@OBJEXT@: $(srcdir)/missing/strncasecmp.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strncasecmp.c
-strchr.@OBJEXT@: @srcdir@/missing/strchr.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strchr.c
+strchr.@OBJEXT@: $(srcdir)/missing/strchr.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strchr.c
-strerror.@OBJEXT@: @srcdir@/missing/strerror.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strerror.c
+strerror.@OBJEXT@: $(srcdir)/missing/strerror.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strerror.c
-strftime.@OBJEXT@: @srcdir@/missing/strftime.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strftime.c
+strftime.@OBJEXT@: $(srcdir)/missing/strftime.c
+ $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strftime.c
-strstr.@OBJEXT@: @srcdir@/missing/strstr.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strstr.c
+strstr.@OBJEXT@: $(srcdir)/missing/strstr.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strstr.c
-strtod.@OBJEXT@: @srcdir@/missing/strtod.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strtod.c
+strtod.@OBJEXT@: $(srcdir)/missing/strtod.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strtod.c
-strtol.@OBJEXT@: @srcdir@/missing/strtol.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strtol.c
+strtol.@OBJEXT@: $(srcdir)/missing/strtol.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strtol.c
-strtoul.@OBJEXT@: @srcdir@/missing/strtoul.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strtoul.c
+strtoul.@OBJEXT@: $(srcdir)/missing/strtoul.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strtoul.c
-x68.@OBJEXT@: @srcdir@/missing/x68.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/x68.c
+x68.@OBJEXT@: $(srcdir)/missing/x68.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/x68.c
-os2.@OBJEXT@: @srcdir@/missing/os2.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/os2.c
+os2.@OBJEXT@: $(srcdir)/missing/os2.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/os2.c
-dl_os2.@OBJEXT@: @srcdir@/missing/dl_os2.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/dl_os2.c
+dl_os2.@OBJEXT@: $(srcdir)/missing/dl_os2.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/dl_os2.c
-win32.@OBJEXT@: @srcdir@/win32/win32.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/win32/win32.c
+win32.@OBJEXT@: $(srcdir)/win32/win32.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/win32/win32.c
# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
View
@@ -89,6 +89,7 @@ case "$target_os" in
AC_CHECK_TOOL(DLLWRAP, dllwrap)
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(DLLTOOL, dlltool)
+ AC_CHECK_TOOL(WINDRES, windres)
;;
esac
@@ -878,13 +879,22 @@ test "$program_suffix" != NONE &&
ri_suffix=$program_suffix
RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
-RUBY_LIB_PREFIX="${prefix}/lib/ruby"
+case "$target_os" in
+ cygwin*|mingw*|*djgpp*)
+ RUBY_LIB_PREFIX="/lib/ruby"
+ SITEDIR='/lib/ruby/site_ruby'
+ ;;
+ *)
+ RUBY_LIB_PREFIX="${prefix}/lib/ruby"
+ SITEDIR='${prefix}/lib/ruby/site_ruby'
+ ;;
+esac
RUBY_LIB_PATH="${RUBY_LIB_PREFIX}/${MAJOR}.${MINOR}"
sitedir='${prefix}/lib/ruby/site_ruby'
AC_ARG_WITH(sitedir,
[--with-sitedir=DIR site libraries in DIR [PREFIX/lib/ruby/site_ruby]],
[sitedir=$withval])
-RUBY_SITE_LIB_PATH=`eval "echo ${sitedir}"`
+RUBY_SITE_LIB_PATH=`eval "echo ${SITEDIR}"`
RUBY_SITE_LIB_PATH2="${RUBY_SITE_LIB_PATH}/${MAJOR}.${MINOR}"
AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}")
View
@@ -7,11 +7,34 @@ ifneq (,$(findstring no, $(ENABLE_SHARED)))
LIBRUBYARG = $(LIBRUBY_A)
endif
+ifneq (,$(findstring ruby, $(RUBY_INSTALL_NAME)))
+ RUBYW_INSTALL_NAME = $(subst ruby,rubyw,$(RUBY_INSTALL_NAME))
+else
+ RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME)w
+endif
+WPROGRAM = $(RUBYW_INSTALL_NAME)$(EXEEXT)
RUBYDEF = $(RUBY_INSTALL_NAME).def
+SOLIBS := $(RUBY_INSTALL_NAME).dll.res.o $(SOLIBS)
+EXTOBJS += $(@:$(EXEEXT)=.res.o)
-$(LIBRUBY_SO): $(RUBYDEF)
+$(LIBRUBY_SO): $(RUBYDEF) $(RUBY_INSTALL_NAME).dll.res.o
$(LIBRUBY): $(LIBRUBY_SO)
+%.res.o: %.rc
+ @WINDRES@ --include-dir . --include-dir $(<D) --include-dir $(srcdir)/win32 $< $@
+
+$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_INSTALL_NAME).dll.rc: rbconfig.rb
+ @@MINIRUBY@ $(srcdir)/win32/resource.rb \
+ -ruby_name=$(RUBY_INSTALL_NAME) -rubyw_name=$(RUBYW_INSTALL_NAME) \
+ -so_name=$(RUBY_INSTALL_NAME).dll \
+ . $(icondirs) $(srcdir)/win32
+
+$(PROGRAM): $(RUBY_INSTALL_NAME).res.o
+$(WPROGRAM): $(RUBYW_INSTALL_NAME).res.o
+ @rm -f $@
+ $(PURIFY) $(CC) -mwindows -e _mainCRTStartup $(LDFLAGS) $(XLDFLAGS) \
+ $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
+
$(RUBYDEF): $(LIBRUBY_A)
echo EXPORTS > $(RUBYDEF)
@NM@ --extern-only --defined-only $(LIBRUBY_A) | \
View
6 eval.c
@@ -8111,13 +8111,13 @@ rb_cont_call(argc, argv, cont)
rb_raise(rb_eRuntimeError, "continuation called across threads");
}
switch (argc) {
- case 0:
+ case 0:
th->result = Qnil;
break;
- case 1:
+ case 1:
th->result = *argv;
break;
- default:
+ default:
th->result = rb_ary_new4(argc, argv);
break;
}
View
@@ -374,14 +374,16 @@ DESTDIR =
CC = @CC@
-CFLAGS = %s -I$(topdir) -I$(hdrdir) #{CFLAGS} #$CFLAGS -I@includedir@ %s
+CFLAGS = %s #{CFLAGS} #$CFLAGS
+CPPFLAGS = -I$(topdir) -I$(hdrdir) -I@includedir@ %s
DLDFLAGS = #$DLDFLAGS #$LDFLAGS
LDSHARED = @LDSHARED@ #{defflag}
", if $static then "" else "@CCDLFLAGS@" end, $defs.join(" ")
mfile.printf "\
RUBY_INSTALL_NAME = @RUBY_INSTALL_NAME@
+RUBY_SO_NAME = @RUBY_SO_NAME@
prefix = @prefix@
exec_prefix = @exec_prefix@
@@ -455,6 +457,16 @@ EOS
install_rb(mfile, $srcdir)
mfile.printf "\n"
+ if /mswin32/ =~ RUBY_PLATFORM
+ mfile.puts "
+.c.obj:
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
+{$(srcdir)}.c{}.obj:
+ $(CC) -I. -I$(<D) $(CFLAGS) $(CPPFLAGS) -c $(<:/=\\)
+
+"
+ end
+
if $static
if "@AR@" =~ /^lib\b/i
mfile.printf "\
@@ -490,6 +502,7 @@ $(DLLIB): $(OBJS)
mfile.printf "###\n"
while line = dfile.gets()
line.gsub!(/\.o\b/, ".#{$OBJEXT}")
+ line.gsub!(/(\s)([^\s\/]+\.[ch])/, '\1$(srcdir)/\2') if /mswin32/ =~ RUBY_PLATFORM
mfile.printf "%s", line.gsub('\$\(hdrdir\)/config.h', '$(topdir)/config.h')
end
dfile.close
@@ -515,7 +528,7 @@ def extmake(target)
$local_flags = ""
if /mswin32/ =~ RUBY_PLATFORM
$LIBEXT = "lib"
- $local_flags = "$(topdir)/rubymw.lib -link /EXPORT:Init_$(TARGET)"
+ $local_flags = "$(topdir)/$(RUBY_SO_NAME).lib -link /EXPORT:Init_$(TARGET)"
end
$LOCAL_LIBS = "" # to be assigned in extconf.rb
dir = with_config("opt-dir")
@@ -536,7 +549,7 @@ def extmake(target)
$LDFLAGS = ldir || ""
begin
- system "mkdir", target unless File.directory?(target)
+ Dir.mkdir target unless File.directory?(target)
Dir.chdir target
$target = target
$mdir = target
View
@@ -86,8 +86,8 @@
if RUBY_PLATFORM =~ /mswin32|mingw/
File.makedirs archlibdir + "/win32", true
File.install "win32/win32.h", archlibdir + "/win32", 0644, true
- if File.exist? wdir+'/rubymw.lib'
- File.install wdir+'/rubymw.lib', archlibdir, 0644, true
+ if File.exist? wdir+'/'+CONFIG["LIBRUBY"]
+ File.install wdir+'/'+CONFIG["LIBRUBY"], archlibdir, 0644, true
end
end
File.install wdir+'/'+CONFIG['LIBRUBY_A'], archlibdir, 0644, true
Oops, something went wrong.

0 comments on commit 8884ab5

Please sign in to comment.