[macruby-changes] [295] MacRuby/branches/testing
source_changes at macosforge.org
source_changes at macosforge.org
Mon Jun 16 18:04:33 PDT 2008
Revision: 295
http://trac.macosforge.org/projects/ruby/changeset/295
Author: lsansonetti at apple.com
Date: 2008-06-16 18:04:32 -0700 (Mon, 16 Jun 2008)
Log Message:
-----------
merge with trunk
Modified Paths:
--------------
MacRuby/branches/testing/dir.c
MacRuby/branches/testing/enumerator.c
MacRuby/branches/testing/eval.c
MacRuby/branches/testing/ext/strscan/strscan.c
MacRuby/branches/testing/gc-stub.m
MacRuby/branches/testing/gc.c
MacRuby/branches/testing/include/ruby/intern.h
MacRuby/branches/testing/include/ruby/node.h
MacRuby/branches/testing/include/ruby/ruby.h
MacRuby/branches/testing/instruby.rb
MacRuby/branches/testing/io.c
MacRuby/branches/testing/objc.m
MacRuby/branches/testing/proc.c
MacRuby/branches/testing/string.c
MacRuby/branches/testing/struct.c
MacRuby/branches/testing/test/ruby/test_regexp.rb
MacRuby/branches/testing/version.h
MacRuby/branches/testing/vm_insnhelper.c
Added Paths:
-----------
MacRuby/branches/testing/Rakefile
MacRuby/branches/testing/bootstraptest/test_autoload.rb
MacRuby/branches/testing/bootstraptest/test_struct.rb
MacRuby/branches/testing/include/ruby/config.h.in
MacRuby/branches/testing/sample-macruby/buildall.rb
Removed Paths:
-------------
MacRuby/branches/testing/Makefile.in
MacRuby/branches/testing/common.mk
MacRuby/branches/testing/config.guess
MacRuby/branches/testing/config.sub
MacRuby/branches/testing/configure.in
MacRuby/branches/testing/eval.c.orig
MacRuby/branches/testing/framework/Info.plist
MacRuby/branches/testing/include/ruby/win32.h
MacRuby/branches/testing/install-sh
MacRuby/branches/testing/mkconfig.rb
MacRuby/branches/testing/thread_win32.c
MacRuby/branches/testing/thread_win32.h
MacRuby/branches/testing/version.h.orig
Deleted: MacRuby/branches/testing/Makefile.in
===================================================================
--- MacRuby/branches/testing/Makefile.in 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/Makefile.in 2008-06-17 01:04:32 UTC (rev 295)
@@ -1,211 +0,0 @@
-SHELL = /bin/sh
-NULLCMD = :
-
-#### Start of system configuration section. ####
-
-srcdir = @srcdir@
-hdrdir = $(srcdir)/include
-
-CC = @CC@
-YACC = bison
-PURIFY =
-AUTOCONF = autoconf
- at SET_MAKE@
-MKFILES = @MAKEFILES@
-BASERUBY = @BASERUBY@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-sbindir = @sbindir@
-libdir = @libdir@
-libexecdir = @libexecdir@
-datarootdir = @datarootdir@
-datadir = @datadir@
-arch = @arch@
-sitearch = @sitearch@
-sitedir = @sitedir@
-
-TESTUI = console
-TESTS =
-RDOCTARGET = @RDOCTARGET@
-
-EXTOUT = @EXTOUT@
-RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system
-arch_hdrdir = $(EXTOUT)/include/$(arch)
-VPATH = $(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir):$(srcdir)/enc:$(srcdir)/missing
-
-empty =
-OUTFLAG = @OUTFLAG@$(empty)
-COUTFLAG = @COUTFLAG@$(empty)
-CFLAGS = @CFLAGS@ @ARCH_FLAG@
-cflags = @cflags@
-optflags = @optflags@
-debugflags = @debugflags@
-warnflags = @warnflags@
-XCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir) @XCFLAGS@
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
-EXTLDFLAGS =
-XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS)
-EXTLIBS =
-LIBS = @LIBS@ $(EXTLIBS)
-MISSING = @LIBOBJS@ @ALLOCA@
-LDSHARED = @LIBRUBY_LDSHARED@
-DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(EXTLDFLAGS) @ARCH_FLAG@
-SOLIBS = @SOLIBS@
-MAINLIBS = @MAINLIBS@
-ARCHMINIOBJS = @MINIOBJS@
-BUILTIN_ENCOBJS = @BUILTIN_ENCOBJS@
-
-RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
-RUBY_SO_NAME=@RUBY_SO_NAME@
-EXEEXT = @EXEEXT@
-PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
-RUBY = $(RUBY_INSTALL_NAME)
-MINIRUBY = @MINIRUBY@ $(MINIRUBYOPT)
-RUNRUBY = @RUNRUBY@ $(RUNRUBYOPT) --
-
-#### End of system configuration section. ####
-
-MAJOR= @MAJOR@
-MINOR= @MINOR@
-TEENY= @TEENY@
-
-LIBRUBY_A = @LIBRUBY_A@
-LIBRUBY_SO = @LIBRUBY_SO@
-LIBRUBY_ALIASES= @LIBRUBY_ALIASES@
-LIBRUBY = @LIBRUBY@
-LIBRUBYARG = @LIBRUBYARG@
-LIBRUBYARG_STATIC = @LIBRUBYARG_STATIC@
-LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@
-
-THREAD_MODEL = @THREAD_MODEL@
-
-PREP = @PREP@
-ARCHFILE = @ARCHFILE@
-SETUP =
-EXTSTATIC = @EXTSTATIC@
-
-CP = cp
-MV = mv
-RM = rm -f
-NM = @NM@
-AR = @AR@
-ARFLAGS = rcu
-RANLIB = @RANLIB@
-AS = @AS@
-ASFLAGS = @ASFLAGS@
-IFCHANGE = $(srcdir)/tool/ifchange
-SET_LC_MESSAGES = env LC_MESSAGES=C
-
-OBJEXT = @OBJEXT@
-ASMEXT = S
-DLEXT = @DLEXT@
-MANTYPE = @MANTYPE@
-
-INSTALLED_LIST= .installed.list
-#### End of variables
-
-all:
-
-.DEFAULT: all
-
-# Prevent GNU make v3 from overflowing arg limit on SysV.
-.NOEXPORT:
-
-miniruby$(EXEEXT): gc-stub.$(OBJEXT)
- @$(RM) $@
- $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(ARCHFILE) $(LIBS) $(OUTFLAG)$@ gc-stub.$(OBJEXT)
-
-$(PROGRAM): gc-stub.$(OBJEXT)
- @$(RM) $@
- $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(OUTFLAG)$@ gc-stub.$(OBJEXT)
-
-# We must `rm' the library each time this rule is invoked because "updating" a
-# MAB library on Apple/NeXT (see --enable-fat-binary in configure) is not
-# supported.
-$(LIBRUBY_A):
- @$(RM) $@
- $(AR) $(ARFLAGS) $@ $(OBJS) $(DMYEXT)
- @-$(RANLIB) $@ 2> /dev/null || true
-
-$(LIBRUBY_SO):
- @-$(PRE_LIBRUBY_UPDATE)
- $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(OUTFLAG)$@
- @-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \
- File.symlink "$(LIBRUBY_SO)", link}' \
- $(LIBRUBY_ALIASES) || true
-
-fake.rb: Makefile
- @echo ' \
- class Object; \
- CROSS_COMPILING = RUBY_PLATFORM; \
- remove_const :RUBY_PLATFORM; \
- remove_const :RUBY_VERSION; \
- RUBY_PLATFORM = "@arch@"; \
- RUBY_VERSION = "@MAJOR at .@MINOR at .@TEENY@"; \
- end; \
- if RUBY_PLATFORM =~ /mswin|bccwin|mingw/; \
- class File; \
- remove_const :ALT_SEPARATOR; \
- ALT_SEPARATOR = "\\"; \
- end; \
- end; \
- ' > $@
-
-Makefile: $(srcdir)/Makefile.in $(srcdir)/enc/Makefile.in
-
-$(MKFILES): config.status $(srcdir)/common.mk
- MAKE=$(MAKE) $(SHELL) ./config.status
- @{ \
- echo "all:; - at rm -f conftest.mk"; \
- echo "conftest.mk: .force; @echo AUTO_REMAKE"; \
- echo ".force:"; \
- } > conftest.mk || exit 1; \
- $(MAKE) -f conftest.mk | grep '^AUTO_REMAKE$$' >/dev/null 2>&1 || \
- { echo "Makefile updated, restart."; exit 1; }
-
-config.status: $(srcdir)/configure $(srcdir)/enc/Makefile.in
- MINIRUBY="$(MINIRUBY)" $(SHELL) ./config.status --recheck
-
-$(srcdir)/configure: $(srcdir)/configure.in
- cd $(srcdir) && $(AUTOCONF)
-
-# Things which should be considered:
-# * with gperf v.s. without gperf
-# * ./configure v.s. ../ruby/configure
-# * GNU make v.s. HP-UX make # HP-UX make invokes the action if lex.c and keywords has same mtime.
-# * svn checkout generate a file with mtime as current time
-# * XFS has a mtime with fractional part
-lex.c: keywords
- if cmp -s $(srcdir)/lex.c.src $?; then \
- cp $(srcdir)/lex.c.blt $@; \
- else \
- gperf -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? > $@.tmp && \
- mv $@.tmp $@ && \
- cp $? $(srcdir)/lex.c.src && \
- cp $@ $(srcdir)/lex.c.blt; \
- fi
-
-.m. at OBJEXT@:
- $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -c -fobjc-gc $<
-
-.c. at OBJEXT@:
- $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $<
-
-.s. at OBJEXT@:
- $(AS) $(ASFLAGS) -o $@ $<
-
-.c.S:
- $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -S $<
-
-clean-local::
- @$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output
- @$(RM) gc-stub.$(OBJEXT)
-
-distclean-local::
- @$(RM) ext/config.cache $(RBCONFIG)
-
-ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP)
- $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c
Copied: MacRuby/branches/testing/Rakefile (from rev 294, MacRuby/trunk/Rakefile)
===================================================================
--- MacRuby/branches/testing/Rakefile (rev 0)
+++ MacRuby/branches/testing/Rakefile 2008-06-17 01:04:32 UTC (rev 295)
@@ -0,0 +1,571 @@
+# User customizable variables.
+
+RUBY_INSTALL_NAME = 'macruby'
+RUBY_SO_NAME = RUBY_INSTALL_NAME
+ARCHS = %w{ppc i386}
+FRAMEWORK_NAME = 'MacRuby'
+FRAMEWORK_INSTDIR = '/Library/Frameworks'
+NO_WARN_BUILD = true
+
+# Everything below this comment should *not* be customized.
+
+version_h = File.read('version.h')
+NEW_RUBY_VERSION = version_h.scan(/#\s*define\s+RUBY_VERSION\s+\"([^"]+)\"/)[0][0]
+MACRUBY_VERSION = version_h.scan(/#\s*define\s+MACRUBY_VERSION\s+(.*)/)[0][0]
+
+NEW_RUBY_PLATFORM = 'universal-darwin' + `uname -r`.scan(/^\d+.\d+/)[0]
+
+FRAMEWORK_PATH = File.join(FRAMEWORK_INSTDIR, FRAMEWORK_NAME + '.framework')
+FRAMEWORK_VERSION = File.join(FRAMEWORK_PATH, 'Versions', MACRUBY_VERSION)
+FRAMEWORK_USR = File.join(FRAMEWORK_VERSION, 'usr')
+FRAMEWORK_USR_LIB = File.join(FRAMEWORK_USR, 'lib')
+FRAMEWORK_USR_LIB_RUBY = File.join(FRAMEWORK_USR_LIB, 'ruby')
+
+RUBY_LIB = File.join(FRAMEWORK_USR_LIB_RUBY, NEW_RUBY_VERSION)
+RUBY_ARCHLIB = File.join(RUBY_LIB, NEW_RUBY_PLATFORM)
+RUBY_SITE_LIB = File.join(FRAMEWORK_USR_LIB_RUBY, 'site_ruby')
+RUBY_SITE_LIB2 = File.join(RUBY_SITE_LIB, NEW_RUBY_VERSION)
+RUBY_SITE_ARCHLIB = File.join(RUBY_SITE_LIB2, NEW_RUBY_PLATFORM)
+RUBY_VENDOR_LIB = File.join(FRAMEWORK_USR_LIB_RUBY, 'vendor_ruby')
+RUBY_VENDOR_LIB2 = File.join(RUBY_VENDOR_LIB, NEW_RUBY_VERSION)
+RUBY_VENDOR_ARCHLIB = File.join(RUBY_VENDOR_LIB2, NEW_RUBY_PLATFORM)
+
+ARCHFLAGS = ARCHS.map { |a| '-arch ' + a }.join(' ')
+CFLAGS = "-I. -I./include -I/usr/include/libxml2 #{ARCHFLAGS} -fno-common -pipe -O2 -g -Wall"
+CFLAGS << " -Wno-parentheses -Wno-deprecated-declarations -Werror" if NO_WARN_BUILD
+OBJC_CFLAGS = CFLAGS + " -fobjc-gc-only"
+LDFLAGS = "-lpthread -ldl -lxml2 -lobjc -lffi -lauto -framework Foundation"
+DLDFLAGS = "-dynamiclib -undefined suppress -flat_namespace -install_name #{File.join(FRAMEWORK_USR_LIB, 'lib' + RUBY_SO_NAME + '.dylib')} -current_version #{MACRUBY_VERSION} -compatibility_version #{MACRUBY_VERSION}"
+
+OBJS = %w{
+ array bignum class compar complex dir enum enumerator error eval load proc
+ file gc hash inits io marshal math numeric object pack parse process prec
+ random range rational re regcomp regenc regerror regexec regparse regsyntax
+ ruby signal sprintf st string struct time transcode util variable version
+ blockinlining compile debug iseq vm vm_dump thread cont id objc bs encoding
+ main dln dmyext enc/ascii missing/lgamma_r prelude miniprelude gc-stub
+}
+
+class Builder
+ attr_reader :objs, :cflags
+ attr_accessor :objc_cflags, :ldflags, :dldflags
+
+ def initialize(objs)
+ @objs = objs.dup
+ @cflags = CFLAGS
+ @objc_cflags = OBJC_CFLAGS
+ @ldflags = LDFLAGS
+ @dldflags = DLDFLAGS
+ @obj_sources = {}
+ @header_paths = {}
+ end
+
+ def build(objs=nil)
+ objs ||= @objs
+ objs.each do |obj|
+ if should_build?(obj)
+ s = obj_source(obj)
+ flags = File.extname(s) == '.m' ? @objc_cflags : @cflags
+ cc("#{flags} -c #{s} -o #{obj}.o")
+ end
+ end
+ end
+
+ def link_executable(name, objs=nil, ldflags=nil)
+ link(objs, ldflags, "-o #{name}", name)
+ end
+
+ def link_dylib(name, objs=nil, ldflags=nil)
+ link(objs, ldflags, "#{@dldflags} -o #{name}", name)
+ end
+
+ def link_archive(name, objs=nil)
+ objs ||= @objs
+ if should_link?(name, objs)
+ rm_f(name)
+ sh("/usr/bin/ar rcu #{name} #{objs.map { |x| x + '.o' }.join(' ') }")
+ sh("/usr/bin/ranlib #{name}")
+ end
+ end
+
+ def clean
+ @objs.map { |o| o + '.o' }.select { |o| File.exist?(o) }.each { |o| rm_f(o) }
+ end
+
+ private
+
+ def cc(args)
+ sh("/usr/bin/gcc #{args}")
+ end
+
+ def link(objs, ldflags, args, name)
+ objs ||= @objs
+ ldflags ||= @ldflags
+ line = "#{@cflags} #{objs.map { |x| x + '.o' }.join(' ') } #{ldflags} #{args}"
+ cc(line) if should_link?(name, objs)
+ end
+
+ def should_build?(obj)
+ if File.exist?(obj + '.o')
+ src_time = File.mtime(obj_source(obj))
+ obj_time = File.mtime(obj + '.o')
+ src_time > obj_time \
+ or dependencies[obj].any? { |f| File.mtime(f) > obj_time }
+ else
+ true
+ end
+ end
+
+ def should_link?(bin, objs)
+ if File.exist?(bin)
+ mtime = File.mtime(bin)
+ objs.any? { |o| File.mtime(o + '.o') > mtime }
+ else
+ true
+ end
+ end
+
+ def err(*args)
+ $stderr.puts args
+ exit 1
+ end
+
+ def obj_source(obj)
+ s = @obj_sources[obj]
+ unless s
+ s = ['.c', '.m'].map { |e| obj + e }.find { |p| File.exist?(p) }
+ err "cannot locate source file for object `#{obj}'" if s.nil?
+ @obj_sources[obj] = s
+ end
+ s
+ end
+
+ HEADER_DIRS = %w{. include include/ruby}
+ def header_path(hdr)
+ p = @header_paths[hdr]
+ unless p
+ p = HEADER_DIRS.map { |d| File.join(d, hdr) }.find { |p| File.exist?(p) }
+ @header_paths[hdr] = p
+ end
+ p
+ end
+
+ def locate_headers(cont, src)
+ txt = File.read(src)
+ txt.scan(/#include\s+\"([^"]+)\"/).flatten.each do |header|
+ p = header_path(header)
+ if p
+ cont << p
+ locate_headers(cont, p)
+ end
+ end
+ end
+
+ def dependencies
+ unless @obj_dependencies
+ @obj_dependencies = {}
+ @objs.each do |obj|
+ ary = []
+ locate_headers(ary, obj_source(obj))
+ @obj_dependencies[obj] = ary.uniq
+ end
+ end
+ @obj_dependencies
+ end
+end
+
+$builder = Builder.new(OBJS)
+
+desc "Same as all"
+task :default => :all
+
+desc "Create config.h"
+task :config_h do
+ config_h = 'include/ruby/config.h'
+ if !File.exist?(config_h) \
+ or File.mtime(config_h) < File.mtime(config_h + '.in') \
+ or File.mtime(config_h) < File.mtime(__FILE__)
+ new_config_h = File.read(config_h + '.in') << "\n"
+ flag = ['/System/Library/Frameworks', '/Library/Frameworks'].any? do |p|
+ File.exist?(File.join(p, 'BridgeSupport.framework'))
+ end
+ new_config_h << "#define HAVE_BRIDGESUPPORT_FRAMEWORK #{flag ? 1 : 0}\n"
+ flag = File.exist?('/usr/include/auto_zone.h')
+ new_config_h << "#define HAVE_AUTO_ZONE_H #{flag ? 1 : 0}\n"
+ new_config_h << "#define RUBY_PLATFORM \"#{NEW_RUBY_PLATFORM}\"\n"
+ new_config_h << "#define RUBY_LIB \"#{RUBY_LIB}\"\n"
+ new_config_h << "#define RUBY_ARCHLIB \"#{RUBY_ARCHLIB}\"\n"
+ new_config_h << "#define RUBY_SITE_LIB \"#{RUBY_SITE_LIB}\"\n"
+ new_config_h << "#define RUBY_SITE_LIB2 \"#{RUBY_SITE_LIB2}\"\n"
+ new_config_h << "#define RUBY_SITE_ARCHLIB \"#{RUBY_SITE_ARCHLIB}\"\n"
+ new_config_h << "#define RUBY_VENDOR_LIB \"#{RUBY_VENDOR_LIB}\"\n"
+ new_config_h << "#define RUBY_VENDOR_LIB2 \"#{RUBY_VENDOR_LIB2}\"\n"
+ new_config_h << "#define RUBY_VENDOR_ARCHLIB \"#{RUBY_VENDOR_ARCHLIB}\"\n"
+ if !File.exist?(config_h) or File.read(config_h) != new_config_h
+ File.open(config_h, 'w') { |io| io.print new_config_h }
+ ext_dir = ".ext/include/#{NEW_RUBY_PLATFORM}/ruby"
+ mkdir_p(ext_dir)
+ cp(config_h, ext_dir)
+ end
+ end
+end
+
+desc "Build known objects"
+task :objects => :config_h do
+ sh "/usr/bin/ruby -I. tool/compile_prelude.rb prelude.rb miniprelude.c.new"
+ if !File.exist?('miniprelude.c') or File.read('miniprelude.c') != File.read('miniprelude.c.new')
+ mv('miniprelude.c.new', 'miniprelude.c')
+ else
+ rm('miniprelude.c.new')
+ end
+ if !File.exist?('prelude.c')
+ touch('prelude.c') # create empty file nevertheless
+ end
+ if !File.exist?('parse.c') or File.mtime('parse.y') > File.mtime('parse.c')
+ sh("/usr/bin/bison -o y.tab.c parse.y")
+ sh("/usr/bin/sed -f ./tool/ytab.sed -e \"/^#/s!y\.tab\.c!parse.c!\" y.tab.c > parse.c.new")
+ if !File.exist?('parse.c') or File.read('parse.c.new') != File.read('parse.c')
+ mv('parse.c.new', 'parse.c')
+ else
+ rm('parse.c.new')
+ end
+ end
+ if !File.exist?('lex.c') or File.read('lex.c') != File.read('lex.c.blt')
+ cp('lex.c.blt', 'lex.c')
+ end
+ inc_to_gen = %w{opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc vmtc.inc vm.inc}.select { |inc| !File.exist?(inc) or File.mtime("template/#{inc}.tmpl") > File.mtime(inc) }
+ unless inc_to_gen.empty?
+ sh("/usr/bin/ruby -Ks tool/insns2vm.rb #{inc_to_gen.join(' ')}")
+ end
+ if !File.exist?('node_name.inc') or File.mtime('include/ruby/node.h') > File.mtime('node_name.inc')
+ sh("/usr/bin/ruby -n tool/node_name.rb include/ruby/node.h > node_name.inc")
+ end
+ $builder.build
+end
+
+desc "Create miniruby"
+task :miniruby => :objects do
+ $builder.link_executable('miniruby', OBJS - ['prelude'])
+end
+
+desc "Create config file"
+task :rbconfig => :miniruby do
+ rbconfig = <<EOS
+# This file was created when MacRuby was built. Any changes made to this file
+# will be lost the next time MacRuby is built.
+
+module RbConfig
+ RUBY_VERSION == "#{NEW_RUBY_VERSION}" or
+ raise "ruby lib version (#{NEW_RUBY_VERSION}) doesn't match executable version (\#{RUBY_VERSION})"
+
+ TOPDIR = File.dirname(__FILE__).chomp!("/lib/ruby/#{NEW_RUBY_VERSION}/#{NEW_RUBY_PLATFORM}")
+ DESTDIR = '' unless defined? DESTDIR
+ CONFIG = {}
+ CONFIG["DESTDIR"] = DESTDIR
+ CONFIG["INSTALL"] = '/usr/bin/install -c'
+ CONFIG["prefix"] = (TOPDIR || DESTDIR + "#{FRAMEWORK_USR}")
+ CONFIG["EXEEXT"] = ""
+ CONFIG["ruby_install_name"] = "#{RUBY_INSTALL_NAME}"
+ CONFIG["RUBY_INSTALL_NAME"] = "#{RUBY_INSTALL_NAME}"
+ CONFIG["RUBY_SO_NAME"] = "#{RUBY_SO_NAME}"
+ CONFIG["SHELL"] = "/bin/sh"
+ CONFIG["PATH_SEPARATOR"] = ":"
+ CONFIG["PACKAGE_NAME"] = ""
+ CONFIG["PACKAGE_TARNAME"] = ""
+ CONFIG["PACKAGE_VERSION"] = ""
+ CONFIG["PACKAGE_STRING"] = ""
+ CONFIG["PACKAGE_BUGREPORT"] = ""
+ CONFIG["exec_prefix"] = "$(prefix)"
+ CONFIG["bindir"] = "$(exec_prefix)/bin"
+ CONFIG["sbindir"] = "$(exec_prefix)/sbin"
+ CONFIG["libexecdir"] = "$(exec_prefix)/libexec"
+ CONFIG["datarootdir"] = "$(prefix)/share"
+ CONFIG["datadir"] = "$(datarootdir)"
+ CONFIG["sysconfdir"] = "$(prefix)/etc"
+ CONFIG["sharedstatedir"] = "$(prefix)/com"
+ CONFIG["localstatedir"] = "$(prefix)/var"
+ CONFIG["includedir"] = "$(prefix)/include"
+ CONFIG["oldincludedir"] = "/usr/include"
+ CONFIG["docdir"] = "$(datarootdir)/doc/$(PACKAGE)"
+ CONFIG["infodir"] = "$(datarootdir)/info"
+ CONFIG["htmldir"] = "$(docdir)"
+ CONFIG["dvidir"] = "$(docdir)"
+ CONFIG["pdfdir"] = "$(docdir)"
+ CONFIG["psdir"] = "$(docdir)"
+ CONFIG["libdir"] = "$(exec_prefix)/lib"
+ CONFIG["localedir"] = "$(datarootdir)/locale"
+ CONFIG["mandir"] = "$(datarootdir)/man"
+ CONFIG["DEFS"] = ""
+ CONFIG["ECHO_C"] = "\\\\\\\\c"
+ CONFIG["ECHO_N"] = ""
+ CONFIG["ECHO_T"] = ""
+ CONFIG["LIBS"] = ""
+ CONFIG["build_alias"] = ""
+ CONFIG["host_alias"] = ""
+ CONFIG["target_alias"] = ""
+ CONFIG["BASERUBY"] = "ruby"
+ CONFIG["MAJOR"], CONFIG["MINOR"], CONFIG["TEENY"] = [#{NEW_RUBY_VERSION.scan(/\d+/).map { |x| "\"" + x + "\"" }.join(', ')}]
+ CONFIG["build"] = "i686-apple-darwin9.0.0"
+ CONFIG["build_cpu"] = "i686"
+ CONFIG["build_vendor"] = "apple"
+ CONFIG["build_os"] = "darwin9.0.0"
+ CONFIG["host"] = "i686-apple-darwin9.0.0"
+ CONFIG["host_cpu"] = "i686"
+ CONFIG["host_vendor"] = "apple"
+ CONFIG["host_os"] = "darwin9.0.0"
+ CONFIG["target"] = "i686-apple-darwin9.0.0"
+ CONFIG["target_cpu"] = "i686"
+ CONFIG["target_vendor"] = "apple"
+ CONFIG["target_os"] = "darwin9.0"
+ CONFIG["CC"] = "gcc"
+ CONFIG["CFLAGS"] = "-fno-common -pipe $(cflags)"
+ CONFIG["LDFLAGS"] = ""
+ CONFIG["CPPFLAGS"] = "$(cppflags)"
+ CONFIG["OBJEXT"] = "o"
+ CONFIG["CXX"] = "g++"
+ CONFIG["CXXFLAGS"] = ""
+ CONFIG["CPP"] = "gcc -E"
+ CONFIG["GREP"] = "/usr/bin/grep"
+ CONFIG["EGREP"] = "/usr/bin/grep -E"
+ CONFIG["GNU_LD"] = "no"
+ CONFIG["CPPOUTFILE"] = "-o conftest.i"
+ CONFIG["OUTFLAG"] = "-o "
+ CONFIG["COUTFLAG"] = "-o "
+ CONFIG["RANLIB"] = "ranlib"
+ CONFIG["AR"] = "ar"
+ CONFIG["AS"] = "as"
+ CONFIG["ASFLAGS"] = ""
+ CONFIG["NM"] = ""
+ CONFIG["WINDRES"] = ""
+ CONFIG["DLLWRAP"] = ""
+ CONFIG["OBJDUMP"] = ""
+ CONFIG["LN_S"] = "ln -s"
+ CONFIG["SET_MAKE"] = ""
+ CONFIG["INSTALL_PROGRAM"] = "$(INSTALL)"
+ CONFIG["INSTALL_SCRIPT"] = "$(INSTALL)"
+ CONFIG["INSTALL_DATA"] = "$(INSTALL) -m 644"
+ CONFIG["RM"] = "rm -f"
+ CONFIG["CP"] = "cp"
+ CONFIG["MAKEDIRS"] = "mkdir -p"
+ CONFIG["ALLOCA"] = ""
+ CONFIG["DLDFLAGS"] = ""
+ CONFIG["ARCH_FLAG"] = "#{ARCHFLAGS}"
+ CONFIG["STATIC"] = ""
+ CONFIG["CCDLFLAGS"] = "-fno-common"
+ CONFIG["LDSHARED"] = "$(CC) -dynamic -bundle -undefined suppress -flat_namespace #{ARCHFLAGS}"
+ CONFIG["LDSHAREDXX"] = "$(CXX) -dynamic -bundle -undefined suppress -flat_namespace"
+ CONFIG["DLEXT"] = "bundle"
+ CONFIG["DLEXT2"] = ""
+ CONFIG["LIBEXT"] = "a"
+ CONFIG["LINK_SO"] = ""
+ CONFIG["LIBPATHFLAG"] = " -L%s"
+ CONFIG["RPATHFLAG"] = ""
+ CONFIG["LIBPATHENV"] = "DYLD_LIBRARY_PATH"
+ CONFIG["TRY_LINK"] = ""
+ CONFIG["STRIP"] = "strip -A -n"
+ CONFIG["EXTSTATIC"] = ""
+ CONFIG["setup"] = "Setup"
+ CONFIG["PREP"] = "miniruby$(EXEEXT)"
+ CONFIG["EXTOUT"] = ".ext"
+ CONFIG["ARCHFILE"] = ""
+ CONFIG["RDOCTARGET"] = "install-doc"
+ CONFIG["cppflags"] = ""
+ CONFIG["cflags"] = "$(optflags) $(debugflags) $(warnflags)"
+ CONFIG["optflags"] = "-O2"
+ CONFIG["debugflags"] = "-g"
+ CONFIG["warnflags"] = "-Wall -Wno-parentheses"
+ CONFIG["LIBRUBY_LDSHARED"] = "cc -dynamiclib -undefined suppress -flat_namespace"
+ CONFIG["LIBRUBY_DLDFLAGS"] = "-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)"
+ CONFIG["rubyw_install_name"] = ""
+ CONFIG["RUBYW_INSTALL_NAME"] = ""
+ CONFIG["LIBRUBY_A"] = "lib$(RUBY_SO_NAME)-static.a"
+ CONFIG["LIBRUBY_SO"] = "lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib"
+ CONFIG["LIBRUBY_ALIASES"] = "lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib"
+ CONFIG["LIBRUBY"] = "$(LIBRUBY_SO)"
+ CONFIG["LIBRUBYARG"] = "$(LIBRUBYARG_SHARED)"
+ CONFIG["LIBRUBYARG_STATIC"] = "-l$(RUBY_SO_NAME)-static #{LDFLAGS}"
+ CONFIG["LIBRUBYARG_SHARED"] = "-l$(RUBY_SO_NAME)"
+ CONFIG["SOLIBS"] = ""
+ CONFIG["DLDLIBS"] = ""
+ CONFIG["ENABLE_SHARED"] = "yes"
+ CONFIG["MAINLIBS"] = ""
+ CONFIG["COMMON_LIBS"] = ""
+ CONFIG["COMMON_MACROS"] = ""
+ CONFIG["COMMON_HEADERS"] = ""
+ CONFIG["EXPORT_PREFIX"] = ""
+ CONFIG["THREAD_MODEL"] = "pthread"
+ CONFIG["MAKEFILES"] = "Makefile"
+ CONFIG["arch"] = "#{NEW_RUBY_PLATFORM}"
+ CONFIG["sitearch"] = "#{NEW_RUBY_PLATFORM}"
+ CONFIG["sitedir"] = "$(libdir)/ruby/site_ruby"
+ CONFIG["vendordir"] = "$(prefix)/lib/ruby/vendor_ruby"
+ CONFIG["configure_args"] = ""
+ CONFIG["rubyhdrdir"] = "$(includedir)/ruby-$(MAJOR).$(MINOR).$(TEENY)"
+ CONFIG["sitehdrdir"] = "$(rubyhdrdir)/site_ruby"
+ CONFIG["vendorhdrdir"] = "$(rubyhdrdir)/vendor_ruby"
+ CONFIG["NROFF"] = "/usr/bin/nroff"
+ CONFIG["MANTYPE"] = "doc"
+ CONFIG["ruby_version"] = "$(MAJOR).$(MINOR).$(TEENY)"
+ CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"
+ CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
+ CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
+ CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
+ CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
+ CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
+ CONFIG["topdir"] = File.dirname(__FILE__)
+ MAKEFILE_CONFIG = {}
+ CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
+ def RbConfig::expand(val, config = CONFIG)
+ val.gsub!(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do
+ var = $&
+ if !(v = $1 || $2)
+ '$'
+ elsif key = config[v = v[/\\A[^:]+(?=(?::(.*?)=(.*))?\\z)/]]
+ pat, sub = $1, $2
+ config[v] = false
+ RbConfig::expand(key, config)
+ config[v] = key
+ key = key.gsub(/\#{Regexp.quote(pat)}(?=\\s|\\z)/n) {sub} if pat
+ key
+ else
+ var
+ end
+ end
+ val
+ end
+ CONFIG.each_value do |val|
+ RbConfig::expand(val)
+ end
+end
+Config = RbConfig # compatibility for ruby-1.8.4 and older.
+CROSS_COMPILING = nil
+RUBY_FRAMEWORK = true
+RUBY_FRAMEWORK_VERSION = RbConfig::CONFIG['ruby_version']
+EOS
+ if !File.exist?('rbconfig.rb') or File.read('rbconfig.rb') != rbconfig
+ File.open('rbconfig.rb', 'w') { |io| io.print rbconfig }
+ end
+end
+
+namespace :macruby do
+ desc "Build dynamic libraries for MacRuby"
+ task :dylib => [:rbconfig, :miniruby] do
+ sh("./miniruby -I. -I./lib -rrbconfig tool/compile_prelude.rb prelude.rb gem_prelude.rb prelude.c.new")
+ if !File.exist?('prelude.c') or File.read('prelude.c') != File.read('prelude.c.new')
+ mv('prelude.c.new', 'prelude.c')
+ $builder.build(['prelude'])
+ else
+ rm('prelude.c.new')
+ end
+ dylib = "lib#{RUBY_SO_NAME}.#{NEW_RUBY_VERSION}.dylib"
+ $builder.link_dylib(dylib, $builder.objs - ['main', 'gc-stub', 'miniprelude'])
+ major, minor, teeny = NEW_RUBY_VERSION.scan(/\d+/)
+ ["lib#{RUBY_SO_NAME}.#{major}.#{minor}.dylib", "lib#{RUBY_SO_NAME}.dylib"].each do |dylib_alias|
+ if !File.exist?(dylib_alias) or File.readlink(dylib_alias) != dylib
+ rm_f(dylib_alias)
+ ln_s(dylib, dylib_alias)
+ end
+ end
+ end
+
+ desc "Build static libraries for MacRuby"
+ task :static => :dylib do
+ $builder.link_archive("lib#{RUBY_SO_NAME}-static.a", $builder.objs - ['main', 'gc-stub', 'miniprelude'])
+ end
+
+ desc "Build MacRuby"
+ task :build => :dylib do
+ $builder.link_executable(RUBY_INSTALL_NAME, ['main', 'gc-stub'], "-L. -l#{RUBY_SO_NAME}")
+ end
+end
+
+DESTDIR = (ENV['DESTDIR'] or "")
+EXTOUT = (ENV['EXTOUT'] or ".ext")
+INSTALLED_LIST = '.installed.list'
+SCRIPT_ARGS = "--make=\"/usr/bin/make\" --dest-dir=\"#{DESTDIR}\" --extout=\"#{EXTOUT}\" --mflags=\"\" --make-flags=\"\""
+EXTMK_ARGS = "#{SCRIPT_ARGS} --extension --extstatic"
+INSTRUBY_ARGS = "#{SCRIPT_ARGS} --data-mode=0644 --prog-mode=0755 --installed-list #{INSTALLED_LIST} --mantype=\"doc\""
+
+desc "Build extensions"
+task :extensions => [:miniruby, "macruby:static"] do
+ sh "./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ext/extmk.rb #{EXTMK_ARGS}"
+end
+
+namespace :framework do
+ desc "Create the plist file for the framework"
+ task :info_plist do
+ plist = <<EOS
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>Ruby</string>
+ <key>CFBundleName</key>
+ <string>Ruby</string>
+ <key>CFBundleGetInfoString</key>
+ <string>MacRuby Runtime and Library</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.macruby</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>#{MACRUBY_VERSION}</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>#{MACRUBY_VERSION}</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>MacRuby-#{MACRUBY_VERSION}</string>
+ <key>NSPrincipalClass</key>
+ <string></string>
+</dict>
+</plist>
+EOS
+ File.open('framework/Info.plist', 'w') { |io| io.print plist }
+ end
+
+ desc "Install the framework"
+ task :install => :info_plist do
+ sh "./miniruby instruby.rb #{INSTRUBY_ARGS}"
+ end
+end
+
+namespace :clean do
+ desc "Clean local build files"
+ task :local do
+ $builder.clean
+ ['parse.c', 'lex.c', INSTALLED_LIST, 'Makefile', *Dir['*.inc']].each { |x| rm_f(x) }
+ end
+
+ desc "Clean extension build files"
+ task :ext do
+ if File.exist?('./miniruby')
+ sh "./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ext/extmk.rb #{EXTMK_ARGS} -- clean"
+ end
+ end
+end
+
+desc "Same as framework:install"
+task :install => 'framework:install'
+
+desc "Same as macruby:build"
+task :macruby => 'macruby:build'
+
+desc "Run the sample tests"
+task :sample_test do
+ sh "./miniruby rubytest.rb"
+end
+
+desc "Clean local and extension build files"
+task :clean => ['clean:local', 'clean:ext']
+
+desc "Build MacRuby and extensions"
+task :all => [:macruby, :extensions]
+
+desc "Same as sample_test"
+task :test => :sample_test
Copied: MacRuby/branches/testing/bootstraptest/test_autoload.rb (from rev 294, MacRuby/trunk/bootstraptest/test_autoload.rb)
===================================================================
--- MacRuby/branches/testing/bootstraptest/test_autoload.rb (rev 0)
+++ MacRuby/branches/testing/bootstraptest/test_autoload.rb 2008-06-17 01:04:32 UTC (rev 295)
@@ -0,0 +1,52 @@
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
+ autoload :ZZZ, "./zzz.rb"
+ ZZZ.ok
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
+ autoload :ZZZ, "./zzz.rb"
+ require "./zzz.rb"
+ ZZZ.ok
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
+ autoload :ZZZ, "./zzz.rb"
+ proc{$SAFE=4; ZZZ.ok}.call
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
+ autoload :ZZZ, "./zzz.rb"
+ require "./zzz.rb"
+ proc{$SAFE=4; ZZZ.ok}.call
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"}
+ autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb')
+ module M; end
+ Thread.new{M.instance_eval('$SAFE=4; ZZZ.new.hoge')}.value
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"}
+ autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb')
+ module M; end
+ Thread.new{$SAFE=4; M.instance_eval('ZZZ.new.hoge')}.value
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"}
+ autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb')
+ Thread.new{$SAFE=4; eval('ZZZ.new.hoge')}.value
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"}
+ autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb')
+ module M; end
+ Thread.new{eval('$SAFE=4; ZZZ.new.hoge')}.value
+}
Copied: MacRuby/branches/testing/bootstraptest/test_struct.rb (from rev 294, MacRuby/trunk/bootstraptest/test_struct.rb)
===================================================================
--- MacRuby/branches/testing/bootstraptest/test_struct.rb (rev 0)
+++ MacRuby/branches/testing/bootstraptest/test_struct.rb 2008-06-17 01:04:32 UTC (rev 295)
@@ -0,0 +1,5 @@
+assert_equal 'Struct::Foo', %q{
+ Struct.instance_eval { const_set(:Foo, nil) }
+ Struct.new("Foo")
+ Struct::Foo
+}
Deleted: MacRuby/branches/testing/common.mk
===================================================================
--- MacRuby/branches/testing/common.mk 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/common.mk 2008-06-17 01:04:32 UTC (rev 295)
@@ -1,849 +0,0 @@
-bin: $(PROGRAM) $(WPROGRAM)
-lib: $(LIBRUBY)
-dll: $(LIBRUBY_SO)
-
-.SUFFIXES: .inc
-
-RUBYLIB = -
-RUBYOPT = -
-
-STATIC_RUBY = static-ruby
-
-EXTCONF = extconf.rb
-RBCONFIG = ./.rbconfig.time
-LIBRUBY_EXTS = ./.libruby-with-ext.time
-RDOCOUT = $(EXTOUT)/rdoc
-
-DMYEXT = dmyext.$(OBJEXT)
-NORMALMAINOBJ = main.$(OBJEXT)
-MAINOBJ = $(NORMALMAINOBJ)
-EXTOBJS =
-DLDOBJS = $(DMYEXT)
-MINIOBJS = $(ARCHMINIOBJS) dmyencoding.$(OBJEXT) miniprelude.$(OBJEXT)
-
-COMMONOBJS = array.$(OBJEXT) \
- bignum.$(OBJEXT) \
- class.$(OBJEXT) \
- compar.$(OBJEXT) \
- complex.$(OBJEXT) \
- dir.$(OBJEXT) \
- enum.$(OBJEXT) \
- enumerator.$(OBJEXT) \
- error.$(OBJEXT) \
- eval.$(OBJEXT) \
- load.$(OBJEXT) \
- proc.$(OBJEXT) \
- file.$(OBJEXT) \
- gc.$(OBJEXT) \
- hash.$(OBJEXT) \
- inits.$(OBJEXT) \
- io.$(OBJEXT) \
- marshal.$(OBJEXT) \
- math.$(OBJEXT) \
- numeric.$(OBJEXT) \
- object.$(OBJEXT) \
- pack.$(OBJEXT) \
- parse.$(OBJEXT) \
- process.$(OBJEXT) \
- prec.$(OBJEXT) \
- random.$(OBJEXT) \
- range.$(OBJEXT) \
- rational.$(OBJEXT) \
- re.$(OBJEXT) \
- regcomp.$(OBJEXT) \
- regenc.$(OBJEXT) \
- regerror.$(OBJEXT) \
- regexec.$(OBJEXT) \
- regparse.$(OBJEXT) \
- regsyntax.$(OBJEXT) \
- ruby.$(OBJEXT) \
- signal.$(OBJEXT) \
- sprintf.$(OBJEXT) \
- st.$(OBJEXT) \
- string.$(OBJEXT) \
- struct.$(OBJEXT) \
- time.$(OBJEXT) \
- transcode.$(OBJEXT) \
- util.$(OBJEXT) \
- variable.$(OBJEXT) \
- version.$(OBJEXT) \
- blockinlining.$(OBJEXT) \
- compile.$(OBJEXT) \
- debug.$(OBJEXT) \
- iseq.$(OBJEXT) \
- vm.$(OBJEXT) \
- vm_dump.$(OBJEXT) \
- thread.$(OBJEXT) \
- cont.$(OBJEXT) \
- id.$(OBJEXT) \
- objc.$(OBJEXT) \
- $(BUILTIN_ENCOBJS) \
- $(MISSING)
-
-OBJS = dln.$(OBJEXT) \
- encoding.$(OBJEXT) \
- prelude.$(OBJEXT) \
- $(COMMONOBJS)
-
-GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT)
-
-PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(srcdir)/gem_prelude.rb
-PRELUDES = prelude.c miniprelude.c golf_prelude.c
-
-SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \
- --extout="$(EXTOUT)" \
- --mflags="$(MFLAGS)" \
- --make-flags="$(MAKEFLAGS)"
-EXTMK_ARGS = $(SCRIPT_ARGS) --extension $(EXTS) --extstatic $(EXTSTATIC) --
-INSTRUBY_ARGS = $(SCRIPT_ARGS) \
- --data-mode=$(INSTALL_DATA_MODE) \
- --prog-mode=$(INSTALL_PROG_MODE) \
- --installed-list $(INSTALLED_LIST)
-INSTALL_PROG_MODE = 0755
-INSTALL_DATA_MODE = 0644
-
-PRE_LIBRUBY_UPDATE = $(MINIRUBY) -e 'ARGV[1] or File.unlink(ARGV[0]) rescue nil' -- \
- $(LIBRUBY_EXTS) $(LIBRUBY_SO_UPDATE)
-
-TESTSDIR = $(srcdir)/test
-TESTWORKDIR = testwork
-
-BOOTSTRAPRUBY = $(BASERUBY)
-
-COMPILE_PRELUDE = $(MINIRUBY) -I$(srcdir) -rrbconfig $(srcdir)/tool/compile_prelude.rb
-
-VCS = svn
-
-all: $(MKFILES) incs $(PREP) $(RBCONFIG) $(LIBRUBY) encs
- @$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" $(EXTMK_ARGS)
-prog: $(PROGRAM) $(WPROGRAM)
-
-loadpath: $(PREP)
- $(MINIRUBY) -e 'p $$:'
-
-$(PREP): $(MKFILES)
-
-miniruby$(EXEEXT): config.status $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(ARCHFILE)
-
-GORUBY = go$(RUBY_INSTALL_NAME)
-golf: $(LIBRUBY) $(GOLFOBJS)
- $(MAKE) $(MFLAGS) MAINOBJ="$(GOLFOBJS)" PROGRAM=$(GORUBY)$(EXEEXT) program
-
-program: $(PROGRAM)
-
-$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SETUP) $(PREP)
-
-$(LIBRUBY_A): $(OBJS) $(DMYEXT) $(ARCHFILE)
-
-$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(LIBRUBY_SO_UPDATE) $(BUILTIN_ENCOBJS)
-
-$(LIBRUBY_EXTS):
- @exit > $@
-
-$(STATIC_RUBY)$(EXEEXT): $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A)
- @$(RM) $@
- $(PURIFY) $(CC) $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)$@ $(LDFLAGS) $(XLDFLAGS)
-
-ruby.imp: $(COMMONOBJS)
- @$(NM) -Pgp $(COMMONOBJS) | awk 'BEGIN{print "#!"}; $$2~/^[BD]$$/{print $$1}' | sort -u -o $@
-
-install: install-nodoc $(RDOCTARGET)
-install-all: install-nodoc install-doc
-
-install-nodoc: pre-install-nodoc do-install-nodoc post-install-nodoc
-pre-install-nodoc:: pre-install-local pre-install-ext
-do-install-nodoc:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --mantype="$(MANTYPE)"
-post-install-nodoc:: post-install-local post-install-ext
-
-install-local: pre-install-local do-install-local post-install-local
-pre-install-local:: pre-install-bin pre-install-lib pre-install-man
-do-install-local:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=local --mantype="$(MANTYPE)"
-post-install-local:: post-install-bin post-install-lib post-install-man
-
-install-ext: pre-install-ext do-install-ext post-install-ext
-pre-install-ext:: pre-install-ext-arch pre-install-ext-comm
-do-install-ext:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext
-post-install-ext:: post-install-ext-arch post-install-ext-comm
-
-install-arch: pre-install-arch do-install-arch post-install-arch
-pre-install-arch:: pre-install-bin pre-install-ext-arch
-do-install-arch:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin --install=ext-arch
-post-install-arch:: post-install-bin post-install-ext-arch
-
-install-comm: pre-install-comm do-install-comm post-install-comm
-pre-install-comm:: pre-install-lib pre-install-ext-comm pre-install-man
-do-install-comm:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib --install=ext-comm --install=man
-post-install-comm:: post-install-lib post-install-ext-comm post-install-man
-
-install-bin: pre-install-bin do-install-bin post-install-bin
-pre-install-bin:: install-prereq
-do-install-bin:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin
-post-install-bin::
- @$(NULLCMD)
-
-install-lib: pre-install-lib do-install-lib post-install-lib
-pre-install-lib:: install-prereq
-do-install-lib:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib
-post-install-lib::
- @$(NULLCMD)
-
-install-ext-comm: pre-install-ext-comm do-install-ext-comm post-install-ext-comm
-pre-install-ext-comm:: install-prereq
-do-install-ext-comm:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-comm
-post-install-ext-comm::
- @$(NULLCMD)
-
-install-ext-arch: pre-install-ext-arch do-install-ext-arch post-install-ext-arch
-pre-install-ext-arch:: install-prereq
-do-install-ext-arch:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-arch
-post-install-ext-arch::
- @$(NULLCMD)
-
-install-man: pre-install-man do-install-man post-install-man
-pre-install-man:: install-prereq
-do-install-man:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man --mantype="$(MANTYPE)"
-post-install-man::
- @$(NULLCMD)
-
-what-where: no-install
-no-install: no-install-nodoc no-install-doc
-what-where-all: no-install-all
-no-install-all: no-install-nodoc
-
-what-where-nodoc: no-install-nodoc
-no-install-nodoc: pre-no-install-nodoc dont-install-nodoc post-no-install-nodoc
-pre-no-install-nodoc:: pre-no-install-local pre-no-install-ext
-dont-install-nodoc:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --mantype="$(MANTYPE)"
-post-no-install-nodoc:: post-no-install-local post-no-install-ext
-
-what-where-local: no-install-local
-no-install-local: pre-no-install-local dont-install-local post-no-install-local
-pre-no-install-local:: pre-no-install-bin pre-no-install-lib pre-no-install-man
-dont-install-local:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=local --mantype="$(MANTYPE)"
-post-no-install-local:: post-no-install-bin post-no-install-lib post-no-install-man
-
-what-where-ext: no-install-ext
-no-install-ext: pre-no-install-ext dont-install-ext post-no-install-ext
-pre-no-install-ext:: pre-no-install-ext-arch pre-no-install-ext-comm
-dont-install-ext:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext
-post-no-install-ext:: post-no-install-ext-arch post-no-install-ext-comm
-
-what-where-arch: no-install-arch
-no-install-arch: pre-no-install-arch dont-install-arch post-no-install-arch
-pre-no-install-arch:: pre-no-install-bin pre-no-install-ext-arch
-dont-install-arch:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin --install=ext-arch
-post-no-install-arch:: post-no-install-lib post-no-install-man post-no-install-ext-arch
-
-what-where-comm: no-install-comm
-no-install-comm: pre-no-install-comm dont-install-comm post-no-install-comm
-pre-no-install-comm:: pre-no-install-lib pre-no-install-ext-comm pre-no-install-man
-dont-install-comm:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib --install=ext-comm --install=man
-post-no-install-comm:: post-no-install-lib post-no-install-ext-comm post-no-install-man
-
-what-where-bin: no-install-bin
-no-install-bin: pre-no-install-bin dont-install-bin post-no-install-bin
-pre-no-install-bin:: install-prereq
-dont-install-bin:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin
-post-no-install-bin::
- @$(NULLCMD)
-
-what-where-lib: no-install-lib
-no-install-lib: pre-no-install-lib dont-install-lib post-no-install-lib
-pre-no-install-lib:: install-prereq
-dont-install-lib:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib
-post-no-install-lib::
- @$(NULLCMD)
-
-what-where-ext-comm: no-install-ext-comm
-no-install-ext-comm: pre-no-install-ext-comm dont-install-ext-comm post-no-install-ext-comm
-pre-no-install-ext-comm:: install-prereq
-dont-install-ext-comm:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-comm
-post-no-install-ext-comm::
- @$(NULLCMD)
-
-what-where-ext-arch: no-install-ext-arch
-no-install-ext-arch: pre-no-install-ext-arch dont-install-ext-arch post-no-install-ext-arch
-pre-no-install-ext-arch:: install-prereq
-dont-install-ext-arch:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-arch
-post-no-install-ext-arch::
- @$(NULLCMD)
-
-what-where-man: no-install-man
-no-install-man: pre-no-install-man dont-install-man post-no-install-man
-pre-no-install-man:: install-prereq
-dont-install-man:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man --mantype="$(MANTYPE)"
-post-no-install-man::
- @$(NULLCMD)
-
-install-doc: rdoc pre-install-doc do-install-doc post-install-doc
-pre-install-doc:: install-prereq
-do-install-doc: $(PROGRAM)
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
-post-install-doc::
- @$(NULLCMD)
-
-rdoc: $(PROGRAM) PHONY
- @echo Generating RDoc documentation
- $(RUNRUBY) "$(srcdir)/bin/rdoc" --all --ri --op "$(RDOCOUT)" "$(srcdir)"
-
-what-where-doc: no-install-doc
-no-install-doc: pre-no-install-doc dont-install-doc post-no-install-doc
-pre-no-install-doc:: install-prereq
-dont-install-doc::
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
-post-no-install-doc::
- @$(NULLCMD)
-
-CLEAR_INSTALLED_LIST = clear-installed-list
-
-install-prereq: $(CLEAR_INSTALLED_LIST)
-
-clear-installed-list:
- @exit > $(INSTALLED_LIST)
-
-clean: clean-ext clean-local clean-enc
-clean-local::
- @$(RM) $(OBJS) $(MINIOBJS) $(MAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES)
- @$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) $(ARCHFILE) .*.time
- @$(RM) *.inc $(GOLFOBJS) y.tab.c y.output encdb.h transdb.h
-clean-ext:
- @-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" $(EXTMK_ARGS) clean
-clean-enc:
- @-$(MAKE) -f enc.mk $(MFLAGS) clean
-
-distclean: distclean-ext distclean-local distclean-enc
-distclean-local:: clean-local
- @$(RM) $(MKFILES) $(arch_hdrdir)/ruby/config.h rbconfig.rb yasmdata.rb encdb.h
- @$(RM) config.cache config.log config.status config.status.lineno $(PRELUDES)
- @$(RM) *~ *.bak *.stackdump core *.core gmon.out $(PREP)
-distclean-ext:
- @-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" $(EXTMK_ARGS) distclean
-# -$(RM) $(INSTALLED_LIST) $(arch_hdrdir)/ruby/config.h
-# -rmdir -p $(arch_hdrdir)/ruby
-distclean-enc: clean-enc
- @-$(MAKE) -f enc.mk $(MFLAGS) distclean
-
-realclean:: realclean-ext realclean-local realclean-enc
-realclean-local:: distclean-local
- @$(RM) parse.c lex.c revision.h
-realclean-ext::
- @-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" $(EXTMK_ARGS) realclean
-realclean-enc:: distclean-enc
-
-check: test test-all
-
-btest: miniruby$(EXEEXT) PHONY
- $(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(MINIRUBY)" $(OPTS)
-
-btest-miniruby: miniruby$(EXEEXT) $(RBCONFIG) $(PROGRAM) PHONY
- @$(MINIRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(MINIRUBY)" -q
-
-test-sample: miniruby$(EXEEXT) $(RBCONFIG) $(PROGRAM) PHONY
- @$(MINIRUBY) $(srcdir)/rubytest.rb
-
-test: test-sample btest-miniruby
-
-test-all:
- $(RUNRUBY) "$(srcdir)/test/runner.rb" --basedir="$(TESTSDIR)" --runner=$(TESTUI) $(TESTS)
-
-extconf:
- $(MINIRUBY) -run -e mkdir -- -p "$(EXTCONFDIR)"
- $(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS)
-
-$(RBCONFIG): $(srcdir)/mkconfig.rb config.status $(PREP)
- @$(MINIRUBY) $(srcdir)/mkconfig.rb -timestamp=$@ \
- -install_name=$(RUBY_INSTALL_NAME) \
- -so_name=$(RUBY_SO_NAME) rbconfig.rb
-
-encs: enc.mk $(LIBRUBY)
- $(MINIRUBY) -run -e mkdir -- -p "$(EXTOUT)/$(arch)/enc/trans" enc/trans
- $(MAKE) -f enc.mk $(MFLAGS)
-
-enc.mk: $(srcdir)/enc/make_encmake.rb $(srcdir)/enc/Makefile.in $(srcdir)/enc/depend \
- $(srcdir)/lib/mkmf.rb $(PREP)
- $(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" $@
-
-.PRECIOUS: $(MKFILES)
-
-.PHONY: test install install-nodoc install-doc dist
-
-PHONY:
-
-{$(VPATH)}parse.c: {$(VPATH)}parse.y $(srcdir)/tool/ytab.sed
-
-{$(srcdir)}.y.c:
- $(YACC) $(YFLAGS) -o y.tab.c $<
- sed -f $(srcdir)/tool/ytab.sed -e "/^#/s!y\.tab\.c!$@!" y.tab.c > $@.new
- @$(RM) $@ y.tab.c
- @$(MV) $@.new $@
-
-acosh.$(OBJEXT): {$(VPATH)}acosh.c
-alloca.$(OBJEXT): {$(VPATH)}alloca.c {$(VPATH)}config.h
-crypt.$(OBJEXT): {$(VPATH)}crypt.c
-dup2.$(OBJEXT): {$(VPATH)}dup2.c
-erf.$(OBJEXT): {$(VPATH)}erf.c
-finite.$(OBJEXT): {$(VPATH)}finite.c
-flock.$(OBJEXT): {$(VPATH)}flock.c
-memcmp.$(OBJEXT): {$(VPATH)}memcmp.c
-memmove.$(OBJEXT): {$(VPATH)}memmove.c
-mkdir.$(OBJEXT): {$(VPATH)}mkdir.c
-strchr.$(OBJEXT): {$(VPATH)}strchr.c
-strdup.$(OBJEXT): {$(VPATH)}strdup.c
-strerror.$(OBJEXT): {$(VPATH)}strerror.c
-strftime.$(OBJEXT): {$(VPATH)}strftime.c
-strstr.$(OBJEXT): {$(VPATH)}strstr.c
-strtod.$(OBJEXT): {$(VPATH)}strtod.c
-strtol.$(OBJEXT): {$(VPATH)}strtol.c
-nt.$(OBJEXT): {$(VPATH)}nt.c
-x68.$(OBJEXT): {$(VPATH)}x68.c
-os2.$(OBJEXT): {$(VPATH)}os2.c
-dl_os2.$(OBJEXT): {$(VPATH)}dl_os2.c
-ia64.$(OBJEXT): {$(VPATH)}ia64.s
- $(CC) $(CFLAGS) -c $<
-
-# when I use -I., there is confliction at "OpenFile"
-# so, set . into environment varible "include"
-win32.$(OBJEXT): {$(VPATH)}win32.c
-
-###
-
-array.$(OBJEXT): {$(VPATH)}array.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}util.h
-bignum.$(OBJEXT): {$(VPATH)}bignum.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h
-class.$(OBJEXT): {$(VPATH)}class.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}signal.h {$(VPATH)}node.h
-compar.$(OBJEXT): {$(VPATH)}compar.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h
-complex.$(OBJEXT): {$(VPATH)}complex.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h
-dir.$(OBJEXT): {$(VPATH)}dir.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}util.h
-dln.$(OBJEXT): {$(VPATH)}dln.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}dln.h
-dmydln.$(OBJEXT): {$(VPATH)}dmydln.c dln.$(OBJEXT)
-dmyext.$(OBJEXT): {$(VPATH)}dmyext.c
-dmyencoding.$(OBJEXT): {$(VPATH)}dmyencoding.c \
- {$(VPATH)}encoding.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}encoding.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}regenc.h
-encoding.$(OBJEXT): dmyencoding.$(OBJEXT)
-enum.$(OBJEXT): {$(VPATH)}enum.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}node.h {$(VPATH)}util.h
-enumerator.$(OBJEXT): {$(VPATH)}enumerator.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}debug.h {$(VPATH)}node.h
-error.$(OBJEXT): {$(VPATH)}error.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}vm_core.h {$(VPATH)}signal.h {$(VPATH)}node.h \
- {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h
-eval.$(OBJEXT): {$(VPATH)}eval.c {$(VPATH)}eval_intern.h \
- {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}defines.h \
- {$(VPATH)}missing.h {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}node.h \
- {$(VPATH)}util.h {$(VPATH)}signal.h {$(VPATH)}vm_core.h \
- {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h {$(VPATH)}dln.h \
- {$(VPATH)}eval_error.c {$(VPATH)}eval_safe.c \
- {$(VPATH)}eval_jump.c
-load.$(OBJEXT): {$(VPATH)}load.c {$(VPATH)}eval_intern.h \
- {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}defines.h \
- {$(VPATH)}missing.h {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}node.h \
- {$(VPATH)}util.h {$(VPATH)}signal.h {$(VPATH)}vm_core.h \
- {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h {$(VPATH)}dln.h
-file.$(OBJEXT): {$(VPATH)}file.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}io.h {$(VPATH)}encoding.h {$(VPATH)}oniguruma.h \
- {$(VPATH)}signal.h {$(VPATH)}util.h {$(VPATH)}dln.h
-gc.$(OBJEXT): {$(VPATH)}gc.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}signal.h {$(VPATH)}node.h {$(VPATH)}re.h \
- {$(VPATH)}regex.h {$(VPATH)}oniguruma.h {$(VPATH)}io.h \
- {$(VPATH)}encoding.h {$(VPATH)}vm_core.h {$(VPATH)}debug.h \
- {$(VPATH)}vm_opts.h {$(VPATH)}id.h {$(VPATH)}thread_$(THREAD_MODEL).h \
- {$(VPATH)}gc.h {$(VPATH)}eval_intern.h
-hash.$(OBJEXT): {$(VPATH)}hash.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}util.h {$(VPATH)}signal.h
-inits.$(OBJEXT): {$(VPATH)}inits.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h
-io.$(OBJEXT): {$(VPATH)}io.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}io.h {$(VPATH)}encoding.h {$(VPATH)}oniguruma.h \
- {$(VPATH)}signal.h {$(VPATH)}util.h
-main.$(OBJEXT): {$(VPATH)}main.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h
-marshal.$(OBJEXT): {$(VPATH)}marshal.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}io.h {$(VPATH)}encoding.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}util.h
-math.$(OBJEXT): {$(VPATH)}math.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h
-numeric.$(OBJEXT): {$(VPATH)}numeric.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}encoding.h \
- {$(VPATH)}oniguruma.h
-object.$(OBJEXT): {$(VPATH)}object.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}util.h {$(VPATH)}debug.h {$(VPATH)}node.h
-pack.$(OBJEXT): {$(VPATH)}pack.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h
-parse.$(OBJEXT): {$(VPATH)}parse.c {$(VPATH)}parse.y {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}node.h {$(VPATH)}encoding.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}id.h {$(VPATH)}regenc.h \
- {$(VPATH)}regex.h {$(VPATH)}util.h {$(VPATH)}lex.c {$(VPATH)}keywords \
- {$(VPATH)}debug.h
-prec.$(OBJEXT): {$(VPATH)}prec.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h
-proc.$(OBJEXT): {$(VPATH)}proc.c {$(VPATH)}eval_intern.h \
- {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}defines.h \
- {$(VPATH)}missing.h {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}node.h \
- {$(VPATH)}util.h {$(VPATH)}signal.h {$(VPATH)}vm_core.h \
- {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h {$(VPATH)}dln.h {$(VPATH)}gc.h
-process.$(OBJEXT): {$(VPATH)}process.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}signal.h {$(VPATH)}vm_core.h \
- {$(VPATH)}node.h {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h
-random.$(OBJEXT): {$(VPATH)}random.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h
-range.$(OBJEXT): {$(VPATH)}range.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h
-rational.$(OBJEXT): {$(VPATH)}rational.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h
-re.$(OBJEXT): {$(VPATH)}re.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}re.h {$(VPATH)}regex.h {$(VPATH)}oniguruma.h \
- {$(VPATH)}encoding.h {$(VPATH)}util.h {$(VPATH)}regint.h \
- {$(VPATH)}regenc.h
-regcomp.$(OBJEXT): {$(VPATH)}regcomp.c {$(VPATH)}regparse.h \
- {$(VPATH)}regint.h {$(VPATH)}config.h {$(VPATH)}defines.h \
- {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h {$(VPATH)}st.h
-regenc.$(OBJEXT): {$(VPATH)}regenc.c {$(VPATH)}regint.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}regenc.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}st.h
-regerror.$(OBJEXT): {$(VPATH)}regerror.c {$(VPATH)}regint.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}regenc.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}st.h
-regexec.$(OBJEXT): {$(VPATH)}regexec.c {$(VPATH)}regint.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}regenc.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}st.h
-regparse.$(OBJEXT): {$(VPATH)}regparse.c {$(VPATH)}regparse.h \
- {$(VPATH)}regint.h {$(VPATH)}config.h {$(VPATH)}defines.h \
- {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h {$(VPATH)}st.h
-regsyntax.$(OBJEXT): {$(VPATH)}regsyntax.c {$(VPATH)}regint.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}regenc.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}st.h
-ruby.$(OBJEXT): {$(VPATH)}ruby.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}node.h {$(VPATH)}encoding.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}eval_intern.h {$(VPATH)}util.h \
- {$(VPATH)}signal.h {$(VPATH)}vm_core.h {$(VPATH)}debug.h \
- {$(VPATH)}vm_opts.h {$(VPATH)}id.h {$(VPATH)}thread_$(THREAD_MODEL).h \
- {$(VPATH)}dln.h
-signal.$(OBJEXT): {$(VPATH)}signal.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}signal.h {$(VPATH)}node.h {$(VPATH)}vm_core.h \
- {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h
-sprintf.$(OBJEXT): {$(VPATH)}sprintf.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}re.h {$(VPATH)}regex.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}encoding.h {$(VPATH)}vsnprintf.c
-st.$(OBJEXT): {$(VPATH)}st.c {$(VPATH)}config.h {$(VPATH)}defines.h \
- {$(VPATH)}st.h
-string.$(OBJEXT): {$(VPATH)}string.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}re.h {$(VPATH)}regex.h {$(VPATH)}oniguruma.h \
- {$(VPATH)}encoding.h
-struct.$(OBJEXT): {$(VPATH)}struct.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h
-thread.$(OBJEXT): {$(VPATH)}thread.c {$(VPATH)}eval_intern.h \
- {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}defines.h \
- {$(VPATH)}missing.h {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}node.h \
- {$(VPATH)}util.h {$(VPATH)}signal.h {$(VPATH)}vm_core.h \
- {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h {$(VPATH)}dln.h {$(VPATH)}vm.h \
- {$(VPATH)}gc.h {$(VPATH)}thread_$(THREAD_MODEL).c
-transcode.$(OBJEXT): {$(VPATH)}transcode.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}encoding.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}transcode_data.h
-cont.$(OBJEXT): {$(VPATH)}cont.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}vm_core.h {$(VPATH)}signal.h {$(VPATH)}node.h \
- {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h {$(VPATH)}gc.h \
- {$(VPATH)}eval_intern.h {$(VPATH)}util.h {$(VPATH)}dln.h
-time.$(OBJEXT): {$(VPATH)}time.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}encoding.h
-util.$(OBJEXT): {$(VPATH)}util.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}util.h
-variable.$(OBJEXT): {$(VPATH)}variable.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}node.h {$(VPATH)}util.h
-version.$(OBJEXT): {$(VPATH)}version.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}version.h \
- $(srcdir)/revision.h
-
-compile.$(OBJEXT): {$(VPATH)}compile.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}node.h {$(VPATH)}vm_core.h \
- {$(VPATH)}signal.h {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h {$(VPATH)}compile.h \
- {$(VPATH)}insns.inc {$(VPATH)}insns_info.inc {$(VPATH)}optinsn.inc
-iseq.$(OBJEXT): {$(VPATH)}iseq.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}node.h {$(VPATH)}gc.h {$(VPATH)}vm_core.h \
- {$(VPATH)}signal.h {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h {$(VPATH)}insns.inc \
- {$(VPATH)}insns_info.inc {$(VPATH)}node_name.inc
-vm.$(OBJEXT): {$(VPATH)}vm.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}node.h {$(VPATH)}encoding.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}gc.h {$(VPATH)}insnhelper.h \
- {$(VPATH)}eval_intern.h {$(VPATH)}util.h {$(VPATH)}signal.h \
- {$(VPATH)}vm_core.h {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h {$(VPATH)}dln.h {$(VPATH)}vm.h \
- {$(VPATH)}vm_insnhelper.c {$(VPATH)}insns.inc {$(VPATH)}vm_evalbody.c \
- {$(VPATH)}vmtc.inc {$(VPATH)}vm.inc {$(VPATH)}insns.def \
- {$(VPATH)}vm_method.c {$(VPATH)}vm_eval.c
-vm_dump.$(OBJEXT): {$(VPATH)}vm_dump.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}node.h {$(VPATH)}vm_core.h \
- {$(VPATH)}signal.h {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h {$(VPATH)}vm.h
-debug.$(OBJEXT): {$(VPATH)}debug.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}encoding.h {$(VPATH)}oniguruma.h \
- {$(VPATH)}debug.h {$(VPATH)}node.h {$(VPATH)}vm_core.h \
- {$(VPATH)}signal.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h
-blockinlining.$(OBJEXT): {$(VPATH)}blockinlining.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}node.h {$(VPATH)}vm_core.h \
- {$(VPATH)}signal.h {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h
-id.$(OBJEXT): {$(VPATH)}id.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}id.h
-miniprelude.$(OBJEXT): {$(VPATH)}miniprelude.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}vm_core.h {$(VPATH)}signal.h \
- {$(VPATH)}node.h {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h
-prelude.$(OBJEXT): {$(VPATH)}prelude.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}vm_core.h {$(VPATH)}signal.h \
- {$(VPATH)}node.h {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h
-golf_prelude.$(OBJEXT): {$(VPATH)}golf_prelude.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}vm_core.h {$(VPATH)}signal.h \
- {$(VPATH)}node.h {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h
-goruby.$(OBJEXT): {$(VPATH)}goruby.c {$(VPATH)}main.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h
-
-ascii.$(OBJEXT): {$(VPATH)}ascii.c {$(VPATH)}regenc.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}oniguruma.h
-us_ascii.$(OBJEXT): {$(VPATH)}us_ascii.c {$(VPATH)}regenc.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}oniguruma.h
-unicode.$(OBJEXT): {$(VPATH)}unicode.c {$(VPATH)}regint.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}regenc.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}st.h
-utf_8.$(OBJEXT): {$(VPATH)}utf_8.c {$(VPATH)}regenc.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}oniguruma.h
-
-objc.$(OBJEXT): {$(VPATH)}objc.m {$(VPATH)}ruby.h {$(VPATH)}node.h \
- {$(VPATH)}encoding.h
-bs.$(OBJEXT): {$(VPATH)}bs.c {$(VPATH)}bs.h {$(VPATH)}bs_lex.h
-
-INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc \
- vmtc.inc vm.inc
-
-INSNS2VMOPT = --srcdir="$(srcdir)"
-
-$(INSNS): $(srcdir)/insns.def {$(VPATH)}vm_opts.h
- $(RM) $(PROGRAM)
- $(BASERUBY) -Ks $(srcdir)/tool/insns2vm.rb $(INSNS2VMOPT) $@
-
-minsns.inc: $(srcdir)/template/minsns.inc.tmpl
-
-opt_sc.inc: $(srcdir)/template/opt_sc.inc.tmpl
-
-optinsn.inc: $(srcdir)/template/optinsn.inc.tmpl
-
-optunifs.inc: $(srcdir)/template/optunifs.inc.tmpl
-
-insns.inc: $(srcdir)/template/insns.inc.tmpl
-
-insns_info.inc: $(srcdir)/template/insns_info.inc.tmpl
-
-vmtc.inc: $(srcdir)/template/vmtc.inc.tmpl
-
-vm.inc: $(srcdir)/template/vm.inc.tmpl
-
-srcs: {$(VPATH)}parse.c {$(VPATH)}lex.c $(srcdir)/ext/ripper/ripper.c
-
-incs: $(INSNS) {$(VPATH)}node_name.inc {$(VPATH)}encdb.h {$(VPATH)}transdb.h $(srcdir)/revision.h
-
-insns: $(INSNS)
-
-node_name.inc: {$(VPATH)}node.h
- $(BASERUBY) -n $(srcdir)/tool/node_name.rb $? > $@
-
-encdb.h: $(PREP)
- $(MINIRUBY) $(srcdir)/enc/make_encdb.rb $(srcdir)/enc $@.new
- $(IFCHANGE) "$@" "$@.new"
-
-transdb.h: $(PREP)
- $(MINIRUBY) $(srcdir)/enc/trans/make_transdb.rb $(srcdir)/enc/trans $@.new
- $(IFCHANGE) "$@" "$@.new"
-
-miniprelude.c: $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb
- $(BASERUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb $@
-
-prelude.c: $(srcdir)/tool/compile_prelude.rb $(PRELUDE_SCRIPTS) $(PREP)
- $(COMPILE_PRELUDE) $(PRELUDE_SCRIPTS) $@
-
-golf_prelude.c: $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb $(srcdir)/golf_prelude.rb $(PREP)
- $(COMPILE_PRELUDE) $(srcdir)/golf_prelude.rb $@
-
-prereq: incs srcs preludes
-
-preludes: {$(VPATH)}miniprelude.c
-preludes: {$(srcdir)}golf_prelude.c
-
-docs:
- $(BASERUBY) -I$(srcdir) $(srcdir)/tool/makedocs.rb $(INSNS2VMOPT)
-
-$(srcdir)/revision.h: $(REVISION_FORCE)
- @set LC_MESSAGES=C
- -@$(SET_LC_MESSAGES) $(VCS) info "$(@D)" | \
- sed -n "s/.*Rev:/#define RUBY_REVISION/p" > "$@.tmp"
- @$(IFCHANGE) "$@" "$@.tmp"
-
-$(srcdir)/ext/ripper/ripper.c:
- cd $(srcdir)/ext/ripper && exec $(MAKE) -f depend $(MFLAGS) top_srcdir=../.. srcdir=.
-
-##
-
-run: miniruby$(EXEEXT) PHONY
- $(MINIRUBY) $(srcdir)/test.rb $(RUNOPT)
-
-runruby: $(PROGRAM) PHONY
- $(RUNRUBY) $(srcdir)/test.rb
-
-parse: miniruby$(EXEEXT) PHONY
- $(MINIRUBY) $(srcdir)/tool/parse.rb $(srcdir)/test.rb
-
-COMPARE_RUBY = $(BASERUBY)
-ITEM =
-OPTS =
-
-benchmark: $(PROGRAM) PHONY
- $(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
- --executables="$(COMPARE_RUBY); $(RUNRUBY)" \
- --pattern='bm_' --directory=$(srcdir)/benchmark $(OPTS)
-
-benchmark-each: $(PROGRAM) PHONY
- $(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
- --executables="$(COMPARE_RUBY); $(RUNRUBY)" \
- --pattern=$(ITEM) --directory=$(srcdir)/benchmark $(OPTS)
-
-tbench: $(PROGRAM) PHONY
- $(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
- --executables="$(COMPARE_RUBY); $(RUNRUBY)" \
- --pattern='bmx_' --directory=$(srcdir)/benchmark $(OPTS)
-
-aotc: $(PROGRAM) PHONY
- ./$(PROGRAM) -I$(srcdir)/lib $(srcdir)/bin/ruby2cext $(srcdir)/test.rb
-
-vmasm: vm.$(ASMEXT)
-
-# vm.o : CFLAGS += -fno-crossjumping
-
-run.gdb:
- echo b ruby_debug_breakpoint > run.gdb
- echo '# handle SIGINT nostop' >> run.gdb
- echo '# handle SIGPIPE nostop' >> run.gdb
- echo '# b rb_longjmp' >> run.gdb
- echo source $(srcdir)/breakpoints.gdb >> run.gdb
- echo source $(srcdir)/.gdbinit >> run.gdb
- echo run >> run.gdb
-
-gdb: miniruby$(EXEEXT) run.gdb PHONY
- gdb -x run.gdb --quiet --args $(MINIRUBY) $(srcdir)/test.rb
-
-# Intel VTune
-
-vtune: miniruby$(EXEEXT)
- vtl activity -c sampling -app ".\miniruby$(EXEEXT)","-I$(srcdir)/lib $(srcdir)/test.rb" run
- vtl view -hf -mn miniruby$(EXEEXT) -sum -sort -cd
- vtl view -ha -mn miniruby$(EXEEXT) -sum -sort -cd | $(RUNRUBY) $(srcdir)/tool/vtlh.rb > ha.lines
-
-dist: $(PROGRAM)
- $(RUNRUBY) $(srcdir)/distruby.rb
-
-up:
- @$(VCS) up "$(srcdir)"
- -@$(MAKE) $(MFLAGS) REVISION_FORCE=PHONY "$(srcdir)/revision.h"
-
-help: PHONY
- @echo " Makefile of Ruby"
- @echo ""
- @echo "targets:"
- @echo " all: compile ruby and extensions"
- @echo " check: equals make test test-all"
- @echo " test: ruby core tests"
- @echo " test-all: all ruby tests"
- @echo " install: install all ruby distributions"
- @echo " install-nodoc: install without rdoc"
- @echo " clean: clean built objects"
- @echo " golf: for golfers"
Deleted: MacRuby/branches/testing/config.guess
===================================================================
--- MacRuby/branches/testing/config.guess 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/config.guess 2008-06-17 01:04:32 UTC (rev 295)
@@ -1,1459 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-
-timestamp='2004-06-11'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Per Bothner <per at bothner.com>.
-# Please send patches to <config-patches at gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches at gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
- --version | -v )
- echo "$version" ; exit 0 ;;
- --help | --h* | -h )
- echo "$usage"; exit 0 ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi at noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit 0 ;;
- amd64:OpenBSD:*:*)
- echo x86_64-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- amiga:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- arc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- cats:OpenBSD:*:*)
- echo arm-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- hp300:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- luna88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- macppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvmeppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- pmax:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sgi:OpenBSD:*:*)
- echo mipseb-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- *:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit 0 ;;
- macppc:MirBSD:*:*)
- echo powerppc-unknown-mirbsd${UNAME_RELEASE}
- exit 0 ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit 0 ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit 0 ;;
- Alpha*:OpenVMS:*:*)
- echo alpha-hp-vms
- exit 0 ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit 0 ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit 0 ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit 0;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit 0 ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit 0 ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit 0 ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit 0 ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit 0;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit 0 ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit 0 ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit 0 ;;
- DRS?6000:UNIX_SV:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7 && exit 0 ;;
- esac ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit 0 ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit 0 ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit 0 ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit 0 ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit 0 ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit 0 ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit 0 ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit 0 ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c \
- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && exit 0
- echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit 0 ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit 0 ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit 0 ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit 0 ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit 0 ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit 0 ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit 0 ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit 0 ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit 0 ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit 0 ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit 0 ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit 0 ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit 0 ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit 0 ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo rs6000-ibm-aix3.2.5
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit 0 ;;
- *:AIX:*:[45])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit 0 ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit 0 ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit 0 ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit 0 ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit 0 ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit 0 ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- # avoid double evaluation of $set_cc_for_build
- test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit 0 ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo unknown-hitachi-hiuxwe2
- exit 0 ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit 0 ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit 0 ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit 0 ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit 0 ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit 0 ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit 0 ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit 0 ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit 0 ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit 0 ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit 0 ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit 0 ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- *:UNICOS/mp:*:*)
- echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:FreeBSD:*:*)
- # Determine whether the default compiler uses glibc.
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #if __GLIBC__ >= 2
- LIBC=gnu
- #else
- LIBC=
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- # GNU/KFreeBSD systems have a "k" prefix to indicate we are using
- # FreeBSD's kernel, but not the complete OS.
- case ${LIBC} in gnu) kernel_only='k' ;; esac
- echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
- exit 0 ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit 0 ;;
- i*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit 0 ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit 0 ;;
- x86:Interix*:[34]*)
- echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
- exit 0 ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit 0 ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit 0 ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit 0 ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit 0 ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
- exit 0 ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit 0 ;;
- arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- cris:Linux:*:*)
- echo cris-axis-linux-gnu
- exit 0 ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips
- #undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
- ;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips64
- #undef mips64el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
- ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit 0 ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit 0 ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit 0 ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
- esac
- exit 0 ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
- exit 0 ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit 0 ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
- exit 0 ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0 ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit 0 ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit 0 ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #ifdef __INTEL_COMPILER
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
- ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit 0 ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit 0 ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit 0 ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit 0 ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit 0 ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit 0 ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit 0 ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit 0 ;;
- i*86:*:5:[78]*)
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit 0 ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit 0 ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit 0 ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit 0 ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit 0 ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit 0 ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit 0 ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit 0 ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit 0 ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit 0 ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit 0 ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel at ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit 0 ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes at openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit 0 ;;
- *:*:*:FTX*)
- # From seanf at swdc.stratus.com.
- echo i860-stratus-sysv4
- exit 0 ;;
- *:VOS:*:*)
- # From Paul.Green at stratus.com.
- echo hppa1.1-stratus-vos
- exit 0 ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit 0 ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit 0 ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit 0 ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit 0 ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit 0 ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
- *:Darwin:*:*)
- case `uname -p` in
- *86) UNAME_PROCESSOR=i686 ;;
- powerpc) UNAME_PROCESSOR=powerpc ;;
- esac
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit 0 ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit 0 ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit 0 ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit 0 ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit 0 ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit 0 ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit 0 ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit 0 ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit 0 ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit 0 ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit 0 ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit 0 ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit 0 ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit 0 ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit 0 ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit 0 ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- c34*)
- echo c34-convex-bsd
- exit 0 ;;
- c38*)
- echo c38-convex-bsd
- exit 0 ;;
- c4*)
- echo c4-convex-bsd
- exit 0 ;;
- esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- ftp://ftp.gnu.org/pub/gnu/config/
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches at gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
Deleted: MacRuby/branches/testing/config.sub
===================================================================
--- MacRuby/branches/testing/config.sub 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/config.sub 2008-06-17 01:04:32 UTC (rev 295)
@@ -1,1537 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-
-timestamp='2004-01-05'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Please send patches to <config-patches at gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches at gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
- --version | -v )
- echo "$version" ; exit 0 ;;
- --help | --h* | -h )
- echo "$usage"; exit 0 ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit 0;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
- kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis)
- os=
- basic_machine=$1
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | m32r | m68000 | m68k | m88k | mcore \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64vr | mips64vrel \
- | mips64orion | mips64orionel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | msp430 \
- | ns16k | ns32k \
- | openrisc | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
- | pyramid \
- | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
- | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
- | v850 | v850e \
- | we32k \
- | x86 | xscale | xstormy16 | xtensa \
- | z8k)
- basic_machine=$basic_machine-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12)
- # Motorola 68HC11/12.
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* \
- | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | m32r-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | mcore-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipstx39-* | mipstx39el-* \
- | msp430-* \
- | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
- | pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
- | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tron-* \
- | v850-* | v850e-* | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
- | xtensa-* \
- | ymp-* \
- | z8k-*)
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- mmix*)
- basic_machine=mmix-knuth
- os=-mmixware
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- nv1)
- basic_machine=nv1-cray
- os=-unicosmp
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- or32 | or32-*)
- basic_machine=or32-unknown
- os=-coff
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparc | sparcv9 | sparcv9b)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -kaos*)
- os=-kaos
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-ibm)
- os=-aix
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
Deleted: MacRuby/branches/testing/configure.in
===================================================================
--- MacRuby/branches/testing/configure.in 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/configure.in 2008-06-17 01:04:32 UTC (rev 295)
@@ -1,1979 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT()
-
-AC_PREREQ(2.60)
-
-AC_ARG_WITH(baseruby,
- [ --with-baseruby=RUBY use RUBY as baseruby; RUBY is the pathname of ruby],
- [
- case "$withval" in
- *ruby*)
- BASERUBY=$withval
- ;;
- *)
- AC_MSG_ERROR(need ruby)
- ;;
- esac
- ],
- [
- BASERUBY="ruby"
- ])
-test "`$BASERUBY -e 'p 42' 2>/dev/null`" = 42 ||
- BASERUBY="echo executable host ruby is required. use --with-baseruby option.; false"
-AC_SUBST(BASERUBY)
-
-AC_DEFUN([RUBY_MINGW32],
-[case "$host_os" in
-cygwin*)
-AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32,
-[AC_TRY_CPP([
-#ifndef __MINGW32__
-# error
-#endif
-], rb_cv_mingw32=yes,rb_cv_mingw32=no)
-rm -f conftest*])
-test "$rb_cv_mingw32" = yes && target_os="mingw32"
- ;;
-esac])
-
-AC_DEFUN([RUBY_CPPOUTFILE],
-[AC_CACHE_CHECK(whether ${CPP} accepts -o, rb_cv_cppoutfile,
-[cppflags=$CPPFLAGS
-CPPFLAGS='-o conftest.i'
-AC_TRY_CPP([], rb_cv_cppoutfile=yes, rb_cv_cppoutfile=no)
-CPPFLAGS=$cppflags
-rm -f conftest*])
-if test "$rb_cv_cppoutfile" = yes; then
- CPPOUTFILE='-o conftest.i'
-elif test "$rb_cv_cppoutfile" = no; then
- CPPOUTFILE='> conftest.i'
-elif test -n "$rb_cv_cppoutfile"; then
- CPPOUTFILE="$rb_cv_cppoutfile"
-fi
-AC_SUBST(CPPOUTFILE)])
-
-AC_DEFUN([RUBY_PROG_GNU_LD],
-[AC_CACHE_CHECK(whether the linker is GNU ld, rb_cv_prog_gnu_ld,
-[if `$CC $CFLAGS $CPPFLAGS $LDFLAGS --print-prog-name=ld 2>&1` -v 2>&1 | grep "GNU ld" > /dev/null; then
- rb_cv_prog_gnu_ld=yes
-else
- rb_cv_prog_gnu_ld=no
-fi
-])
-GNU_LD=$rb_cv_prog_gnu_ld
-AC_SUBST(GNU_LD)])
-
-unset GREP_OPTIONS
-rb_version=`grep RUBY_VERSION $srcdir/version.h`
-MAJOR=`expr "$rb_version" : '#define RUBY_VERSION "\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*"'`
-MINOR=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*"'`
-TEENY=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)"'`
-if test "$MAJOR" = ""; then
- AC_MSG_ERROR(could not determine MAJOR number from version.h)
-fi
-if test "$MINOR" = ""; then
- AC_MSG_ERROR(could not determine MINOR number from version.h)
-fi
-if test "$TEENY" = ""; then
- AC_MSG_ERROR(could not determine TEENY number from version.h)
-fi
-AC_SUBST(MAJOR)
-AC_SUBST(MINOR)
-AC_SUBST(TEENY)
-dnl checks for alternative programs
-AC_ARG_WITH(gcc, [ --without-gcc never use gcc], [
- case $withval in
- no) : ${CC=cc}
- ;;
- yes) : ${CC=gcc}
- ;;
- *) CC=$withval
- ;;
- esac])
-dnl If the user switches compilers, we can't believe the cache
-if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
-then
- AC_MSG_ERROR(cached CC is different -- throw away $cache_file
-(it is also a good idea to do 'make clean' before compiling))
-fi
-
-if test "$program_prefix" = NONE; then
- program_prefix=
-fi
-
-AC_CANONICAL_TARGET
-target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
-ac_install_sh='' # unusable for extension libraries.
-
-case "$target_os" in
- darwin*)
- target_os=`echo $target_os | sed 's/\..*/.0/'`
- ;;
-esac
-
-dnl checks for fat-binary
-AC_ARG_ENABLE(fat-binary,
- [ --enable-fat-binary=ARCHS
- build an Apple/NeXT Multi Architecture Binary (MAB);
- ARCHS is a comma-delimited list of architectures for
- which to build; if ARCHS is omitted, then the package
- will be built for all architectures supported by the
- platform ("ppc,i386" for MacOS/X and Darwin; "ppc,i386"
- for Rhapsody; "m68k,i386,sparc" for OpenStep;
- "m68k,i386,sparc,hppa" for NextStep); if this option
- is disabled or omitted entirely, then the package
- will be built only for the target platform],
- [fat_binary=$enableval], [fat_binary=no])
-if test "$fat_binary" != no; then
-
- AC_MSG_CHECKING([target architectures])
-
- # Respect TARGET_ARCHS setting from environment if available.
- if test -z "$TARGET_ARCHS"; then
- # Respect ARCH given to --enable-fat-binary if present.
- if test "$fat_binary" != yes; then
- TARGET_ARCHS=`echo "$fat_binary" | tr ',' ' '`
- else
- # Choose a default set of architectures based upon platform.
- case "$target_os" in
- darwin*)
- TARGET_ARCHS="ppc i386"
- ;;
- rhapsody*)
- TARGET_ARCHS="ppc i386"
- ;;
- openstep*)
- TARGET_ARCHS="m68k i386 sparc"
- ;;
- nextstep*)
- TARGET_ARCHS="m68k i386 sparc hppa"
- ;;
- *)
- TARGET_ARCHS=`arch`
- esac
- fi
- fi
-
- AC_MSG_RESULT([$TARGET_ARCHS])
-
- # /usr/lib/arch_tool -archify_list $TARGET_ARCHS
- ARCH_FLAG=""
- for archs in $TARGET_ARCHS
- do
- ARCH_FLAG="$ARCH_FLAG -arch $archs"
- done
- AC_DEFINE(NEXT_FAT_BINARY)
-fi
-
-case $target_cpu in
- i?86) frame_address=yes;;
- *) frame_address=no;;
-esac
-AC_ARG_ENABLE(frame-address,
- [ --enable-frame-address use GCC __builtin_frame_address(). ],
- [frame_address=$enableval])
-if test $frame_address = yes; then
- AC_DEFINE(USE_BUILTIN_FRAME_ADDRESS)
-fi
-
-AC_ARG_PROGRAM
-
-dnl Checks for programs.
-
-: ${CFLAGS=} ${CXXFLAGS=}
-if test x"${build}" != x"${host}"; then
- AC_CHECK_TOOL(CC, gcc)
-fi
-AC_PROG_CC
-AC_PROG_CXX
-AC_PROG_GCC_TRADITIONAL
-test $ac_cv_prog_cc_g = yes && : ${debugflags=-g}
-if test "$GCC" = yes; then
- linker_flag=-Wl,
- : ${optflags=-O2} ${warnflags="-Wall -Wno-parentheses"}
-else
- linker_flag=
-fi
-
-RUBY_PROG_GNU_LD
-RUBY_CPPOUTFILE
-
-: ${OUTFLAG='-o '}
-: ${COUTFLAG=${OUTFLAG}}
-AC_SUBST(OUTFLAG)
-AC_SUBST(COUTFLAG)
-
-RUBY_MINGW32
-
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(AR, ar)
-if test -z "$AR"; then
- AC_CHECK_PROGS(AR, aal, ar)
-fi
-
-AC_CHECK_TOOL(AS, as)
-ASFLAGS=$ASFLAGS
-AC_SUBST(ASFLAGS)
-
-case "$target_os" in
-cygwin*|mingw*)
- AC_CHECK_TOOL(NM, nm)
- AC_CHECK_TOOL(WINDRES, windres)
- AC_CHECK_TOOL(DLLWRAP, dllwrap)
- target_cpu=`echo $target_cpu | sed s/i.86/i386/`
- case "$target_os" in
- mingw*)
- test "$rb_cv_msvcrt" = "" && unset rb_cv_msvcrt
- AC_CHECK_TOOL(OBJDUMP, objdump)
- AC_CACHE_CHECK(for mingw32 runtime DLL, rb_cv_msvcrt, [
- AC_TRY_LINK([#include <stdio.h>],
- [FILE* volatile f = stdin; return 0;],
- [rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext |
- tr A-Z a-z |
- sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`],
- [rb_cv_msvcrt=msvcrt])
- test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt])
- esac
- : ${enable_shared=yes}
- ;;
-aix*)
- AC_CHECK_TOOL(NM, nm, /usr/ccs/bin/nm, /usr/ccs/bin:$PATH)
- ;;
-hiuxmpp*)
- # by TOYODA Eizi <toyoda at npd.kishou.go.jp>
- AC_DEFINE(__HIUX_MPP__)
- ;;
-esac
-
-AC_PROG_LN_S
-AC_PROG_MAKE_SET
-AC_PROG_INSTALL
-
-# checks for UNIX variants that set C preprocessor variables
-AC_USE_SYSTEM_EXTENSIONS
-
-AC_SUBST(RM, ['rm -f'])
-AC_SUBST(CP, ['cp'])
-if $as_mkdir_p; then
- MAKEDIRS='mkdir -p'
-else
- MAKEDIRS='install -d'
-fi
-AC_SUBST(MAKEDIRS)
-
-dnl check for large file stuff
-mv confdefs.h confdefs1.h
-: > confdefs.h
-AC_SYS_LARGEFILE
-mv confdefs.h largefile.h
-mv confdefs1.h confdefs.h
-cat largefile.h >> confdefs.h
-
-case "$target_os" in
-mingw*)
- ac_cv_type_off_t=yes
- ac_cv_sizeof_off_t=8
- ;;
-esac
-
-AC_CHECK_TYPES([long long, off_t])
-
-AC_CHECK_SIZEOF(int, 4)
-AC_CHECK_SIZEOF(short, 2)
-AC_CHECK_SIZEOF(long, 4)
-AC_CHECK_SIZEOF(long long, 0)
-AC_CHECK_SIZEOF(__int64, 0)
-AC_CHECK_SIZEOF(off_t, 0)
-AC_CHECK_SIZEOF(void*, 4)
-AC_CHECK_SIZEOF(float, 4)
-AC_CHECK_SIZEOF(double, 8)
-AC_CHECK_SIZEOF(time_t, 0)
-
-dnl RUBY_REPLACE_TYPE [typename] [default type] [macro type] [included]
-AC_DEFUN([RUBY_REPLACE_TYPE], [dnl
- AC_CHECK_TYPE([$1],
- [AC_DEFINE_UNQUOTED(rb_[$1], [$1])],
- [AC_DEFINE_UNQUOTED(rb_[$1], [$2])],
- [$4])
- AC_CACHE_CHECK([for convertible type of [$1]], rb_cv_[$1]_convertible, [
- u= t=
- AC_COMPILE_IFELSE(
- [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT]
- [$4], [(rb_[$1])-1 > 0])],
- [u=U])
- if test x"$t" = x; then
- AC_COMPILE_IFELSE(
- [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT]
- [$4], [sizeof(rb_[$1]) > sizeof(long)])],
- [t=LL])
- fi
- if test x"$t" = x; then
- AC_COMPILE_IFELSE(
- [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT]
- [$4], [sizeof(rb_[$1]) == sizeof(long)])],
- [t=LONG])
- fi
- if test x"$t" = x; then
- t=INT
- fi
- rb_cv_[$1]_convertible=${u}${t}])
- AC_DEFINE_UNQUOTED([$3]2NUM[(v)], [${rb_cv_[$1]_convertible}2NUM(v)])
- AC_DEFINE_UNQUOTED(NUM2[$3][(v)], [NUM2${rb_cv_[$1]_convertible}(v)])
-])
-RUBY_REPLACE_TYPE(pid_t, int, PIDT)
-RUBY_REPLACE_TYPE(uid_t, int, UIDT)
-RUBY_REPLACE_TYPE(gid_t, int, GIDT)
-
-AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes,
- [AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
- rb_cv_have_prototypes=yes,
- rb_cv_have_prototypes=no)])
-if test "$rb_cv_have_prototypes" = yes; then
- AC_DEFINE(HAVE_PROTOTYPES)
-fi
-
-AC_CACHE_CHECK(token paste string, rb_cv_tokenpaste,
- [AC_TRY_COMPILE([#define paste(a,b) a##b],
- [int xy = 1; return paste(x,y);],
- rb_cv_tokenpaste=ansi,
- rb_cv_tokenpaste=knr)])
-if test "$rb_cv_tokenpaste" = ansi; then
- AC_DEFINE(TOKEN_PASTE(x,y),[x##y])
-else
- AC_DEFINE(TOKEN_PASTE(x,y),[x/**/y])
-fi
-
-AC_CACHE_CHECK(stringization, rb_cv_stringization, [
- rb_cv_stringization=no
- for string in "#expr" '"expr"'; do
- AC_COMPILE_IFELSE([
- AC_LANG_BOOL_COMPILE_TRY([
-#define STRINGIZE0(expr) $string
-#define STRINGIZE(expr) STRINGIZE0(expr)
-#undef real_test_for_stringization
-#define test_for_stringization -.real_test_for_stringization.-
-const char stringized[[]] = STRINGIZE(test_for_stringization);
-], [sizeof(stringized) == 32])],
- [rb_cv_stringization="$string"; break],
- [rb_cv_stringization=no])
- done]
-)
-AC_DEFINE(STRINGIZE(expr),STRINGIZE0(expr))
-if test x"$rb_cv_stringization" != xno -a "$rb_cv_stringization" != "#expr"; then
- AC_DEFINE_UNQUOTED(STRINGIZE0(expr),$rb_cv_stringization)
- AC_DEFINE(OLD_FASHIONED_STRINGIZATION,1)
-fi
-
-AC_CACHE_CHECK([string literal concatenation],
- rb_cv_string_literal_concatenation, [
- AC_COMPILE_IFELSE([
- AC_LANG_BOOL_COMPILE_TRY([
-const char concatenated_literal[[]] = "literals" "to"
- "be" "concatenated.";
-], [sizeof(concatenated_literal) == 26])],
- [rb_cv_string_literal_concatenation=yes],
- [rb_cv_string_literal_concatenation=no])]
-)
-if test "$rb_cv_string_literal_concatenation" = no; then
- AC_DEFINE(NO_STRING_LITERAL_CONCATENATION,1)
-fi
-
-AC_CACHE_CHECK(for variable length prototypes and stdarg.h, rb_cv_stdarg,
- [AC_TRY_COMPILE([
-#include <stdarg.h>
-int foo(int x, ...) {
- va_list va;
- va_start(va, x);
- va_arg(va, int);
- va_arg(va, char *);
- va_arg(va, double);
- return 0;
-}
-], [return foo(10, "", 3.14);],
- rb_cv_stdarg=yes,
- rb_cv_stdarg=no)])
-if test "$rb_cv_stdarg" = yes; then
- AC_DEFINE(HAVE_STDARG_PROTOTYPES)
-fi
-
-AC_DEFUN([RUBY_FUNC_ATTRIBUTE], [dnl
-m4_ifval([$2], dnl
- [AS_VAR_PUSHDEF([attrib],[$2])], dnl
- [AS_VAR_PUSHDEF([attrib],[FUNC_]AS_TR_CPP($1))] dnl
-)dnl
-m4_ifval([$3], dnl
- [AS_VAR_PUSHDEF([rbcv],[$3])], dnl
- [AS_VAR_PUSHDEF([rbcv],[rb_cv_func_][$1])]dnl
-)dnl
-AC_CACHE_CHECK(for [$1] function attribute, rbcv,
-[rbcv=x
-if test "${ac_c_werror_flag+set}"; then
- rb_c_werror_flag="$ac_c_werror_flag"
-else
- unset rb_c_werror_flag
-fi
-ac_c_werror_flag=yes
-for mac in "__attribute__ (($1)) x" "x __attribute__ (($1))" "__declspec($1) x" x; do
- AC_TRY_COMPILE(
- [#define ]attrib[(x) $mac
- ]attrib[(void conftest_attribute_check(void));], [],
- [rbcv="$mac"; break])
-done
-if test "${rb_c_werror_flag+set}"; then
- ac_c_werror_flag="$rb_c_werror_flag"
-else
- unset ac_c_werror_flag
-fi
-])
-AC_DEFINE_UNQUOTED(attrib[(x)], $rbcv)
-AS_VAR_POPDEF([attrib])
-AS_VAR_POPDEF([rbcv])
-])
-
-RUBY_FUNC_ATTRIBUTE(noreturn, NORETURN)
-RUBY_FUNC_ATTRIBUTE(deprecated, DEPRECATED)
-RUBY_FUNC_ATTRIBUTE(noinline, NOINLINE)
-RUBY_FUNC_ATTRIBUTE(stdcall)
-RUBY_FUNC_ATTRIBUTE(cdecl)
-RUBY_FUNC_ATTRIBUTE(fastcall)
-
-AC_CACHE_CHECK([for RUBY_EXTERN], rb_cv_ruby_extern,
-[rb_cv_ruby_extern=no
-for mac in "__attribute__((dllimport))" "__declspec(dllimport)"; do
- AC_TRY_COMPILE(
- [extern $mac void conftest(void);],
- [rb_cv_ruby_extern="extern $mac"; break])
-done])
-test "x$rb_cv_ruby_extern" = xno || AC_DEFINE_UNQUOTED(RUBY_EXTERN, $rb_cv_ruby_extern)
-
-XCFLAGS="$XCFLAGS -DRUBY_EXPORT"
-
-dnl Check whether we need to define sys_nerr locally
-AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
-#include <errno.h>])
-
-case "$target_os" in
-freebsd*)
- AC_CACHE_CHECK([whether pthread should be enabled by default],
- rb_cv_enable_pthread_default,
- [AC_TRY_CPP([
-#include <osreldate.h>
-#if __FreeBSD_version < 502102
-#error pthread should be disabled on this platform
-#endif
- ],
- rb_cv_enable_pthread_default=yes,
- rb_cv_enable_pthread_default=no)])
- enable_pthread_default=$rb_cv_enable_pthread_default
- ;;
-mingw*)
- enable_pthread_default=no
- ;;
-*)
- enable_pthread_default=yes
- ;;
-esac
-
-AC_ARG_ENABLE(pthread,
- [ --enable-pthread use pthread library.],
- [enable_pthread=$enableval], [enable_pthread=$enable_pthread_default])
-
-AC_ARG_ENABLE(framework,
- [ --enable-framework build as framework.],
- [enable_framework=$enableval], [enable_framework=no])
-
-AC_ARG_WITH(framework_name,
- [ --with-framework-name=NAME framework name (default is MacRuby)],
- [framework_name=$withval],
- [framework_name='MacRuby'])
-
-AC_ARG_WITH(framework_path,
- [ --with-framework-path=DIR framework install path (default is /Library/Frameworks)],
- [framework_path=$withval],
- [framework_path='/Library/Frameworks'])
-
-enable_shared_default="no"
-
-if test x"$enable_framework" = xyes; then
- echo "*** will build as a framework, as $framework_path/$framework_name.framework"
- macruby_version=`grep "define MACRUBY_VERSION" version.h | awk '{print $4}'`
- prefix="$framework_path/$framework_name.framework/Versions/$macruby_version/usr"
- enable_shared_default="yes"
-fi
-
-dnl Checks for libraries.
-case "$target_os" in
-nextstep*) ;;
-openstep*) ;;
-rhapsody*) ;;
-darwin*) LIBS="-lobjc -framework Foundation -lffi -lauto $LIBS"
- if test -f "/System/Library/Frameworks/BridgeSupport.framework"; then
- LIBS="-framework BridgeSupport $LIBS"
- AC_DEFINE(HAVE_BRIDGESUPPORT_FRAMEWORK, 1)
- else
- LIBS="-lxml2 $LIBS"
- CFLAGS="$CFLAGS -I/usr/include/libxml2 $CFLAGS"
- AC_DEFINE(HAVE_BRIDGESUPPORT_FRAMEWORK, 0)
- AC_LIBOBJ([bs])
- fi
- CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE"
- AC_CHECK_HEADERS(auto_zone.h)
- AC_TRY_CPP([#include <AvailabilityMacros.h>
- #if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040
- #error pre OS X 10.4
- [!<===== pre OS X 10.4 =====>]
- #endif
- ],
- [
- test "x$target_cpu" = xppc && ac_cv_header_ucontext_h=no
- ],
- [
- AC_DEFINE(BROKEN_SETREUID, 1)
- AC_DEFINE(BROKEN_SETREGID, 1)
- ])
- ;;
-hpux*) LIBS="-lm $LIBS"
- ac_cv_c_inline=no;;
-human*) ac_cv_func_getpgrp_void=yes
- ac_cv_func_setitimer=no
- ;;
-beos*) ac_cv_func_link=no;;
-cygwin*) ;;
-mingw*) LIBS="-lshell32 -lws2_32 $LIBS"
- ac_cv_header_a_out_h=no
- ac_cv_header_pwd_h=no
- ac_cv_header_utime_h=no
- ac_cv_header_sys_ioctl_h=no
- ac_cv_header_sys_param_h=no
- ac_cv_header_sys_resource_h=no
- ac_cv_header_sys_select_h=no
- ac_cv_header_sys_time_h=no
- ac_cv_header_sys_times_h=no
- ac_cv_func_times=yes
- ac_cv_func_waitpid=yes
- ac_cv_func_fsync=yes
- ac_cv_func_snprintf=yes
- ac_cv_func_vsnprintf=yes
- ac_cv_func_seekdir=yes
- ac_cv_func_telldir=yes
- ac_cv_func_isinf=yes
- ac_cv_func_isnan=yes
- ac_cv_func_finite=yes
- ac_cv_func_link=yes
- ac_cv_func_truncate=yes
- ac_cv_func_fseeko=yes
- ac_cv_func_ftello=yes
- ac_cv_lib_crypt_crypt=no
- ac_cv_func_getpgrp_void=no
- ac_cv_func_setpgrp_void=yes
- ac_cv_func_memcmp_working=yes
- ac_cv_lib_dl_dlopen=no
- rb_cv_binary_elf=no
- rb_cv_negative_time_t=no
- ac_cv_func_fcntl=yes
- ;;
-os2-emx*) LIBS="-lm $LIBS"
- ac_cv_lib_dir_opendir=no;;
-msdosdjgpp*) LIBS="-lm $LIBS"
- ac_cv_func_getpgrp_void=yes
- ac_cv_func_setitimer=no
- ac_cv_sizeof_rlim_t=4
- ac_cv_func_fork=no
- ac_cv_func_setrlimit=no
- ;;
-bsdi*) LIBS="-lm $LIBS"
- AC_DEFINE(BROKEN_SETREUID, 1)
- AC_DEFINE(BROKEN_SETREGID, 1)
- ac_cv_sizeof_rlim_t=8;;
-freebsd*) LIBS="-lm $LIBS"
- AC_CACHE_CHECK([whether -lxpg4 has to be linked],
- rb_cv_lib_xpg4_needed,
- [AC_TRY_CPP([
-#include <osreldate.h>
-#if __FreeBSD_version < 400020 || \
- (__FreeBSD_version >= 500000 && __FreeBSD_version < 500005)
-#error needs libxpg4
-#endif
- ],
- rb_cv_lib_xpg4_needed=no,
- rb_cv_lib_xpg4_needed=yes,
- rb_cv_lib_xpg4_needed=yes)])
- if test "$rb_cv_lib_xpg4_needed" = yes; then
- AC_CHECK_LIB(xpg4, setlocale)
- fi
- ;;
-dragonfly*) LIBS="-lm $LIBS"
- ;;
-bow) ac_cv_func_setitimer=no
- ;;
-superux*) ac_cv_func_setitimer=no
- ;;
-*) LIBS="-lm $LIBS";;
-esac
-AC_CHECK_LIB(crypt, crypt)
-AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
-AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
-AC_CHECK_LIB(socket, socketpair) # SunOS/Solaris
-AC_CHECK_LIB(rt, clock_gettime) # GNU/Linux
-
-case "$target_cpu" in
-alpha*) case "$target_os"::"$GCC" in
- *::yes) CFLAGS="-mieee $CFLAGS" ;; # gcc
- osf*) CFLAGS="-ieee $CFLAGS" ;; # ccc
- esac ;;
-esac
-
-dnl Checks for header files.
-AC_HEADER_DIRENT
-AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h sys/syscall.h\
- fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
- syscall.h pwd.h grp.h a.out.h utime.h memory.h direct.h sys/resource.h \
- sys/mkdev.h sys/utime.h xti.h netinet/in_systm.h float.h ieeefp.h pthread.h \
- ucontext.h intrinsics.h langinfo.h locale.h sys/sendfile.h time.h)
-
-dnl Check additional types.
-AC_CHECK_SIZEOF(rlim_t, 0, [
- #ifdef HAVE_SYS_TYPES_H
- # include <sys/types.h>
- #endif
- #ifdef HAVE_SYS_TIME_H
- # include <sys/time.h>
- #endif
- #ifdef HAVE_SYS_RESOURCE_H
- # include <sys/resource.h>
- #endif
- #ifdef HAVE_UNISTD_H
- # include <unistd.h>
- #endif
- #include <stdio.h>
-])
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_TYPE_SIZE_T
-AC_CHECK_SIZEOF(size_t, 0)
-AC_STRUCT_ST_BLKSIZE
-AC_STRUCT_ST_BLOCKS
-AC_STRUCT_ST_RDEV
-AC_CHECK_MEMBERS([struct stat.st_atim])
-AC_CHECK_MEMBERS([struct stat.st_atimespec])
-AC_CHECK_MEMBERS([struct stat.st_atimensec])
-AC_CHECK_MEMBERS([struct stat.st_mtim])
-AC_CHECK_MEMBERS([struct stat.st_mtimespec])
-AC_CHECK_MEMBERS([struct stat.st_mtimensec])
-AC_CHECK_MEMBERS([struct stat.st_ctim])
-AC_CHECK_MEMBERS([struct stat.st_ctimespec])
-AC_CHECK_MEMBERS([struct stat.st_ctimensec])
-
-AC_CHECK_TYPES([struct timespec], [], [], [@%:@ifdef HAVE_TIME_H
-@%:@include <time.h>
-@%:@endif])
-
-AC_CHECK_TYPE(fd_mask, [AC_DEFINE(HAVE_RB_FD_INIT, 1)])
-
-dnl RUBY_DEFINT TYPENAME, SIZE, [SIGNED-OR-UNSIGNED], [INCLUDES = DEFAULT-INCLUDES]
-AC_DEFUN([RUBY_DEFINT], [dnl
-AC_CACHE_CHECK([for $1], [rb_cv_type_$1],
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])
-typedef $1 t; int s = sizeof(t) == 42;])],
- [rb_cv_type_$1=yes],
- [case m4_bmatch([$2], [^[1-9][0-9]*$], $2, [$ac_cv_sizeof_]AS_TR_SH($2)) in
- "1") rb_cv_type_$1="m4_if([$3], [], [signed ], [$3 ])char";;
- "$ac_cv_sizeof_short") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])short";;
- "$ac_cv_sizeof_int") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])int";;
- "$ac_cv_sizeof_long") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long";;
- "$ac_cv_sizeof_long_long") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long long";;
- "$ac_cv_sizeof___int64") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])__int64";;
- *) rb_cv_type_$1=no;;
- esac])])
-if test "${rb_cv_type_$1}" != no; then
- AC_DEFINE([HAVE_]AS_TR_CPP($1), 1)
- test "${rb_cv_type_$1}" = yes || AC_DEFINE_UNQUOTED($1, [$rb_cv_type_$1])
-fi
-])
-
-RUBY_DEFINT(int8_t, 1)
-RUBY_DEFINT(uint8_t, 1, unsigned)
-RUBY_DEFINT(int16_t, 2)
-RUBY_DEFINT(uint16_t, 2, unsigned)
-RUBY_DEFINT(int32_t, 4)
-RUBY_DEFINT(uint32_t, 4, unsigned)
-RUBY_DEFINT(int64_t, 8)
-RUBY_DEFINT(uint64_t, 8, unsigned)
-RUBY_DEFINT(int128_t, 16)
-RUBY_DEFINT(uint128_t, 16, unsigned)
-RUBY_DEFINT(intptr_t, void*)
-RUBY_DEFINT(uintptr_t, void*, unsigned)
-RUBY_DEFINT(ssize_t, size_t) dnl may differ from int, so not use AC_TYPE_SSIZE_T.
-
-AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address,
-[rb_cv_stack_end_address=no
-for addr in __libc_stack_end _SEND; do
- AC_TRY_LINK(
- [extern void *$addr;],
- [if (!$addr) return 1;],
- [rb_cv_stack_end_address="$addr"; break])
-done])
-if test $rb_cv_stack_end_address != no; then
- AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address)
-fi
-
-dnl Checks for library functions.
-AC_TYPE_GETGROUPS
-AC_TYPE_SIGNAL
-case "${target_cpu}-${target_os}" in
-powerpc-darwin*)
- AC_LIBSOURCES(alloca.c)
- AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
- AC_DEFINE(C_ALLOCA)
- AC_DEFINE_UNQUOTED(alloca, alloca)
- ;;
-*)
- AC_FUNC_ALLOCA
- ;;
-esac
-AC_FUNC_MEMCMP
-AC_REPLACE_FUNCS(dup2 memmove strerror strftime\
- strchr strstr crypt flock vsnprintf\
- isnan finite isinf hypot acosh erf tgamma lgamma_r cbrt \
- strlcpy strlcat)
-AC_CHECK_FUNCS(fmod killpg wait4 waitpid fork spawnv syscall chroot fsync getcwd eaccess\
- truncate ftruncate chsize times utimes utimensat fcntl lockf lstat\
- link symlink readlink\
- setitimer setruid seteuid setreuid setresuid setproctitle socketpair\
- setrgid setegid setregid setresgid issetugid pause lchown lchmod\
- getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\
- getpriority getrlimit setrlimit sysconf group_member\
- dlopen sigprocmask sigaction sigsetjmp _setjmp _longjmp vsnprintf snprintf\
- setsid telldir seekdir fchmod cosh sinh tanh log2 round signbit\
- setuid setgid daemon select_large_fdset setenv unsetenv\
- mktime timegm clock_gettime gettimeofday\
- pread sendfile)
-
-AC_CACHE_CHECK(for __builtin_setjmp, ac_cv_func___builtin_setjmp,
-[AC_TRY_LINK([@%:@include <setjmp.h>
- jmp_buf jb; void t(v) int v; {__builtin_longjmp(jb, v);}],
- [__builtin_setjmp(jb);],
- [ac_cv_func___builtin_setjmp=yes],
- [ac_cv_func___builtin_setjmp=no])
-])
-
-test x$ac_cv_func__longjmp = xno && ac_cv_func__setjmp=no
-
-AC_MSG_CHECKING(for setjmp type)
-AC_ARG_WITH(setjmp-type,
- [ --with-setjmp-type select setjmp type], [
- case $withval in
- __builtin_setjmp) setjmp_prefix=__builtin_;;
- _setjmp) setjmp_prefix=_;;
- sigsetjmp) setjmp_prefix=sig;;
- setjmp) setjmp_prefix=;;
- '') unset setjmp_prefix;;
- *) AC_MSG_ERROR(invalid setjmp type: $withval);;
- esac], [unset setjmp_prefix])
-if test ${setjmp_prefix+set}; then
- if test "${setjmp_prefix}" && eval test '$ac_cv_func_'${setjmp_prefix}setjmp = no; then
- AC_MSG_ERROR(${setjmp_prefix}setjmp is not available)
- fi
-elif test "$ac_cv_func___builtin_setjmp" = yes; then
- setjmp_prefix=__builtin_
-elif test "$ac_cv_func__setjmp" = yes; then
- setjmp_prefix=_
-elif test "$ac_cv_func_sigsetjmp" = yes; then
- case $target_os in
- solaris*|cygwin*)
- setjmp_prefix=;;
- *)
- setjmp_prefix=sig;;
- esac
-else
- setjmp_prefix=
-fi
-if test x$setjmp_prefix = xsig; then
- setjmp_sigmask=yes
-else
- unset setjmp_sigmask
-fi
-AC_MSG_RESULT(${setjmp_prefix}setjmp)
-AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp(env${setjmp_sigmask+,0})])
-AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp(env,val)])
-AC_DEFINE_UNQUOTED(RUBY_JMP_BUF, ${setjmp_sigmask+${setjmp_prefix}}jmp_buf)
-
-AC_ARG_ENABLE(setreuid,
- [ --enable-setreuid use setreuid()/setregid() according to need even if obsolete.],
- [use_setreuid=$enableval])
-if test "$use_setreuid" = yes; then
- AC_DEFINE(USE_SETREUID)
- AC_DEFINE(USE_SETREGID)
-fi
-AC_STRUCT_TIMEZONE
-AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff,
- [AC_TRY_COMPILE([#include <time.h>],
- [struct tm t; t.tm_gmtoff = 3600;],
- [rb_cv_member_struct_tm_tm_gmtoff=yes],
- [rb_cv_member_struct_tm_tm_gmtoff=no])])
-if test "$rb_cv_member_struct_tm_tm_gmtoff" = yes; then
- AC_DEFINE(HAVE_STRUCT_TM_TM_GMTOFF)
-fi
-AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
- [AC_TRY_LINK([#include <time.h>
- int i;],
- [i = daylight;],
- rb_cv_have_daylight=yes,
- rb_cv_have_daylight=no)])
-if test "$rb_cv_have_daylight" = yes; then
- AC_DEFINE(HAVE_DAYLIGHT)
-fi
-AC_DEFUN([RUBY_CHECK_VARTYPE], [dnl
-AC_CACHE_CHECK([for external $1], rb_cv_var_$1,
- [rb_cv_var_$1=no
- AC_TRY_COMPILE([
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 1
-#endif
-$2
-;
-const volatile void *volatile t;],
- [t = &(&$1)[0];],
- [for t in $3; do
- AC_TRY_COMPILE([
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 1
-#endif
-$2
-;
-extern $t $1;
-const volatile void *volatile t;],
- [t = &(&$1)[0];],
- [rb_cv_var_$1=$t; break])
- done])])
-if test "[$rb_cv_var_]$1" != no; then
- AC_DEFINE([HAVE_VAR_]m4_toupper($1))
- AC_DEFINE_UNQUOTED([TYPEOF_VAR_]m4_toupper($1), $rb_cv_var_$1)
-fi])
-RUBY_CHECK_VARTYPE(timezone, [@%:@include <time.h>], [long int])
-RUBY_CHECK_VARTYPE(altzone, [@%:@include <time.h>], [long int])
-if test "$rb_cv_var_timezone" = no; then
- AC_CHECK_FUNCS(timezone)
- if test "$ac_cv_func_timezone" = yes; then
- AC_CACHE_CHECK([whether timezone requires zero arguments], rb_cv_func_timezone_void,
- [AC_TRY_COMPILE([@%:@include <time.h>],
- [(void)timezone(0, 0);],
- [rb_cv_func_timezone_void=no],
- [rb_cv_func_timezone_void=yes])]
- )
- if test $rb_cv_func_timezone_void = yes; then
- AC_DEFINE(TIMEZONE_VOID)
- fi
- fi
-fi
-
-AC_CACHE_CHECK(for negative time_t for gmtime(3), rb_cv_negative_time_t,
- [AC_TRY_RUN([
-#include <time.h>
-
-void
-check(tm, y, m, d, h, s)
- struct tm *tm;
- int y, m, d, h, s;
-{
- if (!tm ||
- tm->tm_year != y ||
- tm->tm_mon != m-1 ||
- tm->tm_mday != d ||
- tm->tm_hour != h ||
- tm->tm_sec != s) {
- exit(1);
- }
-}
-
-int
-main()
-{
- time_t t = -1;
- struct tm *tm;
-
- check(gmtime(&t), 69, 12, 31, 23, 59);
- t = ~(time_t)0 << 31;
- check(gmtime(&t), 1, 12, 13, 20, 52);
- return 0;
-}
-],
- rb_cv_negative_time_t=yes,
- rb_cv_negative_time_t=no,
- rb_cv_negative_time_t=yes)])
-if test "$rb_cv_negative_time_t" = yes; then
- AC_DEFINE(NEGATIVE_TIME_T)
-fi
-
-if test "$ac_cv_func_sigprocmask" = yes && test "$ac_cv_func_sigaction" = yes; then
- AC_DEFINE(POSIX_SIGNAL)
-else
- AC_CHECK_FUNCS(sigsetmask)
- AC_CACHE_CHECK(for BSD signal semantics, rb_cv_bsd_signal,
- [AC_TRY_RUN([
-#include <stdio.h>
-#include <signal.h>
-
-void
-sig_handler(dummy)
- int dummy;
-{
-}
-
-int
-main()
-{
- signal(SIGINT, sig_handler);
- kill(getpid(), SIGINT);
- kill(getpid(), SIGINT);
- return 0;
-}
-],
- rb_cv_bsd_signal=yes,
- rb_cv_bsd_signal=no,
- rb_cv_bsd_signal=$ac_cv_func_sigsetmask)])
- if test "$rb_cv_bsd_signal" = yes; then
- AC_DEFINE(BSD_SIGNAL)
- fi
-fi
-
-AC_FUNC_GETPGRP
-AC_FUNC_SETPGRP
-
-AC_C_BIGENDIAN
-AC_C_CONST
-AC_C_CHAR_UNSIGNED
-AC_C_INLINE
-AC_C_VOLATILE
-
-if test x"$target_cpu" = xia64; then
- AC_LIBOBJ([ia64])
- AC_CACHE_CHECK(for __libc_ia64_register_backing_store_base,
- rb_cv___libc_ia64_register_backing_store_base,
- [rb_cv___libc_ia64_register_backing_store_base=no
- AC_TRY_LINK(
- [extern unsigned long __libc_ia64_register_backing_store_base;],
- [unsigned long p = __libc_ia64_register_backing_store_base;
- printf("%ld\n", p);],
- [rb_cv___libc_ia64_register_backing_store_base=yes])])
- if test $rb_cv___libc_ia64_register_backing_store_base = yes; then
- AC_DEFINE(HAVE___LIBC_IA64_REGISTER_BACKING_STORE_BASE)
- fi
-fi
-
-AC_CACHE_CHECK(whether right shift preserve sign bit, rb_cv_rshift_sign,
- [AC_TRY_RUN([
-int
-main()
-{
- if (-1==(-1>>1))
- return 0;
- return 1;
-}
-],
- rb_cv_rshift_sign=yes,
- rb_cv_rshift_sign=no,
- rb_cv_rshift_sign=yes)])
-if test "$rb_cv_rshift_sign" = yes; then
- AC_DEFINE(RSHIFT(x,y), ((x)>>(int)y))
-else
- AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>y) : (x)>>y))
-fi
-
-AC_MSG_CHECKING(read count field in FILE structures)
-AC_CACHE_VAL(rb_cv_fcnt,
-[for fcnt in dnl
- _cnt dnl
- __cnt dnl
- _r dnl
- readCount dnl
- _rcount dnl for emx0.9c
-; do
- AC_TRY_COMPILE([#include <stdio.h>
-],
- [FILE *f = stdin; f->$fcnt = 0;],
- rb_cv_fcnt="$fcnt"; break,
- rb_cv_fcnt="not found")
-done])
-if test "$rb_cv_fcnt" = "not found"; then
- AC_MSG_RESULT([not found(OK if using GNU libc)])
-else
- AC_MSG_RESULT($rb_cv_fcnt)
- AC_DEFINE_UNQUOTED(FILE_COUNT, $rb_cv_fcnt)
-fi
-
-AC_MSG_CHECKING(read buffer ptr field in FILE structures)
-AC_CACHE_VAL(rb_cv_frptr,
-[for frptr in dnl
- _IO_read_ptr dnl
- _ptr dnl
- __ptr dnl
- bufpos dnl
- _p dnl
-; do
- AC_TRY_COMPILE([#include <stdio.h>
-],
- [FILE *f = stdin; char buf[256]; f->$frptr = buf;],
- rb_cv_frptr="$frptr"; break,
- rb_cv_frptr="not found")
-done])
-if test "$rb_cv_frptr" = "not found"; then
- AC_MSG_RESULT([not found])
-else
- AC_MSG_RESULT($rb_cv_frptr)
- AC_DEFINE_UNQUOTED(FILE_READPTR, $rb_cv_frptr)
-
- if test "$rb_cv_fcnt" = "not found"; then
- AC_MSG_CHECKING(read buffer end field in FILE structures)
- AC_CACHE_VAL(rb_cv_frend,
- [for frend in dnl
- _IO_read_end dnl
- bufread dnl
- ; do
- AC_TRY_COMPILE([#include <stdio.h>
- ],
- [FILE *f = stdin; char buf[256]; f->$frend = buf;],
- rb_cv_frend="$frend"; break,
- rb_cv_frend="not found")
- done])
- if test "$rb_cv_frend" = "not found"; then
- AC_MSG_RESULT([not found])
- else
- AC_MSG_RESULT($rb_cv_frend)
- AC_DEFINE_UNQUOTED(FILE_READEND, $rb_cv_frend)
- fi
- fi
-fi
-
-AC_CACHE_CHECK([whether st_ino is huge], rb_cv_huge_st_ino,
-[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([
-#include <sys/stat.h>
-struct stat test_stat;
-], [sizeof(test_stat.st_ino)>sizeof(long)])],
-rb_cv_huge_st_ino=yes,
-rb_cv_huge_st_ino=no)
-])
-if test $rb_cv_huge_st_ino = yes; then
- AC_DEFINE(HUGE_ST_INO)
-fi
-
-if test "$ac_cv_func_sysconf" = yes; then
- AC_DEFUN([RUBY_CHECK_SYSCONF], [dnl
- AC_CACHE_CHECK([whether _SC_$1 is supported], rb_cv_have_sc_[]m4_tolower($1),
- [AC_TRY_COMPILE([#include <unistd.h>
- ],
- [_SC_$1 >= 0],
- rb_cv_have_sc_[]m4_tolower($1)=yes,
- rb_cv_have_sc_[]m4_tolower($1)=no)
- ])
- if test "$rb_cv_have_sc_[]m4_tolower($1)" = yes; then
- AC_DEFINE(HAVE__SC_$1)
- fi
- ])
- RUBY_CHECK_SYSCONF(CLK_TCK)
-fi
-
-case "$target_cpu" in
-m68*|i?86|ia64|sparc*|alpha*) rb_cv_stack_grow_dir=-1;;
-hppa*) rb_cv_stack_grow_dir=+1;;
-esac
-AC_CACHE_CHECK(stack growing direction, rb_cv_stack_grow_dir,
- [AC_TRY_RUN([
-/* recurse to get rid of inlining */
-static int
-stack_growup_p(addr, n)
- volatile int *addr, n;
-{
- volatile int end;
- if (n > 0)
- return *addr = stack_growup_p(addr, n - 1);
- else
- return (&end > addr);
-}
-int main()
-{
- int x;
- return stack_growup_p(&x, 10);
-}
-], rb_cv_stack_grow_dir=-1, rb_cv_stack_grow_dir=+1, rb_cv_stack_grow_dir=0)])
-AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $rb_cv_stack_grow_dir)
-
-if test x"$enable_pthread" = xyes; then
- for pthread_lib in thr pthread pthreads c c_r; do
- AC_CHECK_LIB($pthread_lib, pthread_kill,
- rb_with_pthread=yes, rb_with_pthread=no)
- if test "$rb_with_pthread" = "yes"; then break; fi
- done
- if test x"$rb_with_pthread" = xyes; then
- AC_DEFINE(_REENTRANT)
- AC_DEFINE(_THREAD_SAFE)
- AC_DEFINE(HAVE_LIBPTHREAD)
- case $pthread_lib in
- c)
- ;;
- c_r)
- MAINLIBS="-pthread $MAINLIBS"
- ;;
- *)
- LIBS="-l$pthread_lib $LIBS"
- ;;
- esac
- else
- AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled")
- fi
- AC_CHECK_FUNCS(nanosleep)
- if test x"$ac_cv_func_nanosleep" = xno; then
- AC_CHECK_LIB(rt, nanosleep)
- if test x"$ac_cv_lib_rt_nanosleep" = xyes; then
- AC_DEFINE(HAVE_NANOSLEEP)
- fi
- fi
-fi
-if test x"$ac_cv_header_ucontext_h" = xyes; then
- if test x"$rb_with_pthread" = xyes; then
- AC_CHECK_FUNCS(getcontext setcontext)
- fi
-fi
-
-AC_CHECK_FUNCS(backtrace)
-
-AC_ARG_WITH(valgrind,
- [ --with-valgrind enable valgrind memcheck support.],
- [AC_CHECK_HEADERS(valgrind/memcheck.h)])
-
-dnl wheather use dln_a_out or not
-AC_ARG_WITH(dln-a-out,
- [ --with-dln-a-out use dln_a_out if possible], [
- case $withval in
- yes) with_dln_a_out=yes;;
- *) with_dln_a_out=no;;
- esac], [with_dln_a_out=no])
-
-AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
-[AC_TRY_RUN([
-/* Test for whether ELF binaries are produced */
-#include <fcntl.h>
-#include <stdlib.h>
-main() {
- char buffer[4];
- int i=open("conftest",O_RDONLY);
- if(i==-1)
- exit(1); /* fail */
- if(read(i,&buffer[0],4)<4)
- exit(1); /* fail */
- if(buffer[0] != 127 || buffer[1] != 'E' ||
- buffer[2] != 'L' || buffer[3] != 'F')
- exit(1); /* fail */
- exit(0); /* succeed (yes, it's ELF) */
-}
-],
-rb_cv_binary_elf=yes,
-rb_cv_binary_elf=no,
-rb_cv_binary_elf=yes)])
-
-if test "$rb_cv_binary_elf" = yes; then
- AC_DEFINE(USE_ELF)
-fi
-
-case "$target_os" in
-linux* | gnu* | k*bsd*-gnu | bsdi*)
- if test "$rb_cv_binary_elf" = no; then
- with_dln_a_out=yes
- else
- LDFLAGS="$LDFLAGS -rdynamic"
- fi;;
-esac
-LIBEXT=a
-
-AC_SUBST(DLDFLAGS)dnl
-AC_SUBST(ARCH_FLAG)dnl
-
-AC_SUBST(STATIC)dnl
-AC_SUBST(CCDLFLAGS)dnl
-AC_SUBST(LDSHARED)dnl
-AC_SUBST(LDSHAREDXX)dnl
-AC_SUBST(DLEXT)dnl
-AC_SUBST(DLEXT2)dnl
-AC_SUBST(LIBEXT)dnl
-
-STATIC=
-: ${LIBPATHFLAG=' -L%s'}
-: ${PATHFLAG=''}
-
-if test "$with_dln_a_out" != yes; then
- rb_cv_dlopen=unknown
- AC_MSG_CHECKING(whether OS depend dynamic link works)
- if test "$GCC" = yes; then
- case "$target_os" in
- nextstep*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
- openstep*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
- rhapsody*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
- darwin*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
- human*|bsdi*|beos*|cygwin*|mingw*|aix*|interix*) ;;
- *) CCDLFLAGS="$CCDLFLAGS -fPIC";;
- esac
- else
- case "$target_os" in
- hpux*) CCDLFLAGS="$CCDLFLAGS +Z";;
- solaris*|irix*) CCDLFLAGS="$CCDLFLAGS -KPIC" ;;
- sunos*) CCDLFLAGS="$CCDLFLAGS -PIC" ;;
- esix*|uxpds*) CCDLFLAGS="$CCDLFLAGS -KPIC" ;;
- *) : ${CCDLFLAGS=""} ;;
- esac
- fi
-
-
- AC_ARG_ENABLE(rpath,
- [ --disable-rpath embed run path into extension libraries.],
- [enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"])
- if test "$enable_rpath" = yes; then
- LIBPATHFLAG=" -L%1\$-s"
- RPATHFLAG=" ${linker_flag}-R%1\$-s"
- fi
-
- case "$target_os" in
- hpux*) DLDFLAGS="$DLDFLAGS -E"
- : ${LDSHARED='ld -b'}
- XLDFLAGS="$XLDFLAGS -Wl,-E"
- : ${LIBPATHENV=SHLIB_PATH}
- if test "$rb_cv_prog_gnu_ld" = no; then
- RPATHFLAG=' +b %1$-s'
- fi
- rb_cv_dlopen=yes;;
- solaris*) if test "$GCC" = yes; then
- : ${LDSHARED='$(CC) -shared'}
- if test "$rb_cv_prog_gnu_ld" = yes; then
- LDFLAGS="$LDFLAGS -Wl,-E"
- fi
- else
- : ${LDSHARED='ld -G'}
- fi
- rb_cv_dlopen=yes;;
- sunos*) : ${LDSHARED='ld -assert nodefinitions'}
- rb_cv_dlopen=yes;;
- irix*) : ${LDSHARED='ld -shared'}
- rb_cv_dlopen=yes;;
- sysv4*) : ${LDSHARED='ld -G'}
- rb_cv_dlopen=yes;;
- nto-qnx*) : ${LDSHARED="qcc -shared"}
- rb_cv_dlopen=yes ;;
- esix*|uxpds*) : ${LDSHARED="ld -G"}
- rb_cv_dlopen=yes ;;
- osf*) : ${LDSHARED="ld -shared -expect_unresolved \"*\""}
- rb_cv_dlopen=yes ;;
- bsdi3*) case "$CC" in
- *shlicc*) : ${LDSHARED="$CC -r"}
- rb_cv_dlopen=yes ;;
- esac ;;
- linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi*)
- : ${LDSHARED='${CC} -shared'}
- if test "$rb_cv_binary_elf" = yes; then
- LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
- fi
- rb_cv_dlopen=yes ;;
- interix*) : ${LDSHARED="$CC -shared"}
- XLDFLAGS="$XLDFLAGS -Wl,-E"
- LIBPATHFLAG=" -L%1\$-s"
- rb_cv_dlopen=yes ;;
- freebsd*|dragonfly*) : ${LDSHARED="$CC -shared"}
- if test "$rb_cv_binary_elf" = yes; then
- LDFLAGS="$LDFLAGS -rdynamic"
- DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$(.TARGET)'
- else
- test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED="ld -Bshareable"
- fi
- rb_cv_dlopen=yes ;;
- openbsd*) : ${LDSHARED="\$(CC) -shared ${CCDLFLAGS}"}
- if test "$rb_cv_binary_elf" = yes; then
- LDFLAGS="$LDFLAGS -Wl,-E"
- fi
- rb_cv_dlopen=yes ;;
- nextstep*) : ${LDSHARED='cc -r -nostdlib'}
- LDFLAGS="$LDFLAGS -u libsys_s"
- rb_cv_dlopen=yes ;;
- openstep*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress'}
- : ${LDFLAGS=""}
- rb_cv_dlopen=yes ;;
- rhapsody*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress'}
- : ${LDFLAGS=""}
- rb_cv_dlopen=yes ;;
- darwin*) : ${LDSHARED='$(CC) -dynamic -bundle -undefined suppress -flat_namespace'}
- : ${LDFLAGS=""}
- : ${LIBPATHENV=DYLD_LIBRARY_PATH}
- rb_cv_dlopen=yes ;;
- aix*) if test "$GCC" = yes; then
- : ${LDSHARED='$(CC) -shared'}
- else
- : ${LDSHARED='$(CC)'}
- fi
- LDSHARED="$LDSHARED ${linker_flag}-G"
- DLDFLAGS='-eInit_$(TARGET)'
- XLDFLAGS="${linker_flag}-bE:ruby.imp ${linker_flag}-brtl"
- : ${ARCHFILE="ruby.imp"}
- TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)'
- TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LOCAL_LIBS) $(LIBS)'
- : ${LIBPATHENV=SHLIB_PATH}
- rb_cv_dlopen=yes ;;
- human*) : ${DLDFLAGS=''}
- : ${LDSHARED=''}
- : ${LDFLAGS=''}
- : ${LINK_SO='ar cru $@ $(OBJS)'}
- rb_cv_dlopen=yes ;;
- beos*) case "$target_cpu" in
- powerpc*)
- : ${LDSHARED="ld -xms"}
- DLDFLAGS="$DLDFLAGS "'-export Init_$(TARGET) -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
- ;;
- i586*)
- : ${LDSHARED="ld -shared"}
- DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -lbe -lroot"
- ;;
- esac
- : ${LIBPATHENV=LIBRARY_PATH}
- rb_cv_dlopen=yes ;;
- nto-qnx*) DLDFLAGS="$DLDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
- : ${LDSHARED='ld -Bshareable -x'}
- LDFLAGS="$LDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
- rb_cv_dlopen=yes;;
- cygwin*|mingw*) : ${LDSHARED="${CC} -shared -s"}
- XLDFLAGS="$XLDFLAGS -Wl,--stack,0x00200000"
- DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import,--export-all"
- : ${LIBPATHENV=""}
- rb_cv_dlopen=yes ;;
- hiuxmpp) : ${LDSHARED='ld -r'} ;;
- atheos*) : ${LDSHARED="$CC -shared"}
- rb_cv_dlopen=yes ;;
- os2-emx*) LDFLAGS="$LDFLAGS -Zbsd-signals"
- ;;
- *) : ${LDSHARED='ld'} ;;
- esac
- AC_MSG_RESULT($rb_cv_dlopen)
-fi
-if test "${LDSHAREDXX}" = ""; then
- case "${LDSHARED}" in
- *'$(CC)'*)
- LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\$(CC)/$(CXX)/'`
- ;;
- *'${CC}'*)
- LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\${CC}/${CXX}/'`
- ;;
- *$CC*)
- LDSHAREDXX=`echo "${LDSHARED}" | sed "s|$CC|$CXX|"`
- ;;
- ld" "*)
- ;;
- esac
-fi
-
-AC_SUBST(LINK_SO)
-AC_SUBST(LIBPATHFLAG)
-AC_SUBST(RPATHFLAG)
-AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}")
-AC_SUBST(TRY_LINK)
-
-dln_a_out_works=no
-if test "$ac_cv_header_a_out_h" = yes; then
- if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then
- cat confdefs.h > config.h
- AC_CACHE_CHECK(whether matz's dln works, rb_cv_dln_a_out,
- [AC_TRY_COMPILE([
-#define USE_DLN_A_OUT
-#include "dln.c"
-],
- [],
- rb_cv_dln_a_out=yes,
- rb_cv_dln_a_out=no)])
- if test "$rb_cv_dln_a_out" = yes; then
- dln_a_out_works=yes
- AC_DEFINE(USE_DLN_A_OUT)
- fi
- fi
-fi
-
-if test "$dln_a_out_works" = yes; then
- if test "$GCC" = yes; then
- STATIC=-static
- else
- STATIC=-Bstatic
- fi
- DLEXT=so
- CCDLFLAGS=
-else
- case "$target_os" in
- hpux*) DLEXT=sl;;
- nextstep*) DLEXT=bundle;;
- openstep*) DLEXT=bundle;;
- rhapsody*) DLEXT=bundle;;
- darwin*) DLEXT=bundle;;
- os2-emx*) DLEXT=dll;;
- cygwin*|mingw*) DLEXT=so;;
- *) DLEXT=so;;
- esac
-fi
-len=2 # .rb
-n=`expr "$DLEXT" : '.*'`; test "$n" -gt "$len" && len=$n
-n=`expr "$DLEXT2" : '.*'`; test "$n" -gt "$len" && len=$n
-AC_DEFINE_UNQUOTED(DLEXT_MAXLEN, `expr $len + 1`)
-test ".$DLEXT" = "." || AC_DEFINE_UNQUOTED(DLEXT, ".$DLEXT")
-test ".$DLEXT2" = "." || AC_DEFINE_UNQUOTED(DLEXT2, ".$DLEXT2")
-AC_SUBST(DLEXT)
-
-AC_SUBST(STRIP)dnl
-if test "$with_dln_a_out" = yes; then
- STRIP=true
-else
- STRIP=strip
-fi
-
-case "$target_os" in
- linux* | gnu* | k*bsd*-gnu)
- STRIP='strip -S -x';;
- nextstep*)
- STRIP='strip -A -n';;
- openstep*)
- STRIP='strip -A -n';;
- rhapsody*)
- STRIP='strip -A -n';;
- darwin*)
- STRIP='strip -A -n';;
-esac
-
-EXTSTATIC=
-AC_SUBST(EXTSTATIC)dnl
-AC_ARG_WITH(static-linked-ext,
- [ --with-static-linked-ext link external modules statically],
- [case $withval in
- yes) STATIC=
- EXTSTATIC=static;;
- *) ;;
- esac])
-
-case "$target_os" in
- human*)
- AC_CHECK_LIB(signal, _harderr)
- AC_CHECK_LIB(hmem, hmemset)
- AC_CHECK_FUNCS(select)
- AC_CACHE_CHECK(whether PD libc _dtos18 fail to convert big number,
- rb_cv_missing__dtos18,
- [AC_TRY_RUN(
-changequote(<<, >>)dnl
-<<
-#include <stdio.h>
-main ()
-{
- char buf[256];
- sprintf (buf, "%g", 1e+300);
- exit (strcmp (buf, "1e+300") ? 0 : 1);
-}
->>,
-changequote([, ])dnl
-rb_cv_missing__dtos18=yes, rb_cv_missing__dtos18=no, rb_cv_missing__dtos18=no)])
- if test "$rb_cv_missing__dtos18" = yes; then
- AC_DEFINE(MISSING__DTOS18)
- fi
- AC_CACHE_CHECK(whether PD libc fconvert fail to round,
- rb_cv_missing_fconvert,
- [AC_TRY_RUN(
-changequote(<<, >>)dnl
-<<
-#include <stdio.h>
-#include <math.h>
-main ()
-{
- char buf[256];
- sprintf (buf, "%f", log(exp(1.0)));
- exit (strcmp (buf, "1.000000") ? 0 : 1);
-}
->>,
-changequote([, ])dnl
-rb_cv_missing_fconvert=yes, rb_cv_missing_fconvert=no, rb_cv_missing_fconvert=no)])
- if test "$rb_cv_missing_fconvert" = yes; then
- AC_DEFINE(MISSING_FCONVERT)
- fi
- AC_LIBOBJ([x68.o])
- CFLAGS="$CFLAGS -fansi-only"
- XCFLAGS="$XCFLAGS -cc1-stack=262144 -cpp-stack=2694144"
- EXEEXT=.x
- OBJEXT=o
- setup=Setup.x68
- ;;
- dnl OS/2 environment w/ Autoconf 2.1x for EMX
- os2-emx)
- AC_LIBOBJ([os2])
- setup=Setup.emx
- ;;
- *djgpp*)
- setup=Setup.dj
- ;;
- *)
- setup=Setup
- ;;
-esac
-
-AC_SUBST(setup)
-
-if test "$prefix" = NONE; then
- prefix=$ac_default_prefix
-fi
-
-if test x"$fat_binary" != xno ; then
- echo "*** building as a fat binary, with arch flags $ARCH_FLAG"
- CFLAGS="$CFLAGS $ARCH_FLAG"
- LDSHARED="$LDSHARED $ARCH_FLAG"
- LIBRUBY_LDSHARED="LIBRUBY_LDSHARED $ARCH_FLAG"
-fi
-
-if test x"$cross_compiling" = xyes; then
- test x"$MINIRUBY" = x && MINIRUBY="${RUBY-ruby} -I`pwd` -rfake"
- PREP=fake.rb
- RUNRUBY='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
-else
- MINIRUBY='./miniruby$(EXEEXT) -I$(srcdir)/lib'
- MINIRUBY="$MINIRUBY"' -I$(EXTOUT)/common -I./- -r$(srcdir)/ext/purelib.rb'
- PREP='miniruby$(EXEEXT)'
- RUNRUBY='$(MINIRUBY) $(srcdir)/runruby.rb --extout=$(EXTOUT)'
-fi
-AC_SUBST(MINIRUBY)
-AC_SUBST(PREP)
-AC_SUBST(RUNRUBY)
-AC_SUBST(EXTOUT, [${EXTOUT=.ext}])
-
-FIRSTMAKEFILE=""
-LIBRUBY_A='lib$(RUBY_SO_NAME)-static.a'
-LIBRUBY='$(LIBRUBY_A)'
-LIBRUBYARG_STATIC='-l$(RUBY_SO_NAME)-static'
-LIBRUBYARG='$(LIBRUBYARG_STATIC)'
-SOLIBS=
-
-case "$target_os" in
- cygwin*|mingw*|beos*|openstep*|nextstep*|rhapsody*|darwin*|os2-emx*)
- : ${DLDLIBS=""}
- ;;
- *)
- DLDLIBS="$DLDLIBS -lc"
- ;;
-esac
-
-RUBY_SO_NAME='$(RUBY_INSTALL_NAME)'
-LIBRUBY_LDSHARED=$LDSHARED
-LIBRUBY_DLDFLAGS=$DLDFLAGS
-LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY)'
-LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so'
-ENABLE_SHARED=yes
-
-AC_ARG_ENABLE(shared,
- [ --enable-shared build a shared library for Ruby. ],
- [enable_shared=$enableval], [enable_shared=$enable_shared_default])
-if test "$enable_shared" = 'yes'; then
- LIBRUBY='$(LIBRUBY_SO)'
- LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
- LIBRUBYARG='$(LIBRUBYARG_SHARED)'
- CFLAGS="$CFLAGS $CCDLFLAGS"
- ENABLE_SHARED=yes
- if test "$rb_cv_binary_elf" = yes; then
- SOLIBS='$(LIBS)'
- fi
- case "$target_os" in
- sunos4*)
- LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
- ;;
- linux* | gnu* | k*bsd*-gnu | atheos*)
- LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'
- LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
- ;;
- freebsd*|dragonfly*)
- SOLIBS='$(LIBS)'
- LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
- if test "$rb_cv_binary_elf" != "yes" ; then
- LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
- LIBRUBY_ALIASES=''
- fi
- ;;
- netbsd*)
- SOLIBS='$(LIBS)'
- LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
- LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
- if test "$rb_cv_binary_elf" = yes; then # ELF platforms
- LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so'
- else # a.out platforms
- LIBRUBY_ALIASES=""
- fi
- ;;
- openbsd*)
- SOLIBS='$(LIBS)'
- LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).'`expr ${MINOR} \* 10 + ${TEENY}`
- ;;
- solaris*)
- SOLIBS='$(LIBS)'
- LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)'
- LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY) lib$(RUBY_SO_NAME).so'
- if test "$GCC" = yes; then
- LIBRUBY_DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(@F)'
- fi
- XLDFLAGS="$XLDFLAGS "'-R${libdir}'
- ;;
- hpux*)
- XLDFLAGS="$XLDFLAGS "'-Wl,+s,+b,$(libdir)'
- LIBRUBY_SO='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR).$(TEENY)'
- LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).sl'
- ;;
- aix*)
- LIBRUBY_DLDFLAGS="${linker_flag}-bnoentry $XLDFLAGS"
- LIBRUBYARG_SHARED='-L${libdir} -l${RUBY_SO_NAME}'
- SOLIBS='-lm -lc'
- ;;
- beos*)
- case "$target_cpu" in
- powerpc*)
- LIBRUBY_DLDFLAGS='-f ruby.exp -lnet -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
- ;;
- esac
- ;;
- darwin*)
- LIBRUBY_SO='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib'
- LIBRUBY_LDSHARED='cc -dynamiclib -undefined suppress -flat_namespace'
- LIBRUBY_DLDFLAGS='-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
- LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib'
- ;;
- interix*)
- LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)'
- ;;
- *)
- ;;
- esac
-fi
-if test "$enable_rpath" = yes; then
- LIBRUBYARG_SHARED="${linker_flag}-R ${linker_flag}\$(libdir) -L\$(libdir) $LIBRUBYARG_SHARED"
-fi
-
-LDFLAGS="-L. $LDFLAGS"
-AC_SUBST(ARCHFILE)
-
-dnl build rdoc index if requested
-RDOCTARGET=""
-AC_ARG_ENABLE(install-doc,
- [ --disable-install-doc do not install rdoc indexes during install ],
- [install_doc=$enableval], [install_doc=yes])
-if test "$install_doc" != no; then
- RDOCTARGET="install-doc"
-fi
-AC_SUBST(RDOCTARGET)
-
-if test "$rb_with_pthread" = "yes"; then
- THREAD_MODEL=pthread
-fi
-MINIDLNOBJ=dln.o
-case "$target_os" in
- linux*)
- ;;
- netbsd*)
- CFLAGS="$CFLAGS -pipe"
- ;;
- nextstep*|openstep*)
- # The -fno-common is needed if we wish to embed the Ruby interpreter
- # into a plugin module of some project (as opposed to embedding it
- # within the project's application). The -I/usr/local/include is
- # needed because CPP as discovered by configure (cc -E -traditional)
- # fails to consult /usr/local/include by default. This causes
- # mkmf.rb's have_header() to fail if the desired resource happens to be
- # installed in the /usr/local tree.
- CFLAGS="$CFLAGS -pipe -fno-common"
- CPPFLAGS="$CPPFLAGS -I/usr/local/include"
- ;;
- rhapsody*)
- CFLAGS="$CFLAGS -pipe -no-precomp -fno-common"
- ;;
- darwin*)
- XCFLAGS="$XCFLAGS"
- CFLAGS="$CFLAGS -pipe -fno-common"
- MINIDLNOBJ=dmydln.o
- ;;
- os2-emx)
- CFLAGS="$CFLAGS -DOS2 -Zmts"
- LIBRUBY_A=`echo $LIBRUBY_A | sed 's/^lib//'`
- LIBRUBY_SO=`echo $LIBRUBY_SO | sed 's/^lib//'`
- LIBRUBY_ALIASES=`for i in $LIBRUBY_ALIASES; do echo "$i"; done | sed 's/^lib//'`
- ;;
- osf*)
- if test "$GCC" != "yes" ; then
- # compile something small: taint.c is fine for this.
- # the main point is the '-v' flag of 'cc'.
- case "`cc -v -I. -c main.c -o /tmp/main.o 2>&1`" in
- */gemc_cc*) # we have the new DEC GEM CC
- CFLAGS="$CFLAGS -oldc"
- ;;
- *) # we have the old MIPS CC
- ;;
- esac
- # cleanup
- rm -f /tmp/main.o
- CFLAGS="$CFLAGS -std"
- fi
- ;;
- beos*)
- case "$target_cpu" in
- powerpc*)
- CFLAGS="$CFLAGS -relax_pointers"
- ;;
- esac
- ;;
- cygwin*|mingw*)
- LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
- case "$target_os" in
- cygwin*)
- if test x"$enable_shared" = xyes; then
- LIBRUBY_SO='cyg$(RUBY_SO_NAME)'${MAJOR}${MINOR}${TEENY}.dll
- fi
- ;;
- mingw*)
- RUBY_SO_NAME=${rb_cv_msvcrt}-'$(RUBY_INSTALL_NAME)'${MAJOR}${MINOR}${TEENY}
- if test x"$enable_shared" = xyes; then
- LIBRUBY_SO='$(RUBY_SO_NAME)'.dll
- LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
- fi
- AC_LIBOBJ([win32])
- COMMON_LIBS=m
-# COMMON_MACROS="WIN32_LEAN_AND_MEAN="
- COMMON_HEADERS="winsock2.h windows.h"
- THREAD_MODEL=win32
- ;;
- esac
- LIBRUBY_ALIASES=''
- FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
- SOLIBS='$(LIBS)'
- if test x"$enable_shared" = xyes; then
- LIBRUBY='lib$(RUBY_SO_NAME).dll.a'
- else
- LIBRUBY_SO=dummy
- LIBRUBY='lib$(RUBY_SO_NAME).a'
- LIBRUBYARG='-l$(RUBY_SO_NAME)'
- fi
- MINIDLNOBJ=dmydln.o
- ;;
- hpux*)
- case "$YACC" in
- *yacc*)
- XCFLAGS="$XCFLAGS -DYYMAXDEPTH=300"
- YACC="$YACC -Nl40000 -Nm40000"
- ;;
- esac
- MINIDLNOBJ=dmydln.o
- ;;
- *)
- ;;
-esac
-MINIOBJS="$MINIDLNOBJ"
-
-case "$build_os" in
- *msdosdjgpp*) FIRSTMAKEFILE=GNUmakefile:djgpp/GNUmakefile.in;;
-esac
-
-CPPFLAGS="$CPPFLAGS "'$(DEFS)'
-test -z "$CFLAGS" || CFLAGS="$CFLAGS "; CFLAGS="$CFLAGS"'${cflags}'
-test -z "$CPPFLAGS" || CPPFLAGS="$CPPFLAGS "; CPPFLAGS="$CPPFLAGS"'${cppflags}'
-AC_SUBST(cppflags, [])dnl
-AC_SUBST(cflags, ['${optflags} ${debugflags} ${warnflags}'])dnl
-AC_SUBST(optflags)dnl
-AC_SUBST(debugflags)dnl
-AC_SUBST(warnflags)dnl
-AC_SUBST(XCFLAGS)dnl
-AC_SUBST(XLDFLAGS)dnl
-AC_SUBST(LIBRUBY_LDSHARED)
-AC_SUBST(LIBRUBY_DLDFLAGS)
-AC_SUBST(RUBY_INSTALL_NAME)
-AC_SUBST(rubyw_install_name)
-AC_SUBST(RUBYW_INSTALL_NAME)
-AC_SUBST(RUBY_SO_NAME)
-AC_SUBST(LIBRUBY_A)
-AC_SUBST(LIBRUBY_SO)
-AC_SUBST(LIBRUBY_ALIASES)
-AC_SUBST(LIBRUBY)
-AC_SUBST(LIBRUBYARG)
-AC_SUBST(LIBRUBYARG_STATIC)
-AC_SUBST(LIBRUBYARG_SHARED)
-AC_SUBST(SOLIBS)
-AC_SUBST(DLDLIBS)
-AC_SUBST(ENABLE_SHARED)
-AC_SUBST(MAINLIBS)
-AC_SUBST(COMMON_LIBS)
-AC_SUBST(COMMON_MACROS)
-AC_SUBST(COMMON_HEADERS)
-AC_SUBST(EXPORT_PREFIX)
-AC_SUBST(MINIOBJS)
-AC_SUBST(THREAD_MODEL)
-
-MAKEFILES="Makefile `echo $FIRSTMAKEFILE | sed 's/:.*//'`"
-MAKEFILES="`echo $MAKEFILES`"
-AC_SUBST(MAKEFILES)
-
-ri_prefix=
-test "$program_prefix" != NONE &&
- ri_prefix=$program_prefix
-
-ri_suffix=
-test "$program_suffix" != NONE &&
- ri_suffix=$program_suffix
-
-RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
-case "$target_os" in
- cygwin*|mingw*)
- RUBYW_INSTALL_NAME="${ri_prefix}rubyw${ri_suffix}"
- rubyw_install_name="$RUBYW_INSTALL_NAME"
- ;;
-esac
-RUBY_LIB_PREFIX=`eval echo \\"${libdir}/ruby\\"`
-
-AC_ARG_WITH(sitedir,
- [ --with-sitedir=DIR site libraries in DIR [PREFIX/lib/ruby/site_ruby]],
- [sitedir=$withval],
- [sitedir='${libdir}/ruby/site_ruby'])
-SITE_DIR=`eval echo \\"${sitedir}\\"`
-
-AC_ARG_WITH(vendordir,
- [ --with-vendordir=DIR vendor libraries in DIR [PREFIX/lib/ruby/vendor_ruby]],
- [vendordir=$withval],
- [vendordir='${prefix}/lib/ruby/vendor_ruby'])
-VENDOR_DIR=`eval echo \\"${vendordir}\\"`
-
-case "$target_os" in
- cygwin*|mingw*|*djgpp*|os2-emx*)
- RUBY_LIB_PREFIX="`eval echo "$RUBY_LIB_PREFIX" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
- RUBY_SITE_LIB_PATH="`eval echo "$SITE_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
- RUBY_VENDOR_LIB_PATH="`eval echo "$VENDOR_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
- ;;
- *)
- RUBY_LIB_PREFIX="`eval echo \\"$RUBY_LIB_PREFIX\\" | sed 's|^NONE/|'"$prefix"'/|'`"
- RUBY_SITE_LIB_PATH="`eval echo \\"$SITE_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
- RUBY_VENDOR_LIB_PATH="`eval echo \\"$VENDOR_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
- ;;
-esac
-RUBY_LIB_PATH="${RUBY_LIB_PREFIX}/${MAJOR}.${MINOR}.${TEENY}"
-RUBY_SITE_LIB_PATH2="${RUBY_SITE_LIB_PATH}/${MAJOR}.${MINOR}.${TEENY}"
-RUBY_VENDOR_LIB_PATH2="${RUBY_VENDOR_LIB_PATH}/${MAJOR}.${MINOR}.${TEENY}"
-
-AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}")
-AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}")
-AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RUBY_SITE_LIB_PATH2}")
-AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, "${RUBY_VENDOR_LIB_PATH}")
-AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB2, "${RUBY_VENDOR_LIB_PATH2}")
-
-AC_SUBST(enable_framework)dnl
-AC_SUBST(arch)dnl
-AC_SUBST(sitearch)dnl
-AC_SUBST(sitedir)dnl
-AC_SUBST(vendordir)dnl
-
-configure_args=$ac_configure_args
-AC_SUBST(configure_args)dnl
-
-if test "$fat_binary" != no ; then
-
- case "$target_os" in
- darwin*)
- arch="universal-${target_os}"
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}")
- ;;
- *)
- arch="fat-${target_os}"
- AC_DEFINE_UNQUOTED(RUBY_THIN_ARCHLIB,
- "${RUBY_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
-
- AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB,
- "${RUBY_SITE_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
- AC_DEFINE_UNQUOTED(RUBY_VENDOR_THIN_ARCHLIB,
- "${RUBY_VENDOR_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${target_os}")
- ;;
- esac
-else
- arch="${target_cpu}-${target_os}"
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}")
-fi
-
-case "$target_os" in
- mingw*) sitearch="$target_cpu-$rb_cv_msvcrt" ;;
- *) sitearch="${arch}" ;;
-esac
-
-AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${RUBY_LIB_PATH}/${arch}")
-AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH2}/${sitearch}")
-AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCHLIB, "${RUBY_VENDOR_LIB_PATH2}/${sitearch}")
-
-AC_ARG_WITH(search-path,
- [ --with-search-path=DIR specify the additional search path],
- [search_path=$withval])
-if test "$search_path" != ""; then
- AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path")
-fi
-
-AC_ARG_WITH(rubyhdrdir,
- [ --with-ruby-hdrdir=DIR core headers in DIR [INCLUDEDIR]],
- [rubyhdrdir=$withval],
- [rubyhdrdir='${includedir}/ruby-${MAJOR}.${MINOR}.${TEENY}'])
-
-AC_ARG_WITH(sitehdrdir,
- [ --with-site-hdrdir=DIR core headers in DIR [INCLUDEDIR]],
- [sitehdrdir=$withval],
- [sitehdrdir='${rubyhdrdir}/site_ruby'])
-
-AC_ARG_WITH(vendorhdrdir,
- [ --with-vendor-hdrdir=DIR core headers in DIR [INCLUDEDIR]],
- [vendorhdrdir=$withval],
- [vendorhdrdir='${rubyhdrdir}/vendor_ruby'])
-
-AC_SUBST(rubyhdrdir)dnl
-AC_SUBST(sitehdrdir)dnl
-AC_SUBST(vendorhdrdir)dnl
-
-AC_ARG_WITH(mantype,
- [ --with-mantype=TYPE specify man page type; TYPE is one of man and doc],
- [
- case "$withval" in
- man|doc)
- MANTYPE=$withval
- ;;
- *)
- AC_MSG_ERROR(invalid man type: $withval)
- ;;
- esac
- ])
-if test -z "$MANTYPE"; then
- AC_PATH_PROGS(NROFF, nroff awf, /bin/false, "/usr/bin:/usr/ucb")
- if ${NROFF} -mdoc ${srcdir}/ruby.1 >/dev/null 2>&1; then
- MANTYPE=doc
- else
- MANTYPE=man
- fi
-fi
-AC_SUBST(MANTYPE)
-
-arch_hdrdir="${EXTOUT}/include/${arch}/ruby"
-$MAKEDIRS "${arch_hdrdir}"
-config_h="${arch_hdrdir}/config.h"
-if test -f "${config_h}" && tr -d '\015' < confdefs.h | cmp -s "${config_h}" -; then
- echo "config.h unchanged"
-else
- echo "creating config.h"
- tr -d '\015' < confdefs.h > "${config_h}"
-fi
-tr -d '\015' < largefile.h > confdefs.h
-rm largefile.h
-
-BUILTIN_ENCS=["`sed -n -e '/^BUILTIN_ENCS[ ]*=/{' \
- -e s/// -e :l -e '/\\\\$/N' -e 's/\\\\\\n/ /' -e 't l' -e p \
- -e '}' "${srcdir}/enc/Makefile.in"`"]
-BUILTIN_ENCOBJS=
-for e in $BUILTIN_ENCS; do BUILTIN_ENCOBJS="$BUILTIN_ENCOBJS `basename $e .c`"'.$(OBJEXT)'; done
-AC_SUBST(BUILTIN_ENCOBJS)
-
-AC_CONFIG_FILES($FIRSTMAKEFILE)
-AC_CONFIG_FILES(Makefile, [{
- sed '/^MISSING/s/\$U\././g' Makefile
- echo; test x"$EXEEXT" = x || echo 'miniruby: miniruby$(EXEEXT)'
- test "$RUBY_INSTALL_NAME$EXEEXT" = ruby || echo 'ruby: $(PROGRAM);'
- sed ['s/{\$([^(){}]*)[^{}]*}//g'] ${srcdir}/common.mk
- } >> confmk$$.tmp && mv -f confmk$$.tmp Makefile],
-[RUBY_INSTALL_NAME=$RUBY_INSTALL_NAME EXEEXT=$EXEEXT])
-AC_OUTPUT
Modified: MacRuby/branches/testing/dir.c
===================================================================
--- MacRuby/branches/testing/dir.c 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/dir.c 2008-06-17 01:04:32 UTC (rev 295)
@@ -1595,6 +1595,26 @@
return ary;
}
+#if WITH_OBJC
+static VALUE
+dir_globs0(VALUE args, int flags)
+{
+ VALUE ary = rb_ary_new();
+ long i, n;
+
+ for (i = 0, n = RARRAY_LEN(args); i < n; i++) {
+ int status;
+ VALUE str = RARRAY_AT(args, i);
+ StringValue(str);
+ status = push_glob(ary, RSTRING_CPTR(str), flags);
+ if (status)
+ GLOB_JUMP_TAG(status);
+ }
+
+ return ary;
+}
+#endif
+
/*
* call-seq:
* Dir[ array ] => array
@@ -1690,8 +1710,12 @@
ary = rb_push_glob(str, flags);
}
else {
+#if WITH_OBJC
+ ary = dir_globs0(ary, flags);
+#else
volatile VALUE v = ary;
ary = dir_globs(RARRAY_LEN(v), RARRAY_PTR(v), flags);
+#endif
}
if (rb_block_given_p()) {
Modified: MacRuby/branches/testing/enumerator.c
===================================================================
--- MacRuby/branches/testing/enumerator.c 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/enumerator.c 2008-06-17 01:04:32 UTC (rev 295)
@@ -305,7 +305,7 @@
argc = RARRAY_LEN(e->args);
argv = RARRAY_PTR(e->args);
}
- return rb_block_call(e->obj, e->meth, argc, argv,
+ return rb_block_call(e->obj, e->meth, argc, (VALUE *)argv,
enumerator_each_i, (VALUE)e);
}
@@ -340,7 +340,7 @@
argc = RARRAY_LEN(e->args);
argv = RARRAY_PTR(e->args);
}
- return rb_block_call(e->obj, e->meth, argc, argv,
+ return rb_block_call(e->obj, e->meth, argc, (VALUE *)argv,
enumerator_with_index_i, (VALUE)&memo);
}
Modified: MacRuby/branches/testing/eval.c
===================================================================
--- MacRuby/branches/testing/eval.c 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/eval.c 2008-06-17 01:04:32 UTC (rev 295)
@@ -1209,6 +1209,7 @@
exception_error = rb_exc_new2(rb_eFatal, "exception reentered");
rb_ivar_set(exception_error, idThrowState, INT2FIX(TAG_FATAL));
rb_register_mark_object(exception_error);
+ rb_objc_retain((void *)exception_error);
}
Deleted: MacRuby/branches/testing/eval.c.orig
===================================================================
--- MacRuby/branches/testing/eval.c.orig 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/eval.c.orig 2008-06-17 01:04:32 UTC (rev 295)
@@ -1,2822 +0,0 @@
-/**********************************************************************
-
- eval.c -
-
- $Author: mame $
- created at: Thu Jun 10 14:22:17 JST 1993
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
- Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
- Copyright (C) 2000 Information-technology Promotion Agency, Japan
-
-**********************************************************************/
-
-#include "eval_intern.h"
-
-VALUE proc_invoke(VALUE, VALUE, VALUE, VALUE);
-VALUE rb_binding_new();
-
-VALUE rb_f_block_given_p(void);
-
-ID rb_frame_callee(void);
-static VALUE rb_frame_self(void);
-
-static ID removed, singleton_removed, undefined, singleton_undefined;
-static ID init, eqq, each, aref, aset, match, missing;
-static ID added, singleton_added;
-static ID object_id, __send__, respond_to;
-
-VALUE rb_eLocalJumpError;
-VALUE rb_eSysStackError;
-VALUE sysstack_error;
-
-static VALUE exception_error;
-
-static VALUE eval(VALUE, VALUE, VALUE, const char *, int);
-
-static inline VALUE rb_yield_0(int argc, VALUE *argv);
-static VALUE rb_call(VALUE, VALUE, ID, int, const VALUE *, int);
-
-#include "eval_error.c"
-#include "eval_method.c"
-#include "eval_safe.c"
-#include "eval_jump.c"
-
-/* initialize ruby */
-
-#if defined(__APPLE__)
-#define environ (*_NSGetEnviron())
-#elif !defined(_WIN32) && !defined(__MACOS__) || defined(_WIN32_WCE)
-extern char **environ;
-#endif
-char **rb_origenviron;
-
-void rb_clear_trace_func(void);
-void rb_thread_stop_timer_thread(void);
-
-void rb_call_inits(void);
-void Init_stack(VALUE *);
-void Init_heap(void);
-void Init_ext(void);
-void Init_BareVM(void);
-
-void
-ruby_init(void)
-{
- static int initialized = 0;
- int state;
-
- if (initialized)
- return;
- initialized = 1;
-
-#ifdef __MACOS__
- rb_origenviron = 0;
-#else
- rb_origenviron = environ;
-#endif
-
- Init_stack((void *)&state);
- Init_BareVM();
- Init_heap();
-
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- rb_call_inits();
-
-#ifdef __MACOS__
- _macruby_init();
-#elif defined(__VMS)
- _vmsruby_init();
-#endif
-
- ruby_prog_init();
- ALLOW_INTS;
- }
- POP_TAG();
-
- if (state) {
- error_print();
- exit(EXIT_FAILURE);
- }
- ruby_running = 1;
-}
-
-extern void rb_clear_trace_func(void);
-
-void *
-ruby_options(int argc, char **argv)
-{
- int state;
- void *tree = 0;
-
- Init_stack((void *)&state);
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- SAVE_ROOT_JMPBUF(GET_THREAD(), tree = ruby_process_options(argc, argv));
- }
- else {
- rb_clear_trace_func();
- state = error_handle(state);
- tree = (void *)INT2FIX(state);
- }
- POP_TAG();
- return tree;
-}
-
-static void
-ruby_finalize_0(void)
-{
- rb_clear_trace_func();
- PUSH_TAG();
- if (EXEC_TAG() == 0) {
- rb_trap_exit();
- }
- POP_TAG();
- rb_exec_end_proc();
-}
-
-static void
-ruby_finalize_1(void)
-{
- ruby_sig_finalize();
- GET_THREAD()->errinfo = Qnil;
- rb_gc_call_finalizer_at_exit();
-}
-
-void
-ruby_finalize(void)
-{
- ruby_finalize_0();
- ruby_finalize_1();
-}
-
-void rb_thread_stop_timer_thread(void);
-
-int
-ruby_cleanup(int ex)
-{
- int state;
- volatile VALUE errs[2];
- rb_thread_t *th = GET_THREAD();
- int nerr;
-
- errs[1] = th->errinfo;
- th->safe_level = 0;
- Init_stack((void *)&state);
- ruby_finalize_0();
- errs[0] = th->errinfo;
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- SAVE_ROOT_JMPBUF(th, rb_thread_terminate_all());
- }
- else if (ex == 0) {
- ex = state;
- }
- th->errinfo = errs[1];
- ex = error_handle(ex);
- ruby_finalize_1();
- POP_TAG();
- rb_thread_stop_timer_thread();
-
- for (nerr = 0; nerr < sizeof(errs) / sizeof(errs[0]); ++nerr) {
- VALUE err = errs[nerr];
-
- if (!RTEST(err)) continue;
-
- /* th->errinfo contains a NODE while break'ing */
- if (TYPE(err) == T_NODE) continue;
-
- if (rb_obj_is_kind_of(err, rb_eSystemExit)) {
- return sysexit_status(err);
- }
- else if (rb_obj_is_kind_of(err, rb_eSignal)) {
- VALUE sig = rb_iv_get(err, "signo");
- ruby_default_signal(NUM2INT(sig));
- }
- else if (ex == 0) {
- ex = 1;
- }
- }
-
-#if EXIT_SUCCESS != 0 || EXIT_FAILURE != 1
- switch (ex) {
-#if EXIT_SUCCESS != 0
- case 0: return EXIT_SUCCESS;
-#endif
-#if EXIT_FAILURE != 1
- case 1: return EXIT_FAILURE;
-#endif
- }
-#endif
-
- return ex;
-}
-
-int
-ruby_exec_node(void *n, char *file)
-{
- int state;
- VALUE val;
- NODE *node = n;
- rb_thread_t *th = GET_THREAD();
-
- if (!node) return 0;
-
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- SAVE_ROOT_JMPBUF(th, {
- VALUE iseq = rb_iseq_new(n, rb_str_new2("<main>"),
- rb_str_new2(file), Qfalse, ISEQ_TYPE_TOP);
- th->base_block = 0;
- val = rb_iseq_eval(iseq);
- });
- }
- POP_TAG();
- return state;
-}
-
-void
-ruby_stop(int ex)
-{
- exit(ruby_cleanup(ex));
-}
-
-int
-ruby_run_node(void *n)
-{
- NODE *node = (NODE *)n;
-
- switch ((VALUE)n) {
- case Qtrue: return EXIT_SUCCESS;
- case Qfalse: return EXIT_FAILURE;
- }
- if (FIXNUM_P((VALUE)n)) {
- return FIX2INT((VALUE)n);
- }
- Init_stack((void *)&n);
- return ruby_cleanup(ruby_exec_node(node, node->nd_file));
-}
-
-VALUE
-rb_eval_string(const char *str)
-{
- return eval(rb_vm_top_self(), rb_str_new2(str), Qnil, "(eval)", 1);
-}
-
-VALUE
-rb_eval_string_protect(const char *str, int *state)
-{
- return rb_protect((VALUE (*)(VALUE))rb_eval_string, (VALUE)str, state);
-}
-
-VALUE
-rb_eval_string_wrap(const char *str, int *state)
-{
- int status;
- rb_thread_t *th = GET_THREAD();
- VALUE self = th->top_self;
- VALUE wrapper = th->top_wrapper;
- VALUE val;
-
- th->top_wrapper = rb_module_new();
- th->top_self = rb_obj_clone(rb_vm_top_self());
- rb_extend_object(th->top_self, th->top_wrapper);
-
- val = rb_eval_string_protect(str, &status);
-
- th->top_self = self;
- th->top_wrapper = wrapper;
-
- if (state) {
- *state = status;
- }
- else if (status) {
- JUMP_TAG(status);
- }
- return val;
-}
-
-VALUE
-rb_eval_cmd(VALUE cmd, VALUE arg, int level)
-{
- int state;
- VALUE val = Qnil; /* OK */
- volatile int safe = rb_safe_level();
-
- if (OBJ_TAINTED(cmd)) {
- level = 4;
- }
-
- if (TYPE(cmd) != T_STRING) {
- PUSH_TAG();
- rb_set_safe_level_force(level);
- if ((state = EXEC_TAG()) == 0) {
- val = rb_funcall2(cmd, rb_intern("call"), RARRAY_LEN(arg),
- RARRAY_PTR(arg));
- }
- POP_TAG();
-
- rb_set_safe_level_force(safe);
-
- if (state)
- JUMP_TAG(state);
- return val;
- }
-
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- val = eval(rb_vm_top_self(), cmd, Qnil, 0, 0);
- }
- POP_TAG();
-
- rb_set_safe_level_force(safe);
- if (state) vm_jump_tag_but_local_jump(state, val);
- return val;
-}
-
-/*
- * call-seq:
- * Module.nesting => array
- *
- * Returns the list of +Modules+ nested at the point of call.
- *
- * module M1
- * module M2
- * $a = Module.nesting
- * end
- * end
- * $a #=> [M1::M2, M1]
- * $a[0].name #=> "M1::M2"
- */
-
-static VALUE
-rb_mod_nesting(void)
-{
- VALUE ary = rb_ary_new();
- NODE *cref = ruby_cref();
-
- while (cref && cref->nd_next) {
- VALUE klass = cref->nd_clss;
- if (!NIL_P(klass)) {
- rb_ary_push(ary, klass);
- }
- cref = cref->nd_next;
- }
- return ary;
-}
-
-/*
- * call-seq:
- * Module.constants => array
- *
- * Returns an array of the names of all constants defined in the
- * system. This list includes the names of all modules and classes.
- *
- * p Module.constants.sort[1..5]
- *
- * <em>produces:</em>
- *
- * ["ARGV", "ArgumentError", "Array", "Bignum", "Binding"]
- */
-
-static VALUE
-rb_mod_s_constants(int argc, VALUE *argv, VALUE mod)
-{
- NODE *cref = ruby_cref();
- VALUE klass;
- VALUE cbase = 0;
- void *data = 0;
-
- if (argc > 0) {
- return rb_mod_constants(argc, argv, rb_cModule);
- }
-
- while (cref) {
- klass = cref->nd_clss;
- if (!NIL_P(klass)) {
- data = rb_mod_const_at(cref->nd_clss, data);
- if (!cbase) {
- cbase = klass;
- }
- }
- cref = cref->nd_next;
- }
-
- if (cbase) {
- data = rb_mod_const_of(cbase, data);
- }
- return rb_const_list(data);
-}
-
-void
-rb_frozen_class_p(VALUE klass)
-{
- char *desc = "something(?!)";
-
- if (OBJ_FROZEN(klass)) {
- if (FL_TEST(klass, FL_SINGLETON))
- desc = "object";
- else {
- switch (TYPE(klass)) {
- case T_MODULE:
- case T_ICLASS:
- desc = "module";
- break;
- case T_CLASS:
- desc = "class";
- break;
- }
- }
- rb_error_frozen(desc);
- }
-}
-
-/*
- * call-seq:
- * obj.respond_to?(symbol, include_private=false) => true or false
- *
- * Returns +true+> if _obj_ responds to the given
- * method. Private methods are included in the search only if the
- * optional second parameter evaluates to +true+.
- */
-
-static NODE *basic_respond_to = 0;
-
-int
-rb_obj_respond_to(VALUE obj, ID id, int priv)
-{
- VALUE klass = CLASS_OF(obj);
-
- if (rb_method_node(klass, respond_to) == basic_respond_to) {
- return rb_method_boundp(klass, id, !priv);
- }
- else {
- VALUE args[2];
- int n = 0;
- args[n++] = ID2SYM(id);
- if (priv)
- args[n++] = Qtrue;
- return rb_funcall2(obj, respond_to, n, args);
- }
-}
-
-int
-rb_respond_to(VALUE obj, ID id)
-{
- return rb_obj_respond_to(obj, id, Qfalse);
-}
-
-/*
- * call-seq:
- * obj.respond_to?(symbol, include_private=false) => true or false
- *
- * Returns +true+> if _obj_ responds to the given
- * method. Private methods are included in the search only if the
- * optional second parameter evaluates to +true+.
- */
-
-static VALUE
-obj_respond_to(int argc, VALUE *argv, VALUE obj)
-{
- VALUE mid, priv;
- ID id;
-
- rb_scan_args(argc, argv, "11", &mid, &priv);
- id = rb_to_id(mid);
- if (rb_method_boundp(CLASS_OF(obj), id, !RTEST(priv))) {
- return Qtrue;
- }
- return Qfalse;
-}
-
-/*
- * call-seq:
- * mod.method_defined?(symbol) => true or false
- *
- * Returns +true+ if the named method is defined by
- * _mod_ (or its included modules and, if _mod_ is a class,
- * its ancestors). Public and protected methods are matched.
- *
- * module A
- * def method1() end
- * end
- * class B
- * def method2() end
- * end
- * class C < B
- * include A
- * def method3() end
- * end
- *
- * A.method_defined? :method1 #=> true
- * C.method_defined? "method1" #=> true
- * C.method_defined? "method2" #=> true
- * C.method_defined? "method3" #=> true
- * C.method_defined? "method4" #=> false
- */
-
-static VALUE
-rb_mod_method_defined(VALUE mod, VALUE mid)
-{
- return rb_method_boundp(mod, rb_to_id(mid), 1);
-}
-
-#define VISI_CHECK(x,f) (((x)&NOEX_MASK) == (f))
-
-/*
- * call-seq:
- * mod.public_method_defined?(symbol) => true or false
- *
- * Returns +true+ if the named public method is defined by
- * _mod_ (or its included modules and, if _mod_ is a class,
- * its ancestors).
- *
- * module A
- * def method1() end
- * end
- * class B
- * protected
- * def method2() end
- * end
- * class C < B
- * include A
- * def method3() end
- * end
- *
- * A.method_defined? :method1 #=> true
- * C.public_method_defined? "method1" #=> true
- * C.public_method_defined? "method2" #=> false
- * C.method_defined? "method2" #=> true
- */
-
-static VALUE
-rb_mod_public_method_defined(VALUE mod, VALUE mid)
-{
- ID id = rb_to_id(mid);
- NODE *method;
-
- method = rb_method_node(mod, id);
- if (method) {
- if (VISI_CHECK(method->nd_noex, NOEX_PUBLIC))
- return Qtrue;
- }
- return Qfalse;
-}
-
-/*
- * call-seq:
- * mod.private_method_defined?(symbol) => true or false
- *
- * Returns +true+ if the named private method is defined by
- * _ mod_ (or its included modules and, if _mod_ is a class,
- * its ancestors).
- *
- * module A
- * def method1() end
- * end
- * class B
- * private
- * def method2() end
- * end
- * class C < B
- * include A
- * def method3() end
- * end
- *
- * A.method_defined? :method1 #=> true
- * C.private_method_defined? "method1" #=> false
- * C.private_method_defined? "method2" #=> true
- * C.method_defined? "method2" #=> false
- */
-
-static VALUE
-rb_mod_private_method_defined(VALUE mod, VALUE mid)
-{
- ID id = rb_to_id(mid);
- NODE *method;
-
- method = rb_method_node(mod, id);
- if (method) {
- if (VISI_CHECK(method->nd_noex, NOEX_PRIVATE))
- return Qtrue;
- }
- return Qfalse;
-}
-
-/*
- * call-seq:
- * mod.protected_method_defined?(symbol) => true or false
- *
- * Returns +true+ if the named protected method is defined
- * by _mod_ (or its included modules and, if _mod_ is a
- * class, its ancestors).
- *
- * module A
- * def method1() end
- * end
- * class B
- * protected
- * def method2() end
- * end
- * class C < B
- * include A
- * def method3() end
- * end
- *
- * A.method_defined? :method1 #=> true
- * C.protected_method_defined? "method1" #=> false
- * C.protected_method_defined? "method2" #=> true
- * C.method_defined? "method2" #=> true
- */
-
-static VALUE
-rb_mod_protected_method_defined(VALUE mod, VALUE mid)
-{
- ID id = rb_to_id(mid);
- NODE *method;
-
- method = rb_method_node(mod, id);
- if (method) {
- if (VISI_CHECK(method->nd_noex, NOEX_PROTECTED))
- return Qtrue;
- }
- return Qfalse;
-}
-
-NORETURN(static void rb_longjmp(int, VALUE));
-static VALUE make_backtrace(void);
-
-static void
-rb_longjmp(int tag, VALUE mesg)
-{
- VALUE at;
- VALUE e;
- rb_thread_t *th = GET_THREAD();
- const char *file;
- int line = 0;
-
- if (thread_set_raised(th)) {
- th->errinfo = exception_error;
- JUMP_TAG(TAG_FATAL);
- }
-
- if (NIL_P(mesg))
- mesg = th->errinfo;
- if (NIL_P(mesg)) {
- mesg = rb_exc_new(rb_eRuntimeError, 0, 0);
- }
-
- file = rb_sourcefile();
- if (file) line = rb_sourceline();
- if (file && !NIL_P(mesg)) {
- at = get_backtrace(mesg);
- if (NIL_P(at)) {
- at = make_backtrace();
- set_backtrace(mesg, at);
- }
- }
- if (!NIL_P(mesg)) {
- th->errinfo = mesg;
- }
-
- if (RTEST(ruby_debug) && !NIL_P(e = th->errinfo) &&
- !rb_obj_is_kind_of(e, rb_eSystemExit)) {
- int status;
-
- PUSH_TAG();
- if ((status = EXEC_TAG()) == 0) {
- RB_GC_GUARD(e) = rb_obj_as_string(e);
- if (file) {
- warn_printf("Exception `%s' at %s:%d - %s\n",
- rb_obj_classname(th->errinfo),
- file, line, RSTRING_PTR(e));
- }
- else {
- warn_printf("Exception `%s' - %s\n",
- rb_obj_classname(th->errinfo),
- RSTRING_PTR(e));
- }
- }
- POP_TAG();
- if (status == TAG_FATAL && th->errinfo == exception_error) {
- th->errinfo = mesg;
- }
- else if (status) {
- thread_reset_raised(th);
- JUMP_TAG(status);
- }
- }
-
- rb_trap_restore_mask();
-
- if (tag != TAG_FATAL) {
- EXEC_EVENT_HOOK(th, RUBY_EVENT_RAISE, th->cfp->self,
- 0 /* TODO: id */, 0 /* TODO: klass */);
- }
-
- thread_reset_raised(th);
- JUMP_TAG(tag);
-}
-
-void
-rb_exc_raise(VALUE mesg)
-{
- rb_longjmp(TAG_RAISE, mesg);
-}
-
-void
-rb_exc_fatal(VALUE mesg)
-{
- rb_longjmp(TAG_FATAL, mesg);
-}
-
-void
-rb_interrupt(void)
-{
- static const char fmt[1] = {'\0'};
- rb_raise(rb_eInterrupt, fmt);
-}
-
-static VALUE get_errinfo(void);
-
-/*
- * call-seq:
- * raise
- * raise(string)
- * raise(exception [, string [, array]])
- * fail
- * fail(string)
- * fail(exception [, string [, array]])
- *
- * With no arguments, raises the exception in <code>$!</code> or raises
- * a <code>RuntimeError</code> if <code>$!</code> is +nil+.
- * With a single +String+ argument, raises a
- * +RuntimeError+ with the string as a message. Otherwise,
- * the first parameter should be the name of an +Exception+
- * class (or an object that returns an +Exception+ object when sent
- * an +exception+ message). The optional second parameter sets the
- * message associated with the exception, and the third parameter is an
- * array of callback information. Exceptions are caught by the
- * +rescue+ clause of <code>begin...end</code> blocks.
- *
- * raise "Failed to create socket"
- * raise ArgumentError, "No parameters", caller
- */
-
-static VALUE
-rb_f_raise(int argc, VALUE *argv)
-{
- VALUE err;
- if (argc == 0) {
- err = get_errinfo();
- if (!NIL_P(err)) {
- argc = 1;
- argv = &err;
- }
- }
- rb_raise_jump(rb_make_exception(argc, argv));
- return Qnil; /* not reached */
-}
-
-VALUE
-rb_make_exception(int argc, VALUE *argv)
-{
- VALUE mesg;
- ID exception;
- int n;
-
- mesg = Qnil;
- switch (argc) {
- case 0:
- mesg = Qnil;
- break;
- case 1:
- if (NIL_P(argv[0]))
- break;
- if (TYPE(argv[0]) == T_STRING) {
- mesg = rb_exc_new3(rb_eRuntimeError, argv[0]);
- break;
- }
- n = 0;
- goto exception_call;
-
- case 2:
- case 3:
- n = 1;
- exception_call:
- exception = rb_intern("exception");
- if (!rb_respond_to(argv[0], exception)) {
- rb_raise(rb_eTypeError, "exception class/object expected");
- }
- mesg = rb_funcall(argv[0], exception, n, argv[1]);
- break;
- default:
- rb_raise(rb_eArgError, "wrong number of arguments");
- break;
- }
- if (argc > 0) {
- if (!rb_obj_is_kind_of(mesg, rb_eException))
- rb_raise(rb_eTypeError, "exception object expected");
- if (argc > 2)
- set_backtrace(mesg, argv[2]);
- }
-
- return mesg;
-}
-
-void
-rb_raise_jump(VALUE mesg)
-{
- /* TODO: fix me */
- rb_longjmp(TAG_RAISE, mesg);
-}
-
-void
-rb_jump_tag(int tag)
-{
- JUMP_TAG(tag);
-}
-
-int
-rb_block_given_p(void)
-{
- rb_thread_t *th = GET_THREAD();
- if (GC_GUARDED_PTR_REF(th->cfp->lfp[0])) {
- return Qtrue;
- }
- else {
- return Qfalse;
- }
-}
-
-int
-rb_iterator_p()
-{
- return rb_block_given_p();
-}
-
-/*
- * call-seq:
- * block_given? => true or false
- * iterator? => true or false
- *
- * Returns <code>true</code> if <code>yield</code> would execute a
- * block in the current context. The <code>iterator?</code> form
- * is mildly deprecated.
- *
- * def try
- * if block_given?
- * yield
- * else
- * "no block"
- * end
- * end
- * try #=> "no block"
- * try { "hello" } #=> "hello"
- * try do "hello" end #=> "hello"
- */
-
-
-VALUE
-rb_f_block_given_p()
-{
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = th->cfp;
- cfp = vm_get_ruby_level_cfp(th, RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp));
- if (GC_GUARDED_PTR_REF(cfp->lfp[0])) {
- return Qtrue;
- }
- else {
- return Qfalse;
- }
-}
-
-VALUE rb_eThreadError;
-
-void
-rb_need_block()
-{
- if (!rb_block_given_p()) {
- vm_localjump_error("no block given", Qnil, 0);
- }
-}
-
-static inline VALUE
-rb_yield_0(int argc, VALUE *argv)
-{
- return vm_yield(GET_THREAD(), argc, argv);
-}
-
-VALUE
-rb_yield(VALUE val)
-{
- volatile VALUE tmp = val;
- if (val == Qundef) {
- tmp = rb_yield_0(0, 0);
- }
- else {
- tmp = rb_yield_0(1, &val);
- }
- return tmp;
-}
-
-VALUE
-rb_yield_values(int n, ...)
-{
- int i;
- VALUE *argv;
- va_list args;
-
- if (n == 0) {
- return rb_yield_0(0, 0);
- }
-
- argv = ALLOCA_N(VALUE, n);
-
- va_init_list(args, n);
- for (i=0; i<n; i++) {
- argv[i] = va_arg(args, VALUE);
- }
- va_end(args);
-
- return rb_yield_0(n, argv);
-}
-
-VALUE
-rb_yield_values2(int argc, VALUE *argv)
-{
- return rb_yield_0(argc, argv);
-}
-
-VALUE
-rb_yield_splat(VALUE values)
-{
- VALUE tmp = rb_check_array_type(values);
- volatile VALUE v;
- if (NIL_P(tmp)) {
- rb_raise(rb_eArgError, "not an array");
- }
- v = rb_yield_0(RARRAY_LEN(tmp), RARRAY_PTR(tmp));
- return v;
-}
-
-static VALUE
-loop_i()
-{
- for (;;) {
- rb_yield_0(0, 0);
- }
- return Qnil;
-}
-
-/*
- * call-seq:
- * loop {|| block }
- *
- * Repeatedly executes the block.
- *
- * loop do
- * print "Input: "
- * line = gets
- * break if !line or line =~ /^qQ/
- * # ...
- * end
- */
-
-static VALUE
-rb_f_loop(void)
-{
- rb_rescue2(loop_i, (VALUE)0, 0, 0, rb_eStopIteration, (VALUE)0);
- return Qnil; /* dummy */
-}
-
-VALUE
-rb_iterate(VALUE (*it_proc) (VALUE), VALUE data1,
- VALUE (*bl_proc) (ANYARGS), VALUE data2)
-{
- int state;
- volatile VALUE retval = Qnil;
- NODE *node = NEW_IFUNC(bl_proc, data2);
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = th->cfp;
-
- TH_PUSH_TAG(th);
- state = TH_EXEC_TAG();
- if (state == 0) {
- iter_retry:
- {
- rb_block_t *blockptr = RUBY_VM_GET_BLOCK_PTR_IN_CFP(th->cfp);
- blockptr->iseq = (void *)node;
- blockptr->proc = 0;
- th->passed_block = blockptr;
- }
- retval = (*it_proc) (data1);
- }
- else {
- VALUE err = th->errinfo;
- if (state == TAG_BREAK) {
- VALUE *escape_dfp = GET_THROWOBJ_CATCH_POINT(err);
- VALUE *cdfp = cfp->dfp;
-
- if (cdfp == escape_dfp) {
- state = 0;
- th->state = 0;
- th->errinfo = Qnil;
- th->cfp = cfp;
- }
- else{
- /* SDR(); printf("%p, %p\n", cdfp, escape_dfp); */
- }
- }
- else if (state == TAG_RETRY) {
- VALUE *escape_dfp = GET_THROWOBJ_CATCH_POINT(err);
- VALUE *cdfp = cfp->dfp;
-
- if (cdfp == escape_dfp) {
- state = 0;
- th->state = 0;
- th->errinfo = Qnil;
- th->cfp = cfp;
- goto iter_retry;
- }
- }
- }
- TH_POP_TAG();
-
- switch (state) {
- case 0:
- break;
- default:
- TH_JUMP_TAG(th, state);
- }
- return retval;
-}
-
-struct iter_method_arg {
- VALUE obj;
- ID mid;
- int argc;
- VALUE *argv;
-};
-
-static VALUE
-iterate_method(VALUE obj)
-{
- struct iter_method_arg *arg;
-
- arg = (struct iter_method_arg *)obj;
- return rb_call(CLASS_OF(arg->obj), arg->obj, arg->mid,
- arg->argc, arg->argv, NOEX_PRIVATE);
-}
-
-VALUE
-rb_block_call(VALUE obj, ID mid, int argc, VALUE *argv,
- VALUE (*bl_proc) (ANYARGS), VALUE data2)
-{
- struct iter_method_arg arg;
-
- arg.obj = obj;
- arg.mid = mid;
- arg.argc = argc;
- arg.argv = argv;
- return rb_iterate(iterate_method, (VALUE)&arg, bl_proc, data2);
-}
-
-VALUE
-rb_each(VALUE obj)
-{
- return rb_call(CLASS_OF(obj), obj, rb_intern("each"), 0, 0,
- NOEX_PRIVATE);
-}
-
-VALUE
-rb_rescue2(VALUE (*b_proc) (ANYARGS), VALUE data1, VALUE (*r_proc) (ANYARGS),
- VALUE data2, ...)
-{
- int state;
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = th->cfp;
- volatile VALUE result;
- volatile VALUE e_info = th->errinfo;
- va_list args;
-
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- retry_entry:
- result = (*b_proc) (data1);
- }
- else {
- th->cfp = cfp; /* restore */
-
- if (state == TAG_RAISE) {
- int handle = Qfalse;
- VALUE eclass;
-
- va_init_list(args, data2);
- while ((eclass = va_arg(args, VALUE)) != 0) {
- if (rb_obj_is_kind_of(th->errinfo, eclass)) {
- handle = Qtrue;
- break;
- }
- }
- va_end(args);
-
- if (handle) {
- if (r_proc) {
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- result = (*r_proc) (data2, th->errinfo);
- }
- POP_TAG();
- if (state == TAG_RETRY) {
- state = 0;
- th->errinfo = Qnil;
- goto retry_entry;
- }
- }
- else {
- result = Qnil;
- state = 0;
- }
- if (state == 0) {
- th->errinfo = e_info;
- }
- }
- }
- }
- POP_TAG();
- if (state)
- JUMP_TAG(state);
-
- return result;
-}
-
-VALUE
-rb_rescue(VALUE (*b_proc)(ANYARGS), VALUE data1, VALUE (*r_proc)(ANYARGS), VALUE data2)
-{
- return rb_rescue2(b_proc, data1, r_proc, data2, rb_eStandardError,
- (VALUE)0);
-}
-
-VALUE
-rb_protect(VALUE (*proc) (VALUE), VALUE data, int *state)
-{
- VALUE result = Qnil; /* OK */
- int status;
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = th->cfp;
- struct rb_vm_trap_tag trap_tag;
- rb_jmpbuf_t org_jmpbuf;
-
- trap_tag.prev = th->trap_tag;
-
- PUSH_TAG();
- th->trap_tag = &trap_tag;
- MEMCPY(&org_jmpbuf, &(th)->root_jmpbuf, rb_jmpbuf_t, 1);
- if ((status = EXEC_TAG()) == 0) {
- SAVE_ROOT_JMPBUF(th, result = (*proc) (data));
- }
- MEMCPY(&(th)->root_jmpbuf, &org_jmpbuf, rb_jmpbuf_t, 1);
- th->trap_tag = trap_tag.prev;
- POP_TAG();
-
- if (state) {
- *state = status;
- }
- if (status != 0) {
- th->cfp = cfp;
- return Qnil;
- }
-
- return result;
-}
-
-VALUE
-rb_ensure(VALUE (*b_proc)(ANYARGS), VALUE data1, VALUE (*e_proc)(ANYARGS), VALUE data2)
-{
- int state;
- volatile VALUE result = Qnil;
-
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- result = (*b_proc) (data1);
- }
- POP_TAG();
- /* TODO: fix me */
- /* retval = prot_tag ? prot_tag->retval : Qnil; */ /* save retval */
- (*e_proc) (data2);
- if (state)
- JUMP_TAG(state);
- return result;
-}
-
-VALUE
-rb_with_disable_interrupt(VALUE (*proc)(ANYARGS), VALUE data)
-{
- VALUE result = Qnil; /* OK */
- int status;
-
- DEFER_INTS;
- {
- int thr_critical = rb_thread_critical;
-
- rb_thread_critical = Qtrue;
- PUSH_TAG();
- if ((status = EXEC_TAG()) == 0) {
- result = (*proc) (data);
- }
- POP_TAG();
- rb_thread_critical = thr_critical;
- }
- ENABLE_INTS;
- if (status)
- JUMP_TAG(status);
-
- return result;
-}
-
-static inline void
-stack_check(void)
-{
- static int overflowing = 0;
-
- if (!overflowing && ruby_stack_check()) {
- int state;
- overflowing = 1;
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- rb_exc_raise(sysstack_error);
- }
- POP_TAG();
- overflowing = 0;
- JUMP_TAG(state);
- }
-}
-
-/*
- * call-seq:
- * obj.method_missing(symbol [, *args] ) => result
- *
- * Invoked by Ruby when <i>obj</i> is sent a message it cannot handle.
- * <i>symbol</i> is the symbol for the method called, and <i>args</i>
- * are any arguments that were passed to it. By default, the interpreter
- * raises an error when this method is called. However, it is possible
- * to override the method to provide more dynamic behavior.
- * If it is decided that a particular method should not be handled, then
- * <i>super</i> should be called, so that ancestors can pick up the
- * missing method.
- * The example below creates
- * a class <code>Roman</code>, which responds to methods with names
- * consisting of roman numerals, returning the corresponding integer
- * values.
- *
- * class Roman
- * def romanToInt(str)
- * # ...
- * end
- * def method_missing(methId)
- * str = methId.id2name
- * romanToInt(str)
- * end
- * end
- *
- * r = Roman.new
- * r.iv #=> 4
- * r.xxiii #=> 23
- * r.mm #=> 2000
- */
-
-static VALUE
-rb_method_missing(int argc, const VALUE *argv, VALUE obj)
-{
- ID id;
- VALUE exc = rb_eNoMethodError;
- char *format = 0;
- rb_thread_t *th = GET_THREAD();
- int last_call_status = th->method_missing_reason;
- if (argc == 0 || !SYMBOL_P(argv[0])) {
- rb_raise(rb_eArgError, "no id given");
- }
-
- stack_check();
-
- id = SYM2ID(argv[0]);
-
- if (last_call_status & NOEX_PRIVATE) {
- format = "private method `%s' called for %s";
- }
- else if (last_call_status & NOEX_PROTECTED) {
- format = "protected method `%s' called for %s";
- }
- else if (last_call_status & NOEX_VCALL) {
- format = "undefined local variable or method `%s' for %s";
- exc = rb_eNameError;
- }
- else if (last_call_status & NOEX_SUPER) {
- format = "super: no superclass method `%s' for %s";
- }
- if (!format) {
- format = "undefined method `%s' for %s";
- }
-
- {
- int n = 0;
- VALUE args[3];
- args[n++] = rb_funcall(rb_const_get(exc, rb_intern("message")), '!',
- 3, rb_str_new2(format), obj, argv[0]);
- args[n++] = argv[0];
- if (exc == rb_eNoMethodError) {
- args[n++] = rb_ary_new4(argc - 1, argv + 1);
- }
- exc = rb_class_new_instance(n, args, exc);
-
- th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
- rb_exc_raise(exc);
- }
-
- return Qnil; /* not reached */
-}
-
-static VALUE
-method_missing(VALUE obj, ID id, int argc, const VALUE *argv, int call_status)
-{
- VALUE *nargv;
- GET_THREAD()->method_missing_reason = call_status;
-
- if (id == missing) {
- rb_method_missing(argc, argv, obj);
- }
- else if (id == ID_ALLOCATOR) {
- rb_raise(rb_eTypeError, "allocator undefined for %s",
- rb_class2name(obj));
- }
-
- nargv = ALLOCA_N(VALUE, argc + 1);
- nargv[0] = ID2SYM(id);
- MEMCPY(nargv + 1, argv, VALUE, argc);
-
- return rb_funcall2(obj, missing, argc + 1, nargv);
-}
-
-static VALUE
-rb_call0(VALUE klass, VALUE recv, ID mid, int argc, const VALUE *argv, int scope, VALUE self)
-{
- NODE *body, *method;
- int noex;
- ID id = mid;
- struct cache_entry *ent;
- rb_thread_t *th = GET_THREAD();
-
- if (!klass) {
- rb_raise(rb_eNotImpError,
- "method `%s' called on terminated object (%p)",
- rb_id2name(mid), (void *)recv);
- }
- /* is it in the method cache? */
- ent = cache + EXPR1(klass, mid);
-
- if (ent->mid == mid && ent->klass == klass) {
- if (!ent->method)
- return method_missing(recv, mid, argc, argv,
- scope == 2 ? NOEX_VCALL : 0);
- id = ent->mid0;
- noex = ent->method->nd_noex;
- klass = ent->method->nd_clss;
- body = ent->method->nd_body;
- }
- else if ((method = rb_get_method_body(klass, id, &id)) != 0) {
- noex = method->nd_noex;
- klass = method->nd_clss;
- body = method->nd_body;
- }
- else {
- if (scope == 3) {
- return method_missing(recv, mid, argc, argv, NOEX_SUPER);
- }
- return method_missing(recv, mid, argc, argv,
- scope == 2 ? NOEX_VCALL : 0);
- }
-
-
- if (mid != missing) {
- /* receiver specified form for private method */
- if (UNLIKELY(noex)) {
- if (((noex & NOEX_MASK) & NOEX_PRIVATE) && scope == 0) {
- return method_missing(recv, mid, argc, argv, NOEX_PRIVATE);
- }
-
- /* self must be kind of a specified form for protected method */
- if (((noex & NOEX_MASK) & NOEX_PROTECTED) && scope == 0) {
- VALUE defined_class = klass;
-
- if (TYPE(defined_class) == T_ICLASS) {
- defined_class = RBASIC(defined_class)->klass;
- }
-
- if (!rb_obj_is_kind_of(self, rb_class_real(defined_class))) {
- return method_missing(recv, mid, argc, argv, NOEX_PROTECTED);
- }
- }
-
- if (NOEX_SAFE(noex) > th->safe_level) {
- rb_raise(rb_eSecurityError, "calling insecure method: %s", rb_id2name(mid));
- }
- }
- }
-
- {
- VALUE val;
- /*
- //static int level;
- //int i;
- //for(i=0; i<level; i++){printf(" ");}
- //printf("invoke %s (%s)\n", rb_id2name(mid), ruby_node_name(nd_type(body)));
- //level++;
- //printf("%s with %d args\n", rb_id2name(mid), argc);
- */
- val = vm_call0(th, klass, recv, mid, id, argc, argv, body,
- noex & NOEX_NOSUPER);
- /*
- //level--;
- //for(i=0; i<level; i++){printf(" ");}
- //printf("done %s (%s)\n", rb_id2name(mid), ruby_node_name(nd_type(body)));
- */
- return val;
- }
-}
-
-static VALUE
-rb_call(VALUE klass, VALUE recv, ID mid, int argc, const VALUE *argv, int scope)
-{
- return rb_call0(klass, recv, mid, argc, argv, scope, rb_frame_self());
-}
-
-VALUE
-rb_apply(VALUE recv, ID mid, VALUE args)
-{
- int argc;
- VALUE *argv;
-
- argc = RARRAY_LEN(args); /* Assigns LONG, but argc is INT */
- argv = ALLOCA_N(VALUE, argc);
- MEMCPY(argv, RARRAY_PTR(args), VALUE, argc);
- return rb_call(CLASS_OF(recv), recv, mid, argc, argv, NOEX_NOSUPER);
-}
-
-static VALUE
-send_internal(int argc, VALUE *argv, VALUE recv, int scope)
-{
- VALUE vid;
- VALUE self = RUBY_VM_PREVIOUS_CONTROL_FRAME(GET_THREAD()->cfp)->self;
-
- if (argc == 0) {
- rb_raise(rb_eArgError, "no method name given");
- }
-
- vid = *argv++; argc--;
- PASS_PASSED_BLOCK();
- return rb_call0(CLASS_OF(recv), recv, rb_to_id(vid), argc, argv, scope, self);
-}
-
-/*
- * call-seq:
- * obj.send(symbol [, args...]) => obj
- * obj.__send__(symbol [, args...]) => obj
- *
- * Invokes the method identified by _symbol_, passing it any
- * arguments specified. You can use <code>__send__</code> if the name
- * +send+ clashes with an existing method in _obj_.
- *
- * class Klass
- * def hello(*args)
- * "Hello " + args.join(' ')
- * end
- * end
- * k = Klass.new
- * k.send :hello, "gentle", "readers" #=> "Hello gentle readers"
- */
-
-VALUE
-rb_f_send(int argc, VALUE *argv, VALUE recv)
-{
- return send_internal(argc, argv, recv, NOEX_NOSUPER | NOEX_PRIVATE);
-}
-
-
-/*
- * call-seq:
- * obj.public_send(symbol [, args...]) => obj
- *
- * Invokes the method identified by _symbol_, passing it any
- * arguments specified. Unlike send, public_send calls public
- * methods only.
- *
- * 1.public_send(:puts, "hello") # causes NoMethodError
- */
-
-VALUE
-rb_f_public_send(int argc, VALUE *argv, VALUE recv)
-{
- return send_internal(argc, argv, recv, NOEX_PUBLIC);
-}
-
-VALUE
-rb_funcall(VALUE recv, ID mid, int n, ...)
-{
- VALUE *argv;
- va_list ar;
- va_init_list(ar, n);
-
- if (n > 0) {
- long i;
-
- argv = ALLOCA_N(VALUE, n);
-
- for (i = 0; i < n; i++) {
- argv[i] = va_arg(ar, VALUE);
- }
- va_end(ar);
- }
- else {
- argv = 0;
- }
- return rb_call(CLASS_OF(recv), recv, mid, n, argv,
- NOEX_NOSUPER | NOEX_PRIVATE);
-}
-
-VALUE
-rb_funcall2(VALUE recv, ID mid, int argc, const VALUE *argv)
-{
- return rb_call(CLASS_OF(recv), recv, mid, argc, argv,
- NOEX_NOSUPER | NOEX_PRIVATE);
-}
-
-VALUE
-rb_funcall3(VALUE recv, ID mid, int argc, const VALUE *argv)
-{
- return rb_call(CLASS_OF(recv), recv, mid, argc, argv, NOEX_PUBLIC);
-}
-
-static VALUE
-backtrace(int lev)
-{
- return vm_backtrace(GET_THREAD(), lev);
-}
-
-/*
- * call-seq:
- * caller(start=1) => array
- *
- * Returns the current execution stack---an array containing strings in
- * the form ``<em>file:line</em>'' or ``<em>file:line: in
- * `method'</em>''. The optional _start_ parameter
- * determines the number of initial stack entries to omit from the
- * result.
- *
- * def a(skip)
- * caller(skip)
- * end
- * def b(skip)
- * a(skip)
- * end
- * def c(skip)
- * b(skip)
- * end
- * c(0) #=> ["prog:2:in `a'", "prog:5:in `b'", "prog:8:in `c'", "prog:10"]
- * c(1) #=> ["prog:5:in `b'", "prog:8:in `c'", "prog:11"]
- * c(2) #=> ["prog:8:in `c'", "prog:12"]
- * c(3) #=> ["prog:13"]
- */
-
-static VALUE
-rb_f_caller(int argc, VALUE *argv)
-{
- VALUE level;
- int lev;
-
- rb_scan_args(argc, argv, "01", &level);
-
- if (NIL_P(level))
- lev = 1;
- else
- lev = NUM2INT(level);
- if (lev < 0)
- rb_raise(rb_eArgError, "negative level (%d)", lev);
-
- return backtrace(lev);
-}
-
-void
-rb_backtrace(void)
-{
- long i;
- VALUE ary;
-
- ary = backtrace(-1);
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- printf("\tfrom %s\n", RSTRING_PTR(RARRAY_PTR(ary)[i]));
- }
-}
-
-static VALUE
-make_backtrace(void)
-{
- return backtrace(-1);
-}
-
-static ID
-frame_func_id(rb_control_frame_t *cfp)
-{
- rb_iseq_t *iseq = cfp->iseq;
- if (!iseq) {
- return cfp->method_id;
- }
- while (iseq) {
- if (RUBY_VM_IFUNC_P(iseq)) {
- return rb_intern("<ifunc>");
- }
- if (iseq->defined_method_id) {
- return iseq->defined_method_id;
- }
- if (iseq->local_iseq == iseq) {
- break;
- }
- iseq = iseq->parent_iseq;
- }
- return 0;
-}
-
-ID
-rb_frame_this_func(void)
-{
- return frame_func_id(GET_THREAD()->cfp);
-}
-
-ID
-rb_frame_callee(void)
-{
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *prev_cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
- /* check if prev_cfp can be accessible */
- if ((void *)(th->stack + th->stack_size) == (void *)(prev_cfp)) {
- return 0;
- }
- return frame_func_id(prev_cfp);
-}
-
-void
-rb_frame_pop(void)
-{
- rb_thread_t *th = GET_THREAD();
- th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
-}
-
-static VALUE
-rb_frame_self(void)
-{
- return GET_THREAD()->cfp->self;
-}
-
-static VALUE
-eval(VALUE self, VALUE src, VALUE scope, const char *file, int line)
-{
- int state;
- VALUE result = Qundef;
- VALUE envval;
- rb_binding_t *bind = 0;
- rb_thread_t *th = GET_THREAD();
- rb_env_t *env = NULL;
- NODE *stored_cref_stack = 0;
-
- if (file == 0) {
- file = rb_sourcefile();
- line = rb_sourceline();
- }
-
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- rb_iseq_t *iseq;
- volatile VALUE iseqval;
-
- if (scope != Qnil) {
- if (rb_obj_is_kind_of(scope, rb_cBinding)) {
- GetBindingPtr(scope, bind);
- envval = bind->env;
- stored_cref_stack = bind->cref_stack;
- }
- else {
- rb_raise(rb_eTypeError,
- "wrong argument type %s (expected Binding)",
- rb_obj_classname(scope));
- }
- GetEnvPtr(envval, env);
- th->base_block = &env->block;
- }
- else {
- rb_control_frame_t *cfp = vm_get_ruby_level_cfp(th, th->cfp);
- th->base_block = RUBY_VM_GET_BLOCK_PTR_IN_CFP(cfp);
- th->base_block->iseq = cfp->iseq; /* TODO */
- }
-
- /* make eval iseq */
- th->parse_in_eval++;
- iseqval = rb_iseq_compile(src, rb_str_new2(file), INT2FIX(line));
- th->parse_in_eval--;
- rb_vm_set_eval_stack(th, iseqval);
- th->base_block = 0;
-
- if (0) { /* for debug */
- extern VALUE ruby_iseq_disasm(VALUE);
- printf("%s\n", RSTRING_PTR(ruby_iseq_disasm(iseqval)));
- }
-
- /* save new env */
- GetISeqPtr(iseqval, iseq);
- if (bind && iseq->local_size > 0) {
- bind->env = vm_make_env_object(th, th->cfp);
- }
-
- /* push tag */
- if (stored_cref_stack) {
- stored_cref_stack =
- vm_set_special_cref(th, env->block.lfp, stored_cref_stack);
- }
-
- /* kick */
- CHECK_STACK_OVERFLOW(th->cfp, iseq->stack_max);
- result = vm_eval_body(th);
- }
- POP_TAG();
-
- if (stored_cref_stack) {
- vm_set_special_cref(th, env->block.lfp, stored_cref_stack);
- }
-
- if (state) {
- if (state == TAG_RAISE) {
- VALUE errinfo = th->errinfo;
- if (strcmp(file, "(eval)") == 0) {
- VALUE mesg, errat, bt2;
-
- errat = get_backtrace(errinfo);
- mesg = rb_attr_get(errinfo, rb_intern("mesg"));
- if (!NIL_P(errat) && TYPE(errat) == T_ARRAY &&
- (bt2 = backtrace(-2), RARRAY_LEN(bt2) > 0)) {
- if (!NIL_P(mesg) && TYPE(mesg) == T_STRING && !RSTRING_LEN(mesg)) {
- rb_str_update(mesg, 0, 0, rb_str_new2(": "));
- rb_str_update(mesg, 0, 0, RARRAY_PTR(errat)[0]);
- }
- RARRAY_PTR(errat)[0] = RARRAY_PTR(bt2)[0];
- }
- }
- rb_exc_raise(errinfo);
- }
- JUMP_TAG(state);
- }
- return result;
-}
-
-/*
- * call-seq:
- * eval(string [, binding [, filename [,lineno]]]) => obj
- *
- * Evaluates the Ruby expression(s) in <em>string</em>. If
- * <em>binding</em> is given, the evaluation is performed in its
- * context. The binding may be a <code>Binding</code> object or a
- * <code>Proc</code> object. If the optional <em>filename</em> and
- * <em>lineno</em> parameters are present, they will be used when
- * reporting syntax errors.
- *
- * def getBinding(str)
- * return binding
- * end
- * str = "hello"
- * eval "str + ' Fred'" #=> "hello Fred"
- * eval "str + ' Fred'", getBinding("bye") #=> "bye Fred"
- */
-
-VALUE
-rb_f_eval(int argc, VALUE *argv, VALUE self)
-{
- VALUE src, scope, vfile, vline;
- char *file = "(eval)";
- int line = 1;
-
- rb_scan_args(argc, argv, "13", &src, &scope, &vfile, &vline);
- if (rb_safe_level() >= 4) {
- StringValue(src);
- if (!NIL_P(scope) && !OBJ_TAINTED(scope)) {
- rb_raise(rb_eSecurityError,
- "Insecure: can't modify trusted binding");
- }
- }
- else {
- SafeStringValue(src);
- }
- if (argc >= 3) {
- StringValue(vfile);
- }
- if (argc >= 4) {
- line = NUM2INT(vline);
- }
-
- if (!NIL_P(vfile))
- file = RSTRING_PTR(vfile);
- return eval(self, src, scope, file, line);
-}
-
-VALUE vm_cfp_svar_get(rb_thread_t *th, rb_control_frame_t *cfp, VALUE key);
-void vm_cfp_svar_set(rb_thread_t *th, rb_control_frame_t *cfp, VALUE key, VALUE val);
-
-/* function to call func under the specified class/module context */
-static VALUE
-exec_under(VALUE (*func) (VALUE), VALUE under, VALUE self, VALUE args)
-{
- VALUE val = Qnil; /* OK */
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = th->cfp;
- rb_control_frame_t *pcfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
- VALUE stored_self = pcfp->self;
- NODE *stored_cref = 0;
-
- rb_block_t block;
- rb_block_t *blockptr;
- int state;
-
- /* replace environment */
- pcfp->self = self;
- if ((blockptr = GC_GUARDED_PTR_REF(*th->cfp->lfp)) != 0) {
- /* copy block info */
- /* TODO: why? */
- block = *blockptr;
- block.self = self;
- *th->cfp->lfp = GC_GUARDED_PTR(&block);
- }
-
- while (!RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
- cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
- }
-
- stored_cref = (NODE *)vm_cfp_svar_get(th, cfp, 2);
- vm_cfp_svar_set(th, cfp, 2, (VALUE)vm_cref_push(th, under, NOEX_PUBLIC));
-
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- val = (*func) (args);
- }
- POP_TAG();
-
- /* restore environment */
- vm_cfp_svar_set(th, cfp, 2, (VALUE)stored_cref);
- pcfp->self = stored_self;
-
- if (state) {
- JUMP_TAG(state);
- }
- return val;
-}
-
-static VALUE
-yield_under_i(VALUE arg)
-{
- if (arg == Qundef) {
- return rb_yield_0(0, 0);
- }
- else {
- return rb_yield_0(RARRAY_LEN(arg), RARRAY_PTR(arg));
- }
-}
-
-/* block eval under the class/module context */
-static VALUE
-yield_under(VALUE under, VALUE self, VALUE values)
-{
- return exec_under(yield_under_i, under, self, values);
-}
-
-static VALUE
-eval_under_i(VALUE arg)
-{
- VALUE *args = (VALUE *)arg;
- return eval(args[0], args[1], Qnil, (char *)args[2], (int)args[3]);
-}
-
-/* string eval under the class/module context */
-static VALUE
-eval_under(VALUE under, VALUE self, VALUE src, const char *file, int line)
-{
- VALUE args[4];
-
- if (rb_safe_level() >= 4) {
- StringValue(src);
- }
- else {
- SafeStringValue(src);
- }
- args[0] = self;
- args[1] = src;
- args[2] = (VALUE)file;
- args[3] = (VALUE)line;
- return exec_under(eval_under_i, under, self, (VALUE)args);
-}
-
-static VALUE
-specific_eval(int argc, VALUE *argv, VALUE klass, VALUE self)
-{
- if (rb_block_given_p()) {
- if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)",
- argc);
- }
- return yield_under(klass, self, Qundef);
- }
- else {
- char *file = "(eval)";
- int line = 1;
-
- if (argc == 0) {
- rb_raise(rb_eArgError, "block not supplied");
- }
- else {
- if (rb_safe_level() >= 4) {
- StringValue(argv[0]);
- }
- else {
- SafeStringValue(argv[0]);
- }
- if (argc > 3) {
- const char *name = rb_id2name(rb_frame_callee());
- rb_raise(rb_eArgError,
- "wrong number of arguments: %s(src) or %s{..}",
- name, name);
- }
- if (argc > 2)
- line = NUM2INT(argv[2]);
- if (argc > 1) {
- file = StringValuePtr(argv[1]);
- }
- }
- return eval_under(klass, self, argv[0], file, line);
- }
-}
-
-/*
- * call-seq:
- * obj.instance_eval(string [, filename [, lineno]] ) => obj
- * obj.instance_eval {| | block } => obj
- *
- * Evaluates a string containing Ruby source code, or the given block,
- * within the context of the receiver (_obj_). In order to set the
- * context, the variable +self+ is set to _obj_ while
- * the code is executing, giving the code access to _obj_'s
- * instance variables. In the version of <code>instance_eval</code>
- * that takes a +String+, the optional second and third
- * parameters supply a filename and starting line number that are used
- * when reporting compilation errors.
- *
- * class Klass
- * def initialize
- * @secret = 99
- * end
- * end
- * k = Klass.new
- * k.instance_eval { @secret } #=> 99
- */
-
-VALUE
-rb_obj_instance_eval(int argc, VALUE *argv, VALUE self)
-{
- VALUE klass;
-
- if (SPECIAL_CONST_P(self)) {
- klass = CLASS_OF(self); //klass = Qnil;
- }
- else {
- klass = rb_singleton_class(self);
- }
- return specific_eval(argc, argv, klass, self);
-}
-
-/*
- * call-seq:
- * obj.instance_exec(arg...) {|var...| block } => obj
- *
- * Executes the given block within the context of the receiver
- * (_obj_). In order to set the context, the variable +self+ is set
- * to _obj_ while the code is executing, giving the code access to
- * _obj_'s instance variables. Arguments are passed as block parameters.
- *
- * class Klass
- * def initialize
- * @secret = 99
- * end
- * end
- * k = Klass.new
- * k.instance_exec(5) {|x| @secret+x } #=> 104
- */
-
-VALUE
-rb_obj_instance_exec(int argc, VALUE *argv, VALUE self)
-{
- VALUE klass;
-
- if (SPECIAL_CONST_P(self)) {
- klass = Qnil;
- }
- else {
- klass = rb_singleton_class(self);
- }
- return yield_under(klass, self, rb_ary_new4(argc, argv));
-}
-
-/*
- * call-seq:
- * mod.class_eval(string [, filename [, lineno]]) => obj
- * mod.module_eval {|| block } => obj
- *
- * Evaluates the string or block in the context of _mod_. This can
- * be used to add methods to a class. <code>module_eval</code> returns
- * the result of evaluating its argument. The optional _filename_
- * and _lineno_ parameters set the text for error messages.
- *
- * class Thing
- * end
- * a = %q{def hello() "Hello there!" end}
- * Thing.module_eval(a)
- * puts Thing.new.hello()
- * Thing.module_eval("invalid code", "dummy", 123)
- *
- * <em>produces:</em>
- *
- * Hello there!
- * dummy:123:in `module_eval': undefined local variable
- * or method `code' for Thing:Class
- */
-
-VALUE
-rb_mod_module_eval(int argc, VALUE *argv, VALUE mod)
-{
- return specific_eval(argc, argv, mod, mod);
-}
-
-/*
- * call-seq:
- * mod.module_exec(arg...) {|var...| block } => obj
- * mod.class_exec(arg...) {|var...| block } => obj
- *
- * Evaluates the given block in the context of the class/module.
- * The method defined in the block will belong to the receiver.
- *
- * class Thing
- * end
- * Thing.class_exec{
- * def hello() "Hello there!" end
- * }
- * puts Thing.new.hello()
- *
- * <em>produces:</em>
- *
- * Hello there!
- */
-
-VALUE
-rb_mod_module_exec(int argc, VALUE *argv, VALUE mod)
-{
- return yield_under(mod, mod, rb_ary_new4(argc, argv));
-}
-
-static void
-secure_visibility(VALUE self)
-{
- if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
- rb_raise(rb_eSecurityError,
- "Insecure: can't change method visibility");
- }
-}
-
-static void
-set_method_visibility(VALUE self, int argc, VALUE *argv, ID ex)
-{
- int i;
- secure_visibility(self);
- for (i = 0; i < argc; i++) {
- rb_export_method(self, rb_to_id(argv[i]), ex);
- }
- rb_clear_cache_by_class(self);
-}
-
-/*
- * call-seq:
- * public => self
- * public(symbol, ...) => self
- *
- * With no arguments, sets the default visibility for subsequently
- * defined methods to public. With arguments, sets the named methods to
- * have public visibility.
- */
-
-static VALUE
-rb_mod_public(int argc, VALUE *argv, VALUE module)
-{
- secure_visibility(module);
- if (argc == 0) {
- SCOPE_SET(NOEX_PUBLIC);
- }
- else {
- set_method_visibility(module, argc, argv, NOEX_PUBLIC);
- }
- return module;
-}
-
-/*
- * call-seq:
- * protected => self
- * protected(symbol, ...) => self
- *
- * With no arguments, sets the default visibility for subsequently
- * defined methods to protected. With arguments, sets the named methods
- * to have protected visibility.
- */
-
-static VALUE
-rb_mod_protected(int argc, VALUE *argv, VALUE module)
-{
- secure_visibility(module);
- if (argc == 0) {
- SCOPE_SET(NOEX_PROTECTED);
- }
- else {
- set_method_visibility(module, argc, argv, NOEX_PROTECTED);
- }
- return module;
-}
-
-/*
- * call-seq:
- * private => self
- * private(symbol, ...) => self
- *
- * With no arguments, sets the default visibility for subsequently
- * defined methods to private. With arguments, sets the named methods
- * to have private visibility.
- *
- * module Mod
- * def a() end
- * def b() end
- * private
- * def c() end
- * private :a
- * end
- * Mod.private_instance_methods #=> ["a", "c"]
- */
-
-static VALUE
-rb_mod_private(int argc, VALUE *argv, VALUE module)
-{
- secure_visibility(module);
- if (argc == 0) {
- SCOPE_SET(NOEX_PRIVATE);
- }
- else {
- set_method_visibility(module, argc, argv, NOEX_PRIVATE);
- }
- return module;
-}
-
-/*
- * call-seq:
- * mod.public_class_method(symbol, ...) => mod
- *
- * Makes a list of existing class methods public.
- */
-
-static VALUE
-rb_mod_public_method(int argc, VALUE *argv, VALUE obj)
-{
- set_method_visibility(CLASS_OF(obj), argc, argv, NOEX_PUBLIC);
- return obj;
-}
-
-/*
- * call-seq:
- * mod.private_class_method(symbol, ...) => mod
- *
- * Makes existing class methods private. Often used to hide the default
- * constructor <code>new</code>.
- *
- * class SimpleSingleton # Not thread safe
- * private_class_method :new
- * def SimpleSingleton.create(*args, &block)
- * @me = new(*args, &block) if ! @me
- * @me
- * end
- * end
- */
-
-static VALUE
-rb_mod_private_method(int argc, VALUE *argv, VALUE obj)
-{
- set_method_visibility(CLASS_OF(obj), argc, argv, NOEX_PRIVATE);
- return obj;
-}
-
-/*
- * call-seq:
- * public
- * public(symbol, ...)
- *
- * With no arguments, sets the default visibility for subsequently
- * defined methods to public. With arguments, sets the named methods to
- * have public visibility.
- */
-
-static VALUE
-top_public(int argc, VALUE *argv)
-{
- return rb_mod_public(argc, argv, rb_cObject);
-}
-
-static VALUE
-top_private(int argc, VALUE *argv)
-{
- return rb_mod_private(argc, argv, rb_cObject);
-}
-
-/*
- * call-seq:
- * module_function(symbol, ...) => self
- *
- * Creates module functions for the named methods. These functions may
- * be called with the module as a receiver, and also become available
- * as instance methods to classes that mix in the module. Module
- * functions are copies of the original, and so may be changed
- * independently. The instance-method versions are made private. If
- * used with no arguments, subsequently defined methods become module
- * functions.
- *
- * module Mod
- * def one
- * "This is one"
- * end
- * module_function :one
- * end
- * class Cls
- * include Mod
- * def callOne
- * one
- * end
- * end
- * Mod.one #=> "This is one"
- * c = Cls.new
- * c.callOne #=> "This is one"
- * module Mod
- * def one
- * "This is the new one"
- * end
- * end
- * Mod.one #=> "This is one"
- * c.callOne #=> "This is the new one"
- */
-
-static VALUE
-rb_mod_modfunc(int argc, VALUE *argv, VALUE module)
-{
- int i;
- ID id;
- NODE *fbody;
-
- if (TYPE(module) != T_MODULE) {
- rb_raise(rb_eTypeError, "module_function must be called for modules");
- }
-
- secure_visibility(module);
- if (argc == 0) {
- SCOPE_SET(NOEX_MODFUNC);
- return module;
- }
-
- set_method_visibility(module, argc, argv, NOEX_PRIVATE);
-
- for (i = 0; i < argc; i++) {
- VALUE m = module;
-
- id = rb_to_id(argv[i]);
- for (;;) {
- fbody = search_method(m, id, &m);
- if (fbody == 0) {
- fbody = search_method(rb_cObject, id, &m);
- }
- if (fbody == 0 || fbody->nd_body == 0) {
- rb_bug("undefined method `%s'; can't happen", rb_id2name(id));
- }
- if (nd_type(fbody->nd_body->nd_body) != NODE_ZSUPER) {
- break; /* normal case: need not to follow 'super' link */
- }
- m = RCLASS_SUPER(m);
- if (!m)
- break;
- }
- rb_add_method(rb_singleton_class(module), id, fbody->nd_body->nd_body,
- NOEX_PUBLIC);
- }
- return module;
-}
-
-/*
- * call-seq:
- * append_features(mod) => mod
- *
- * When this module is included in another, Ruby calls
- * <code>append_features</code> in this module, passing it the
- * receiving module in _mod_. Ruby's default implementation is
- * to add the constants, methods, and module variables of this module
- * to _mod_ if this module has not already been added to
- * _mod_ or one of its ancestors. See also <code>Module#include</code>.
- */
-
-static VALUE
-rb_mod_append_features(VALUE module, VALUE include)
-{
- switch (TYPE(include)) {
- case T_CLASS:
- case T_MODULE:
- break;
- default:
- Check_Type(include, T_CLASS);
- break;
- }
- rb_include_module(include, module);
-
- return module;
-}
-
-/*
- * call-seq:
- * include(module, ...) => self
- *
- * Invokes <code>Module.append_features</code> on each parameter in turn.
- */
-
-static VALUE
-rb_mod_include(int argc, VALUE *argv, VALUE module)
-{
- int i;
-
- for (i = 0; i < argc; i++)
- Check_Type(argv[i], T_MODULE);
- while (argc--) {
- rb_funcall(argv[argc], rb_intern("append_features"), 1, module);
- rb_funcall(argv[argc], rb_intern("included"), 1, module);
- }
- return module;
-}
-
-void
-rb_obj_call_init(VALUE obj, int argc, VALUE *argv)
-{
- PASS_PASSED_BLOCK();
- rb_funcall2(obj, init, argc, argv);
-}
-
-void
-rb_extend_object(VALUE obj, VALUE module)
-{
- rb_include_module(rb_singleton_class(obj), module);
-}
-
-/*
- * call-seq:
- * extend_object(obj) => obj
- *
- * Extends the specified object by adding this module's constants and
- * methods (which are added as singleton methods). This is the callback
- * method used by <code>Object#extend</code>.
- *
- * module Picky
- * def Picky.extend_object(o)
- * if String === o
- * puts "Can't add Picky to a String"
- * else
- * puts "Picky added to #{o.class}"
- * super
- * end
- * end
- * end
- * (s = Array.new).extend Picky # Call Object.extend
- * (s = "quick brown fox").extend Picky
- *
- * <em>produces:</em>
- *
- * Picky added to Array
- * Can't add Picky to a String
- */
-
-static VALUE
-rb_mod_extend_object(VALUE mod, VALUE obj)
-{
- rb_extend_object(obj, mod);
- return obj;
-}
-
-/*
- * call-seq:
- * obj.extend(module, ...) => obj
- *
- * Adds to _obj_ the instance methods from each module given as a
- * parameter.
- *
- * module Mod
- * def hello
- * "Hello from Mod.\n"
- * end
- * end
- *
- * class Klass
- * def hello
- * "Hello from Klass.\n"
- * end
- * end
- *
- * k = Klass.new
- * k.hello #=> "Hello from Klass.\n"
- * k.extend(Mod) #=> #<Klass:0x401b3bc8>
- * k.hello #=> "Hello from Mod.\n"
- */
-
-static VALUE
-rb_obj_extend(int argc, VALUE *argv, VALUE obj)
-{
- int i;
-
- if (argc == 0) {
- rb_raise(rb_eArgError, "wrong number of arguments (0 for 1)");
- }
- for (i = 0; i < argc; i++)
- Check_Type(argv[i], T_MODULE);
- while (argc--) {
- rb_funcall(argv[argc], rb_intern("extend_object"), 1, obj);
- rb_funcall(argv[argc], rb_intern("extended"), 1, obj);
- }
- return obj;
-}
-
-/*
- * call-seq:
- * include(module, ...) => self
- *
- * Invokes <code>Module.append_features</code>
- * on each parameter in turn. Effectively adds the methods and constants
- * in each module to the receiver.
- */
-
-static VALUE
-top_include(int argc, VALUE *argv, VALUE self)
-{
- rb_thread_t *th = GET_THREAD();
-
- rb_secure(4);
- if (th->top_wrapper) {
- rb_warning
- ("main#include in the wrapped load is effective only in wrapper module");
- return rb_mod_include(argc, argv, th->top_wrapper);
- }
- return rb_mod_include(argc, argv, rb_cObject);
-}
-
-VALUE rb_f_trace_var();
-VALUE rb_f_untrace_var();
-
-static VALUE *
-errinfo_place(void)
-{
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = th->cfp;
- rb_control_frame_t *end_cfp = RUBY_VM_END_CONTROL_FRAME(th);
-
- while (RUBY_VM_VALID_CONTROL_FRAME_P(cfp, end_cfp)) {
- if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
- if (cfp->iseq->type == ISEQ_TYPE_RESCUE) {
- return &cfp->dfp[-1];
- }
- else if (cfp->iseq->type == ISEQ_TYPE_ENSURE &&
- TYPE(cfp->dfp[-1]) != T_NODE &&
- !FIXNUM_P(cfp->dfp[-1])) {
- return &cfp->dfp[-1];
- }
- }
- cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
- }
- return 0;
-}
-
-static VALUE
-get_errinfo(void)
-{
- VALUE *ptr = errinfo_place();
- if (ptr) {
- return *ptr;
- }
- else {
- return Qnil;
- }
-}
-
-static VALUE
-errinfo_getter(ID id)
-{
- return get_errinfo();
-}
-
-#if 0
-static void
-errinfo_setter(VALUE val, ID id, VALUE *var)
-{
- if (!NIL_P(val) && !rb_obj_is_kind_of(val, rb_eException)) {
- rb_raise(rb_eTypeError, "assigning non-exception to $!");
- }
- else {
- VALUE *ptr = errinfo_place();
- if (ptr) {
- *ptr = val;
- }
- else {
- rb_raise(rb_eRuntimeError, "errinfo_setter: not in rescue clause.");
- }
- }
-}
-#endif
-
-VALUE
-rb_errinfo(void)
-{
- rb_thread_t *th = GET_THREAD();
- return th->errinfo;
-}
-
-void
-rb_set_errinfo(VALUE err)
-{
- if (!NIL_P(err) && !rb_obj_is_kind_of(err, rb_eException)) {
- rb_raise(rb_eTypeError, "assigning non-exception to $!");
- }
- GET_THREAD()->errinfo = err;
-}
-
-VALUE
-rb_rubylevel_errinfo(void)
-{
- return get_errinfo();
-}
-
-static VALUE
-errat_getter(ID id)
-{
- VALUE err = get_errinfo();
- if (!NIL_P(err)) {
- return get_backtrace(err);
- }
- else {
- return Qnil;
- }
-}
-
-static void
-errat_setter(VALUE val, ID id, VALUE *var)
-{
- VALUE err = get_errinfo();
- if (NIL_P(err)) {
- rb_raise(rb_eArgError, "$! not set");
- }
- set_backtrace(err, val);
-}
-
-int vm_collect_local_variables_in_heap(rb_thread_t *th, VALUE *dfp, VALUE ary);
-
-/*
- * call-seq:
- * local_variables => array
- *
- * Returns the names of the current local variables.
- *
- * fred = 1
- * for i in 1..10
- * # ...
- * end
- * local_variables #=> ["fred", "i"]
- */
-
-static VALUE
-rb_f_local_variables(void)
-{
- VALUE ary = rb_ary_new();
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp =
- vm_get_ruby_level_cfp(th, RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp));
- int i;
-
- while (1) {
- if (cfp->iseq) {
- for (i = 0; i < cfp->iseq->local_table_size; i++) {
- ID lid = cfp->iseq->local_table[i];
- if (lid) {
- const char *vname = rb_id2name(lid);
- /* should skip temporary variable */
- if (vname) {
- rb_ary_push(ary, rb_str_new2(vname));
- }
- }
- }
- }
- if (cfp->lfp != cfp->dfp) {
- /* block */
- VALUE *dfp = GC_GUARDED_PTR_REF(cfp->dfp[0]);
-
- if (vm_collect_local_variables_in_heap(th, dfp, ary)) {
- break;
- }
- else {
- while (cfp->dfp != dfp) {
- cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
- }
- }
- }
- else {
- break;
- }
- }
- return ary;
-}
-
-
-/*
- * call-seq:
- * __method__ => symbol
- * __callee__ => symbol
- *
- * Returns the name of the current method as a Symbol.
- * If called outside of a method, it returns <code>nil</code>.
- *
- */
-
-static VALUE
-rb_f_method_name(void)
-{
- ID fname = rb_frame_callee();
-
- if (fname) {
- return ID2SYM(fname);
- }
- else {
- return Qnil;
- }
-}
-
-void
-Init_eval(void)
-{
- /* TODO: fix position */
- GET_THREAD()->vm->mark_object_ary = rb_ary_new();
-
- init = rb_intern("initialize");
- eqq = rb_intern("===");
- each = rb_intern("each");
-
- aref = rb_intern("[]");
- aset = rb_intern("[]=");
- match = rb_intern("=~");
- missing = rb_intern("method_missing");
- added = rb_intern("method_added");
- singleton_added = rb_intern("singleton_method_added");
- removed = rb_intern("method_removed");
- singleton_removed = rb_intern("singleton_method_removed");
- undefined = rb_intern("method_undefined");
- singleton_undefined = rb_intern("singleton_method_undefined");
-
- object_id = rb_intern("object_id");
- __send__ = rb_intern("__send__");
-
- rb_define_virtual_variable("$@", errat_getter, errat_setter);
- rb_define_virtual_variable("$!", errinfo_getter, 0);
-
- rb_define_private_method(rb_cBasicObject, "method_missing", rb_method_missing, -1);
-
- rb_define_global_function("eval", rb_f_eval, -1);
- rb_define_global_function("iterator?", rb_f_block_given_p, 0);
- rb_define_global_function("block_given?", rb_f_block_given_p, 0);
- rb_define_global_function("loop", rb_f_loop, 0);
-
- rb_define_method(rb_mKernel, "respond_to?", obj_respond_to, -1);
- respond_to = rb_intern("respond_to?");
- basic_respond_to = rb_method_node(rb_cObject, respond_to);
- rb_register_mark_object((VALUE)basic_respond_to);
-
- rb_define_global_function("raise", rb_f_raise, -1);
- rb_define_global_function("fail", rb_f_raise, -1);
-
- rb_define_global_function("caller", rb_f_caller, -1);
-
- rb_define_global_function("global_variables", rb_f_global_variables, 0); /* in variable.c */
- rb_define_global_function("local_variables", rb_f_local_variables, 0);
-
- rb_define_global_function("__method__", rb_f_method_name, 0);
- rb_define_global_function("__callee__", rb_f_method_name, 0);
-
- rb_define_method(rb_cBasicObject, "__send__", rb_f_send, -1);
- rb_define_method(rb_mKernel, "send", rb_f_send, -1);
- rb_define_method(rb_mKernel, "public_send", rb_f_public_send, -1);
-
- rb_define_method(rb_cBasicObject, "instance_eval", rb_obj_instance_eval, -1);
- rb_define_method(rb_cBasicObject, "instance_exec", rb_obj_instance_exec, -1);
-
- rb_define_private_method(rb_cModule, "append_features", rb_mod_append_features, 1);
- rb_define_private_method(rb_cModule, "extend_object", rb_mod_extend_object, 1);
- rb_define_private_method(rb_cModule, "include", rb_mod_include, -1);
- rb_define_private_method(rb_cModule, "public", rb_mod_public, -1);
- rb_define_private_method(rb_cModule, "protected", rb_mod_protected, -1);
- rb_define_private_method(rb_cModule, "private", rb_mod_private, -1);
- rb_define_private_method(rb_cModule, "module_function", rb_mod_modfunc, -1);
- rb_define_method(rb_cModule, "method_defined?", rb_mod_method_defined, 1);
- rb_define_method(rb_cModule, "public_method_defined?", rb_mod_public_method_defined, 1);
- rb_define_method(rb_cModule, "private_method_defined?", rb_mod_private_method_defined, 1);
- rb_define_method(rb_cModule, "protected_method_defined?", rb_mod_protected_method_defined, 1);
- rb_define_method(rb_cModule, "public_class_method", rb_mod_public_method, -1);
- rb_define_method(rb_cModule, "private_class_method", rb_mod_private_method, -1);
- rb_define_method(rb_cModule, "module_eval", rb_mod_module_eval, -1);
- rb_define_method(rb_cModule, "class_eval", rb_mod_module_eval, -1);
- rb_define_method(rb_cModule, "module_exec", rb_mod_module_exec, -1);
- rb_define_method(rb_cModule, "class_exec", rb_mod_module_exec, -1);
-
- rb_undef_method(rb_cClass, "module_function");
-
- Init_eval_method();
-
- rb_define_singleton_method(rb_cModule, "nesting", rb_mod_nesting, 0);
- rb_define_singleton_method(rb_cModule, "constants", rb_mod_s_constants, -1);
-
- rb_define_singleton_method(rb_vm_top_self(), "include", top_include, -1);
- rb_define_singleton_method(rb_vm_top_self(), "public", top_public, -1);
- rb_define_singleton_method(rb_vm_top_self(), "private", top_private, -1);
-
- rb_define_method(rb_mKernel, "extend", rb_obj_extend, -1);
-
- rb_define_global_function("trace_var", rb_f_trace_var, -1); /* in variable.c */
- rb_define_global_function("untrace_var", rb_f_untrace_var, -1); /* in variable.c */
-
- rb_define_virtual_variable("$SAFE", safe_getter, safe_setter);
-
- exception_error = rb_exc_new2(rb_eFatal, "exception reentered");
- rb_ivar_set(exception_error, idThrowState, INT2FIX(TAG_FATAL));
- rb_register_mark_object(exception_error);
-}
-
-
-/* for parser */
-
-int
-rb_dvar_defined(ID id)
-{
- rb_thread_t *th = GET_THREAD();
- rb_iseq_t *iseq;
- if (th->base_block && (iseq = th->base_block->iseq)) {
- while (iseq->type == ISEQ_TYPE_BLOCK ||
- iseq->type == ISEQ_TYPE_RESCUE ||
- iseq->type == ISEQ_TYPE_ENSURE ||
- iseq->type == ISEQ_TYPE_EVAL) {
- int i;
-
- for (i = 0; i < iseq->local_table_size; i++) {
- if (iseq->local_table[i] == id) {
- return 1;
- }
- }
- iseq = iseq->parent_iseq;
- }
- }
- return 0;
-}
-
-int
-rb_local_defined(ID id)
-{
- rb_thread_t *th = GET_THREAD();
- rb_iseq_t *iseq;
-
- if (th->base_block && th->base_block->iseq) {
- int i;
- iseq = th->base_block->iseq->local_iseq;
-
- for (i=0; i<iseq->local_table_size; i++) {
- if (iseq->local_table[i] == id) {
- return 1;
- }
- }
- }
- return 0;
-}
-
-int
-rb_parse_in_eval(void)
-{
- return GET_THREAD()->parse_in_eval != 0;
-}
Modified: MacRuby/branches/testing/ext/strscan/strscan.c
===================================================================
--- MacRuby/branches/testing/ext/strscan/strscan.c 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/ext/strscan/strscan.c 2008-06-17 01:04:32 UTC (rev 295)
@@ -42,13 +42,13 @@
#define MATCHED(s) (s)->flags |= FLAG_MATCHED
#define CLEAR_MATCH_STATUS(s) (s)->flags &= ~FLAG_MATCHED
-#define S_PBEG(s) (RSTRING_PTR((s)->str))
-#define S_LEN(s) (RSTRING_LEN((s)->str))
+#define S_PBEG(s) (RSTRING_CPTR((s)->str))
+#define S_LEN(s) (RSTRING_CLEN((s)->str))
#define S_PEND(s) (S_PBEG(s) + S_LEN(s))
#define CURPTR(s) (S_PBEG(s) + (s)->curr)
#define S_RESTLEN(s) (S_LEN(s) - (s)->curr)
-#define EOS_P(s) ((s)->curr >= RSTRING_LEN(p->str))
+#define EOS_P(s) ((s)->curr >= RSTRING_CLEN(p->str))
#define GET_SCANNER(obj,var) do {\
Data_Get_Struct(obj, struct strscanner, var);\
@@ -1089,7 +1089,7 @@
len = snprintf(buf, BUFSIZE, "#<%s %ld/%ld @ %s>",
rb_class2name(CLASS_OF(self)),
p->curr, S_LEN(p),
- RSTRING_PTR(b));
+ RSTRING_CPTR(b));
return infect(rb_str_new(buf, len), p);
}
a = inspect1(p);
@@ -1097,8 +1097,8 @@
len = snprintf(buf, BUFSIZE, "#<%s %ld/%ld %s @ %s>",
rb_class2name(CLASS_OF(self)),
p->curr, S_LEN(p),
- RSTRING_PTR(a),
- RSTRING_PTR(b));
+ RSTRING_CPTR(a),
+ RSTRING_CPTR(b));
return infect(rb_str_new(buf, len), p);
}
Deleted: MacRuby/branches/testing/framework/Info.plist
===================================================================
--- MacRuby/branches/testing/framework/Info.plist 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/framework/Info.plist 2008-06-17 01:04:32 UTC (rev 295)
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>Ruby</string>
- <key>CFBundleName</key>
- <string>Ruby</string>
- <key>CFBundleGetInfoString</key>
- <string>MacRuby Runtime and Library</string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string>com.apple.macruby</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>0.1</string>
- <key>CFBundlePackageType</key>
- <string>FMWK</string>
- <key>CFBundleShortVersionString</key>
- <string>1.9.0</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>MacRuby-0.1</string>
- <key>NSPrincipalClass</key>
- <string></string>
-</dict>
-</plist>
Modified: MacRuby/branches/testing/gc-stub.m
===================================================================
--- MacRuby/branches/testing/gc-stub.m 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/gc-stub.m 2008-06-17 01:04:32 UTC (rev 295)
@@ -26,13 +26,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#import <Foundation/Foundation.h>
-
/* This file is needed to enable GC in miniruby and ruby executables.
* The __RBDummy__ class is only to have something Objective-C in the
* executable bits, for the compiler.
*/
- at interface __RBDummy__ : NSObject
+ at interface __RBDummy__
@end
@implementation __RBDummy__
@end
Modified: MacRuby/branches/testing/gc.c
===================================================================
--- MacRuby/branches/testing/gc.c 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/gc.c 2008-06-17 01:04:32 UTC (rev 295)
@@ -56,7 +56,21 @@
#define AUTO_LOG_UNUSUAL (1 << 5)
#define AUTO_LOG_WEAK (1 << 6)
#define AUTO_LOG_ALL (~0u)
+extern void auto_zone_retain(auto_zone_t *, void *);
+extern unsigned int auto_zone_release(auto_zone_t *, void *);
+extern void auto_collector_disable(auto_zone_t *);
+extern void auto_collector_reenable(auto_zone_t *);
+extern boolean_t auto_zone_set_write_barrier(auto_zone_t *, const void *,
+ const void *);
+extern void auto_zone_write_barrier_range(auto_zone_t *, void *, size_t);
+extern void auto_zone_add_root(auto_zone_t *, void *, void *);
+extern void auto_zone_register_thread(auto_zone_t *);
+extern void auto_zone_unregister_thread(auto_zone_t *);
+extern void auto_collect(auto_zone_t *, int, void *);
+extern boolean_t auto_zone_is_valid_pointer(auto_zone_t *, const void *);
typedef int auto_memory_type_t;
+extern auto_memory_type_t auto_zone_get_layout_type_no_lock(auto_zone_t *,
+ void *);
extern void *auto_zone_allocate_object(
auto_zone_t *, size_t, auto_memory_type_t, boolean_t, boolean_t);
extern void *auto_zone_write_barrier_memmove(
@@ -395,6 +409,16 @@
#if WITH_OBJC
+static void
+rb_objc_no_gc_error(void)
+{
+ fprintf(stderr,
+ "The client that links against MacRuby was not built for "\
+ "GC. Please turn on garbage collection (-fobjc-gc) and "\
+ "try again.\n");
+ exit(1);
+}
+
void *
ruby_xmalloc(size_t size)
{
@@ -406,13 +430,8 @@
if (size == 0) size = 1;
rb_gc_malloc_increase(size);
- if (__auto_zone == NULL) {
- fprintf(stderr,
- "The client that links against MacRuby was not built for "\
- "GC. Please turn on garbage collection (-fobjc-gc) and "\
- "try again.\n");
- exit(1);
- }
+ if (__auto_zone == NULL)
+ rb_objc_no_gc_error();
mem = auto_zone_allocate_object(__auto_zone, size,
AUTO_MEMORY_SCANNED, 0, 0);
xmalloc_count++;
@@ -3097,6 +3116,10 @@
auto_collection_control_t *control;
__auto_zone = auto_zone();
+
+ if (__auto_zone == NULL)
+ rb_objc_no_gc_error();
+
//auto_zone_register_thread(__auto_zone);
control = auto_collection_parameters(__auto_zone);
Copied: MacRuby/branches/testing/include/ruby/config.h.in (from rev 294, MacRuby/trunk/include/ruby/config.h.in)
===================================================================
--- MacRuby/branches/testing/include/ruby/config.h.in (rev 0)
+++ MacRuby/branches/testing/include/ruby/config.h.in 2008-06-17 01:04:32 UTC (rev 295)
@@ -0,0 +1,222 @@
+#define PACKAGE_NAME ""
+#define PACKAGE_TARNAME ""
+#define PACKAGE_VERSION ""
+#define PACKAGE_STRING ""
+#define PACKAGE_BUGREPORT ""
+#define NEXT_FAT_BINARY 1
+#define USE_BUILTIN_FRAME_ADDRESS 1
+#define _GNU_SOURCE 1
+#define STDC_HEADERS 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRING_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_UNISTD_H 1
+#define __EXTENSIONS__ 1
+#define _POSIX_PTHREAD_SEMANTICS 1
+#define _TANDEM_SOURCE 1
+#define HAVE_LONG_LONG 1
+#define HAVE_OFF_T 1
+#define SIZEOF_INT 4
+#define SIZEOF_SHORT 2
+#define SIZEOF_LONG 4
+#define SIZEOF_LONG_LONG 8
+#define SIZEOF___INT64 0
+#define SIZEOF_OFF_T 8
+#define SIZEOF_VOIDP 4
+#define SIZEOF_FLOAT 4
+#define SIZEOF_DOUBLE 8
+#define SIZEOF_TIME_T 4
+#define rb_pid_t pid_t
+#define PIDT2NUM(v) LONG2NUM(v)
+#define NUM2PIDT(v) NUM2LONG(v)
+#define rb_uid_t uid_t
+#define UIDT2NUM(v) ULONG2NUM(v)
+#define NUM2UIDT(v) NUM2ULONG(v)
+#define rb_gid_t gid_t
+#define GIDT2NUM(v) ULONG2NUM(v)
+#define NUM2GIDT(v) NUM2ULONG(v)
+#define HAVE_PROTOTYPES 1
+#define TOKEN_PASTE(x,y) x##y
+#define STRINGIZE(expr) STRINGIZE0(expr)
+#define HAVE_STDARG_PROTOTYPES 1
+#define NORETURN(x) __attribute__ ((noreturn)) x
+#define DEPRECATED(x) __attribute__ ((deprecated)) x
+#define NOINLINE(x) __attribute__ ((noinline)) x
+#define HAVE_DECL_SYS_NERR 1
+#define HAVE_LIBDL 1
+#define HAVE_DIRENT_H 1
+#define STDC_HEADERS 1
+#define HAVE_SYS_WAIT_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRING_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_SYS_FILE_H 1
+#define HAVE_SYS_IOCTL_H 1
+#define HAVE_SYS_SYSCALL_H 1
+#define HAVE_FCNTL_H 1
+#define HAVE_SYS_FCNTL_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_TIMES_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_PWD_H 1
+#define HAVE_GRP_H 1
+#define HAVE_UTIME_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_NETINET_IN_SYSTM_H 1
+#define HAVE_FLOAT_H 1
+#define HAVE_PTHREAD_H 1
+#define HAVE_UCONTEXT_H 1
+#define HAVE_LANGINFO_H 1
+#define HAVE_LOCALE_H 1
+#define HAVE_TIME_H 1
+#define SIZEOF_RLIM_T 8
+#define SIZEOF_SIZE_T 4
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+#define HAVE_ST_BLKSIZE 1
+#define HAVE_STRUCT_STAT_ST_BLOCKS 1
+#define HAVE_ST_BLOCKS 1
+#define HAVE_STRUCT_STAT_ST_RDEV 1
+#define HAVE_ST_RDEV 1
+#define HAVE_STRUCT_STAT_ST_ATIMESPEC 1
+#define HAVE_STRUCT_STAT_ST_MTIMESPEC 1
+#define HAVE_STRUCT_STAT_ST_CTIMESPEC 1
+#define HAVE_STRUCT_TIMESPEC 1
+#define HAVE_RB_FD_INIT 1
+#define HAVE_INT8_T 1
+#define HAVE_UINT8_T 1
+#define HAVE_INT16_T 1
+#define HAVE_UINT16_T 1
+#define HAVE_INT32_T 1
+#define HAVE_UINT32_T 1
+#define HAVE_INT64_T 1
+#define HAVE_UINT64_T 1
+#define HAVE_INTPTR_T 1
+#define HAVE_UINTPTR_T 1
+#define HAVE_SSIZE_T 1
+#define GETGROUPS_T gid_t
+#define RETSIGTYPE void
+#define HAVE_ALLOCA_H 1
+#define HAVE_ALLOCA 1
+#define HAVE_DUP2 1
+#define HAVE_MEMMOVE 1
+#define HAVE_STRERROR 1
+#define HAVE_STRFTIME 1
+#define HAVE_STRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_CRYPT 1
+#define HAVE_FLOCK 1
+#define HAVE_VSNPRINTF 1
+#define HAVE_ISNAN 1
+#define HAVE_FINITE 1
+#define HAVE_ISINF 1
+#define HAVE_HYPOT 1
+#define HAVE_ACOSH 1
+#define HAVE_ERF 1
+#define HAVE_TGAMMA 1
+#define HAVE_CBRT 1
+#define HAVE_STRLCPY 1
+#define HAVE_STRLCAT 1
+#define HAVE_FMOD 1
+#define HAVE_KILLPG 1
+#define HAVE_WAIT4 1
+#define HAVE_WAITPID 1
+#define HAVE_FORK 1
+#define HAVE_SYSCALL 1
+#define HAVE_CHROOT 1
+#define HAVE_FSYNC 1
+#define HAVE_GETCWD 1
+#define HAVE_TRUNCATE 1
+#define HAVE_FTRUNCATE 1
+#define HAVE_TIMES 1
+#define HAVE_UTIMES 1
+#define HAVE_FCNTL 1
+#define HAVE_LOCKF 1
+#define HAVE_LSTAT 1
+#define HAVE_LINK 1
+#define HAVE_SYMLINK 1
+#define HAVE_READLINK 1
+#define HAVE_SETITIMER 1
+#define HAVE_SETRUID 1
+#define HAVE_SETEUID 1
+#define HAVE_SETREUID 1
+#define HAVE_SOCKETPAIR 1
+#define HAVE_SETRGID 1
+#define HAVE_SETEGID 1
+#define HAVE_SETREGID 1
+#define HAVE_ISSETUGID 1
+#define HAVE_PAUSE 1
+#define HAVE_LCHOWN 1
+#define HAVE_LCHMOD 1
+#define HAVE_GETPGRP 1
+#define HAVE_SETPGRP 1
+#define HAVE_GETPGID 1
+#define HAVE_SETPGID 1
+#define HAVE_INITGROUPS 1
+#define HAVE_GETGROUPS 1
+#define HAVE_SETGROUPS 1
+#define HAVE_GETPRIORITY 1
+#define HAVE_GETRLIMIT 1
+#define HAVE_SETRLIMIT 1
+#define HAVE_SYSCONF 1
+#define HAVE_DLOPEN 1
+#define HAVE_SIGPROCMASK 1
+#define HAVE_SIGACTION 1
+#define HAVE_SIGSETJMP 1
+#define HAVE__SETJMP 1
+#define HAVE__LONGJMP 1
+#define HAVE_VSNPRINTF 1
+#define HAVE_SNPRINTF 1
+#define HAVE_SETSID 1
+#define HAVE_TELLDIR 1
+#define HAVE_SEEKDIR 1
+#define HAVE_FCHMOD 1
+#define HAVE_COSH 1
+#define HAVE_SINH 1
+#define HAVE_TANH 1
+#define HAVE_LOG2 1
+#define HAVE_ROUND 1
+#define HAVE_SETUID 1
+#define HAVE_SETGID 1
+#define HAVE_DAEMON 1
+#define HAVE_SETENV 1
+#define HAVE_UNSETENV 1
+#define HAVE_MKTIME 1
+#define HAVE_TIMEGM 1
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_PREAD 1
+#define HAVE_SENDFILE 1
+#define RUBY_SETJMP(env) _setjmp(env)
+#define RUBY_LONGJMP(env,val) _longjmp(env,val)
+#define RUBY_JMP_BUF jmp_buf
+#define HAVE_STRUCT_TM_TM_ZONE 1
+#define HAVE_TM_ZONE 1
+#define HAVE_STRUCT_TM_TM_GMTOFF 1
+#define HAVE_DAYLIGHT 1
+#define HAVE_VAR_TIMEZONE 1
+#define TYPEOF_VAR_TIMEZONE long
+#define NEGATIVE_TIME_T 1
+#define POSIX_SIGNAL 1
+#define GETPGRP_VOID 1
+#define SETPGRP_VOID 1
+#define RSHIFT(x,y) ((x)>>(int)y)
+#define FILE_COUNT _r
+#define FILE_READPTR _p
+#define HAVE__SC_CLK_TCK 1
+#define STACK_GROW_DIRECTION -1
+#define _REENTRANT 1
+#define _THREAD_SAFE 1
+#define HAVE_LIBPTHREAD 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_GETCONTEXT 1
+#define HAVE_SETCONTEXT 1
+#define HAVE_BACKTRACE 1
+#define DLEXT_MAXLEN 7
+#define DLEXT ".bundle"
Modified: MacRuby/branches/testing/include/ruby/intern.h
===================================================================
--- MacRuby/branches/testing/include/ruby/intern.h 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/include/ruby/intern.h 2008-06-17 01:04:32 UTC (rev 295)
@@ -150,6 +150,7 @@
VALUE rb_objc_import_class(Class);
VALUE rb_objc_create_class(const char *name, VALUE super);
VALUE rb_objc_rename_class(VALUE klass, const char *name);
+bool rb_objc_install_primitives(Class ocklass, Class ocsuper);
#endif
VALUE rb_class_boot(VALUE);
VALUE rb_class_new(VALUE);
Modified: MacRuby/branches/testing/include/ruby/node.h
===================================================================
--- MacRuby/branches/testing/include/ruby/node.h 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/include/ruby/node.h 2008-06-17 01:04:32 UTC (rev 295)
@@ -507,7 +507,7 @@
void rb_add_method(VALUE, ID, NODE *, int);
void rb_add_method_direct(VALUE, ID, NODE *);
#if WITH_OBJC
-NODE *rb_objc_define_objc_mid_closure(VALUE, ID, NODE *);
+NODE *rb_objc_define_objc_mid_closure(VALUE, ID, ID);
#endif
NODE *rb_node_newnode(enum node_type,VALUE,VALUE,VALUE);
Modified: MacRuby/branches/testing/include/ruby/ruby.h
===================================================================
--- MacRuby/branches/testing/include/ruby/ruby.h 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/include/ruby/ruby.h 2008-06-17 01:04:32 UTC (rev 295)
@@ -1116,7 +1116,7 @@
static char *dln_libs_to_be_linked[] = { EXTLIB, 0 };
#endif
-#if (defined(__APPLE__) || defined(__NeXT__)) && defined(__MACH__)
+#if (defined(__APPLE__) || defined(__NeXT__)) && defined(__MACH__) && !defined(WITH_OBJC)
/* to link startup code with ObjC support */
#define RUBY_GLOBAL_SETUP static void objcdummyfunction(void) {objc_msgSend(NULL,NULL);}
#else
Deleted: MacRuby/branches/testing/include/ruby/win32.h
===================================================================
--- MacRuby/branches/testing/include/ruby/win32.h 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/include/ruby/win32.h 2008-06-17 01:04:32 UTC (rev 295)
@@ -1,568 +0,0 @@
-#ifndef RUBY_WIN32_H
-#define RUBY_WIN32_H 1
-
-#if defined(__cplusplus)
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-
-/*
- * Copyright (c) 1993, Intergraph Corporation
- *
- * You may distribute under the terms of either the GNU General Public
- * License or the Artistic License, as specified in the perl README file.
- *
- */
-
-//
-// Definitions for NT port of Perl
-//
-
-
-//
-// Ok now we can include the normal include files.
-//
-
-// #include <stdarg.h> conflict with varargs.h?
-#if !defined(WSAAPI)
-#include <winsock2.h>
-#endif
-
-#define NT 1 /* deprecated */
-
-#ifdef _WIN32_WCE
-#undef CharNext
-#define CharNext CharNextA
-#endif
-
-//
-// We're not using Microsoft's "extensions" to C for
-// Structured Exception Handling (SEH) so we can nuke these
-//
-#undef try
-#undef except
-#undef finally
-#undef leave
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <direct.h>
-#include <process.h>
-#include <time.h>
-#if defined(__cplusplus) && defined(_MSC_VER) && _MSC_VER == 1200
-extern "C++" { /* template without extern "C++" */
-#endif
-#include <math.h>
-#if defined(__cplusplus) && defined(_MSC_VER) && _MSC_VER == 1200
-}
-#endif
-#include <signal.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#ifdef HAVE_SYS_UTIME_H
-# include <sys/utime.h>
-#else
-# include <utime.h>
-#endif
-#include <io.h>
-#include <malloc.h>
-#ifdef __MINGW32__
-# include <stdint.h>
-#else
-# if !defined(_INTPTR_T_DEFINED)
-# ifdef _WIN64
-typedef __int64 intptr_t;
-# else
-typedef int intptr_t;
-# endif
-# define _INTPTR_T_DEFINED
-# endif
-# if !defined(_UINTPTR_T_DEFINED)
-# ifdef _WIN64
-typedef unsigned __int64 uintptr_t;
-# else
-typedef unsigned int uintptr_t;
-# endif
-# define _UINTPTR_T_DEFINED
-# endif
-#endif
-#ifndef __MINGW32__
-# define mode_t int
-#endif
-
-#ifdef _M_IX86
-# define WIN95 1
-#else
-# undef WIN95
-#endif
-
-#ifdef WIN95
-extern DWORD rb_w32_osid(void);
-#define rb_w32_iswinnt() (rb_w32_osid() == VER_PLATFORM_WIN32_NT)
-#define rb_w32_iswin95() (rb_w32_osid() == VER_PLATFORM_WIN32_WINDOWS)
-#else
-#define rb_w32_iswinnt() TRUE
-#define rb_w32_iswin95() FALSE
-#endif
-
-#define WNOHANG -1
-
-#undef getc
-#undef putc
-#undef fgetc
-#undef fputc
-#undef getchar
-#undef putchar
-#undef fgetchar
-#undef fputchar
-#undef utime
-#undef lseek
-#undef fstat
-#define getc(_stream) rb_w32_getc(_stream)
-#define getchar() rb_w32_getc(stdin)
-#define putc(_c, _stream) rb_w32_putc(_c, _stream)
-#define putchar(_c) rb_w32_putc(_c, stdout)
-#ifdef RUBY_EXPORT
-#define fgetc(_stream) getc(_stream)
-#define fputc(_c, _stream) putc(_c, _stream)
-#define fgetchar() getchar()
-#define fputchar(_c) putchar(_c)
-#define utime(_p, _t) rb_w32_utime(_p, _t)
-#define lseek(_f, _o, _w) _lseeki64(_f, _o, _w)
-
-#define pipe(p) _pipe(p, 2048L, O_BINARY)
-#define close(h) rb_w32_close(h)
-#define fclose(f) rb_w32_fclose(f)
-#define read(f, b, s) rb_w32_read(f, b, s)
-#define write(f, b, s) rb_w32_write(f, b, s)
-#define getpid() rb_w32_getpid()
-#define sleep(x) rb_w32_Sleep((x)*1000)
-#define Sleep(msec) (void)rb_w32_Sleep(msec)
-#define fstat(fd,st) _fstati64(fd,st)
-#ifdef __BORLANDC__
-#define creat(p, m) _creat(p, m)
-#define eof() _eof()
-#define filelength(h) _filelength(h)
-#define mktemp(t) _mktemp(t)
-#define tell(h) _tell(h)
-#define _open _sopen
-#define sopen _sopen
-#define _fstati64(fd,st) rb_w32_fstati64(fd,st)
-#undef fopen
-#define fopen(p, m) rb_w32_fopen(p, m)
-#undef fdopen
-#define fdopen(h, m) rb_w32_fdopen(h, m)
-#undef fsopen
-#define fsopen(p, m, sh) rb_w32_fsopen(p, m, sh)
-#endif
-
-#undef execv
-#define execv(path,argv) rb_w32_aspawn(P_OVERLAY,path,argv)
-#if !defined(__BORLANDC__) && !defined(_WIN32_WCE)
-#undef isatty
-#define isatty(h) rb_w32_isatty(h)
-#endif
-
-#undef mkdir
-#define mkdir(p, m) rb_w32_mkdir(p, m)
-#undef rmdir
-#define rmdir(p) rb_w32_rmdir(p)
-#undef unlink
-#define unlink(p) rb_w32_unlink(p)
-#endif
-
-#if SIZEOF_OFF_T == 8
-#define off_t __int64
-#define stat stati64
-#if defined(__BORLANDC__)
-#define stati64(path, st) rb_w32_stati64(path, st)
-#elif !defined(_MSC_VER) || _MSC_VER < 1400
-#define stati64 _stati64
-#define _stati64(path, st) rb_w32_stati64(path, st)
-#else
-#define stati64 _stat64
-#define _stat64(path, st) rb_w32_stati64(path, st)
-#endif
-#else
-#define stat(path,st) rb_w32_stat(path,st)
-#define fstat(fd,st) rb_w32_fstat(fd,st)
-extern int rb_w32_stat(const char *, struct stat *);
-extern int rb_w32_fstat(int, struct stat *);
-#endif
-
-#define strcasecmp stricmp
-#define strncasecmp strnicmp
-#define fsync _commit
-
-#ifdef __MINGW32__
-struct timezone {
- int tz_minuteswest;
- int tz_dsttime;
-};
-#undef isascii
-#define isascii __isascii
-#endif
-#define NtInitialize ruby_sysinit
-extern int rb_w32_cmdvector(const char *, char ***);
-extern rb_pid_t rb_w32_pipe_exec(const char *, const char *, int, int *, int *);
-extern int flock(int fd, int oper);
-extern int rb_w32_is_socket(int);
-extern int WSAAPI rb_w32_accept(int, struct sockaddr *, int *);
-extern int WSAAPI rb_w32_bind(int, const struct sockaddr *, int);
-extern int WSAAPI rb_w32_connect(int, const struct sockaddr *, int);
-extern void rb_w32_fdset(int, fd_set*);
-extern void rb_w32_fdclr(int, fd_set*);
-extern int rb_w32_fdisset(int, fd_set*);
-extern int WSAAPI rb_w32_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
-extern int WSAAPI rb_w32_getpeername(int, struct sockaddr *, int *);
-extern int WSAAPI rb_w32_getsockname(int, struct sockaddr *, int *);
-extern int WSAAPI rb_w32_getsockopt(int, int, int, char *, int *);
-extern int WSAAPI rb_w32_ioctlsocket(int, long, u_long *);
-extern int WSAAPI rb_w32_listen(int, int);
-extern int WSAAPI rb_w32_recv(int, char *, int, int);
-extern int WSAAPI rb_w32_recvfrom(int, char *, int, int, struct sockaddr *, int *);
-extern int WSAAPI rb_w32_send(int, const char *, int, int);
-extern int WSAAPI rb_w32_sendto(int, const char *, int, int, const struct sockaddr *, int);
-extern int WSAAPI rb_w32_setsockopt(int, int, int, const char *, int);
-extern int WSAAPI rb_w32_shutdown(int, int);
-extern int WSAAPI rb_w32_socket(int, int, int);
-extern SOCKET rb_w32_get_osfhandle(int);
-extern struct hostent *WSAAPI rb_w32_gethostbyaddr(const char *, int, int);
-extern struct hostent *WSAAPI rb_w32_gethostbyname(const char *);
-extern int WSAAPI rb_w32_gethostname(char *, int);
-extern struct protoent *WSAAPI rb_w32_getprotobyname(const char *);
-extern struct protoent *WSAAPI rb_w32_getprotobynumber(int);
-extern struct servent *WSAAPI rb_w32_getservbyname(const char *, const char *);
-extern struct servent *WSAAPI rb_w32_getservbyport(int, const char *);
-extern int rb_w32_socketpair(int, int, int, int *);
-extern char * rb_w32_getcwd(char *, int);
-extern char * rb_w32_getenv(const char *);
-extern int rb_w32_rename(const char *, const char *);
-extern char **rb_w32_get_environ(void);
-extern void rb_w32_free_environ(char **);
-extern int rb_w32_map_errno(DWORD);
-
-#define vsnprintf(s,n,f,l) rb_w32_vsnprintf(s,n,f,l)
-#define snprintf rb_w32_snprintf
-extern int rb_w32_vsnprintf(char *, size_t, const char *, va_list);
-extern int rb_w32_snprintf(char *, size_t, const char *, ...);
-
-extern int chown(const char *, int, int);
-extern int link(const char *, const char *);
-extern int gettimeofday(struct timeval *, struct timezone *);
-extern rb_pid_t waitpid (rb_pid_t, int *, int);
-extern int rb_w32_argv_size(char *const *);
-extern char *rb_w32_join_argv(char *, char *const *);
-extern rb_pid_t rb_w32_spawn(int, const char *, const char*);
-extern rb_pid_t rb_w32_aspawn(int, const char *, char *const *);
-extern int kill(int, int);
-extern int fcntl(int, int, ...);
-extern rb_pid_t rb_w32_getpid(void);
-#if !defined(__BORLANDC__) && !defined(_WIN32_WCE)
-extern int rb_w32_isatty(int);
-#endif
-extern int rb_w32_mkdir(const char *, int);
-extern int rb_w32_rmdir(const char *);
-extern int rb_w32_unlink(const char *);
-extern int rb_w32_stati64(const char *, struct stati64 *);
-
-#ifdef __BORLANDC__
-extern int rb_w32_fstati64(int, struct stati64 *);
-extern off_t _lseeki64(int, off_t, int);
-extern FILE *rb_w32_fopen(const char *, const char *);
-extern FILE *rb_w32_fdopen(int, const char *);
-extern FILE *rb_w32_fsopen(const char *, const char *, int);
-#endif
-
-#include <float.h>
-#if !defined __MINGW32__ || defined __NO_ISOCEXT
-#ifndef isnan
-#define isnan(x) _isnan(x)
-#endif
-#ifndef finite
-#define finite(x) _finite(x)
-#endif
-#ifndef copysign
-#define copysign(a, b) _copysign(a, b)
-#endif
-#ifndef scalb
-#define scalb(a, b) _scalb(a, b)
-#endif
-#endif
-
-#if !defined S_IFIFO && defined _S_IFIFO
-#define S_IFIFO _S_IFIFO
-#endif
-
-#if 0 && defined __BORLANDC__
-#undef S_ISDIR
-#undef S_ISFIFO
-#undef S_ISBLK
-#undef S_ISCHR
-#undef S_ISREG
-#define S_ISDIR(m) (((unsigned short)(m) & S_IFMT) == S_IFDIR)
-#define S_ISFIFO(m) (((unsigned short)(m) & S_IFMT) == S_IFIFO)
-#define S_ISBLK(m) (((unsigned short)(m) & S_IFMT) == S_IFBLK)
-#define S_ISCHR(m) (((unsigned short)(m) & S_IFMT) == S_IFCHR)
-#define S_ISREG(m) (((unsigned short)(m) & S_IFMT) == S_IFREG)
-#endif
-
-#if !defined S_IRUSR && !defined __MINGW32__
-#define S_IRUSR 0400
-#endif
-#ifndef S_IRGRP
-#define S_IRGRP 0040
-#endif
-#ifndef S_IROTH
-#define S_IROTH 0004
-#endif
-
-#if !defined S_IWUSR && !defined __MINGW32__
-#define S_IWUSR 0200
-#endif
-#ifndef S_IWGRP
-#define S_IWGRP 0020
-#endif
-#ifndef S_IWOTH
-#define S_IWOTH 0002
-#endif
-
-#if !defined S_IXUSR && !defined __MINGW32__
-#define S_IXUSR 0100
-#endif
-#ifndef S_IXGRP
-#define S_IXGRP 0010
-#endif
-#ifndef S_IXOTH
-#define S_IXOTH 0001
-#endif
-
-//
-// define this so we can do inplace editing
-//
-
-#define SUFFIX
-extern int truncate(const char *path, off_t length);
-extern int ftruncate(int fd, off_t length);
-extern int fseeko(FILE *stream, off_t offset, int whence);
-extern off_t ftello(FILE *stream);
-
-//
-// stubs
-//
-extern int ioctl (int, int, ...);
-extern rb_uid_t getuid (void);
-extern rb_uid_t geteuid (void);
-extern rb_gid_t getgid (void);
-extern rb_gid_t getegid (void);
-extern int setuid (rb_uid_t);
-extern int setgid (rb_gid_t);
-
-extern char *rb_w32_strerror(int);
-
-#ifdef RUBY_EXPORT
-#define strerror(e) rb_w32_strerror(e)
-#endif
-
-#define PIPE_BUF 1024
-
-#define LOCK_SH 1
-#define LOCK_EX 2
-#define LOCK_NB 4
-#define LOCK_UN 8
-
-
-#ifndef SIGINT
-#define SIGINT 2
-#endif
-#ifndef SIGKILL
-#define SIGKILL 9
-#endif
-
-
-/* #undef va_start */
-/* #undef va_end */
-
-/* winsock error map */
-#define EWOULDBLOCK WSAEWOULDBLOCK
-#define EINPROGRESS WSAEINPROGRESS
-#define EALREADY WSAEALREADY
-#define ENOTSOCK WSAENOTSOCK
-#define EDESTADDRREQ WSAEDESTADDRREQ
-#define EMSGSIZE WSAEMSGSIZE
-#define EPROTOTYPE WSAEPROTOTYPE
-#define ENOPROTOOPT WSAENOPROTOOPT
-#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
-#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
-#define EOPNOTSUPP WSAEOPNOTSUPP
-#define EPFNOSUPPORT WSAEPFNOSUPPORT
-#define EAFNOSUPPORT WSAEAFNOSUPPORT
-#define EADDRINUSE WSAEADDRINUSE
-#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
-#define ENETDOWN WSAENETDOWN
-#define ENETUNREACH WSAENETUNREACH
-#define ENETRESET WSAENETRESET
-#define ECONNABORTED WSAECONNABORTED
-#define ECONNRESET WSAECONNRESET
-#define ENOBUFS WSAENOBUFS
-#define EISCONN WSAEISCONN
-#define ENOTCONN WSAENOTCONN
-#define ESHUTDOWN WSAESHUTDOWN
-#define ETOOMANYREFS WSAETOOMANYREFS
-#define ETIMEDOUT WSAETIMEDOUT
-#define ECONNREFUSED WSAECONNREFUSED
-#define ELOOP WSAELOOP
-/*#define ENAMETOOLONG WSAENAMETOOLONG*/
-#define EHOSTDOWN WSAEHOSTDOWN
-#define EHOSTUNREACH WSAEHOSTUNREACH
-/*#define ENOTEMPTY WSAENOTEMPTY*/
-#define EPROCLIM WSAEPROCLIM
-#define EUSERS WSAEUSERS
-#define EDQUOT WSAEDQUOT
-#define ESTALE WSAESTALE
-#define EREMOTE WSAEREMOTE
-
-#define F_SETFL 1
-#define O_NONBLOCK 1
-
-#undef FD_SET
-#define FD_SET(f, s) rb_w32_fdset(f, s)
-
-#undef FD_CLR
-#define FD_CLR(f, s) rb_w32_fdclr(f, s)
-
-#undef FD_ISSET
-#define FD_ISSET(f, s) rb_w32_fdisset(f, s)
-
-#ifdef RUBY_EXPORT
-#undef accept
-#define accept(s, a, l) rb_w32_accept(s, a, l)
-
-#undef bind
-#define bind(s, a, l) rb_w32_bind(s, a, l)
-
-#undef connect
-#define connect(s, a, l) rb_w32_connect(s, a, l)
-
-#undef select
-#define select(n, r, w, e, t) rb_w32_select(n, r, w, e, t)
-
-#undef getpeername
-#define getpeername(s, a, l) rb_w32_getpeername(s, a, l)
-
-#undef getsockname
-#define getsockname(s, a, l) rb_w32_getsockname(s, a, l)
-
-#undef getsockopt
-#define getsockopt(s, v, n, o, l) rb_w32_getsockopt(s, v, n, o, l)
-
-#undef ioctlsocket
-#define ioctlsocket(s, c, a) rb_w32_ioctlsocket(s, c, a)
-
-#undef listen
-#define listen(s, b) rb_w32_listen(s, b)
-
-#undef recv
-#define recv(s, b, l, f) rb_w32_recv(s, b, l, f)
-
-#undef recvfrom
-#define recvfrom(s, b, l, f, fr, frl) rb_w32_recvfrom(s, b, l, f, fr, frl)
-
-#undef send
-#define send(s, b, l, f) rb_w32_send(s, b, l, f)
-
-#undef sendto
-#define sendto(s, b, l, f, t, tl) rb_w32_sendto(s, b, l, f, t, tl)
-
-#undef setsockopt
-#define setsockopt(s, v, n, o, l) rb_w32_setsockopt(s, v, n, o, l)
-
-#undef shutdown
-#define shutdown(s, h) rb_w32_shutdown(s, h)
-
-#undef socket
-#define socket(s, t, p) rb_w32_socket(s, t, p)
-
-#undef gethostbyaddr
-#define gethostbyaddr(a, l, t) rb_w32_gethostbyaddr(a, l, t)
-
-#undef gethostbyname
-#define gethostbyname(n) rb_w32_gethostbyname(n)
-
-#undef gethostname
-#define gethostname(n, l) rb_w32_gethostname(n, l)
-
-#undef getprotobyname
-#define getprotobyname(n) rb_w32_getprotobyname(n)
-
-#undef getprotobynumber
-#define getprotobynumber(n) rb_w32_getprotobynumber(n)
-
-#undef getservbyname
-#define getservbyname(n, p) rb_w32_getservbyname(n, p)
-
-#undef getservbyport
-#define getservbyport(p, pr) rb_w32_getservbyport(p, pr)
-
-#undef socketpair
-#define socketpair(a, t, p, s) rb_w32_socketpair(a, t, p, s)
-
-#undef get_osfhandle
-#define get_osfhandle(h) rb_w32_get_osfhandle(h)
-
-#undef getcwd
-#define getcwd(b, s) rb_w32_getcwd(b, s)
-
-#undef getenv
-#define getenv(n) rb_w32_getenv(n)
-
-#undef rename
-#define rename(o, n) rb_w32_rename(o, n)
-
-#undef times
-#define times(t) rb_w32_times(t)
-#endif
-
-struct tms {
- long tms_utime;
- long tms_stime;
- long tms_cutime;
- long tms_cstime;
-};
-
-int rb_w32_times(struct tms *);
-
-/* thread stuff */
-HANDLE GetCurrentThreadHandle(void);
-int rb_w32_sleep(unsigned long msec);
-int rb_w32_putc(int, FILE*);
-int rb_w32_getc(FILE*);
-int rb_w32_close(int);
-int rb_w32_fclose(FILE*);
-size_t rb_w32_read(int, void *, size_t);
-size_t rb_w32_write(int, const void *, size_t);
-int rb_w32_utime(const char *, const struct utimbuf *);
-int WINAPI rb_w32_Sleep(unsigned long msec);
-int rb_w32_wait_events_blocking(HANDLE *events, int num, DWORD timeout);
-
-/*
-== ***CAUTION***
-Since this function is very dangerous, ((*NEVER*))
-* lock any HANDLEs(i.e. Mutex, Semaphore, CriticalSection and so on) or,
-* use anything like TRAP_BEG...TRAP_END block structure,
-in asynchronous_func_t.
-*/
-typedef uintptr_t (*asynchronous_func_t)(uintptr_t self, int argc, uintptr_t* argv);
-uintptr_t rb_w32_asynchronize(asynchronous_func_t func, uintptr_t self, int argc, uintptr_t* argv, uintptr_t intrval);
-
-#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C" { */
-#endif
-
-#endif /* RUBY_WIN32_H */
Deleted: MacRuby/branches/testing/install-sh
===================================================================
Modified: MacRuby/branches/testing/instruby.rb
===================================================================
--- MacRuby/branches/testing/instruby.rb 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/instruby.rb 2008-06-17 01:04:32 UTC (rev 295)
@@ -461,7 +461,7 @@
# Installing executable links.
dest_bin = '/usr/local/bin'
mkdir_p dest_bin, :mode => 0755
- Dir.entries(CONFIG['bindir']).each do |bin|
+ Dir.entries(with_destdir(CONFIG['bindir'])).each do |bin|
next if bin[0] == '.'
link = File.join("../../../", CONFIG['bindir'], bin)
link.sub!(/#{MACRUBY_VERSION}/, 'Current')
@@ -470,11 +470,11 @@
# Installing man pages links.
dest_man = '/usr/local/share/man'
mkdir_p dest_man, :mode => 0755
- Dir.entries(CONFIG['mandir']).each do |mandir|
+ Dir.entries(with_destdir(CONFIG['mandir'])).each do |mandir|
next if mandir[0] == '.'
- if File.stat(File.join(CONFIG['mandir'], mandir)).directory?
+ if File.stat(File.join(with_destdir(CONFIG['mandir']), mandir)).directory?
mkdir_p File.join(dest_man, File.basename(mandir)), :mode => 0755
- Dir.entries(File.join(CONFIG['mandir'], mandir)).each do |man|
+ Dir.entries(File.join(with_destdir(CONFIG['mandir']), mandir)).each do |man|
next if man[0] == '.'
link = File.join("../../../../../", CONFIG['mandir'], mandir, man)
link.sub!(/#{MACRUBY_VERSION}/, 'Current')
Modified: MacRuby/branches/testing/io.c
===================================================================
--- MacRuby/branches/testing/io.c 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/io.c 2008-06-17 01:04:32 UTC (rev 295)
@@ -1254,7 +1254,7 @@
rb_io_inspect(VALUE obj)
{
rb_io_t *fptr;
- char *cname;
+ const char *cname;
const char *st = "";
fptr = RFILE(rb_io_taint_check(obj))->fptr;
@@ -4085,8 +4085,10 @@
tmp = rb_check_array_type(pname);
if (!NIL_P(tmp)) {
tmp = rb_ary_dup(tmp);
+#if !WITH_OBJC
RBASIC(tmp)->klass = 0;
- port = pipe_open_v(RARRAY_LEN(tmp), RARRAY_PTR(tmp), mode);
+#endif
+ port = pipe_open_v(RARRAY_LEN(tmp), (VALUE *)RARRAY_PTR(tmp), mode);
rb_ary_clear(tmp);
}
else {
@@ -5157,7 +5159,7 @@
rb_io_s_new(int argc, VALUE *argv, VALUE klass)
{
if (rb_block_given_p()) {
- char *cname = rb_class2name(klass);
+ const char *cname = rb_class2name(klass);
rb_warn("%s::new() does not take block; use %s::open() instead",
cname, cname);
@@ -6273,15 +6275,22 @@
}
v = rb_hash_aref(opt, open_args);
if (!NIL_P(v)) {
+ v = rb_convert_type(v, T_ARRAY, "Array", "to_ary");
+#if WITH_OBJC
+ long i, v_len = RARRAY_LEN(v);
+ VALUE *values = (VALUE *)alloca(v_len + 1);
+ values[0] = argv[0];
+ for (i = 0; i < v_len; i++)
+ values[i + 1] = RARRAY_AT(v, i);
+ arg->io = rb_io_open_with_args(v_len + 1, values);
+#else
VALUE args;
-
- v = rb_convert_type(v, T_ARRAY, "Array", "to_ary");
args = rb_ary_new2(RARRAY_LEN(v)+1);
rb_ary_push(args, argv[0]);
rb_ary_concat(args, v);
MEMCPY(RARRAY_PTR(args)+1, RARRAY_PTR(v), VALUE, RARRAY_LEN(v));
-
arg->io = rb_io_open_with_args(RARRAY_LEN(args), RARRAY_PTR(args));
+#endif
return;
}
v = rb_hash_aref(opt, mode);
Deleted: MacRuby/branches/testing/mkconfig.rb
===================================================================
--- MacRuby/branches/testing/mkconfig.rb 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/mkconfig.rb 2008-06-17 01:04:32 UTC (rev 295)
@@ -1,200 +0,0 @@
-#!./miniruby -s
-
-# avoid warnings with -d.
-$install_name ||= nil
-$so_name ||= nil
-
-srcdir = File.dirname(__FILE__)
-$:.replace [srcdir+"/lib"] unless defined?(CROSS_COMPILING)
-$:.unshift(".")
-
-require "fileutils"
-mkconfig = File.basename($0)
-
-rbconfig_rb = ARGV[0] || 'rbconfig.rb'
-unless File.directory?(dir = File.dirname(rbconfig_rb))
- FileUtils.makedirs(dir, :verbose => true)
-end
-
-version = RUBY_VERSION
-def (config = "").write(arg)
- concat(arg.to_s)
-end
-$stdout = config
-
-fast = {'prefix'=>TRUE, 'ruby_install_name'=>TRUE, 'INSTALL'=>TRUE, 'EXEEXT'=>TRUE}
-print %[
-# This file was created by #{mkconfig} when ruby was built. Any
-# changes made to this file will be lost the next time ruby is built.
-
-module RbConfig
- RUBY_VERSION == "#{version}" or
- raise "ruby lib version (#{version}) doesn't match executable version (\#{RUBY_VERSION})"
-
-]
-
-v_fast = []
-v_others = []
-vars = {}
-has_version = false
-continued_name = nil
-continued_line = nil
-File.foreach "config.status" do |line|
- next if /^#/ =~ line
- name = nil
- case line
- when /^s([%,])@(\w+)@\1(?:\|\#_!!_\#\|)?(.*)\1/
- name = $2
- val = $3.gsub(/\\(?=,)/, '')
- when /^S\["(\w+)"\]\s*=\s*"(.*)"\s*(\\)?$/
- name = $1
- val = $2
- if $3
- continued_line = []
- continued_line << val
- continued_name = name
- next
- end
- when /^"(.+)"\s*(\\)?$/
- if continued_line
- continued_line << $1
- unless $2
- val = continued_line.join("")
- name = continued_name
- continued_line = nil
- end
- end
- when /^(?:ac_given_)?INSTALL=(.*)/
- v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n"
- end
-
- if name
- next if /^(?:ac_.*|configure_input|(?:top_)?srcdir|\w+OBJS)$/ =~ name
- next if /^\$\(ac_\w+\)$/ =~ val
- next if /^\$\{ac_\w+\}$/ =~ val
- next if /^\$ac_\w+$/ =~ val
- next if $install_name and /^RUBY_INSTALL_NAME$/ =~ name
- next if $so_name and /^RUBY_SO_NAME$/ =~ name
- next if /^(?:X|(?:MINI|RUN)RUBY$)/ =~ name
- if /^program_transform_name$/ =~ name and /^s(\\?.)(.*)\1$/ =~ val
- next if $install_name
- sep = %r"#{Regexp.quote($1)}"
- ptn = $2.sub(/\$\$/, '$').split(sep, 2)
- name = "ruby_install_name"
- val = "ruby".sub(/#{ptn[0]}/, ptn[1])
- end
- val.gsub!(/ +(?!-)/, "=") if name == "configure_args" && /mswin32/ =~ RUBY_PLATFORM
- val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump
- if /^prefix$/ =~ name
- val = "(TOPDIR || DESTDIR + #{val})"
- end
- v = " CONFIG[\"#{name}\"] #{vars[name] ? '<< "\n"' : '='} #{val}\n"
- vars[name] = true
- if fast[name]
- v_fast << v
- else
- v_others << v
- end
- has_version = true if name == "MAJOR"
- end
-# break if /^CEOF/
-end
-
-drive = File::PATH_SEPARATOR == ';'
-
-prefix = '/lib/ruby/' + RUBY_VERSION + '/' + RUBY_PLATFORM
-print " TOPDIR = File.dirname(__FILE__).chomp!(#{prefix.dump})\n"
-print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n"
-print " CONFIG = {}\n"
-print " CONFIG[\"DESTDIR\"] = DESTDIR\n"
-
-unless has_version
- RUBY_VERSION.scan(/(\d+)\.(\d+)\.(\d+)/) {
- print " CONFIG[\"MAJOR\"] = \"" + $1 + "\"\n"
- print " CONFIG[\"MINOR\"] = \"" + $2 + "\"\n"
- print " CONFIG[\"TEENY\"] = \"" + $3 + "\"\n"
- }
- patchlevel = IO.foreach(File.join(srcdir, "version.h")) {|l|
- m = /^\s*#\s*define\s+RUBY_PATCHLEVEL\s+(\d+)/.match(l) and break m[1]
- }
- print " CONFIG[\"PATCHLEVEL\"] = \"#{patchlevel}\"\n"
-end
-
-dest = drive ? /= \"(?!\$[\(\{])(?:[a-z]:)?/i : /= \"(?!\$[\(\{])/
-v_others.collect! do |x|
- if /^\s*CONFIG\["(?!abs_|old)[a-z]+(?:_prefix|dir)"\]/ === x
- x.sub(dest, '= "$(DESTDIR)')
- else
- x
- end
-end
-
-if $install_name
- v_fast << " CONFIG[\"ruby_install_name\"] = \"" + $install_name + "\"\n"
- v_fast << " CONFIG[\"RUBY_INSTALL_NAME\"] = \"" + $install_name + "\"\n"
-end
-if $so_name
- v_fast << " CONFIG[\"RUBY_SO_NAME\"] = \"" + $so_name + "\"\n"
-end
-
-print(*v_fast)
-print(*v_others)
-print <<EOS
- CONFIG["ruby_version"] = "$(MAJOR).$(MINOR).$(TEENY)"
- CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"
- CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
- CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
- CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
- CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
- CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
- CONFIG["topdir"] = File.dirname(__FILE__)
- MAKEFILE_CONFIG = {}
- CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
- def RbConfig::expand(val, config = CONFIG)
- val.gsub!(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do
- var = $&
- if !(v = $1 || $2)
- '$'
- elsif key = config[v = v[/\\A[^:]+(?=(?::(.*?)=(.*))?\\z)/]]
- pat, sub = $1, $2
- config[v] = false
- RbConfig::expand(key, config)
- config[v] = key
- key = key.gsub(/\#{Regexp.quote(pat)}(?=\\s|\\z)/n) {sub} if pat
- key
- else
- var
- end
- end
- val
- end
- CONFIG.each_value do |val|
- RbConfig::expand(val)
- end
-end
-Config = RbConfig # compatibility for ruby-1.8.4 and older.
-CROSS_COMPILING = nil unless defined? CROSS_COMPILING
-RUBY_FRAMEWORK = RbConfig::CONFIG["enable_framework"] == 'yes'
-if RUBY_FRAMEWORK
- RUBY_FRAMEWORK_VERSION = RbConfig::CONFIG['ruby_version']
-end
-EOS
-
-$stdout = STDOUT
-mode = IO::RDWR|IO::CREAT
-mode |= IO::BINARY if defined?(IO::BINARY)
-open(rbconfig_rb, mode) do |f|
- if $timestamp and f.stat.size == config.size and f.read == config
- puts "#{rbconfig_rb} unchanged"
- else
- puts "#{rbconfig_rb} updated"
- f.rewind
- f.truncate(0)
- f.print(config)
- end
-end
-if String === $timestamp
- FileUtils.touch($timestamp)
-end
-
-# vi:set sw=2:
Modified: MacRuby/branches/testing/objc.m
===================================================================
--- MacRuby/branches/testing/objc.m 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/objc.m 2008-06-17 01:04:32 UTC (rev 295)
@@ -1055,95 +1055,165 @@
return type;
}
+extern NODE *rb_current_cfunc_node;
+
+struct objc_ruby_closure_context {
+ SEL selector;
+ bs_element_method_t *bs_method;
+ Method method;
+ ffi_cif *cif;
+ IMP imp;
+};
+
static VALUE
-rb_objc_to_ruby_closure(VALUE rcv, VALUE argv)
+rb_objc_to_ruby_closure(int argc, VALUE *argv, VALUE rcv)
{
- Method method;
unsigned i, real_count, count;
ffi_type *ffi_rettype, **ffi_argtypes;
void *ffi_ret, **ffi_args;
ffi_cif *cif;
Class klass;
- SEL selector;
const char *type;
char buf[128];
id ocrcv;
void *imp;
- bs_element_method_t *bs_method;
+ struct objc_ruby_closure_context *ctx;
+ bool super_call;
- if (TYPE(argv) != T_ARRAY)
- rb_bug("argv isn't an array");
+ super_call = (ruby_current_thread->cfp->flag >> FRAME_MAGIC_MASK_BITS)
+ & VM_CALL_SUPER_BIT;
- method = class_getInstanceMethod(object_getClass((void *)rcv),
- sel_registerName(rb_id2name(rb_frame_this_func())));
- assert(method != NULL);
- count = method_getNumberOfArguments(method);
+ rb_objc_rval_to_ocid(rcv, (void **)&ocrcv);
+ klass = *(Class *)ocrcv;
+
+ assert(rb_current_cfunc_node != NULL);
+
+ if (rb_current_cfunc_node->u3.value == 0) {
+ ctx = (struct objc_ruby_closure_context *)xmalloc(sizeof(
+ struct objc_ruby_closure_context));
+ ctx->selector = sel_registerName(rb_id2name(rb_frame_this_func()));
+ ctx->bs_method = rb_bs_find_method(klass, ctx->selector);
+ ctx->method = class_getInstanceMethod(klass, ctx->selector);
+ ctx->cif = NULL;
+ ctx->imp = NULL;
+ assert(ctx->method != NULL);
+ GC_WB(&rb_current_cfunc_node->u3.value, ctx);
+ }
+ else {
+ ctx = (struct objc_ruby_closure_context *)
+ rb_current_cfunc_node->u3.value;
+ }
+
+ count = method_getNumberOfArguments(ctx->method);
assert(count >= 2);
- rb_objc_rval_to_ocid(rcv, (void **)&ocrcv);
- klass = object_getClass(ocrcv);
- selector = method_getName(method);
-
- bs_method = rb_bs_find_method(klass, selector);
real_count = count;
- if (bs_method != NULL && bs_method->variadic) {
- if (RARRAY_LEN(argv) < count - 2)
- rb_raise(rb_eArgError, "wrong number of arguments (%ld for %d)",
- RARRAY_LEN(argv), count - 2);
- count = RARRAY_LEN(argv) + 2;
+ if (ctx->bs_method != NULL && ctx->bs_method->variadic) {
+ if (argc < count - 2)
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
+ argc, count - 2);
+ count = argc + 2;
}
- else if (RARRAY_LEN(argv) != count - 2) {
- rb_raise(rb_eArgError, "wrong number of arguments (%ld for %d)",
- RARRAY_LEN(argv), count - 2);
+ else if (argc != count - 2) {
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
+ argc, count - 2);
}
- ffi_argtypes = (ffi_type **)alloca(sizeof(ffi_type *) * (count + 1));
- ffi_argtypes[0] = &ffi_type_pointer;
- ffi_argtypes[1] = &ffi_type_pointer;
+ if (count == 2) {
+ method_getReturnType(ctx->method, buf, sizeof buf);
+ if (buf[0] == '@' || buf[0] == 'v') {
+ /* Easy case! */
+ @try {
+ if (super_call) {
+ struct objc_super s;
+ s.receiver = ocrcv;
+ s.class = class_getSuperclass(*(Class *)ocrcv);
+ ffi_ret = objc_msgSendSuper(&s, ctx->selector);
+ }
+ else {
+ ffi_ret = objc_msgSend(ocrcv, ctx->selector);
+ }
+ }
+ @catch (id e) {
+ rb_objc_exc_raise(e);
+ }
+ return buf[0] == '@' ? (VALUE)ffi_ret : Qnil;
+ }
+ }
+ if (ctx->cif == NULL) {
+ const size_t s = sizeof(ffi_type *) * (count + 1);
+ ffi_argtypes = ctx->bs_method != NULL && ctx->bs_method->variadic
+ ? (ffi_type **)alloca(s) : (ffi_type **)malloc(s);
+ ffi_argtypes[0] = &ffi_type_pointer;
+ ffi_argtypes[1] = &ffi_type_pointer;
+ }
+
ffi_args = (void **)alloca(sizeof(void *) * (count + 1));
ffi_args[0] = &ocrcv;
- ffi_args[1] = &selector;
+ ffi_args[1] = &ctx->selector;
- if ((ruby_current_thread->cfp->flag >> FRAME_MAGIC_MASK_BITS)
- & VM_CALL_SUPER_BIT) {
+ if (super_call) {
Class sklass;
Method smethod;
sklass = class_getSuperclass(klass);
assert(sklass != NULL);
- smethod = class_getInstanceMethod(sklass, selector);
- assert(smethod != method);
+ smethod = class_getInstanceMethod(sklass, ctx->selector);
+ assert(smethod != ctx->method);
imp = method_getImplementation(smethod);
}
else {
- imp = method == class_getInstanceMethod(klass, selector)
- ? method_getImplementation(method)
- : objc_msgSend; /* alea jacta est */
+ if (ctx->imp != NULL) {
+ imp = ctx->imp;
+ }
+ else {
+ ctx->imp = imp = ctx->method ==
+ class_getInstanceMethod(klass, ctx->selector)
+ ? method_getImplementation(ctx->method)
+ : objc_msgSend; /* alea jacta est */
+ }
}
- for (i = 0; i < RARRAY_LEN(argv); i++) {
- type = rb_objc_method_get_type(method, real_count, bs_method, i, buf,
- sizeof buf);
- ffi_argtypes[i + 2] = rb_objc_octype_to_ffitype(type);
- assert(ffi_argtypes[i + 2]->size > 0);
- ffi_args[i + 2] = (void *)alloca(ffi_argtypes[i + 2]->size);
- rb_objc_rval_to_ocval(RARRAY_AT(argv, i), type, ffi_args[i + 2]);
+ for (i = 0; i < argc; i++) {
+ ffi_type *ffi_argtype;
+
+ type = rb_objc_method_get_type(ctx->method, real_count, ctx->bs_method,
+ i, buf, sizeof buf);
+
+ if (ctx->cif == NULL) {
+ ffi_argtypes[i + 2] = rb_objc_octype_to_ffitype(type);
+ assert(ffi_argtypes[i + 2]->size > 0);
+ ffi_argtype = ffi_argtypes[i + 2];
+ }
+ else {
+ ffi_argtype = ctx->cif->arg_types[i + 2];
+ }
+
+ ffi_args[i + 2] = (void *)alloca(ffi_argtype->size);
+ rb_objc_rval_to_ocval(argv[i], type, ffi_args[i + 2]);
}
- ffi_argtypes[count] = NULL;
+ if (ctx->cif == NULL)
+ ffi_argtypes[count] = NULL;
ffi_args[count] = NULL;
- type = rb_objc_method_get_type(method, real_count, bs_method, -1, buf,
- sizeof buf);
- ffi_rettype = rb_objc_octype_to_ffitype(type);
+ type = rb_objc_method_get_type(ctx->method, real_count, ctx->bs_method,
+ -1, buf, sizeof buf);
+ ffi_rettype = ctx->cif == NULL
+ ? rb_objc_octype_to_ffitype(type) : ctx->cif->rtype;
- cif = (ffi_cif *)alloca(sizeof(ffi_cif));
- if (ffi_prep_cif(cif, FFI_DEFAULT_ABI, count, ffi_rettype,
- ffi_argtypes)
- != FFI_OK)
- rb_fatal("can't prepare cif for objc method type `%s'",
- method_getTypeEncoding(method));
-
+ cif = ctx->cif;
+ if (cif == NULL) {
+ if (ctx->bs_method != NULL && ctx->bs_method->variadic)
+ cif = (ffi_cif *)alloca(sizeof(ffi_cif));
+ else
+ cif = ctx->cif = (ffi_cif *)malloc(sizeof(ffi_cif));
+ if (ffi_prep_cif(cif, FFI_DEFAULT_ABI, count, ffi_rettype,
+ ffi_argtypes) != FFI_OK) {
+ rb_fatal("can't prepare cif for objc method type `%s'",
+ method_getTypeEncoding(ctx->method));
+ }
+ }
if (ffi_rettype != &ffi_type_void) {
ffi_ret = (void *)alloca(ffi_rettype->size);
}
@@ -1430,20 +1500,17 @@
#endif
NODE *
-rb_objc_define_objc_mid_closure(VALUE recv, ID mid, NODE *node)
+rb_objc_define_objc_mid_closure(VALUE recv, ID mid, ID alias_mid)
{
SEL sel;
Class ocklass;
Method method;
VALUE mod;
- NODE *data;
+ NODE *node, *data;
Method (*getMethod)(Class, SEL);
assert(mid > 1);
- if (node != NULL)
- return NULL; /* TODO: verify that there isn't a prior method */
-
sel = sel_registerName(rb_id2name(mid));
if (!rb_special_const_p(recv) && !rb_objc_is_non_native(recv)
@@ -1484,12 +1551,15 @@
if (node != NULL)
return node;
- node = NEW_CFUNC(rb_objc_to_ruby_closure, -2);
+ node = NEW_CFUNC(rb_objc_to_ruby_closure, -1);
data = NEW_FBODY(NEW_METHOD(node, mod,
NOEX_WITH_SAFE(NOEX_PUBLIC)), 0);
rb_add_method_direct(mod, mid, data);
+ if (alias_mid != 0)
+ rb_add_method_direct(mod, alias_mid, data);
+
return data->nd_body;
}
Modified: MacRuby/branches/testing/proc.c
===================================================================
--- MacRuby/branches/testing/proc.c 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/proc.c 2008-06-17 01:04:32 UTC (rev 295)
@@ -1496,7 +1496,7 @@
#endif
a = args;
- return rb_method_call(RARRAY_LEN(a), RARRAY_PTR(a), method);
+ return rb_method_call(RARRAY_LEN(a), (VALUE *)RARRAY_PTR(a), method);
}
VALUE
@@ -1756,6 +1756,7 @@
sysstack_error = rb_exc_new2(rb_eSysStackError, "stack level too deep");
OBJ_TAINT(sysstack_error);
rb_register_mark_object(sysstack_error);
+ rb_objc_retain((void *)sysstack_error);
/* utility functions */
rb_define_global_function("proc", rb_block_proc, 0);
Copied: MacRuby/branches/testing/sample-macruby/buildall.rb (from rev 294, MacRuby/trunk/sample-macruby/buildall.rb)
===================================================================
--- MacRuby/branches/testing/sample-macruby/buildall.rb (rev 0)
+++ MacRuby/branches/testing/sample-macruby/buildall.rb 2008-06-17 01:04:32 UTC (rev 295)
@@ -0,0 +1,39 @@
+require 'fileutils'
+include FileUtils
+
+def die(*x)
+ STDERR.puts x
+ exit 1
+end
+
+if ARGV.size != 1
+ die "Usage: #{__FILE__} <output-directory>"
+end
+
+out_dir = ARGV.first
+if !File.exist?(out_dir) or !File.directory?(out_dir)
+ die "Given #{out_dir} doesn't exist or is not a directory"
+end
+
+tmp_dir = '/tmp/macruby_samples'
+rm_rf tmp_dir
+mkdir_p tmp_dir
+
+succeeded, failed = [], []
+
+Dir.glob('*/**/*.xcodeproj').each do |sampleDir|
+ name = File.dirname(sampleDir)
+ Dir.chdir name do
+ ary = system("xcodebuild SYMROOT=#{tmp_dir} >& /dev/null") ? succeeded : failed
+ ary << name
+ end
+end
+
+Dir.glob(File.join(tmp_dir, '**/*.app')).each do |app|
+ cp_r app, out_dir
+end
+
+[succeeded, failed].each { |a| a << 'None' if a.empty? }
+
+puts "Successful to build: #{succeeded.join(', ')}"
+puts "Failed to build: #{failed.join(', ')}"
Modified: MacRuby/branches/testing/string.c
===================================================================
--- MacRuby/branches/testing/string.c 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/string.c 2008-06-17 01:04:32 UTC (rev 295)
@@ -525,43 +525,37 @@
str = str_alloc(klass);
#if WITH_OBJC
bool need_padding = len > 0;
- if (ptr != NULL) {
- if (len == 0) {
- char c = 0;
- rb_objc_str_set_bytestring(str, &c, 1);
+ if (ptr != NULL && len > 0) {
+ long slen;
+ slen = strlen(ptr);
+
+ if (slen == len) {
+ CFStringAppendCString((CFMutableStringRef)str, ptr,
+ kCFStringEncodingUTF8);
+ need_padding = false;
+ if (CFStringGetLength((CFStringRef)str) != len)
+ rb_objc_str_set_bytestring(str, ptr, len);
}
else {
- long slen;
- slen = strlen(ptr);
+ if (slen == 0 || len < slen) {
+ CFStringRef substr;
- if (slen == len) {
- CFStringAppendCString((CFMutableStringRef)str, ptr,
- kCFStringEncodingUTF8);
- need_padding = false;
- if (CFStringGetLength((CFStringRef)str) != len)
- rb_objc_str_set_bytestring(str, ptr, len);
- }
- else {
- if (slen == 0 || len < slen) {
- CFStringRef substr;
-
- substr = CFStringCreateWithBytes(NULL, (const UInt8 *)ptr,
+ substr = CFStringCreateWithBytes(NULL, (const UInt8 *)ptr,
len, kCFStringEncodingUTF8, false);
-
- rb_gc_malloc_increase(32 + (sizeof(UniChar) * len));
- if (substr != NULL) {
- CFStringAppend((CFMutableStringRef)str, substr);
- CFRelease(substr);
- }
- else {
- rb_objc_str_set_bytestring(str, ptr, len);
- }
+ rb_gc_malloc_increase(32 + (sizeof(UniChar) * len));
+
+ if (substr != NULL) {
+ CFStringAppend((CFMutableStringRef)str, substr);
+ CFRelease(substr);
}
else {
rb_objc_str_set_bytestring(str, ptr, len);
}
}
+ else {
+ rb_objc_str_set_bytestring(str, ptr, len);
+ }
}
}
rb_gc_malloc_increase(32 + (sizeof(UniChar) * len));
Modified: MacRuby/branches/testing/struct.c
===================================================================
--- MacRuby/branches/testing/struct.c 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/struct.c 2008-06-17 01:04:32 UTC (rev 295)
@@ -396,7 +396,7 @@
VALUE
rb_struct_alloc(VALUE klass, VALUE values)
{
- return rb_class_new_instance(RARRAY_LEN(values), RARRAY_PTR(values), klass);
+ return rb_class_new_instance(RARRAY_LEN(values), (VALUE *)RARRAY_PTR(values), klass);
}
VALUE
Modified: MacRuby/branches/testing/test/ruby/test_regexp.rb
===================================================================
--- MacRuby/branches/testing/test/ruby/test_regexp.rb 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/test/ruby/test_regexp.rb 2008-06-17 01:04:32 UTC (rev 295)
@@ -718,6 +718,8 @@
assert_raise(TypeError) { $+ }
end
+=begin
+ # TODO: this doesn't work in MacRuby yet!
def test_unicode
assert_match(/^\u3042{0}\p{Any}$/, "a")
assert_match(/^\u3042{0}\p{Any}$/, "\u3041")
@@ -755,4 +757,5 @@
assert_nothing_raised { 0x03ffffff.chr("utf-8").size }
assert_nothing_raised { 0x7fffffff.chr("utf-8").size }
end
+=end
end
Deleted: MacRuby/branches/testing/thread_win32.c
===================================================================
--- MacRuby/branches/testing/thread_win32.c 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/thread_win32.c 2008-06-17 01:04:32 UTC (rev 295)
@@ -1,528 +0,0 @@
-/* -*-c-*- */
-/**********************************************************************
-
- thread_win32.c -
-
- $Author: nobu $
-
- Copyright (C) 2004-2007 Koichi Sasada
-
-**********************************************************************/
-
-#ifdef THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION
-
-#include <process.h>
-
-#define WIN32_WAIT_TIMEOUT 10 /* 10 ms */
-#undef Sleep
-
-#define native_thread_yield() Sleep(0)
-#define remove_signal_thread_list(th)
-
-static volatile DWORD ruby_native_thread_key = TLS_OUT_OF_INDEXES;
-
-static int native_mutex_lock(rb_thread_lock_t *);
-static int native_mutex_unlock(rb_thread_lock_t *);
-static int native_mutex_trylock(rb_thread_lock_t *);
-static void native_mutex_initialize(rb_thread_lock_t *);
-
-static void native_cond_signal(rb_thread_cond_t *cond);
-static void native_cond_broadcast(rb_thread_cond_t *cond);
-static void native_cond_wait(rb_thread_cond_t *cond, rb_thread_lock_t *mutex);
-static void native_cond_initialize(rb_thread_cond_t *cond);
-static void native_cond_destroy(rb_thread_cond_t *cond);
-
-static rb_thread_t *
-ruby_thread_from_native(void)
-{
- return TlsGetValue(ruby_native_thread_key);
-}
-
-static int
-ruby_thread_set_native(rb_thread_t *th)
-{
- return TlsSetValue(ruby_native_thread_key, th);
-}
-
-static void
-Init_native_thread(void)
-{
- rb_thread_t *th = GET_THREAD();
-
- ruby_native_thread_key = TlsAlloc();
- DuplicateHandle(GetCurrentProcess(),
- GetCurrentThread(),
- GetCurrentProcess(),
- &th->thread_id, 0, FALSE, DUPLICATE_SAME_ACCESS);
-
- th->native_thread_data.interrupt_event = CreateEvent(0, TRUE, FALSE, 0);
-
- thread_debug("initial thread (th: %p, thid: %p, event: %p)\n",
- th, GET_THREAD()->thread_id,
- th->native_thread_data.interrupt_event);
-}
-
-static void
-w32_error(void)
-{
- LPVOID lpMsgBuf;
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR) & lpMsgBuf, 0, NULL);
- rb_bug("%s", (char*)lpMsgBuf);
-}
-
-static void
-w32_set_event(HANDLE handle)
-{
- if (SetEvent(handle) == 0) {
- w32_error();
- }
-}
-
-static void
-w32_reset_event(HANDLE handle)
-{
- if (ResetEvent(handle) == 0) {
- w32_error();
- }
-}
-
-static int
-w32_wait_events(HANDLE *events, int count, DWORD timeout, rb_thread_t *th)
-{
- HANDLE *targets = events;
- HANDLE intr;
- DWORD ret;
-
- thread_debug(" w32_wait_events events:%p, count:%d, timeout:%ld, th:%p\n",
- events, count, timeout, th);
- if (th && (intr = th->native_thread_data.interrupt_event)) {
- w32_reset_event(intr);
- if (RUBY_VM_INTERRUPTED(th)) {
- w32_set_event(intr);
- }
-
- targets = ALLOCA_N(HANDLE, count + 1);
- memcpy(targets, events, sizeof(HANDLE) * count);
-
- targets[count++] = intr;
- thread_debug(" * handle: %p (count: %d, intr)\n", intr, count);
- }
-
- thread_debug(" WaitForMultipleObjects start (count: %d)\n", count);
- ret = WaitForMultipleObjects(count, targets, FALSE, timeout);
- thread_debug(" WaitForMultipleObjects end (ret: %lu)\n", ret);
-
- if (ret == WAIT_OBJECT_0 + count - 1 && th) {
- errno = EINTR;
- }
- if (ret == -1 && THREAD_DEBUG) {
- int i;
- DWORD dmy;
- for (i = 0; i < count; i++) {
- thread_debug(" * error handle %d - %s\n", i,
- GetHandleInformation(targets[i], &dmy) ? "OK" : "NG");
- }
- }
- return ret;
-}
-
-static void ubf_handle(void *ptr);
-#define ubf_select ubf_handle
-
-int
-rb_w32_wait_events_blocking(HANDLE *events, int num, DWORD timeout)
-{
- return w32_wait_events(events, num, timeout, GET_THREAD());
-}
-
-int
-rb_w32_wait_events(HANDLE *events, int num, DWORD timeout)
-{
- int ret;
-
- BLOCKING_REGION(ret = rb_w32_wait_events_blocking(events, num, timeout),
- ubf_handle, GET_THREAD());
- return ret;
-}
-
-static void
-w32_close_handle(HANDLE handle)
-{
- if (CloseHandle(handle) == 0) {
- w32_error();
- }
-}
-
-static void
-w32_resume_thread(HANDLE handle)
-{
- if (ResumeThread(handle) == -1) {
- w32_error();
- }
-}
-
-#ifdef _MSC_VER
-#define HAVE__BEGINTHREADEX 1
-#else
-#undef HAVE__BEGINTHREADEX
-#endif
-
-#ifdef HAVE__BEGINTHREADEX
-#define start_thread (HANDLE)_beginthreadex
-typedef unsigned long (_stdcall *w32_thread_start_func)(void*);
-#else
-#define start_thread CreateThread
-typedef LPTHREAD_START_ROUTINE w32_thread_start_func;
-#endif
-
-static HANDLE
-w32_create_thread(DWORD stack_size, w32_thread_start_func func, void *val)
-{
- return start_thread(0, stack_size, func, val, CREATE_SUSPENDED, 0);
-}
-
-int
-rb_w32_sleep(unsigned long msec)
-{
- return w32_wait_events(0, 0, msec, GET_THREAD());
-}
-
-int WINAPI
-rb_w32_Sleep(unsigned long msec)
-{
- int ret;
-
- BLOCKING_REGION(ret = rb_w32_sleep(msec),
- ubf_handle, GET_THREAD());
- return ret;
-}
-
-static void
-native_sleep(rb_thread_t *th, struct timeval *tv)
-{
- DWORD msec;
- if (tv) {
- msec = tv->tv_sec * 1000 + tv->tv_usec / 1000;
- }
- else {
- msec = INFINITE;
- }
-
- GVL_UNLOCK_BEGIN();
- {
- DWORD ret;
- int status = th->status;
-
- th->status = THREAD_STOPPED;
- th->unblock.func = ubf_handle;
- th->unblock.arg = th;
-
- if (RUBY_VM_INTERRUPTED(th)) {
- /* interrupted. return immediate */
- }
- else {
- thread_debug("native_sleep start (%lu)\n", msec);
- ret = w32_wait_events(0, 0, msec, th);
- thread_debug("native_sleep done (%lu)\n", ret);
- }
-
- th->unblock.func = 0;
- th->unblock.arg = 0;
- th->status = status;
- }
- GVL_UNLOCK_END();
- RUBY_VM_CHECK_INTS();
-}
-
-static int
-native_mutex_lock(rb_thread_lock_t *lock)
-{
-#if USE_WIN32_MUTEX
- DWORD result;
- while (1) {
- thread_debug("native_mutex_lock: %p\n", *lock);
- result = w32_wait_events(&*lock, 1, INFINITE, 0);
- switch (result) {
- case WAIT_OBJECT_0:
- /* get mutex object */
- thread_debug("acquire mutex: %p\n", *lock);
- return 0;
- case WAIT_OBJECT_0 + 1:
- /* interrupt */
- errno = EINTR;
- thread_debug("acquire mutex interrupted: %p\n", *lock);
- return 0;
- case WAIT_TIMEOUT:
- thread_debug("timeout mutex: %p\n", *lock);
- break;
- case WAIT_ABANDONED:
- rb_bug("win32_mutex_lock: WAIT_ABANDONED");
- break;
- default:
- rb_bug("win32_mutex_lock: unknown result (%d)", result);
- break;
- }
- }
- return 0;
-#else
- EnterCriticalSection(lock);
- return 0;
-#endif
-}
-
-static int
-native_mutex_unlock(rb_thread_lock_t *lock)
-{
-#if USE_WIN32_MUTEX
- thread_debug("release mutex: %p\n", *lock);
- return ReleaseMutex(*lock);
-#else
- LeaveCriticalSection(lock);
- return 0;
-#endif
-}
-
-static int
-native_mutex_trylock(rb_thread_lock_t *lock)
-{
-#if USE_WIN32_MUTEX
- int result;
- thread_debug("native_mutex_trylock: %p\n", *lock);
- result = w32_wait_events(&*lock, 1, 1, 0);
- thread_debug("native_mutex_trylock result: %d\n", result);
- switch (result) {
- case WAIT_OBJECT_0:
- return 0;
- case WAIT_TIMEOUT:
- return EBUSY;
- }
- return EINVAL;
-#else
- return TryEnterCriticalSection(lock) == 0;
-#endif
-}
-
-static void
-native_mutex_initialize(rb_thread_lock_t *lock)
-{
-#if USE_WIN32_MUTEX
- *lock = CreateMutex(NULL, FALSE, NULL);
- if (*lock == NULL) {
- w32_error();
- }
- /* thread_debug("initialize mutex: %p\n", *lock); */
-#else
- InitializeCriticalSection(lock);
-#endif
-}
-
-static void
-native_mutex_destroy(rb_thread_lock_t *lock)
-{
-#if USE_WIN32_MUTEX
- w32_close_handle(lock);
-#else
- DeleteCriticalSection(lock);
-#endif
-}
-
-struct cond_event_entry {
- struct cond_event_entry* next;
- HANDLE event;
-};
-
-struct rb_thread_cond_struct {
- struct cond_event_entry *next;
- struct cond_event_entry *last;
-};
-
-static void
-native_cond_signal(rb_thread_cond_t *cond)
-{
- /* cond is guarded by mutex */
- struct cond_event_entry *e = cond->next;
-
- if (e) {
- cond->next = e->next;
- SetEvent(e->event);
- }
- else {
- rb_bug("native_cond_signal: no pending threads");
- }
-}
-
-static void
-native_cond_broadcast(rb_thread_cond_t *cond)
-{
- /* cond is guarded by mutex */
- struct cond_event_entry *e = cond->next;
- cond->next = 0;
-
- while (e) {
- SetEvent(e->event);
- e = e->next;
- }
-}
-
-static void
-native_cond_wait(rb_thread_cond_t *cond, rb_thread_lock_t *mutex)
-{
- DWORD r;
- struct cond_event_entry entry;
-
- entry.next = 0;
- entry.event = CreateEvent(0, FALSE, FALSE, 0);
-
- /* cond is guarded by mutex */
- if (cond->next) {
- cond->last->next = &entry;
- cond->last = &entry;
- }
- else {
- cond->next = &entry;
- cond->last = &entry;
- }
-
- native_mutex_unlock(mutex);
- {
- r = WaitForSingleObject(entry.event, INFINITE);
- if (r != WAIT_OBJECT_0) {
- rb_bug("native_cond_wait: WaitForSingleObject returns %lu", r);
- }
- }
- native_mutex_lock(mutex);
-
- w32_close_handle(entry.event);
-}
-
-static void
-native_cond_initialize(rb_thread_cond_t *cond)
-{
- cond->next = 0;
- cond->last = 0;
-}
-
-static void
-native_cond_destroy(rb_thread_cond_t *cond)
-{
- /* */
-}
-
-static void
-native_thread_destroy(rb_thread_t *th)
-{
- HANDLE intr = th->native_thread_data.interrupt_event;
- native_mutex_destroy(&th->interrupt_lock);
- thread_debug("close handle - intr: %p, thid: %p\n", intr, th->thread_id);
- th->native_thread_data.interrupt_event = 0;
- w32_close_handle(intr);
-}
-
-static unsigned long _stdcall
-thread_start_func_1(void *th_ptr)
-{
- rb_thread_t *th = th_ptr;
- VALUE stack_start;
- volatile HANDLE thread_id = th->thread_id;
-
- th->native_thread_data.interrupt_event = CreateEvent(0, TRUE, FALSE, 0);
-
- /* run */
- thread_debug("thread created (th: %p, thid: %p, event: %p)\n", th,
- th->thread_id, th->native_thread_data.interrupt_event);
- thread_start_func_2(th, &stack_start, 0);
-
- w32_close_handle(thread_id);
- thread_debug("thread deleted (th: %p)\n", th);
- return 0;
-}
-
-extern size_t rb_gc_stack_maxsize;
-
-static int
-native_thread_create(rb_thread_t *th)
-{
- size_t stack_size = 4 * 1024; /* 4KB */
- th->thread_id = w32_create_thread(stack_size, thread_start_func_1, th);
-
- th->machine_stack_maxsize = rb_gc_stack_maxsize; /* not tested. */
-
- if ((th->thread_id) == 0) {
- st_delete_wrap(th->vm->living_threads, th->self);
- rb_raise(rb_eThreadError, "can't create Thread (%d)", errno);
- }
-
- w32_resume_thread(th->thread_id);
-
- if (THREAD_DEBUG) {
- Sleep(0);
- thread_debug("create: (th: %p, thid: %p, intr: %p), stack size: %d\n",
- th, th->thread_id,
- th->native_thread_data.interrupt_event, stack_size);
- }
- return 0;
-}
-
-static void
-native_thread_join(HANDLE th)
-{
- w32_wait_events(&th, 1, 0, 0);
-}
-
-static void
-native_thread_apply_priority(rb_thread_t *th)
-{
- int priority = th->priority;
- if (th->priority > 0) {
- priority = THREAD_PRIORITY_ABOVE_NORMAL;
- }
- else if (th->priority < 0) {
- priority = THREAD_PRIORITY_BELOW_NORMAL;
- }
- else {
- priority = THREAD_PRIORITY_NORMAL;
- }
-
- SetThreadPriority(th->thread_id, priority);
-}
-
-static void
-ubf_handle(void *ptr)
-{
- rb_thread_t *th = (rb_thread_t *)ptr;
- thread_debug("ubf_handle: %p\n", th);
- w32_set_event(th->native_thread_data.interrupt_event);
-}
-
-static void timer_thread_function(void);
-
-static HANDLE timer_thread_id = 0;
-
-static unsigned long _stdcall
-timer_thread_func(void *dummy)
-{
- thread_debug("timer_thread\n");
- while (system_working) {
- Sleep(WIN32_WAIT_TIMEOUT);
- timer_thread_function();
- }
- thread_debug("timer killed\n");
- return 0;
-}
-
-void
-rb_thread_create_timer_thread(void)
-{
- if (timer_thread_id == 0) {
- timer_thread_id = w32_create_thread(1024, timer_thread_func, 0);
- w32_resume_thread(timer_thread_id);
- }
-}
-
-#endif /* THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION */
Deleted: MacRuby/branches/testing/thread_win32.h
===================================================================
--- MacRuby/branches/testing/thread_win32.h 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/thread_win32.h 2008-06-17 01:04:32 UTC (rev 295)
@@ -1,33 +0,0 @@
-/**********************************************************************
-
- thread_win32.h -
-
- $Author: akr $
-
- Copyright (C) 2004-2007 Koichi Sasada
-
-**********************************************************************/
-
-/* interface */
-#ifndef RUBY_THREAD_WIN32_H
-#define RUBY_THREAD_WIN32_H
-
-#include <windows.h>
-
-# ifdef __CYGWIN__
-# undef _WIN32
-# endif
-
-WINBASEAPI BOOL WINAPI
-TryEnterCriticalSection(IN OUT LPCRITICAL_SECTION lpCriticalSection);
-
-typedef HANDLE rb_thread_id_t;
-typedef CRITICAL_SECTION rb_thread_lock_t;
-typedef struct rb_thread_cond_struct rb_thread_cond_t;
-
-typedef struct native_thread_data_struct {
- HANDLE interrupt_event;
-} native_thread_data_t;
-
-#endif /* RUBY_THREAD_WIN32_H */
-
Modified: MacRuby/branches/testing/version.h
===================================================================
--- MacRuby/branches/testing/version.h 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/version.h 2008-06-17 01:04:32 UTC (rev 295)
@@ -52,7 +52,7 @@
#endif
#if WITH_OBJC
-# define MACRUBY_VERSION 0.2
+# define MACRUBY_VERSION 0.3
# define RUBY_DESCRIPTION \
"MacRuby version " STRINGIZE(MACRUBY_VERSION) \
" (ruby "RUBY_VERSION \
Deleted: MacRuby/branches/testing/version.h.orig
===================================================================
--- MacRuby/branches/testing/version.h.orig 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/version.h.orig 2008-06-17 01:04:32 UTC (rev 295)
@@ -1,57 +0,0 @@
-#define RUBY_VERSION "1.9.0"
-#define RUBY_RELEASE_DATE "2008-02-18"
-#define RUBY_VERSION_CODE 190
-#define RUBY_RELEASE_CODE 20080218
-#define RUBY_PATCHLEVEL 0
-
-#define RUBY_VERSION_MAJOR 1
-#define RUBY_VERSION_MINOR 9
-#define RUBY_VERSION_TEENY 0
-#define RUBY_RELEASE_YEAR 2008
-#define RUBY_RELEASE_MONTH 2
-#define RUBY_RELEASE_DAY 18
-
-#ifdef RUBY_EXTERN
-RUBY_EXTERN const char ruby_version[];
-RUBY_EXTERN const char ruby_release_date[];
-RUBY_EXTERN const char ruby_platform[];
-RUBY_EXTERN const int ruby_patchlevel;
-RUBY_EXTERN const char ruby_description[];
-RUBY_EXTERN const char ruby_copyright[];
-#endif
-
-#define RUBY_AUTHOR "Yukihiro Matsumoto"
-#define RUBY_BIRTH_YEAR 1993
-#define RUBY_BIRTH_MONTH 2
-#define RUBY_BIRTH_DAY 24
-
-#ifndef RUBY_REVISION
-#include "revision.h"
-#endif
-#ifndef RUBY_REVISION
-#define RUBY_REVISION 0
-#endif
-
-#if RUBY_VERSION_TEENY > 0 && RUBY_PATCHLEVEL < 5000 && !RUBY_REVISION
-#define RUBY_RELEASE_STR "patchlevel"
-#define RUBY_RELEASE_NUM RUBY_PATCHLEVEL
-#else
-#ifdef RUBY_BRANCH_NAME
-#define RUBY_RELEASE_STR RUBY_BRANCH_NAME
-#else
-#define RUBY_RELEASE_STR "revision"
-#endif
-#define RUBY_RELEASE_NUM RUBY_REVISION
-#endif
-
-# define RUBY_DESCRIPTION \
- "ruby "RUBY_VERSION \
- " ("RUBY_RELEASE_DATE" " \
- RUBY_RELEASE_STR" " \
- STRINGIZE(RUBY_RELEASE_NUM)") " \
- "["RUBY_PLATFORM"]"
-# define RUBY_COPYRIGHT \
- "ruby - Copyright (C) " \
- STRINGIZE(RUBY_BIRTH_YEAR)"-" \
- STRINGIZE(RUBY_RELEASE_YEAR)" " \
- RUBY_AUTHOR
Modified: MacRuby/branches/testing/vm_insnhelper.c
===================================================================
--- MacRuby/branches/testing/vm_insnhelper.c 2008-06-16 08:50:24 UTC (rev 294)
+++ MacRuby/branches/testing/vm_insnhelper.c 2008-06-17 01:04:32 UTC (rev 295)
@@ -353,6 +353,10 @@
return Qnil; /* not reached */
}
+#if WITH_OBJC
+NODE *rb_current_cfunc_node = NULL;
+#endif
+
static inline VALUE
vm_call_cfunc(rb_thread_t *th, rb_control_frame_t *reg_cfp,
int num, ID id, VALUE recv, VALUE klass,
@@ -371,7 +375,13 @@
reg_cfp->sp -= num + 1;
+#if WITH_OBJC
+ rb_current_cfunc_node = (NODE *)mn;
+#endif
val = call_cfunc(mn->nd_cfnc, recv, mn->nd_argc, num, reg_cfp->sp + 1);
+#if WITH_OBJC
+ rb_current_cfunc_node = NULL;
+#endif
if (reg_cfp != th->cfp + 1) {
rb_bug("cfp consistency error - send");
@@ -589,7 +599,7 @@
else {
int stat = 0;
#if WITH_OBJC
- mn = rb_objc_define_objc_mid_closure(recv, id, NULL);
+ mn = rb_objc_define_objc_mid_closure(recv, id, 0);
if (mn != NULL) {
return vm_call_method(th, cfp, num, blockptr, flag, id,
mn, recv, klass);
@@ -1150,25 +1160,16 @@
return;
}
}
- }
-
- if (*pmn == NULL) {
id = rb_objc_missing_sel(*pid, *pnum);
- if (id != *pid
- && (mn = rb_objc_define_objc_mid_closure(recv, id, NULL))
- != NULL) {
- *pmn = mn;
- *pid = id;
- return;
+ if (id != *pid) {
+ mn = rb_objc_define_objc_mid_closure(recv, id, *pid);
+ if (mn != NULL) {
+ *pmn = mn;
+ *pid = id;
+ return;
+ }
}
}
- else {
- mn = rb_objc_define_objc_mid_closure(recv, *pid, *pmn);
- if (mn != NULL) {
- *pmn = mn;
- return;
- }
- }
}
#endif
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080616/e81d9072/attachment-0001.htm
More information about the macruby-changes
mailing list