зеркало из https://github.com/github/ruby.git
* cygwin/GNUmakefile.in (RUBYDEF): uses mkexports.rb on cygwin too.
* win32/mkexports.rb (Exports::Cygwin): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
dc960b8729
Коммит
5ac71d9f9e
|
@ -1,3 +1,9 @@
|
|||
Tue Feb 3 08:18:26 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* cygwin/GNUmakefile.in (RUBYDEF): uses mkexports.rb on cygwin too.
|
||||
|
||||
* win32/mkexports.rb (Exports::Cygwin): added.
|
||||
|
||||
Tue Feb 3 08:10:23 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* common.mk (Doxyfile): moved from Makefile.in.
|
||||
|
|
|
@ -69,14 +69,8 @@ endif
|
|||
|
||||
$(LIBRUBY_SO): $(RUBYDEF)
|
||||
|
||||
$(RUBYDEF): $(LIBRUBY_A) $(PREP) $(RBCONFIG) GNUmakefile
|
||||
ifeq (@target_os@,cygwin)
|
||||
@NM@ --extern --defined $(LIBRUBY_A) | \
|
||||
$(MINIRUBY) -n -e 'BEGIN{puts "VERSION $(MAJOR).$(MINOR)","EXPORTS"}' \
|
||||
-e 'if / (?:(T)|[A-Z]) _((?!Init_).*)$$/; puts "#{$$2}#{" DATA" if !$$1}"; end' > $@
|
||||
else
|
||||
$(RUBYDEF): $(LIBRUBY_A) $(PREP) $(RBCONFIG)
|
||||
$(MINIRUBY) $(srcdir)/win32/mkexports.rb -output=$@ $(LIBRUBY_A)
|
||||
endif
|
||||
|
||||
clean-local::
|
||||
@$(RM) $(RUBYDEF)
|
||||
|
|
|
@ -7,14 +7,14 @@ module RbConfig
|
|||
end
|
||||
|
||||
class Exports
|
||||
@subclass = []
|
||||
@@subclass = []
|
||||
def self.inherited(klass)
|
||||
@subclass << [/#{klass.name.sub(/.*::/, '').downcase}/i, klass]
|
||||
@@subclass << [/#{klass.name.sub(/.*::/, '').downcase}/i, klass]
|
||||
end
|
||||
|
||||
def self.create(*args, &block)
|
||||
platform = RUBY_PLATFORM
|
||||
pat, klass = @subclass.find {|p, k| p =~ platform}
|
||||
pat, klass = @@subclass.find {|p, k| p =~ platform}
|
||||
unless klass
|
||||
raise ArgumentError, "unsupported platform: #{platform}"
|
||||
end
|
||||
|
@ -128,7 +128,7 @@ class Exports::Mswin < Exports
|
|||
end
|
||||
end
|
||||
|
||||
class Exports::Mingw < Exports
|
||||
class Exports::Cygwin < Exports
|
||||
def self.nm
|
||||
@@nm ||= RbConfig::CONFIG["NM"]
|
||||
end
|
||||
|
@ -145,6 +145,12 @@ class Exports::Mingw < Exports
|
|||
objdump(objs) do |l|
|
||||
yield $2, !$1 if /\s(?:(T)|[[:upper:]])\s_((?!Init_).*)$/ =~ l
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class Exports::Mingw < Exports::Cygwin
|
||||
def each_export(objs)
|
||||
super
|
||||
yield "strcasecmp", "_stricmp"
|
||||
yield "strncasecmp", "_strnicmp"
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче