summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--eval.c3
-rw-r--r--lib/mkmf.rb43
-rw-r--r--win32/Makefile.sub9
4 files changed, 43 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d2c1faaca..ebe90eff63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+Thu Dec 18 21:47:35 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/mkmf.rb (create_makefile): should remove deffile if it's
+ made by miniruby. based on nobu's patch.
+
+Thu Dec 18 21:44:21 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * eval.c (stack_extend): ignore inline optimization on VC7.
+
+ * win32/Makefile.sub (OS, RT): can override.
+
+ * win32/Makefile.sub (LDFLAGS): ditto. shouldn't use pdb:none
+ option. based on Tietew's patch [ruby-dev:22289]
+
Thu Dec 18 16:38:44 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dir.c (fnmatch): unlike find_dirsep(), rb_path_next() never
diff --git a/eval.c b/eval.c
index 078d095ecf..1abed8619c 100644
--- a/eval.c
+++ b/eval.c
@@ -8466,6 +8466,9 @@ rb_thread_switch(n)
NORETURN(static void rb_thread_restore_context _((rb_thread_t,int)));
+# if _MSC_VER >= 1300
+__declspec(noinline)
+# endif
static void
stack_extend(th, exit)
rb_thread_t th;
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 080aa051b1..359a7418b1 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -797,30 +797,19 @@ def create_makefile(target, srcprefix = nil)
target = nil if $objs == ""
if target and EXPORT_PREFIX
- origdef = target + '.def'
- deffile = EXPORT_PREFIX + origdef
- unless File.exist? deffile
- if File.exist? File.join(srcdir, deffile)
- deffile = File.join(srcdir, deffile)
- elsif !EXPORT_PREFIX.empty? and File.exist?(origdef = File.join(srcdir, origdef))
- open(origdef) do |d|
- open(deffile, 'wb') do |f|
- d.each do |l|
- f.print l
- break if /^EXPORTS$/i =~ l
- end
- d.each do |l|
- f.print l.sub(/\S/, EXPORT_PREFIX+'\&')
- end
- end
- end
- else
- open(deffile, 'wb') do |f|
- f.print "EXPORTS\n", EXPORT_PREFIX, "Init_", target, "\n"
- end
+ if File.exist?(File.join(srcdir, target + '.def'))
+ deffile = "$(srcdir)/$(TARGET).def"
+ unless EXPORT_PREFIX.empty?
+ makedef = %{-pe "sub!(/^(?=\\w)/,'#{EXPORT_PREFIX}') unless 1../^EXPORTS$/i"}
end
+ else
+ makedef = %{-e "puts 'EXPORTS', '#{EXPORT_PREFIX}Init_$(TARGET)'"}
+ end
+ if makedef
+ $distcleanfiles << '$(DEFFILE)'
+ origdef = deffile
+ deffile = "$(TARGET)-$(arch).def"
end
- $distcleanfiles << deffile unless deffile == origdef
end
libpath = libpathflag(libpath)
@@ -914,7 +903,11 @@ static: $(STATIC_LIB)
end
end
- mfile.print "$(DLLIB): $(OBJS)\n\t"
+ if makedef
+ mfile.print "$(DLLIB): $(OBJS) $(DEFFILE)\n\t"
+ else
+ mfile.print "$(DLLIB): $(OBJS)\n\t"
+ end
mfile.print "@-$(RM) $@\n\t"
mfile.print "@-$(RM) $(TARGET).lib\n\t" if $mswin
mfile.print LINK_SO, "\n\n"
@@ -924,6 +917,10 @@ static: $(STATIC_LIB)
mfile.print "\n\t@-#{ranlib} $(DLLIB) 2> /dev/null || true"
end
mfile.print "\n\n"
+ if makedef
+ mfile.print "$(DEFFILE): #{origdef}\n"
+ mfile.print "\t$(RUBY) #{makedef} #{origdef} > $@\n\n"
+ end
depend = File.join(srcdir, "depend")
if File.exist?(depend)
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index e591386d1f..6e669aceda 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -66,8 +66,10 @@ DEBUGFLAGS = -Zi
!if !defined(OPTFLAGS)
OPTFLAGS = -O2b2xg-
!endif
+!if !defined(OS) || !defined(RT)
OS = mswin32
RT = msvcrt
+!endif
!ifndef RUBY_SO_NAME
RUBY_SO_NAME = $(RT)-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)
@@ -91,8 +93,11 @@ CFLAGS = -MD $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG)
!if !defined(CPPFLAGS)
CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/missing
!endif
+!if !defined(LDFLAGS)
+LDFLAGS = -link -incremental:no -debug -opt:ref -opt:icf
+!endif
!if !defined(XLDFLAGS)
-XLDFLAGS =
+XLDFLAGS = -stack:$(STACK)
!endif
!if !defined(RFLAGS)
RFLAGS = -r
@@ -108,9 +113,7 @@ CC = $(CC) -nologo
LD = $(CC)
LDSHARED = $(LD) -LD
XCFLAGS = -DRUBY_EXPORT
-LDFLAGS = -link -incremental:no -pdb:none
DLDFLAGS = $(LDFLAGS) -dll
-XLDFLAGS = -stack:$(STACK)
SOLIBS =
LIBRUBY_LDSHARED = $(LDSHARED)