diff --git a/ext/configsub.rb b/ext/configsub.rb new file mode 100644 index 0000000000..315cdaf868 --- /dev/null +++ b/ext/configsub.rb @@ -0,0 +1,32 @@ +#!./miniruby -ps + +BEGIN { + CONFIG = {} + + VERSION.scan(/(\d+)\.(\d+)\.(\d+)/) do + # overridden if config.status has version + CONFIG['MAJOR'] = $1 + CONFIG['MINOR'] = $2 + CONFIG['TEENY'] = $3 + end + + File.foreach($config || "config.status") do |$_| + next if /^#/ + if /^s%@(\w+)@%(.*)%g/ + name = $1 + val = $2 || "" + next if /^(INSTALL|DEFS|configure_input|srcdir)$/ =~ name + val.gsub!(/\$\{([^{}]+)\}/) { "$(#{$1})" } + CONFIG[name] = val + end + end + + CONFIG['top_srcdir'] = File.expand_path($srcdir || ".") + CONFIG['RUBY_INSTALL_NAME'] = $install_name if $install_name + CONFIG['RUBY_SO_NAME'] = $so_name if $so_name + $defout = open($output, 'w') if $output +} + +gsub!(/@(\w+)@/) {CONFIG[$1] || $&} + +# vi:set sw=2: diff --git a/ext/mswin32_extmk.rb b/ext/mswin32_extmk.rb deleted file mode 100644 index c79284dd8c..0000000000 --- a/ext/mswin32_extmk.rb +++ /dev/null @@ -1,41 +0,0 @@ -#!./miniruby - -def create_gsub_rb() - f = open("mswin32_gsub.rb", "w") - has_version = false - f.print 'f = open("extmk.rb", "w")', "\n" - f.print 'File.foreach "extmk.rb.in" do |$_|', "\n" - File.foreach "../config.status" do |$_| - next if /^#/ - if /^s%@(\w+)@%(.*)%g/ - name = $1 - val = $2 || "" - next if name =~ /^(INSTALL|DEFS|configure_input|srcdir)$/ - val = ".." if name == "top_srcdir" - val.gsub!(/\$\{([^{}]+)\}/) { "$(#{$1})" } - f.print " gsub!(\"@#{name}@\", \"#{val}\")\n" - has_version = true if name == "MAJOR" - end - end - - if not has_version - VERSION.scan(/(\d+)\.(\d+)\.(\d+)/) { - f.print " gsub!(\"@MAJOR@\", \"#{$1}\")\n" - f.print " gsub!(\"@MINOR@\", \"#{$2}\")\n" - f.print " gsub!(\"@TEENY@\", \"#{$3}\")\n" - } - end - f.print ' f.print $_', "\n" - f.print 'end', "\n" - f.print 'f.close', "\n" - f.close -end - -begin - create_gsub_rb() - load "mswin32_gsub.rb" -ensure - File.unlink "mswin32_gsub.rb" -end - -# vi:set sw=2: diff --git a/win32/Makefile b/win32/Makefile deleted file mode 100644 index 620e2d731a..0000000000 --- a/win32/Makefile +++ /dev/null @@ -1,266 +0,0 @@ -SHELL = $(COMPSEC) - -#### Start of system configuration section. #### - -srcdir = . -VPATH = .:./missing - -CC = cl -YACC = byacc -PURIFY = -AUTOCONF = autoconf - - -prefix = -CFLAGS = -nologo -DNT=1 -Ox -I. -I./missing -LDFLAGS = $(CFLAGS) -Fm -#CFLAGS = -nologo -DNT=1 -Zi -I. -I./missing -#LDFLAGS = $(CFLAGS) -Fm -XLDFLAGS = -#EXTLIBS = -LIBS = user32.lib advapi32.lib wsock32.lib $(EXTLIBS) -MISSING = crypt.obj alloca.obj win32.obj isinf.obj isnan.obj -LDSHARED = -DLDFLAGS = -SOLIBS = - -RUBY_INSTALL_NAME=ruby -EXEEXT = .exe -PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT) - -STACK = 0x2000000 -ORGLIBPATH = $(LIB) - -#### End of system configuration section. #### - -LIBRUBY_A = libruby.lib -LIBRUBY_SO = rubymw.dll -LIBRUBY = $(LIBRUBY_SO) -LIBRUBYARG = rubymw.lib - -EXTOBJS = dmyext.obj - -MAINOBJ = main.obj - -OBJS = array.obj \ - bignum.obj \ - class.obj \ - compar.obj \ - dir.obj \ - dln.obj \ - enum.obj \ - error.obj \ - eval.obj \ - file.obj \ - gc.obj \ - hash.obj \ - inits.obj \ - io.obj \ - marshal.obj \ - math.obj \ - numeric.obj \ - object.obj \ - pack.obj \ - parse.obj \ - prec.obj \ - process.obj \ - random.obj \ - range.obj \ - re.obj \ - regex.obj \ - ruby.obj \ - signal.obj \ - sprintf.obj \ - st.obj \ - string.obj \ - struct.obj \ - time.obj \ - util.obj \ - variable.obj \ - version.obj \ - $(MISSING) - -all: miniruby$(EXEEXT) rbconfig.rb ext/extmk.rb ext/Setup rubymw.lib $(MISCLIBS) - set LIB=..\..\win32;$(ORGLIBPATH) - @.\miniruby$(EXEEXT) -Xext extmk.rb - -ext/extmk.rb: ext/extmk.rb.in rbconfig.rb - @echo Creating ext/extmk.rb - @.\miniruby$(EXEEXT) -Xext mswin32_extmk.rb - -miniruby$(EXEEXT): $(OBJS) $(MAINOBJ) $(EXTOBJS) - @echo $(EXTOBJS) - @echo $(LIBS) - $(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) $(EXTOBJS) $(OBJS) $(LIBS) -o $@ - -$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(LIBRUBY_SO) - $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) -o $@ $(LIBRUBYARG) -link /STACK:$(STACK) - -$(LIBRUBY_A): $(OBJS) dmyext.obj - lib -nologo /OUT:$@ $(OBJS) dmyext.obj - -rubymw.lib: ruby.def - lib -nologo /OUT:$@ /DEF:ruby.def - -$(LIBRUBY_SO): $(LIBRUBY_A) $(EXTOBJS) ruby.def - set LIB=.\win32;$(ORGLIBPATH) - $(CC) $(LDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBY_A) $(LIBS) -o $@ -link /DLL /DEF:ruby.def - -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 - @-.\miniruby$(EXEEXT) -Xext 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 rubymw.* ruby.def - @rm -f $(PROGRAM) miniruby$(EXEEXT) - -realclean: distclean - @rm -f parse.c - @rm -f lex.c - -test: miniruby$(EXEEXT) - @.\miniruby$(EXEEXT) $(srcdir)/rubytest.rb - -rbconfig.rb: miniruby$(EXEEXT) - @.\miniruby$(EXEEXT) $(srcdir)/mkconfig.rb rbconfig.rb - -config.status: $(srcdir)/configure -# $(SHELL) ./config.status --recheck - -.c.obj: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< - -parse.c: parse.y - $(YACC) $(YFLAGS) parse.y - sed -e "s!^extern char \*getenv();!/* & */!" y.tab.c > parse.c - @rm y.tab.c - -alloca.obj: missing/alloca.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c missing/alloca.c - -crypt.obj: missing/crypt.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c missing/crypt.c - -dup2.obj: missing/dup2.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c missing/dup2.c - -finite.obj: missing/finite.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c missing/finite.c - -flock.obj: missing/flock.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c missing/flock.c - -isinf.obj: missing/isinf.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c missing/isinf.c - -isnan.obj: missing/isnan.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c missing/isnan.c - -memcmp.obj: missing/memcmp.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/memcmp.c - -memmove.obj: missing/memmove.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/memmove.c - -mkdir.obj: missing/mkdir.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/mkdir.c - -vsnprintf.obj: missing/vsnprintf.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/vsnprintf.c - -strcasecmp.obj: missing/strcasecmp.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/strcasecmp.c - -strncasecmp.obj: missing/strncasecmp.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/strncasecmp.c - -strchr.obj: missing/strchr.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/strchr.c - -strdup.obj: missing/strdup.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/strdup.c - -strerror.obj: missing/strerror.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/strerror.c - -strftime.obj: missing/strftime.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c missing/strftime.c - -strstr.obj: missing/strstr.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/strstr.c - -strtod.obj: missing/strtod.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/strtod.c - -strtol.obj: missing/strtol.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/strtol.c - -strtoul.obj: missing/strtoul.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/strtoul.c - -nt.obj: missing/nt.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/nt.c - -x68.obj: missing/x68.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/x68.c - -os2.obj: missing/os2.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/os2.c - -dl_os2.obj: missing/dl_os2.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c missing/dl_os2.c - -# when I use -I., there is confliction at "OpenFile" -# so, set . into environment varible "include" -win32.obj: win32/win32.c - @set include=$(INCLUDE);. - $(CC) $(CFLAGS) $(CPPFLAGS) -c win32/win32.c - -# Prevent GNU make v3 from overflowing arg limit on SysV. -.NOEXPORT: -### -parse.obj: parse.y ruby.h config.h defines.h intern.h env.h node.h st.h regex.h util.h lex.c -### -array.obj: array.c ruby.h config.h defines.h intern.h -bignum.obj: bignum.c ruby.h config.h defines.h intern.h -class.obj: class.c ruby.h config.h defines.h intern.h node.h st.h -compar.obj: compar.c ruby.h config.h defines.h intern.h -dir.obj: dir.c ruby.h config.h defines.h intern.h -dln.obj: dln.c config.h defines.h dln.h -dmyext.obj: dmyext.c -enum.obj: enum.c ruby.h config.h defines.h intern.h -error.obj: error.c ruby.h config.h defines.h intern.h env.h -eval.obj: eval.c ruby.h config.h defines.h intern.h node.h env.h rubysig.h st.h dln.h -file.obj: file.c ruby.h config.h defines.h intern.h rubyio.h rubysig.h -gc.obj: gc.c ruby.h config.h defines.h intern.h rubysig.h st.h node.h env.h re.h regex.h -hash.obj: hash.c ruby.h config.h defines.h intern.h st.h rubysig.h util.h -inits.obj: inits.c ruby.h config.h defines.h intern.h -io.obj: io.c ruby.h config.h defines.h intern.h rubyio.h rubysig.h env.h -main.obj: main.c ruby.h config.h defines.h intern.h -marshal.obj: marshal.c ruby.h config.h defines.h intern.h rubyio.h st.h -prec.obj: prec.c ruby.h config.h defines.h intern.h -math.obj: math.c ruby.h config.h defines.h intern.h -numeric.obj: numeric.c ruby.h config.h defines.h intern.h -object.obj: object.c ruby.h config.h defines.h intern.h st.h -pack.obj: pack.c ruby.h config.h defines.h intern.h -process.obj: process.c ruby.h config.h defines.h intern.h rubysig.h st.h -random.obj: random.c ruby.h config.h defines.h intern.h -range.obj: range.c ruby.h config.h defines.h intern.h -re.obj: re.c ruby.h config.h defines.h intern.h re.h regex.h -regex.obj: regex.c config.h regex.h util.h -ruby.obj: ruby.c ruby.h config.h defines.h intern.h dln.h util.h -signal.obj: signal.c ruby.h config.h defines.h intern.h rubysig.h -sprintf.obj: sprintf.c ruby.h config.h defines.h intern.h -st.obj: st.c config.h st.h -string.obj: string.c ruby.h config.h defines.h intern.h re.h regex.h -struct.obj: struct.c ruby.h config.h defines.h intern.h -time.obj: time.c ruby.h config.h defines.h intern.h -util.obj: util.c ruby.h config.h defines.h intern.h util.h -variable.obj: variable.c ruby.h config.h defines.h intern.h env.h node.h st.h -version.obj: version.c ruby.h config.h defines.h intern.h version.h diff --git a/win32/Makefile.sub b/win32/Makefile.sub new file mode 100644 index 0000000000..ee3f72bfc8 --- /dev/null +++ b/win32/Makefile.sub @@ -0,0 +1,277 @@ +SHELL = $(COMPSEC) + +#### Start of system configuration section. #### + +## variables may be overridden by $(compile_dir)/Makefile +!ifndef srcdir +srcdir = .. +!endif +!ifndef RUBY_INSTALL_NAME +RUBY_INSTALL_NAME = ruby +!endif +!if !defined(RUBYW_INSTALL_NAME) || "$(RUBYW_INSTALL_NAME)" == "$(RUBY_INSTALL_NAME)" +RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME:ruby=rubyw) +!endif +!if "$(RUBYW_INSTALL_NAME)" == "$(RUBY_INSTALL_NAME)" +RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME)w +!endif +!ifndef RUBY_SO_NAME +RUBY_SO_NAME = rubymw +!endif +############### + +VPATH = $(srcdir):$(srcdir)/missing + +CC = cl +YACC = byacc +PURIFY = +AUTOCONF = autoconf + + +prefix = /usr +CFLAGS = -nologo -DNT=1 -Zi -O2b2x -G5 +CPPFLAGS = -I$(srcdir) -I$(srcdir)/missing +LDFLAGS = $(CFLAGS) -Fm +XLDFLAGS = +#EXTLIBS = +LIBS = user32.lib advapi32.lib wsock32.lib $(EXTLIBS) +MISSING = crypt.obj alloca.obj win32.obj isinf.obj isnan.obj +LDSHARED = +DLDFLAGS = +SOLIBS = +RFLAGS = -r + +EXEEXT = .exe +PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT) +WPROGRAM=$(RUBYW_INSTALL_NAME)$(EXEEXT) +RUBYDEF = $(RUBY_SO_NAME).def + +STACK = 0x2000000 +ORGLIBPATH = $(LIB) + +#### End of system configuration section. #### + +LIBRUBY_A = lib$(RUBY_INSTALL_NAME).lib +LIBRUBY_SO = $(RUBY_SO_NAME).dll +LIBRUBY = $(RUBY_SO_NAME).lib +LIBRUBYARG = $(LIBRUBY) + +EXTOBJS = dmyext.obj + +MAINOBJ = main.obj +WINMAINOBJ = winmain.obj + +OBJS = array.obj \ + bignum.obj \ + class.obj \ + compar.obj \ + dir.obj \ + dln.obj \ + enum.obj \ + error.obj \ + eval.obj \ + file.obj \ + gc.obj \ + hash.obj \ + inits.obj \ + io.obj \ + marshal.obj \ + math.obj \ + numeric.obj \ + object.obj \ + pack.obj \ + parse.obj \ + prec.obj \ + process.obj \ + random.obj \ + range.obj \ + re.obj \ + regex.obj \ + ruby.obj \ + signal.obj \ + sprintf.obj \ + st.obj \ + string.obj \ + struct.obj \ + time.obj \ + util.obj \ + variable.obj \ + version.obj \ + $(MISSING) + +all: miniruby$(EXEEXT) rbconfig.rb ext/extmk.rb \ + $(LIBRUBY) $(MISCLIBS) + set LIB=../../win32;$(ORGLIBPATH) + @.\miniruby$(EXEEXT) -Xext extmk.rb + +ruby: $(PROGRAM) +rubyw: $(WPROGRAM) +lib: $(LIBRUBY) +dll: $(LIBRUBY_SO) + +ext/extmk.rb: $(srcdir)/ext/extmk.rb.in config.status + @echo Creating ext/extmk.rb + @.\miniruby$(EXEEXT) $(srcdir)/ext/configsub.rb \ + -srcdir=$(srcdir) \ + -install_name=$(RUBY_INSTALL_NAME) \ + -so_name=$(RUBY_SO_NAME) \ + -output=$@ $(srcdir)/ext/extmk.rb.in + +miniruby$(EXEEXT): $(OBJS) $(MAINOBJ) $(EXTOBJS) + @echo $(EXTOBJS) + @echo $(LIBS) + $(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) $(EXTOBJS) $(OBJS) $(LIBS) -o $@ + +$(PROGRAM): $(MAINOBJ) $(LIBRUBY_SO) $*.res + $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $*.res \ + -o $@ $(LIBRUBYARG) -link /STACK:$(STACK) + +$(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $*.res + $(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) $(WINMAINOBJ) $*.res \ + -o $@ $(LIBRUBYARG) -link /STACK:$(STACK) /SUBSYSTEM:Windows + +$(LIBRUBY_A): $(OBJS) dmyext.obj + lib -nologo /OUT:$@ $(OBJS) dmyext.obj + +$(LIBRUBY): $(RUBYDEF) + lib -nologo /OUT:$@ /DEF:$(RUBYDEF) + +$(LIBRUBY_SO): $(LIBRUBY_A) $(EXTOBJS) $(RUBYDEF) $@.res + set LIB=./win32;$(ORGLIBPATH) + $(CC) $(LDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBY_A) $@.res $(LIBS) \ + -o $@ -link /DLL /DEF:$(RUBYDEF) + +!if "$(LIBRUBY_SO)" != "rubymw.dll" +rubymw.dll: $(LIBRUBY) + $(CC) -nologo $(EXTOBJS) $(LIBRUBY) -o $@ -link /DLL /DEF:$(RUBYDEF) +!endif + +$(RUBYDEF): $(LIBRUBY_A) miniruby$(EXEEXT) + .\miniruby$(EXEEXT) $(srcdir)/win32/mkexports.rb -output=$@ $(LIBRUBY_A) + +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 + @-.\miniruby$(EXEEXT) -Xext 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) + +realclean: distclean + @rm -f parse.c + @rm -f lex.c + +test: miniruby$(EXEEXT) + @.\miniruby$(EXEEXT) $(srcdir)/rubytest.rb + +rbconfig.rb: miniruby$(EXEEXT) config.status + @.\miniruby$(EXEEXT) $(srcdir)/mkconfig.rb -srcdir=$(srcdir) \ + -install_name=$(RUBY_INSTALL_NAME) \ + -so_name=$(RUBY_SO_NAME) rbconfig.rb + +$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(LIBRUBY_SO).rc: rbconfig.rb + @.\miniruby$(EXEEXT) $(srcdir)/win32/resource.rb \ + -ruby_name=$(RUBY_INSTALL_NAME) \ + -rubyw_name=$(RUBYW_INSTALL_NAME) \ + -so_name=$(LIBRUBY_SO) \ + . $(icondirs) $(srcdir)/win32 + +#config.status: $(srcdir)/configure +# $(SHELL) ./config.status --recheck + +.c.obj: + $(CC) $(CFLAGS) $(CPPFLAGS) -c $< +{$(srcdir)}.c{}.obj: + $(CC) -I. -I$( parse.c + @rm y.tab.c + +alloca.obj: $(srcdir)/missing/alloca.c +crypt.obj: $(srcdir)/missing/crypt.c +dup2.obj: $(srcdir)/missing/dup2.c +finite.obj: $(srcdir)/missing/finite.c +flock.obj: $(srcdir)/missing/flock.c +isinf.obj: $(srcdir)/missing/isinf.c +isnan.obj: $(srcdir)/missing/isnan.c +memcmp.obj: $(srcdir)/missing/memcmp.c +memmove.obj: $(srcdir)/missing/memmove.c +mkdir.obj: $(srcdir)/missing/mkdir.c +vsnprintf.obj: $(srcdir)/missing/vsnprintf.c +strcasecmp.obj: $(srcdir)/missing/strcasecmp.c +strncasecmp.obj: $(srcdir)/missing/strncasecmp.c +strchr.obj: $(srcdir)/missing/strchr.c +strdup.obj: $(srcdir)/missing/strdup.c +strerror.obj: $(srcdir)/missing/strerror.c +strftime.obj: $(srcdir)/missing/strftime.c +strstr.obj: $(srcdir)/missing/strstr.c +strtod.obj: $(srcdir)/missing/strtod.c +strtol.obj: $(srcdir)/missing/strtol.c +strtoul.obj: $(srcdir)/missing/strtoul.c +nt.obj: $(srcdir)/missing/nt.c +x68.obj: $(srcdir)/missing/x68.c +os2.obj: $(srcdir)/missing/os2.c +dl_os2.obj: $(srcdir)/missing/dl_os2.c + +# when I use -I., there is confliction at "OpenFile" +# so, set . into environment varible "include" +win32.obj: $(srcdir)/win32/win32.c + +# Prevent GNU make v3 from overflowing arg limit on SysV. +.NOEXPORT: +### +parse.obj: $(srcdir)/parse.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/env.h $(srcdir)/node.h $(srcdir)/st.h $(srcdir)/regex.h $(srcdir)/util.h $(srcdir)/lex.c +### +array.obj: $(srcdir)/array.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h +bignum.obj: $(srcdir)/bignum.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h +class.obj: $(srcdir)/class.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/node.h $(srcdir)/st.h +compar.obj: $(srcdir)/compar.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h +dir.obj: $(srcdir)/dir.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h +dln.obj: $(srcdir)/dln.c config.h $(srcdir)/defines.h $(srcdir)/dln.h +dmyext.obj: $(srcdir)/dmyext.c +enum.obj: $(srcdir)/enum.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h +error.obj: $(srcdir)/error.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/env.h +eval.obj: $(srcdir)/eval.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/node.h $(srcdir)/env.h $(srcdir)/rubysig.h $(srcdir)/st.h $(srcdir)/dln.h +file.obj: $(srcdir)/file.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/rubyio.h $(srcdir)/rubysig.h +gc.obj: $(srcdir)/gc.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/rubysig.h $(srcdir)/st.h $(srcdir)/node.h $(srcdir)/env.h $(srcdir)/re.h $(srcdir)/regex.h +hash.obj: $(srcdir)/hash.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/st.h $(srcdir)/rubysig.h $(srcdir)/util.h +inits.obj: $(srcdir)/inits.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h +io.obj: $(srcdir)/io.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/rubyio.h $(srcdir)/rubysig.h $(srcdir)/env.h +main.obj: $(srcdir)/main.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h +marshal.obj: $(srcdir)/marshal.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/rubyio.h $(srcdir)/st.h +prec.obj: $(srcdir)/prec.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h +math.obj: $(srcdir)/math.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h +numeric.obj: $(srcdir)/numeric.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h +object.obj: $(srcdir)/object.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/st.h +pack.obj: $(srcdir)/pack.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h +process.obj: $(srcdir)/process.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/rubysig.h $(srcdir)/st.h +random.obj: $(srcdir)/random.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h +range.obj: $(srcdir)/range.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h +re.obj: $(srcdir)/re.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/re.h $(srcdir)/regex.h +regex.obj: $(srcdir)/regex.c config.h $(srcdir)/regex.h $(srcdir)/util.h +ruby.obj: $(srcdir)/ruby.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/dln.h $(srcdir)/util.h +signal.obj: $(srcdir)/signal.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/rubysig.h +sprintf.obj: $(srcdir)/sprintf.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h +st.obj: $(srcdir)/st.c config.h $(srcdir)/st.h +string.obj: $(srcdir)/string.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/re.h $(srcdir)/regex.h +struct.obj: $(srcdir)/struct.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h +time.obj: $(srcdir)/time.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h +util.obj: $(srcdir)/util.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/util.h +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 diff --git a/win32/README.win32 b/win32/README.win32 new file mode 100644 index 0000000000..774a5c424c --- /dev/null +++ b/win32/README.win32 @@ -0,0 +1,123 @@ +=begin + += How to build ruby using Visual C++ + +== Requirement + +(1) Visual C++ 4.0 or later. + +(2) If you want to run `((%nmake clean%))' or `((%nmake distclean%))' + properly, you must install UNIX compatible `((%rm%))' command on + your ((|PATH|)). + +(3) Please set environment variable (({INCLUDE})), (({LIB})), (({PATH})) + to run required commands properly from the command line. + + Note: building ruby requires following commands. + * nmake + * cl + * lib + * dumpbin + * rm + +== How to compile and install + +(1) Execute win32\configure.bat on your build directory. + +(2) Change ((|RUBY_INSTALL_NAME|)) and ((|RUBY_SO_NAME|)) in (({Makefile})) + if you want to change the name of the executable files. + And add ((|RUBYW_INSTALL_NAME|)) to change the name of the + executable without console window if also you want. + +(3) Run `((%nmake%))' + +(4) Run `((%nmake test%))' + +(5) Run `((%nmake DESTDIR= install%))' + + This command will create following directories and install files onto them. + * \bin + * \lib + * \lib\ruby + * \lib\ruby\. + * \lib\ruby\.\ + * \lib\ruby\site_ruby + * \lib\ruby\site_ruby\. + * \lib\ruby\site_ruby\.\ + * \man\man1 + If Ruby's version is `x.y.z', the ((||)) is `x' and the ((||)) is `y'. + The ((||)) is usually `(({i586-mswin32}))'. + +== Icons + +Any icon files(*.ico) in the build directory, directories specified with +((|icondirs|)) make variable and (({win32})) directory under the ruby +source directory will be included in DLL or executable files, according +to their base names. + $(RUBY_INSTALL_NAME).ico or ruby.ico --> $(RUBY_INSTALL_NAME).exe + $(RUBYW_INSTALL_NAME).ico or rubyw.ico --> $(RUBYW_INSTALL_NAME).exe + the others --> $(RUBY_SO_NAME).dll + +Although no icons are distributed with the ruby source or in the official +site, you can use anything you like. For example, followings are written +in Japanese, but you can download at least. + +* (()) or + (()) +* (()) or + (()) + +== Build examples + +* Build on the ruby source directory. + + ex.) + ruby source directory: C:\ruby + build directory: C:\ruby + install directory: C:\usr\local + + C: + cd \ruby + win32\configure + nmake + nmake test + nmake DESTDIR=/usr/local install + +* Build on the relative directory from the ruby source directory. + + ex.) + ruby source directory: C:\ruby + build directory: C:\ruby\mswin32 + install directory: C:\usr\local + + C: + cd \ruby + mkdir mswin32 + cd mswin32 + ..\win32\configure + nmake + nmake test + nmake DESTDIR=/usr/local install + +* Build on the different drive. + + ex.) + ruby source directory: C:\src\ruby + build directory: D:\build\ruby + install directory: C:\usr\local + + D: + cd D:\build\ruby + C:\src\ruby\win32\configure + nmake + nmake test + nmake DESTDIR=C:/usr/local install + +== Bugs + +You can ((*NOT*)) use a path name contains any white space characters as +the ruby source directory, this restriction comes from the behavior of +(({!INCLUDE})) directives of (({NMAKE})). +((- you may call it a bug. -)) + +=end diff --git a/win32/config.h b/win32/config.h.in similarity index 79% rename from win32/config.h rename to win32/config.h.in index 7dac047323..a85038882b 100644 --- a/win32/config.h +++ b/win32/config.h.in @@ -40,12 +40,12 @@ #define FILE_COUNT _cnt #define DLEXT ".so" #define DLEXT2 ".dll" -#define RUBY_LIB "/usr/local/lib/ruby/1.5" -#define RUBY_SITE_LIB "/usr/local/lib/ruby/site_ruby" -#define RUBY_SITE_LIB2 "/usr/local/lib/ruby/site_ruby/1.5" -#define RUBY_PLATFORM "i386-mswin32" -#define RUBY_ARCHLIB "/usr/local/lib/ruby/1.5/i386-mswin32" -#define RUBY_SITE_ARCHLIB "/usr/local/lib/ruby/site_ruby/1.5/i386-mswin32" +#define RUBY_LIB "/lib/ruby/1.5" +#define RUBY_SITE_LIB "/lib/ruby/site_ruby" +#define RUBY_SITE_LIB2 "/lib/ruby/site_ruby/1.5" +#define RUBY_PLATFORM "i586-mswin32" +#define RUBY_ARCHLIB "/lib/ruby/1.5/i586-mswin32" +#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/1.5/i586-mswin32" #define SIZEOF_INT 4 #define SIZEOF_SHORT 2 diff --git a/win32/config.status b/win32/config.status.in similarity index 86% rename from win32/config.status rename to win32/config.status.in index cdb7ac6abe..128e83a6e1 100644 --- a/win32/config.status +++ b/win32/config.status.in @@ -1,15 +1,14 @@ -ac_given_srcdir=. s%@SHELL@%%g -s%@CFLAGS@%-nologo -DNT=1 -Ox%g +s%@CFLAGS@%-nologo -DNT=1 -Zi -O2b2x -G5%g s%@CPPFLAGS@%%g s%@CXXFLAGS@%%g s%@FFLAGS@%%g s%@DEFS@% - -DUSE_THREAD -DSIZEOF_INT=4 -DSIZEOF_SHORT=2 -DSIZEOF_LONG=4 -DSIZEOF_VOIDP=4 -DSIZEOF_FLOAT=4 -DSIZEOF_DOUBLE=8 -DHAVE_PROTOTYPES=1 -DHAVE_STDARG_PROTOTYPES=1 -DHAVE_STDLIB_H=1 -DHAVE_LIMITS_H=1 -DHAVE_FCNTL_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ST_RDEV=1 -DGETGROUPS_T=int -DRETSIGTYPE=void -DHAVE_ALLOCA=1 -DHAVE_FMOD=1 -DHAVE_WAITPID=1 -DHAVE_GETCWD=1 -DHAVE_CHSIZE=1 -DHAVE_GETGROUPS=1 -DHAVE_GETLOGIN=1 -DRSHIFT=\(x,y\)\ \(\(x\)\>\>y\) -DFILE_COUNT=_cnt -DDLEXT=\".so\" -DDLEXT2=\".dll\" -DRUBY_PLATFORM=\"i386-mswin32\" %g + -DUSE_THREAD -DSIZEOF_INT=4 -DSIZEOF_SHORT=2 -DSIZEOF_LONG=4 -DSIZEOF_VOIDP=4 -DSIZEOF_FLOAT=4 -DSIZEOF_DOUBLE=8 -DHAVE_PROTOTYPES=1 -DHAVE_STDARG_PROTOTYPES=1 -DHAVE_STDLIB_H=1 -DHAVE_LIMITS_H=1 -DHAVE_FCNTL_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ST_RDEV=1 -DGETGROUPS_T=int -DRETSIGTYPE=void -DHAVE_ALLOCA=1 -DHAVE_FMOD=1 -DHAVE_WAITPID=1 -DHAVE_GETCWD=1 -DHAVE_CHSIZE=1 -DHAVE_GETGROUPS=1 -DHAVE_GETLOGIN=1 -DRSHIFT=\(x,y\)\ \(\(x\)\>\>y\) -DFILE_COUNT=_cnt -DDLEXT=\".so\" -DDLEXT2=\".dll\" -DRUBY_PLATFORM=\"i586-mswin32\" %g s%@LDFLAGS@%-nologo -Ox%g s%@LIBS@%user32.lib advapi32.lib wsock32.lib%g s%@exec_prefix@%${prefix}%g -s%@prefix@%/usr/local%g +s%@prefix@%%g s%@program_transform_name@%s,x,x,%g s%@bindir@%${exec_prefix}/bin%g s%@sbindir@%${exec_prefix}/sbin%g @@ -23,9 +22,9 @@ s%@includedir@%${prefix}/include%g s%@oldincludedir@%/usr/include%g s%@infodir@%${prefix}/info%g s%@mandir@%${prefix}/man%g -s%@host@%i386-pc-mswin32%g -s%@host_alias@%i386-mswin32%g -s%@host_cpu@%i386%g +s%@host@%i586-pc-mswin32%g +s%@host_alias@%i586-mswin32%g +s%@host_cpu@%i586%g s%@host_vendor@%pc%g s%@host_os@%mswin32%g s%@CC@%cl%g @@ -53,14 +52,15 @@ s%@setup@%Setup%g s%@LIBRUBY_LDSHARED@%%g s%@LIBRUBY_DLDFLAGS@%%g s%@RUBY_INSTALL_NAME@%ruby%g +s%@RUBY_SO_NAME@%ruby.mswin32%g s%@LIBRUBY_A@%lib$(RUBY_INSTALL_NAME).lib%g s%@LIBRUBY_SO@%%g s%@LIBRUBY_ALIASES@%%g -s%@LIBRUBY@%libruby.lib%g -s%@LIBRUBYARG@%$(topdir)/rubymw.lib%g +s%@LIBRUBY@%$(RUBY_SO_NAME).lib%g +s%@LIBRUBYARG@%$(topdir)/$(RUBY_SO_NAME).lib%g s%@SOLIBS@%%g s%@DLDLIBS@%%g -s%@arch@%i386-mswin32%g +s%@arch@%i586-mswin32%g s%@sitedir@%${prefix}/lib/ruby/site_ruby%g s%@configure_args@%--with-make-prog=nmake%g s%@configure_input@%$configure_input%g diff --git a/win32/configure.bat b/win32/configure.bat new file mode 100755 index 0000000000..e35a4c312c --- /dev/null +++ b/win32/configure.bat @@ -0,0 +1,13 @@ +@echo off +::: Don't set environment variable in batch file other than autoexec.bat +::: to avoid "Out of environment space" problem on Windows 95/98. +::: set TMPMAKE=~tmp~.mak + +echo> ~tmp~.mak #### +echo>> ~tmp~.mak conf = %0 +echo>> ~tmp~.mak $(conf:\=/): nul +echo>> ~tmp~.mak @del ~tmp~.mak +echo>> ~tmp~.mak @-$(MAKE) -l$(MAKEFLAGS) -f $(@D)/setup.mak \ +if not "%1" == "" echo>> ~tmp~.mak srcdir="%1" \ +echo>> ~tmp~.mak WIN32DIR=$(@D) +nmake -alf ~tmp~.mak diff --git a/win32/mkexports.rb b/win32/mkexports.rb new file mode 100644 index 0000000000..faf342b2cb --- /dev/null +++ b/win32/mkexports.rb @@ -0,0 +1,30 @@ +#!./miniruby -s + +SYM = {} + +objs = ARGV.collect {|s| s.tr('/', '\\')} +IO.foreach("|dumpbin -symbols " + objs.join(' ')) do |l| + next if /^[0-9A-F]+ 0+ UNDEF / =~ l + next unless l.sub!(/.*\sExternal\s+\|\s+/, '') + if l.sub!(/^_/, '') + next if /@.*@/ =~ l + elsif !l.sub!(/^(\S+) \([^@?]*\)$/, '\1') + next + end + SYM[l.strip] = true +end + +exports = [] +if $name + exports << "Name " + $name +elsif $library + exports << "Library " + $library +end +exports << "Description " + $description.dump if $description +exports << "EXPORTS" << SYM.keys.sort + +if $output + open($output, 'w') {|f| f.puts exports} +else + puts exports +end diff --git a/win32/ntsetup.bat b/win32/ntsetup.bat deleted file mode 100755 index dc67b70673..0000000000 --- a/win32/ntsetup.bat +++ /dev/null @@ -1,8 +0,0 @@ -@echo off -copy config.h .. -copy Makefile .. -copy ruby.def .. -copy config.status .. - -cd .. -echo type `nmake' to make ruby for mswin32. diff --git a/win32/resource.rb b/win32/resource.rb new file mode 100644 index 0000000000..3e97688c0a --- /dev/null +++ b/win32/resource.rb @@ -0,0 +1,94 @@ +#!./miniruby -sI. + +require 'rbconfig' + +CONFIG = Config::MAKEFILE_CONFIG + +fversion = "#{CONFIG['MAJOR']},#{CONFIG['MINOR']},#{CONFIG['TEENY']},0" + +$ruby_name ||= CONFIG["RUBY_INSTALL_NAME"] +$rubyw_name ||= CONFIG["RUBYW_INSTALL_NAME"] || $ruby_name.sub(/ruby/, '\&w') +$so_name ||= CONFIG["RUBY_SO_NAME"] + +icons = {} +def icons.find(path) + if File.directory?(path) + Dir.open(File.expand_path(path)) do |d| + d.grep(/\.ico$/i) {|i| self[$`] = i} + end + else + self[File.basename(path, '.ico')] = path + end + self +end + +if ARGV.empty? + icons.find('.') +else + ARGV.each {|i| icons.find(i)} +end + +ruby_icon = rubyw_icon = nil +[$ruby_name, 'ruby'].each do |i| + if i = icons.delete(i) + ruby_icon = "1 ICON DISCARDABLE "+i.dump+"\n" + break + end +end +[$rubyw_name, 'rubyw'].each do |i| + if i = icons.delete(i) + rubyw_icon = "1 ICON DISCARDABLE "+i.dump+"\n" + break + end +end +dll_icons = [] +icons.keys.sort.each do |i| + dll_icons << "#{dll_icons.size + 1} ICON DISCARDABLE "+icons[i].dump+"\n" +end + +[ # base name extension file type icons + [$ruby_name, CONFIG["EXEEXT"], 'VFT_APP', ruby_icon], + [$rubyw_name, CONFIG["EXEEXT"], 'VFT_APP', rubyw_icon], + [$so_name, '.'+CONFIG["DLEXT2"], 'VFT_DLL', dll_icons], +].each do |base, ext, type, icons| + open(base + '.rc', "w") { |f| + f.binmode if /mingw/ =~ RUBY_PLATFORM + + f.print < + +#{icons} +VS_VERSION_INFO VERSIONINFO + FILEVERSION #{fversion} + PRODUCTVERSION #{fversion} + FILEFLAGSMASK 0x3fL + FILEFLAGS 0x0L + FILEOS VOS__WINDOWS32 + FILETYPE #{type} + FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "FileDescription", "Ruby interpreter\\0" + VALUE "FileVersion", "#{fversion}\\0" + VALUE "Home Page", "http://www.ruby-lang.org/\\0" + VALUE "InternalName", "#{base + ext}\\0" + VALUE "LegalCopyright", "Copyright (C) 1993-2000 Yukihiro Matsumoto\\0" + VALUE "OriginalFilename", "#{base + ext}\\0" + VALUE "Platform", "#{RUBY_PLATFORM}\\0" + VALUE "ProductVersion", "#{fversion}\\0" + VALUE "Release Date", "#{RUBY_RELEASE_DATE}\\0" + VALUE "Version", "#{RUBY_VERSION}\\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 0x4b0 + END +END +EOF + } +end + diff --git a/win32/ruby.def b/win32/ruby.def deleted file mode 100644 index 274948aef4..0000000000 --- a/win32/ruby.def +++ /dev/null @@ -1,637 +0,0 @@ -LIBRARY rubymw.dll -DESCRIPTION 'win32 rubymw.dll' -EXPORTS -;;global objects -;array.c - rb_cArray -;bignum.c - rb_cBignum -;compar.c - rb_mComparable -;dir.c - rb_cDir -;enum.c - rb_mEnumerable -;error.c - rb_eException - rb_eSystemExit - rb_eInterrupt - rb_eSignal - rb_eFatal - rb_eStandardError - rb_eRuntimeError - rb_eSyntaxError - rb_eTypeError - rb_eArgError - rb_eNameError - rb_eIndexError - rb_eRangeError - rb_eLoadError - rb_eSecurityError - rb_eNotImpError - rb_eSystemCallError - rb_eZeroDivError - rb_mErrno - ruby_nerrs -;eval.c - rb_cProc - ruby_safe_level - ruby_errinfo - ruby_frame - rb_cThread - rb_thread_tick - rb_thread_critical -;file.c - rb_cFile - rb_mFileTest -;gc.c - rb_mGC -;hash.c - rb_cHash -;io.c - rb_cIO - rb_eEOFError - rb_eIOError - rb_stdin - rb_stdout - rb_stderr - rb_defout - rb_output_fs - rb_rs - rb_output_rs - rb_default_rs -;math.c - rb_mMath -;numeric.c - rb_cNumeric - rb_cFloat - rb_cInteger - rb_cFixnum - rb_eFloatDomainError -;object.c - rb_mKernel - rb_cObject - rb_cModule - rb_cClass - rb_cData - rb_cNilClass - rb_cTrueClass - rb_cFalseClass - rb_cSymbol -;parse.c - ruby_sourcefile - ruby_sourceline -;prec.c - rb_mPrecision -;process.c - rb_mProcess -;range.c - rb_cRange -;re.c - ruby_ignorecase - rb_cRegexp -;regex.c - re_mbctab -;ruby.c - ruby_debug - ruby_verbose - rb_progname - rb_argv - rb_argv0 -;signal.c - rb_trap_pending - rb_trap_immediate - rb_prohibit_interrupt -;string.c - rb_cString - rb_cStruct -;time.c - rb_cTime - -;;procedures/methods -;missing/alloca.c - alloca -;missing/crypt.c - definekey - encrypt - crypt -;missing/isinf.c - isinf -;missing/isnan.c - isnan -;win32/win32.c - NtInitialize - myfdopen - myfdclose - myaccept - mybind - myfdclr - myconnect - myfdset - myfdisset - myselect - mygetpeername - mygetsockname - mygetsockopt - myioctlsocket - mylisten - myrecv - myrecvfrom - mysend - mysendto - mysetsockopt - myshutdown - mysocket - mygethostbyaddr - mygethostbyname - mygethostname - mygetprotobyname - mygetprotobynumber - mygetservbyname - mygetservbyport - myget_osfhandle - win32_getcwd - win32_getenv -;array.c - rb_mem_clear - rb_ary_freeze - rb_ary_new - rb_ary_new2 - rb_ary_new3 - rb_ary_new4 - rb_assoc_new - rb_ary_store - rb_ary_push - rb_ary_pop - rb_ary_shift - rb_ary_unshift - rb_ary_entry - rb_ary_aref - rb_ary_each - rb_ary_join - rb_ary_to_s - rb_protect_inspect - rb_inspecting_p - rb_ary_reverse - rb_ary_sort_bang - rb_ary_sort - rb_ary_delete - rb_ary_delete_at - rb_ary_plus - rb_ary_concat - rb_ary_assoc - rb_ary_rassoc - rb_ary_includes -;bignum.c - rb_big_clone - rb_big_2comp - rb_big_norm - rb_uint2big - rb_int2big - rb_uint2inum - rb_int2inum - rb_cstr2inum - rb_str2inum - rb_big2str - rb_big2ulong - rb_big2long - rb_dbl2big - rb_big2dbl - rb_big_plus - rb_big_minus - rb_big_mul - rb_big_divmod - rb_big_pow - rb_big_and - rb_big_or - rb_big_xor - rb_big_lshift - rb_big_rand -;class.c - rb_class_new - rb_singleton_class_new - rb_singleton_class_clone - rb_singleton_class_attached - rb_define_class_id - rb_define_class - rb_define_class_under - rb_module_new - rb_define_module_id - rb_define_module - rb_define_module_under - rb_include_module - rb_mod_included_modules - rb_mod_ancestors - rb_class_instance_methods - rb_class_protected_instance_methods - rb_class_private_instance_methods - rb_obj_singleton_methods - rb_define_method_id - rb_define_method - rb_define_protected_method - rb_define_private_method - rb_undef_method - rb_singleton_class - rb_define_singleton_method - rb_define_module_function - rb_define_global_function - rb_define_alias - rb_define_attr - rb_scan_args -;dir.c - rb_glob -;dln.c - dln_load - dln_find_exe - dln_find_file -;enum.c - rb_each -;error.c - rb_compile_error - rb_compile_error_append - rb_warn - rb_warning - rb_bug - rb_check_type - rb_exc_new - rb_exc_new2 - rb_exc_new3 - rb_raise - rb_loaderror - rb_notimplement - rb_fatal - rb_sys_fail -;eval.c - rb_clear_cache - rb_add_method - rb_alias - rb_remove_method - rb_disable_super - rb_enable_super - rb_method_boundp - rb_attr - rb_dvar_defined - rb_dvar_curr - rb_dvar_ref - rb_dvar_push - rb_set_safe_level - rb_check_safe_str - rb_secure - ruby_init - ruby_options - ruby_run - rb_eval_string - rb_eval_string_protect - rb_eval_string_wrap - rb_eval_cmd - rb_respond_to - rb_exit - rb_iter_break - rb_exc_raise - rb_exc_fatal - rb_interrupt - rb_jump_tag - rb_block_given_p - rb_iterator_p - rb_yield - rb_iterate - rb_rescue - rb_rescue2 - rb_protect - rb_ensure - rb_with_disable_interrupt - rb_apply - rb_funcall - rb_funcall2 - rb_funcall3 - rb_call_super - rb_backtrace - rb_frame_last_func - rb_obj_instance_eval - rb_load - rb_load_protect - rb_provide - rb_f_require - rb_require - rb_obj_call_init - rb_class_new_instance - rb_extend_object - rb_set_end_proc - rb_exec_end_proc - rb_f_lambda - rb_gc_mark_threads - rb_thread_fd_close - rb_thread_schedule - rb_thread_wait_fd - rb_thread_fd_writable - rb_thread_wait_for - rb_thread_alone - rb_thread_select - rb_thread_current - rb_thread_main - rb_thread_wakeup - rb_thread_run - rb_thread_stop - rb_thread_polling - rb_thread_sleep - rb_thread_sleep_forever - rb_thread_create - rb_thread_scope_shared_p - rb_thread_interrupt - rb_thread_signal_raise - rb_thread_trap_eval - rb_thread_local_aref - rb_thread_local_aset - rb_catch - rb_throw -;file.c - eaccess - rb_file_s_expand_path - rb_file_const - rb_find_file - rb_path_check -;gc.c - ruby_xmalloc - ruby_xcalloc - ruby_xrealloc - ruby_xfree - rb_global_variable - rb_newobj - rb_data_object_alloc - rb_gc_mark_locations - rb_mark_tbl - rb_mark_hash - rb_gc_mark_maybe - rb_gc_mark - rb_gc_force_recycle - rb_gc_mark_frame - rb_gc - rb_gc_call_finalizer_at_exit - xmalloc - xcalloc - xrealloc - xfree -;hash.c - rb_hash_freeze - rb_hash - rb_hash_new - rb_hash_aref - rb_hash_aset - rb_hash_delete_if - rb_path_check - rb_env_path_tainted - ruby_setenv - ruby_unsetenv -;inits.c - rb_call_inits -;io.c - rb_eof_error - rb_io_check_closed - rb_io_check_readable - rb_io_check_writable - rb_read_pending - rb_read_check - rb_io_write - rb_io_eof - rb_io_gets - rb_io_getc - rb_getc - rb_io_ungetc - rb_io_fptr_finalize - rb_io_close - rb_io_close_read - rb_io_binmode - rb_io_mode_flags - rb_fopen - rb_fdopen - rb_file_open - rb_file_sysopen - rb_io_synchronized - rb_p - rb_gets - rb_str_setter -;numeric.c - rb_num_zerodiv - rb_num_coerce_bin - rb_float_new - rb_num2long - rb_num2ulong - rb_num2int - rb_fix2int - rb_num2fix - rb_fix2str - rb_fix_upto -;object.c - rb_equal - rb_eql - rb_obj_id - rb_obj_clone - rb_obj_dup - rb_any_to_s - rb_inspect - rb_obj_is_instance_of - rb_obj_is_kind_of - rb_obj_tainted - rb_obj_taint - rb_obj_untaint - rb_obj_alloc - rb_to_id - rb_convert_type - rb_Integer - rb_Float - rb_num2dbl - rb_str2cstr - rb_String - rb_Array -;parse.c - rb_compile_string - rb_compile_cstr - rb_compile_file - rb_node_newnode - rb_id_attrset - rb_parser_append_print - rb_parser_while_loop - rb_intern - rb_id2name - rb_is_const_id - rb_is_instance_id - rb_backref_get - rb_backref_set - rb_lastline_get - rb_lastline_set -;process.c - rb_proc_exec - rb_syswait -;range.c - rb_range_new - rb_range_beg_len -;re.c - rb_memcmp - rb_reg_mbclen2 - rb_match_busy - rb_reg_adjust_startpos - rb_reg_search - rb_reg_nth_defined - rb_reg_nth_match - rb_reg_last_match - rb_reg_match_pre - rb_reg_match_post - rb_reg_match_last - rb_reg_new - rb_reg_regcomp - rb_reg_match - rb_reg_match2 - rb_kcode - rb_reg_options - rb_reg_regsub - rb_get_kcode - rb_set_kcode -;regex.c - ruby_re_set_casetable - ruby_re_compile_pattern - ruby_re_free_pattern - ruby_re_compile_fastmap - ruby_re_adjust_startpos - ruby_re_search - ruby_re_match - ruby_re_copy_registers - ruby_re_free_registers - ruby_re_mbcinit -;ruby.c - rb_load_file - ruby_script - ruby_prog_init - ruby_set_argv - ruby_process_options - ruby_load_script - ruby_init_loadpath - ruby_incpush -;signal.c - rb_f_kill - rb_gc_mark_trap_list - rb_trap_exit - rb_trap_exec - rb_trap_restore_mask -;sprintf.c - rb_f_sprintf -;st.c - st_init_table_with_size - st_init_table - st_init_numtable - st_init_numtable_with_size - st_init_strtable - st_init_strtable_with_size - st_free_table - st_lookup - st_insert - st_add_direct - st_copy - st_delete - st_delete_safe - st_cleanup_safe - st_foreach -;string.c - rb_str_new - rb_str_new2 - rb_tainted_str_new - rb_tainted_str_new2 - rb_str_new3 - rb_str_new4 - rb_str_to_str - rb_str_associate - rb_obj_as_string - rb_str_dup - rb_str_plus - rb_str_times - rb_str_substr - rb_str_modify - rb_str_freeze - rb_str_dup_frozen - rb_str_resize - rb_str_cat - rb_str_cat2 - rb_str_append - rb_str_concat - rb_str_hash - rb_str_cmp - rb_str_upto - rb_str_inspect - rb_str_split -;struct.c - rb_struct_getmember - rb_struct_define - rb_struct_alloc - rb_struct_new - rb_struct_aref - rb_struct_aset -;time.c - rb_time_new - rb_time_interval - rb_time_timeval -;util.c - rb_class_of - rb_type - rb_special_const_p - ruby_scan_oct - ruby_scan_hex - ruby_add_suffix - ruby_qsort -;variable.c - rb_mod_name - rb_class_path - rb_set_class_path - rb_path2class - rb_name_class - rb_autoload - rb_f_autoload - rb_class2name - rb_global_entry - rb_gc_mark_global_tbl - rb_define_hooked_variable - rb_define_variable - rb_define_readonly_variable - rb_define_virtual_variable - rb_f_trace_var - rb_f_untrace_var - rb_gvar_get - rb_gvar_set - rb_gv_set - rb_gv_get - rb_gvar_defined - rb_f_global_variables - rb_alias_variable - rb_mark_generic_ivar - rb_mark_generic_ivar_tbl - rb_free_generic_ivar - rb_clone_generic_ivar - rb_ivar_get - rb_ivar_set - rb_ivar_defined - rb_obj_instance_variables - rb_obj_remove_instance_variable - rb_const_get_at - rb_autoload_load - rb_const_get - rb_mod_remove_const - rb_mod_const_at - rb_mod_const_of - rb_mod_constants - rb_const_defined_at - rb_autoload_defined - rb_const_defined - rb_const_set - rb_const_assign - rb_define_const - rb_define_global_const - rb_cvar_declare - rb_cvar_set - rb_cvar_get - rb_cvar_defined - rb_cv_set - rb_cv_get - rb_define_class_variable - rb_iv_get - rb_iv_set -;version.c - ruby_show_version - ruby_show_copyright diff --git a/win32/setup.mak b/win32/setup.mak new file mode 100644 index 0000000000..71d8ce05ec --- /dev/null +++ b/win32/setup.mak @@ -0,0 +1,27 @@ +# -*- makefile -*- + +!IF "$(WIN32DIR)" == "win32" +srcdir = . +!ELSEIF "$(WIN32DIR)" == "$(WIN32DIR:/win32=)/win32" +srcdir = $(WIN32DIR:/win32=) +!ELSE +srcdir = $(WIN32DIR)/.. +!ENDIF +OS = mswin32 + +all: config.h config.status +all: ext +all: Makefile +all:; @echo type `nmake' to make ruby for mswin32. + +Makefile: + @echo> $@ ### makefile for ruby $(OS) ### + @echo>> $@ srcdir = $(srcdir:\=/) + @echo>> $@ RUBY_INSTALL_NAME = ruby + @echo>> $@ RUBY_SO_NAME = $$(RUBY_INSTALL_NAME).$(OS) + @echo>> $@ !INCLUDE $$(srcdir)/win32/Makefile.sub + +config.h config.status: $(srcdir)/win32/$$@.in + @copy $(srcdir:/=\)\win32\$@.in $@ > nul + +ext:; @if not exist $@\* mkdir $@ diff --git a/win32/winmain.c b/win32/winmain.c new file mode 100644 index 0000000000..4902d1daaf --- /dev/null +++ b/win32/winmain.c @@ -0,0 +1,10 @@ +#include +#include + +extern int main(int, char**, char**); + +int WINAPI +WinMain(HINSTANCE current, HINSTANCE prev, LPSTR cmdline, int showcmd) +{ + return main(0, NULL, NULL); +}