summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog37
-rw-r--r--Makefile.in244
-rw-r--r--README.EXT.jp358
-rw-r--r--config_s.dj3
-rw-r--r--configure594
-rw-r--r--configure.in12
-rw-r--r--cygwin/GNUmakefile.in2
-rw-r--r--dir.c4
-rw-r--r--dln.c12
-rw-r--r--eval.c18
-rw-r--r--ext/curses/extconf.rb15
-rw-r--r--ext/dbm/dbm.c2
-rw-r--r--ext/dbm/extconf.rb5
-rw-r--r--ext/extmk.rb.in146
-rw-r--r--ext/extmk.rb.nt252
-rw-r--r--ext/gdbm/extconf.rb6
-rw-r--r--ext/readline/extconf.rb17
-rw-r--r--ext/socket/extconf.rb10
-rw-r--r--ext/tcltklib/extconf.rb96
-rw-r--r--file.c43
-rw-r--r--hash.c6
-rw-r--r--instruby.rb15
-rw-r--r--io.c16
-rw-r--r--lib/ftools.rb17
-rw-r--r--lib/jcode.rb160
-rw-r--r--lib/mkmf.rb158
-rw-r--r--mkconfig.rb12
-rw-r--r--pack.c4
-rw-r--r--parse.y2
-rw-r--r--process.c6
-rw-r--r--regex.c4
-rw-r--r--rubytest.rb5
-rw-r--r--st.c6
-rw-r--r--string.c2
-rw-r--r--top.sed3
-rw-r--r--util.c14
-rw-r--r--version.h8
-rw-r--r--win32/Makefile50
-rw-r--r--win32/config.status36
39 files changed, 1316 insertions, 1084 deletions
diff --git a/ChangeLog b/ChangeLog
index 58f5e3879cd..83cc64e0d31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,36 @@
+Wed Jul 28 18:24:45 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * version 1.3.6 - version 1.4 alpha
+
+Tue Jul 27 09:38:08 1999 EGUCHI Osamu <eguchi@shizuokanet.ne.jp>
+
+ * eval.c (rb_eval): reduce recursive rb_eval() calls by
+ NODE_BLOCKs.
+
+Tue Jul 27 01:20:40 1999 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
+
+ * file.c (rb_file_s_expand_path): drive letter patch.
+
+Mon Jul 26 02:36:31 1999 Shugo Maeda <shugo@netlab.co.jp>
+
+ * eval.c (rb_load): should clear ruby_nerr.
+
+ * eval.c (rb_thread_join): oldbt should not be empty to unshift.
+
+Sun Jul 25 12:09:16 1999 Koji Arai <JCA02266@nifty.ne.jp>
+
+ * dir.c (push_braces): should treat nested braces.
+
+Fri Jul 23 02:49:49 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * hash.c (rb_hash_clear): dummy argument added; suggested by
+ <eguchi@shizuokanet.ne.jp>. thanks.
+
+Thu Jul 22 19:37:22 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * eval.c (rb_thread_join): get_backtrace() may retrun Qnil.
+ typecheck added.
+
Tue Jul 20 02:28:34 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* io.c (rb_gets): $_ should be nil, when get returns nil.
@@ -9,6 +42,10 @@ Mon Jul 19 17:13:09 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* regex.c (re_compile_fastmap): should continue fastmap compile
for anychar_repeat, for it's repeat anyway.
+Mon Jul 26 13:33:45 1999 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
+
+ * lib/jcode.rb: replaced by faster code.
+
Mon Jul 19 01:57:28 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* lib/mkmf.rb: no longer use install program.
diff --git a/Makefile.in b/Makefile.in
index 2fb4542b52d..d6981a46dd5 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -23,8 +23,8 @@ DLDFLAGS = @LIBRUBY_DLDFLAGS@
SOLIBS = @SOLIBS@
RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
-binsuffix = @binsuffix@
-PROGRAM=$(RUBY_INSTALL_NAME)$(binsuffix)
+EXEEXT = @EXEEXT@
+PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
#### End of system configuration section. ####
@@ -40,74 +40,74 @@ LIBRUBYARG = @LIBRUBYARG@
EXTOBJS =
-MAINOBJ = main.o
-
-OBJS = array.o \
- bignum.o \
- class.o \
- compar.o \
- dir.o \
- dln.o \
- enum.o \
- error.o \
- eval.o \
- file.o \
- gc.o \
- hash.o \
- inits.o \
- io.o \
- marshal.o \
- math.o \
- numeric.o \
- object.o \
- pack.o \
- parse.o \
- process.o \
- prec.o \
- random.o \
- range.o \
- re.o \
- regex.o \
- ruby.o \
- signal.o \
- sprintf.o \
- st.o \
- string.o \
- struct.o \
- time.o \
- util.o \
- variable.o \
- version.o \
+MAINOBJ = main.@OBJEXT@
+
+OBJS = array.@OBJEXT@ \
+ bignum.@OBJEXT@ \
+ class.@OBJEXT@ \
+ compar.@OBJEXT@ \
+ dir.@OBJEXT@ \
+ dln.@OBJEXT@ \
+ enum.@OBJEXT@ \
+ error.@OBJEXT@ \
+ eval.@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@ \
+ re.@OBJEXT@ \
+ regex.@OBJEXT@ \
+ ruby.@OBJEXT@ \
+ signal.@OBJEXT@ \
+ sprintf.@OBJEXT@ \
+ st.@OBJEXT@ \
+ string.@OBJEXT@ \
+ struct.@OBJEXT@ \
+ time.@OBJEXT@ \
+ util.@OBJEXT@ \
+ variable.@OBJEXT@ \
+ version.@OBJEXT@ \
$(MISSING)
-all: miniruby$(binsuffix) rbconfig.rb
- @./miniruby$(binsuffix) -Xext extmk.rb @EXTSTATIC@
+all: miniruby$(EXEEXT) rbconfig.rb
+ @./miniruby$(EXEEXT) -Xext extmk.rb @EXTSTATIC@
-miniruby$(binsuffix): config.status $(LIBRUBY_A) $(MAINOBJ) dmyext.o
+miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) dmyext.@OBJEXT@
@rm -f $@
- $(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) dmyext.o $(LIBRUBY_A) $(LIBS) -o $@
+ $(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) dmyext.@OBJEXT@ $(LIBRUBY_A) $(LIBS) -o $@
$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(EXTOBJS)
@rm -f $@
$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
-$(LIBRUBY_A): $(OBJS) dmyext.o
- @AR@ rcu $@ $(OBJS) dmyext.o
+$(LIBRUBY_A): $(OBJS) dmyext.@OBJEXT@
+ @AR@ rcu $@ $(OBJS) dmyext.@OBJEXT@
@-@RANLIB@ $@ 2> /dev/null || true
-$(LIBRUBY_SO): $(OBJS) dmyext.o
- $(LDSHARED) $(DLDFLAGS) $(SOLIBS) $(OBJS) dmyext.o -o $@
+$(LIBRUBY_SO): $(OBJS) dmyext.@OBJEXT@
+ $(LDSHARED) $(DLDFLAGS) $(SOLIBS) $(OBJS) dmyext.@OBJEXT@ -o $@
@-./miniruby -e 'ARGV.each{|link| File.delete link if File.exist? link; \
File.symlink "$(LIBRUBY_SO)", link}' \
$(LIBRUBY_ALIASES) || true
install: rbconfig.rb
- ./miniruby$(binsuffix) $(srcdir)/instruby.rb $(DESTDIR)
+ ./miniruby$(EXEEXT) $(srcdir)/instruby.rb $(DESTDIR)
clean:; @rm -f $(OBJS) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY_ALIASES) $(MAINOBJ) rbconfig.rb
- @rm -f ext/extinit.c ext/extinit.o dmyext.o
- @-./miniruby$(binsuffix) -Xext extmk.rb clean 2> /dev/null || true
- @rm -f $(PROGRAM) miniruby$(binsuffix)
+ @rm -f ext/extinit.c ext/extinit.@OBJEXT@ dmyext.@OBJEXT@
+ @-./miniruby$(EXEEXT) -Xext extmk.rb clean 2> /dev/null || true
+ @rm -f $(PROGRAM) miniruby$(EXEEXT)
distclean: clean
@rm -f Makefile ext/extmk.rb config.h
@@ -118,11 +118,11 @@ realclean: distclean
@rm -f parse.c
@rm -f lex.c
-test: miniruby$(binsuffix)
- @./miniruby$(binsuffix) $(srcdir)/rubytest.rb
+test: miniruby$(EXEEXT)
+ @./miniruby$(EXEEXT) $(srcdir)/rubytest.rb
-rbconfig.rb: miniruby$(binsuffix)
- @./miniruby$(binsuffix) $(srcdir)/mkconfig.rb rbconfig.rb
+rbconfig.rb: miniruby$(EXEEXT)
+ @./miniruby$(EXEEXT) $(srcdir)/mkconfig.rb rbconfig.rb
config.status: $(srcdir)/configure
$(SHELL) ./config.status --recheck
@@ -130,7 +130,7 @@ config.status: $(srcdir)/configure
$(srcdir)/configure: $(srcdir)/configure.in
cd $(srcdir) && $(AUTOCONF)
-.c.o:
+.c.@OBJEXT@:
$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
lex.c: keywords
@@ -140,124 +140,124 @@ parse.c: parse.y
$(YACC) $<
mv -f y.tab.c parse.c
-alloca.o: @srcdir@/missing/alloca.c
+alloca.@OBJEXT@: @srcdir@/missing/alloca.c
$(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/alloca.c
-crypt.o: @srcdir@/missing/crypt.c
+crypt.@OBJEXT@: @srcdir@/missing/crypt.c
$(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/crypt.c
-dup2.o: @srcdir@/missing/dup2.c
+dup2.@OBJEXT@: @srcdir@/missing/dup2.c
$(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/dup2.c
-finite.o: @srcdir@/missing/finite.c
+finite.@OBJEXT@: @srcdir@/missing/finite.c
$(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/finite.c
-flock.o: @srcdir@/missing/flock.c
+flock.@OBJEXT@: @srcdir@/missing/flock.c
$(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/flock.c
-isinf.o: @srcdir@/missing/isinf.c
+isinf.@OBJEXT@: @srcdir@/missing/isinf.c
$(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/isinf.c
-isnan.o: @srcdir@/missing/isnan.c
+isnan.@OBJEXT@: @srcdir@/missing/isnan.c
$(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/isnan.c
-fnmatch.o: @srcdir@/missing/fnmatch.c
+fnmatch.@OBJEXT@: @srcdir@/missing/fnmatch.c
$(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/fnmatch.c
-memcmp.o: @srcdir@/missing/memcmp.c
+memcmp.@OBJEXT@: @srcdir@/missing/memcmp.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/memcmp.c
-memmove.o: @srcdir@/missing/memmove.c
+memmove.@OBJEXT@: @srcdir@/missing/memmove.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/memmove.c
-mkdir.o: @srcdir@/missing/mkdir.c
+mkdir.@OBJEXT@: @srcdir@/missing/mkdir.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/mkdir.c
-vsnprintf.o: @srcdir@/missing/vsnprintf.c
+vsnprintf.@OBJEXT@: @srcdir@/missing/vsnprintf.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/vsnprintf.c
-strcasecmp.o: @srcdir@/missing/strcasecmp.c
+strcasecmp.@OBJEXT@: @srcdir@/missing/strcasecmp.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strcasecmp.c
-strncasecmp.o: @srcdir@/missing/strncasecmp.c
+strncasecmp.@OBJEXT@: @srcdir@/missing/strncasecmp.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strncasecmp.c
-strchr.o: @srcdir@/missing/strchr.c
+strchr.@OBJEXT@: @srcdir@/missing/strchr.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strchr.c
-strdup.o: @srcdir@/missing/strdup.c
+strdup.@OBJEXT@: @srcdir@/missing/strdup.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strdup.c
-strerror.o: @srcdir@/missing/strerror.c
+strerror.@OBJEXT@: @srcdir@/missing/strerror.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strerror.c
-strftime.o: @srcdir@/missing/strftime.c
+strftime.@OBJEXT@: @srcdir@/missing/strftime.c
$(CC) -I. $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strftime.c
-strstr.o: @srcdir@/missing/strstr.c
+strstr.@OBJEXT@: @srcdir@/missing/strstr.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strstr.c
-strtod.o: @srcdir@/missing/strtod.c
+strtod.@OBJEXT@: @srcdir@/missing/strtod.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strtod.c
-strtol.o: @srcdir@/missing/strtol.c
+strtol.@OBJEXT@: @srcdir@/missing/strtol.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strtol.c
-strtoul.o: @srcdir@/missing/strtoul.c
+strtoul.@OBJEXT@: @srcdir@/missing/strtoul.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strtoul.c
-nt.o: @srcdir@/missing/nt.c
+nt.@OBJEXT@: @srcdir@/missing/nt.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/nt.c
-x68.o: @srcdir@/missing/x68.c
+x68.@OBJEXT@: @srcdir@/missing/x68.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/x68.c
-os2.o: @srcdir@/missing/os2.c
+os2.@OBJEXT@: @srcdir@/missing/os2.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/os2.c
-dl_os2.o: @srcdir@/missing/dl_os2.c
+dl_os2.@OBJEXT@: @srcdir@/missing/dl_os2.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/dl_os2.c
# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
###
-parse.o: parse.y ruby.h config.h defines.h intern.h env.h node.h st.h regex.h util.h lex.c
+parse.@OBJEXT@: parse.y ruby.h config.h defines.h intern.h env.h node.h st.h regex.h util.h lex.c
###
-array.o: array.c ruby.h config.h defines.h intern.h
-bignum.o: bignum.c ruby.h config.h defines.h intern.h
-class.o: class.c ruby.h config.h defines.h intern.h node.h st.h
-compar.o: compar.c ruby.h config.h defines.h intern.h
-dir.o: dir.c ruby.h config.h defines.h intern.h
-dln.o: dln.c config.h defines.h dln.h
-dmyext.o: dmyext.c
-enum.o: enum.c ruby.h config.h defines.h intern.h
-error.o: error.c ruby.h config.h defines.h intern.h env.h
-eval.o: eval.c ruby.h config.h defines.h intern.h node.h env.h rubysig.h st.h dln.h
-file.o: file.c ruby.h config.h defines.h intern.h rubyio.h rubysig.h
-fnmatch.o: fnmatch.c config.h fnmatch.h
-gc.o: gc.c ruby.h config.h defines.h intern.h rubysig.h st.h node.h env.h re.h regex.h
-hash.o: hash.c ruby.h config.h defines.h intern.h st.h rubysig.h util.h
-inits.o: inits.c ruby.h config.h defines.h intern.h
-io.o: io.c ruby.h config.h defines.h intern.h rubyio.h rubysig.h
-main.o: main.c ruby.h config.h defines.h intern.h
-marshal.o: marshal.c ruby.h config.h defines.h intern.h rubyio.h st.h
-prec.o: prec.c ruby.h config.h defines.h intern.h
-math.o: math.c ruby.h config.h defines.h intern.h
-numeric.o: numeric.c ruby.h config.h defines.h intern.h
-object.o: object.c ruby.h config.h defines.h intern.h st.h
-pack.o: pack.c ruby.h config.h defines.h intern.h
-process.o: process.c ruby.h config.h defines.h intern.h rubysig.h st.h
-random.o: random.c ruby.h config.h defines.h intern.h
-range.o: range.c ruby.h config.h defines.h intern.h
-re.o: re.c ruby.h config.h defines.h intern.h re.h regex.h
-regex.o: regex.c config.h regex.h util.h
-ruby.o: ruby.c ruby.h config.h defines.h intern.h dln.h util.h
-signal.o: signal.c ruby.h config.h defines.h intern.h rubysig.h
-sprintf.o: sprintf.c ruby.h config.h defines.h intern.h
-st.o: st.c config.h st.h
-string.o: string.c ruby.h config.h defines.h intern.h re.h regex.h
-struct.o: struct.c ruby.h config.h defines.h intern.h
-time.o: time.c ruby.h config.h defines.h intern.h
-util.o: util.c ruby.h config.h defines.h intern.h util.h
-variable.o: variable.c ruby.h config.h defines.h intern.h env.h node.h st.h
-version.o: version.c ruby.h config.h defines.h intern.h version.h
+array.@OBJEXT@: array.c ruby.h config.h defines.h intern.h
+bignum.@OBJEXT@: bignum.c ruby.h config.h defines.h intern.h
+class.@OBJEXT@: class.c ruby.h config.h defines.h intern.h node.h st.h
+compar.@OBJEXT@: compar.c ruby.h config.h defines.h intern.h
+dir.@OBJEXT@: dir.c ruby.h config.h defines.h intern.h
+dln.@OBJEXT@: dln.c config.h defines.h dln.h
+dmyext.@OBJEXT@: dmyext.c
+enum.@OBJEXT@: enum.c ruby.h config.h defines.h intern.h
+error.@OBJEXT@: error.c ruby.h config.h defines.h intern.h env.h
+eval.@OBJEXT@: eval.c ruby.h config.h defines.h intern.h node.h env.h rubysig.h st.h dln.h
+file.@OBJEXT@: file.c ruby.h config.h defines.h intern.h rubyio.h rubysig.h
+fnmatch.@OBJEXT@: fnmatch.c config.h fnmatch.h
+gc.@OBJEXT@: gc.c ruby.h config.h defines.h intern.h rubysig.h st.h node.h env.h re.h regex.h
+hash.@OBJEXT@: hash.c ruby.h config.h defines.h intern.h st.h rubysig.h util.h
+inits.@OBJEXT@: inits.c ruby.h config.h defines.h intern.h
+io.@OBJEXT@: io.c ruby.h config.h defines.h intern.h rubyio.h rubysig.h
+main.@OBJEXT@: main.c ruby.h config.h defines.h intern.h
+marshal.@OBJEXT@: marshal.c ruby.h config.h defines.h intern.h rubyio.h st.h
+prec.@OBJEXT@: prec.c ruby.h config.h defines.h intern.h
+math.@OBJEXT@: math.c ruby.h config.h defines.h intern.h
+numeric.@OBJEXT@: numeric.c ruby.h config.h defines.h intern.h
+object.@OBJEXT@: object.c ruby.h config.h defines.h intern.h st.h
+pack.@OBJEXT@: pack.c ruby.h config.h defines.h intern.h
+process.@OBJEXT@: process.c ruby.h config.h defines.h intern.h rubysig.h st.h
+random.@OBJEXT@: random.c ruby.h config.h defines.h intern.h
+range.@OBJEXT@: range.c ruby.h config.h defines.h intern.h
+re.@OBJEXT@: re.c ruby.h config.h defines.h intern.h re.h regex.h
+regex.@OBJEXT@: regex.c config.h regex.h util.h
+ruby.@OBJEXT@: ruby.c ruby.h config.h defines.h intern.h dln.h util.h
+signal.@OBJEXT@: signal.c ruby.h config.h defines.h intern.h rubysig.h
+sprintf.@OBJEXT@: sprintf.c ruby.h config.h defines.h intern.h
+st.@OBJEXT@: st.c config.h st.h
+string.@OBJEXT@: string.c ruby.h config.h defines.h intern.h re.h regex.h
+struct.@OBJEXT@: struct.c ruby.h config.h defines.h intern.h
+time.@OBJEXT@: time.c ruby.h config.h defines.h intern.h
+util.@OBJEXT@: util.c ruby.h config.h defines.h intern.h util.h
+variable.@OBJEXT@: variable.c ruby.h config.h defines.h intern.h env.h node.h st.h
+version.@OBJEXT@: version.c ruby.h config.h defines.h intern.h version.h
diff --git a/README.EXT.jp b/README.EXT.jp
index dab85df08a4..da3902b8cc1 100644
--- a/README.EXT.jp
+++ b/README.EXT.jp
@@ -332,7 +332,7 @@ privateメソッドとは関数形式でしか呼び出すことの出来ないメソッ
2.2.1 Rubyのプログラムをevalする
CからRubyの機能を呼び出すもっとも簡単な方法として,文字列で
-与えられたRubyのプログラムを評価する関数があります.
+与えられたRubyのプログラムを評価する以下の関数があります.
VALUE rb_eval_string(char *str)
@@ -401,16 +401,16 @@ C言語とRubyの間で情報を共有する方法について解説します.
3.1 Cから参照できるRubyの定数
-以下のRubyの定数はCのレベルから参照できる.
+以下のRubyの定数はCのレベルから参照できます.
Qtrue
Qfalse
-真偽値.QfalseはC言語でも偽とみなされる(つまり0).
+ 真偽値.QfalseはC言語でも偽とみなされます(つまり0).
Qnil
-C言語から見た「nil」.
+ C言語から見た「nil」.
3.2 CとRubyで共有される大域変数
@@ -837,275 +837,279 @@ C言語からRubyの機能を利用するAPIは以下の通りである.
** 型
- VALUE
+VALUE
-Rubyオブジェクトを表現する型.必要に応じてキャストして用いる.
-組み込み型を表現するCの型はruby.hに記述してあるRで始まる構造
-体である.VALUE型をこれらにキャストするためにRで始まる構造体
-名を全て大文字にした名前のマクロが用意されている.
+ Rubyオブジェクトを表現する型.必要に応じてキャストして用いる.
+ 組み込み型を表現するCの型はruby.hに記述してあるRで始まる構造
+ 体である.VALUE型をこれらにキャストするためにRで始まる構造体
+ 名を全て大文字にした名前のマクロが用意されている.
** 変数・定数
- Qnil
+Qnil
-定数: nilオブジェクト
+ 定数: nilオブジェクト
- Qtrue
+Qtrue
-定数: trueオブジェクト(真のデフォルト値)
+ 定数: trueオブジェクト(真のデフォルト値)
- Qfalse
+Qfalse
-定数: falseオブジェクト
+ 定数: falseオブジェクト
** Cデータのカプセル化
- Data_Wrap_Struct(VALUE class, void (*mark)(), void (*free)(), void *sval)
+Data_Wrap_Struct(VALUE class, void (*mark)(), void (*free)(), void *sval)
-Cの任意のポインタをカプセル化したRubyオブジェクトを返す.こ
-のポインタがRubyからアクセスされなくなった時,freeで指定した
-関数が呼ばれる.また,このポインタの指すデータが他のRubyオブ
-ジェクトを指している場合,markに指定する関数でマークする必要
-がある.
+ Cの任意のポインタをカプセル化したRubyオブジェクトを返す.こ
+ のポインタがRubyからアクセスされなくなった時,freeで指定した
+ 関数が呼ばれる.また,このポインタの指すデータが他のRubyオブ
+ ジェクトを指している場合,markに指定する関数でマークする必要
+ がある.
- Data_Make_Struct(class, type, mark, free, sval)
+Data_Make_Struct(class, type, mark, free, sval)
-type型のメモリをmallocし,変数svalに代入した後,それをカプセ
-ル化したデータを返すマクロ.
+ type型のメモリをmallocし,変数svalに代入した後,それをカプセ
+ ル化したデータを返すマクロ.
- Data_Get_Struct(data, type, sval)
+Data_Get_Struct(data, type, sval)
-dataからtype型のポインタを取り出し変数svalに代入するマクロ.
+ dataからtype型のポインタを取り出し変数svalに代入するマクロ.
** 型チェック
- TYPE(value)
- FIXNUM_P(value)
- NIL_P(value)
- void Check_Type(VALUE value, int type)
- void Check_SafeStr(VALUE value)
+TYPE(value)
+FIXNUM_P(value)
+NIL_P(value)
+void Check_Type(VALUE value, int type)
+void Check_SafeStr(VALUE value)
** 型変換
- FIX2INT(value)
- INT2FIX(i)
- NUM2INT(value)
- INT2NUM(i)
- NUM2DBL(value)
- rb_float_new(f)
- STR2CSTR(value)
- rb_str_new2(s)
+FIX2INT(value)
+INT2FIX(i)
+NUM2INT(value)
+INT2NUM(i)
+NUM2DBL(value)
+rb_float_new(f)
+STR2CSTR(value)
+rb_str_new2(s)
** クラス/モジュール定義
- VALUE rb_define_class(char *name, VALUE super)
+VALUE rb_define_class(char *name, VALUE super)
-superのサブクラスとして新しいRubyクラスを定義する.
+ superのサブクラスとして新しいRubyクラスを定義する.
- VALUE rb_define_class_under(VALUE module, char *name, VALUE super)
+VALUE rb_define_class_under(VALUE module, char *name, VALUE super)
-superのサブクラスとして新しいRubyクラスを定義し,moduleの定
-数として定義する.
+ superのサブクラスとして新しいRubyクラスを定義し,moduleの
+ 定数として定義する.
- VALUE rb_define_module(char *name)
+VALUE rb_define_module(char *name)
-新しいRubyモジュールを定義する.
+ 新しいRubyモジュールを定義する.
- VALUE rb_define_module_under(VALUE module, char *name, VALUE super)
+VALUE rb_define_module_under(VALUE module, char *name, VALUE super)
-新しいRubyモジュールを定義し,moduleの定数として定義する.
+ 新しいRubyモジュールを定義し,moduleの定数として定義する.
- void rb_include_module(VALUE class, VALUE module)
+void rb_include_module(VALUE class, VALUE module)
-モジュールをインクルードする.classがすでにmoduleをインクルー
-ドしている時には何もしない(多重インクルードの禁止).
+ モジュールをインクルードする.classがすでにmoduleをインク
+ ルードしている時には何もしない(多重インクルードの禁止).
- void rb_extend_object(VALUE object, VALUE module)
+void rb_extend_object(VALUE object, VALUE module)
-オブジェクトをモジュール(で定義されているメソッド)で拡張する.
+ オブジェクトをモジュール(で定義されているメソッド)で拡張する.
** 大域変数定義
- void rb_define_variable(char *name, VALUE *var)
+void rb_define_variable(char *name, VALUE *var)
-RubyとCとで共有するグローバル変数を定義する.変数名が`$'で始
-まらない時には自動的に追加される.nameとしてRubyの識別子とし
-て許されない文字(例えば` ')を含む場合にはRubyプログラムから
-は見えなくなる.
+ RubyとCとで共有するグローバル変数を定義する.変数名が`$'で
+ 始まらない時には自動的に追加される.nameとしてRubyの識別子
+ として許されない文字(例えば` ')を含む場合にはRubyプログラ
+ ムからは見えなくなる.
- void rb_define_readonly_variable(char *name, VALUE *var)
+void rb_define_readonly_variable(char *name, VALUE *var)
-RubyとCとで共有するread onlyのグローバル変数を定義する.read
-onlyであること以外はrb_define_variable()と同じ.
+ RubyとCとで共有するread onlyのグローバル変数を定義する.
+ read onlyであること以外はrb_define_variable()と同じ.
- void rb_define_virtual_variable(char *name,
+void rb_define_virtual_variable(char *name,
VALUE (*getter)(), VALUE (*setter)())
-関数によって実現されるRuby変数を定義する.変数が参照された時
-にはgetterが,変数に値がセットされた時にはsetterが呼ばれる.
+ 関数によって実現されるRuby変数を定義する.変数が参照された
+ 時にはgetterが,変数に値がセットされた時にはsetterが呼ばれ
+ る.
- void rb_define_hooked_variable(char *name, VALUE *var,
- VALUE (*getter)(), VALUE (*setter)())
+void rb_define_hooked_variable(char *name, VALUE *var,
+ VALUE (*getter)(), VALUE (*setter)())
-関数によってhookのつけられたグローバル変数を定義する.変数が
-参照された時にはgetterが,関数に値がセットされた時にはsetter
-が呼ばれる.getterやsetterに0を指定した時にはhookを指定しな
-いのと同じ事になる.
+ 関数によってhookのつけられたグローバル変数を定義する.変数
+ が参照された時にはgetterが,関数に値がセットされた時には
+ setterが呼ばれる.getterやsetterに0を指定した時にはhookを
+ 指定しないのと同じ事になる.
- void rb_global_variable(VALUE *var)
+void rb_global_variable(VALUE *var)
-GCのため,Rubyプログラムからはアクセスされないが, Rubyオブジェ
-クトを含む大域変数をマークする.
+ GCのため,Rubyプログラムからはアクセスされないが, Rubyオブ
+ ジェクトを含む大域変数をマークする.
** 定数
- void rb_define_const(VALUE klass, char *name, VALUE val)
+void rb_define_const(VALUE klass, char *name, VALUE val)
-定数を定義する.
+ 定数を定義する.
- void rb_define_global_const(char *name, VALUE val)
+void rb_define_global_const(char *name, VALUE val)
-大域定数を定義する.
+ 大域定数を定義する.
rb_define_const(cKernal, name, val)
-と同じ意味.
+ と同じ意味.
** メソッド定義
- rb_define_method(VALUE class, char *name, VALUE (*func)(), int argc)
-
-メソッドを定義する.argcはselfを除く引数の数.argcが-1の時,
-関数には引数の数(selfを含まない)を第1引数, 引数の配列を第2引
-数とする形式で与えられる(第3引数はself).argcが-2の時, 第1引
-数がself, 第2引数がargs(argsは引数を含むRubyの配列)という形
-式で与えられる.
+rb_define_method(VALUE class, char *name, VALUE (*func)(), int argc)
- rb_define_private_method(VALUE class, char *name, VALUE (*func)(), int argc)
+ メソッドを定義する.argcはselfを除く引数の数.argcが-1の時,
+ 関数には引数の数(selfを含まない)を第1引数, 引数の配列を第2
+ 引数とする形式で与えられる(第3引数はself).argcが-2の時,
+ 第1引数がself, 第2引数がargs(argsは引数を含むRubyの配列)と
+ いう形式で与えられる.
+
+rb_define_private_method(VALUE class, char *name, VALUE (*func)(), int argc)
-privateメソッドを定義する.引数はrb_define_method()と同じ.
+ privateメソッドを定義する.引数はrb_define_method()と同じ.
- rb_define_singleton_method(VALUE class, char *name, VALUE (*func)(), int argc)
+rb_define_singleton_method(VALUE class, char *name, VALUE (*func)(), int argc)
-特異メソッドを定義する.引数はrb_define_method()と同じ.
+ 特異メソッドを定義する.引数はrb_define_method()と同じ.
- rb_scan_args(int argc, VALUE *argv, char *fmt, ...)
+rb_scan_args(int argc, VALUE *argv, char *fmt, ...)
-argc,argv形式で与えられた引数を分解する.fmtは必須引数の数,
-付加引数の数, 残りの引数があるかを指定する文字列で, "数字数
-字*"という形式である. 2 番目の数字と"*"はそれぞれ省略可能で
-ある.必須引数が一つもない場合は0を指定する.第3引数以降は変
-数へのポインタで, 該当する要素がその変数に格納される.付加引
-数に対応する引数が与えられていない場合は変数にQnilが代入され
-る.
+ argc,argv形式で与えられた引数を分解する.fmtは必須引数の数,
+ 付加引数の数, 残りの引数があるかを指定する文字列で, "数字
+ 数字*"という形式である. 2 番目の数字と"*"はそれぞれ省略可
+ 能である.必須引数が一つもない場合は0を指定する.第3引数以
+ 降は変数へのポインタで, 該当する要素がその変数に格納される.
+ 付加引数に対応する引数が与えられていない場合は変数にQnilが
+ 代入される.
** Rubyメソッド呼び出し
- VALUE rb_funcall(VALUE recv, ID mid, int narg, ...)
+VALUE rb_funcall(VALUE recv, ID mid, int narg, ...)
-メソッド呼び出し.文字列からmidを得るためにはrb_intern()を使う.
+ メソッド呼び出し.文字列からmidを得るためにはrb_intern()を
+ 使う.
- VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)
+VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)
-メソッド呼び出し.引数をargc,argv形式で渡す.
+ メソッド呼び出し.引数をargc,argv形式で渡す.
- VALUE rb_eval_string(char *str)
+VALUE rb_eval_string(char *str)
-文字列をRubyとスクリプトしてコンパイル・実行する.
+ 文字列をRubyとスクリプトしてコンパイル・実行する.
- ID rb_intern(char *name)
+ID rb_intern(char *name)
-文字列に対応するIDを返す.
+ 文字列に対応するIDを返す.
- char *rb_id2name(ID id)
+char *rb_id2name(ID id)
-IDに対応する文字列を返す(デバッグ用).
+ IDに対応する文字列を返す(デバッグ用).
- char *rb_class2name(VALUE class)
+char *rb_class2name(VALUE class)
-classの名前を返す(デバッグ用).classが名前を持たない時には,
-祖先を遡って名前を持つクラスの名前を返す.
+ classの名前を返す(デバッグ用).classが名前を持たない時には,
+ 祖先を遡って名前を持つクラスの名前を返す.
** インスタンス変数
- VALUE rb_iv_get(VALUE obj, char *name)
+VALUE rb_iv_get(VALUE obj, char *name)
-objのインスタンス変数の値を得る.`@'で始まらないインスタンス
-変数は Rubyプログラムからアクセスできない「隠れた」インスタ
-ンス変数になる.定数は大文字の名前を持つクラス(またはモジュー
-ル)のインスタンス変数として実装されている.
+ objのインスタンス変数の値を得る.`@'で始まらないインスタン
+ ス変数は Rubyプログラムからアクセスできない「隠れた」イン
+ スタンス変数になる.定数は大文字の名前を持つクラス(または
+ モジュール)のインスタンス変数として実装されている.
- VALUE rb_iv_set(VALUE obj, char *name, VALUE val)
+VALUE rb_iv_set(VALUE obj, char *name, VALUE val)
-objのインスタンス変数をvalにセットする.
+ objのインスタンス変数をvalにセットする.
** 制御構造
- VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)
+VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)
-func2をブロックとして設定し, func1をイテレータとして呼ぶ.
-func1には arg1が引数として渡され, func2には第1引数にイテレー
-タから与えられた値, 第2引数にarg2が渡される.
+ func2をブロックとして設定し, func1をイテレータとして呼ぶ.
+ func1には arg1が引数として渡され, func2には第1引数にイテレー
+ タから与えられた値, 第2引数にarg2が渡される.
- VALUE rb_yield(VALUE val)
+VALUE rb_yield(VALUE val)
-valを値としてイテレータブロックを呼び出す.
+ valを値としてイテレータブロックを呼び出す.
- VALUE rb_rescue(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)
+VALUE rb_rescue(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)
-関数func1をarg1を引数に呼び出す.func1の実行中に例外が発生し
-た時には func2をarg2を引数として呼ぶ.戻り値は例外が発生しな
-かった時はfunc1の戻り値, 例外が発生した時にはfunc2の戻り値で
-ある.
+ 関数func1をarg1を引数に呼び出す.func1の実行中に例外が発生
+ した時には func2をarg2を引数として呼ぶ.戻り値は例外が発生
+ しなかった時はfunc1の戻り値, 例外が発生した時にはfunc2の戻
+ り値である.
- VALUE rb_ensure(VALUE (*func1)(), void *arg1, void (*func2)(), void *arg2)
+VALUE rb_ensure(VALUE (*func1)(), void *arg1, void (*func2)(), void *arg2)
-関数func1をarg1を引数として実行し, 実行終了後(たとえ例外が発
-生しても) func2をarg2を引数として実行する.戻り値はfunc1の戻
-り値である(例外が発生した時は戻らない).
+ 関数func1をarg1を引数として実行し, 実行終了後(たとえ例外が
+ 発生しても) func2をarg2を引数として実行する.戻り値はfunc1
+ の戻り値である(例外が発生した時は戻らない).
** 例外・エラー
- void rb_warning(char *fmt, ...)
+void rb_warning(char *fmt, ...)
-rb_verbose時に標準エラー出力に警告情報を表示する.引数はprintf()と同じ.
+ rb_verbose時に標準エラー出力に警告情報を表示する.引数は
+ printf()と同じ.
- void rb_raise(rb_eRuntimeError, char *fmt, ...)
+void rb_raise(rb_eRuntimeError, char *fmt, ...)
-RuntimeError例外を発生させる.引数はprintf()と同じ.
+ RuntimeError例外を発生させる.引数はprintf()と同じ.
- void rb_raise(VALUE exception, char *fmt, ...)
+void rb_raise(VALUE exception, char *fmt, ...)
-exceptionで指定した例外を発生させる.fmt以下の引数はprintf()と同じ.
+ exceptionで指定した例外を発生させる.fmt以下の引数は
+ printf()と同じ.
- void rb_fatal(char *fmt, ...)
+void rb_fatal(char *fmt, ...)
-致命的例外を発生させる.通常の例外処理は行なわれず, インター
-プリタが終了する(ただしensureで指定されたコードは終了前に実
-行される).
+ 致命的例外を発生させる.通常の例外処理は行なわれず, インター
+ プリタが終了する(ただしensureで指定されたコードは終了前に
+ 実行される).
- void rb_bug(char *fmt, ...)
+void rb_bug(char *fmt, ...)
-インタープリタなどプログラムのバグでしか発生するはずのない状
-況の時呼ぶ.インタープリタはコアダンプし直ちに終了する.例外
-処理は一切行なわれない.
+ インタープリタなどプログラムのバグでしか発生するはずのない
+ 状況の時呼ぶ.インタープリタはコアダンプし直ちに終了する.
+ 例外処理は一切行なわれない.
** Rubyの初期化・実行
Rubyをアプリケーションに埋め込む場合には以下のインタフェース
を使う.通常の拡張ライブラリには必要ない.
- void ruby_init(int argc, char **argv, char **envp)
+void ruby_init(int argc, char **argv, char **envp)
-Rubyインタプリタの初期化を行なう.
+ Rubyインタプリタの初期化を行なう.
- void ruby_run()
+void ruby_run()
-Rubyインタプリタを実行する.
+ Rubyインタプリタを実行する.
- void ruby_script(char *name)
+void ruby_script(char *name)
-Rubyのスクリプト名($0)を設定する.
+ Rubyのスクリプト名($0)を設定する.
Appendix B. extconf.rbで使える関数たち
@@ -1113,27 +1117,49 @@ Appendix B. extconf.rbで使える関数たち
extconf.rbの中では利用可能なコンパイル条件チェックの関数は以
下の通りである.
- have_library(lib, func)
+have_library(lib, func)
+
+ 関数funcを定義しているライブラリlibの存在をチェックする.
+ ライブラリが存在する時,trueを返す.
+
+find_library(lib, func, path...)
+
+ 関数funcを定義しているライブラリlibの存在を -Lpath を追加
+ しながらチェックする.ライブラリが見付かった時,trueを返す.
+ 結果をキャッシュしない.
+
+have_func(func)
+
+ 関数funcの存在をチェックする.funcが標準ではリンクされない
+ ライブラリ内のものである時には先にhave_libraryでそのライブ
+ ラリをチェックしておく事.関数が存在する時trueを返す.
+
+have_header(header)
+
+ ヘッダファイルの存在をチェックする.ヘッダファイルが存在す
+ る時trueを返す.
+
+find_header(header)
-関数funcを定義しているライブラリlibの存在をチェックする.ラ
-イブラリが存在する時,trueを返す.
+ ヘッダファイルの存在を -Ipath を追加しながらチェックする.
+ ヘッダファイルが見付かった時trueを返す.結果をキャッシュし
+ ない.
- have_func(func)
+create_makefile(target)
-関数funcの存在をチェックする.funcが標準ではリンクされないラ
-イブラリ内のものである時には先にhave_libraryでそのライブラリ
-をチェックしておく事.関数が存在する時TRUEを返す.
+ 拡張ライブラリ用のMakefileを生成する.この関数を呼ばなけれ
+ ばそのライブラリはコンパイルされない.targetはモジュール名
+ を表す.
- have_header(header)
+with_config(withval[, default=nil])
-ヘッダファイルの存在をチェックする.ヘッダファイルが存在する
-時trueを返す.
+ --with-<withval>で指定されたオプション値を得る.
- create_makefile(target)
+dir_config(target)
-拡張ライブラリ用のMakefileを生成する.この関数を呼ばなければ
-そのライブラリはコンパイルされない.targetはモジュール名を表
-す.
+ --with-<target>-dir, --with-<target>-include, --with-<target>-lib
+ のいずれかで指定されるディレクトリを $CFLAGS や $LDFLAGS
+ に追加する.
/*
* Local variables:
diff --git a/config_s.dj b/config_s.dj
index 71d477125f5..41b83660ac6 100644
--- a/config_s.dj
+++ b/config_s.dj
@@ -34,6 +34,9 @@ s%@INSTALL_DATA@%${INSTALL} -m 644%g
s%@SET_MAKE@%%g
s%@LIBOBJS@% crypt.o flock.o snprintf.o%g
s%@ALLOCA@%%g
+s%@DEFAULT_KCODE@%%g
+s%@EXEEXT@%.exe%g
+s%@OBJEXT@%o%g
s%@DLDFLAGS@%%g
s%@STATIC@%%g
s%@CCDLFLAGS@%%g
diff --git a/configure b/configure
index 880bdac3c5c..b42807d40b8 100644
--- a/configure
+++ b/configure
@@ -1175,20 +1175,140 @@ else
fi
+echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:1180: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1185 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
+; return 0; }
+EOF
+if { (eval echo configure:1196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_cygwin=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_cygwin=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:1213: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1218 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:1225: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_mingw32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:1244: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+ ac_cv_exeext=.exe
+else
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_exeext=
+ if { (eval echo configure:1254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj) ;;
+ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ else
+ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ rm -f conftest*
+ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
+echo $ac_n "checking for object suffix""... $ac_c" 1>&6
+echo "configure:1275: checking for object suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftest*
+echo 'int i = 1;' > conftest.$ac_ext
+if { (eval echo configure:1281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ for ac_file in conftest.*; do
+ case $ac_file in
+ *.c) ;;
+ *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
+ esac
+ done
+else
+ { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_objext" 1>&6
+OBJEXT=$ac_cv_objext
+ac_objext=$ac_cv_objext
+
+
# checks for UNIX variants that set C preprocessor variables
ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:1182: checking for minix/config.h" >&5
+echo "configure:1302: checking for minix/config.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1187 "configure"
+#line 1307 "configure"
#include "confdefs.h"
#include <minix/config.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1312: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1227,7 +1347,7 @@ fi
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:1231: checking size of int" >&5
+echo "configure:1351: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1235,7 +1355,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1239 "configure"
+#line 1359 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1246,7 +1366,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_int=`cat conftestval`
else
@@ -1266,7 +1386,7 @@ EOF
echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:1270: checking size of short" >&5
+echo "configure:1390: checking size of short" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1274,7 +1394,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1278 "configure"
+#line 1398 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1285,7 +1405,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_short=`cat conftestval`
else
@@ -1305,7 +1425,7 @@ EOF
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:1309: checking size of long" >&5
+echo "configure:1429: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1313,7 +1433,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1317 "configure"
+#line 1437 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1324,7 +1444,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long=`cat conftestval`
else
@@ -1344,7 +1464,7 @@ EOF
echo $ac_n "checking size of void*""... $ac_c" 1>&6
-echo "configure:1348: checking size of void*" >&5
+echo "configure:1468: checking size of void*" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_voidp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1352,7 +1472,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1356 "configure"
+#line 1476 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1363,7 +1483,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_voidp=`cat conftestval`
else
@@ -1383,7 +1503,7 @@ EOF
echo $ac_n "checking size of float""... $ac_c" 1>&6
-echo "configure:1387: checking size of float" >&5
+echo "configure:1507: checking size of float" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1391,7 +1511,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1395 "configure"
+#line 1515 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1402,7 +1522,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_float=`cat conftestval`
else
@@ -1422,7 +1542,7 @@ EOF
echo $ac_n "checking size of double""... $ac_c" 1>&6
-echo "configure:1426: checking size of double" >&5
+echo "configure:1546: checking size of double" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1430,7 +1550,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1434 "configure"
+#line 1554 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1441,7 +1561,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_double=`cat conftestval`
else
@@ -1462,19 +1582,19 @@ EOF
echo $ac_n "checking for prototypes""... $ac_c" 1>&6
-echo "configure:1466: checking for prototypes" >&5
+echo "configure:1586: checking for prototypes" >&5
if eval "test \"`echo '$''{'rb_cv_have_prototypes'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1471 "configure"
+#line 1591 "configure"
#include "confdefs.h"
int foo(int x) { return 0; }
int main() {
return foo(10);
; return 0; }
EOF
-if { (eval echo configure:1478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1598: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_have_prototypes=yes
else
@@ -1495,19 +1615,19 @@ EOF
fi
echo $ac_n "checking token paste string""... $ac_c" 1>&6
-echo "configure:1499: checking token paste string" >&5
+echo "configure:1619: checking token paste string" >&5
if eval "test \"`echo '$''{'rb_cv_tokenpaste'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1504 "configure"
+#line 1624 "configure"
#include "confdefs.h"
#define paste(a,b) a##b
int main() {
int xy = 1; return paste(x,y);
; return 0; }
EOF
-if { (eval echo configure:1511: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1631: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_tokenpaste=ansi
else
@@ -1533,12 +1653,12 @@ EOF
fi
echo $ac_n "checking for variable length prototypes and stdarg.h""... $ac_c" 1>&6
-echo "configure:1537: checking for variable length prototypes and stdarg.h" >&5
+echo "configure:1657: checking for variable length prototypes and stdarg.h" >&5
if eval "test \"`echo '$''{'rb_cv_stdarg'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1542 "configure"
+#line 1662 "configure"
#include "confdefs.h"
#include <stdarg.h>
@@ -1555,7 +1675,7 @@ int main() {
return foo(10, "", 3.14);
; return 0; }
EOF
-if { (eval echo configure:1559: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_stdarg=yes
else
@@ -1576,19 +1696,19 @@ EOF
fi
echo $ac_n "checking for gcc attribute noreturn""... $ac_c" 1>&6
-echo "configure:1580: checking for gcc attribute noreturn" >&5
+echo "configure:1700: checking for gcc attribute noreturn" >&5
if eval "test \"`echo '$''{'rb_cv_have_attr_noreturn'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1585 "configure"
+#line 1705 "configure"
#include "confdefs.h"
void exit(int x) __attribute__ ((noreturn));
int main() {
; return 0; }
EOF
-if { (eval echo configure:1592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_have_attr_noreturn=yes
else
@@ -1618,7 +1738,7 @@ cygwin*) ;;
*) LIBS="-lm $LIBS";;
esac
echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:1622: checking for crypt in -lcrypt" >&5
+echo "configure:1742: checking for crypt in -lcrypt" >&5
ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1626,7 +1746,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcrypt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1630 "configure"
+#line 1750 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1637,7 +1757,7 @@ int main() {
crypt()
; return 0; }
EOF
-if { (eval echo configure:1641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1665,7 +1785,7 @@ else
fi
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:1669: checking for dlopen in -ldl" >&5
+echo "configure:1789: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1673,7 +1793,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1677 "configure"
+#line 1797 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1684,7 +1804,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:1688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1712,7 +1832,7 @@ else
fi
# Dynamic linking for SunOS/Solaris and SYSV
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:1716: checking for shl_load in -ldld" >&5
+echo "configure:1836: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1720,7 +1840,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1724 "configure"
+#line 1844 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1731,7 +1851,7 @@ int main() {
shl_load()
; return 0; }
EOF
-if { (eval echo configure:1735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1759,7 +1879,7 @@ else
fi
# Dynamic linking for HP-UX
echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6
-echo "configure:1763: checking for setlocale in -lxpg4" >&5
+echo "configure:1883: checking for setlocale in -lxpg4" >&5
ac_lib_var=`echo xpg4'_'setlocale | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1767,7 +1887,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lxpg4 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1771 "configure"
+#line 1891 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1778,7 +1898,7 @@ int main() {
setlocale()
; return 0; }
EOF
-if { (eval echo configure:1782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1811,12 +1931,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:1815: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1935: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1820 "configure"
+#line 1940 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -1824,7 +1944,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:1828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -1849,7 +1969,7 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:1853: checking for opendir in -ldir" >&5
+echo "configure:1973: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1857,7 +1977,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1861 "configure"
+#line 1981 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1868,7 +1988,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:1872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1890,7 +2010,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1894: checking for opendir in -lx" >&5
+echo "configure:2014: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1898,7 +2018,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1902 "configure"
+#line 2022 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1909,7 +2029,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:1913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1932,12 +2052,12 @@ fi
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1936: checking for ANSI C header files" >&5
+echo "configure:2056: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1941 "configure"
+#line 2061 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1945,7 +2065,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1949: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1962,7 +2082,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1966 "configure"
+#line 2086 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1980,7 +2100,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1984 "configure"
+#line 2104 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2001,7 +2121,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2005 "configure"
+#line 2125 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2012,7 +2132,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2036,12 +2156,12 @@ EOF
fi
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:2040: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:2160: checking for sys/wait.h that is POSIX.1 compatible" >&5
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2045 "configure"
+#line 2165 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -2057,7 +2177,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:2061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -2077,23 +2197,23 @@ EOF
fi
-for ac_hdr in stdlib.h unistd.h limits.h sys/file.h sys/ioctl.h pwd.h \
- sys/select.h sys/time.h sys/times.h sys/param.h syscall.h\
- a.out.h string.h utime.h memory.h direct.h fnmatch.h
+for ac_hdr in stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h\
+ fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
+ syscall.h pwd.h a.out.h utime.h memory.h direct.h fnmatch.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2087: checking for $ac_hdr" >&5
+echo "configure:2207: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2092 "configure"
+#line 2212 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2097: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2121,12 +2241,12 @@ done
echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2125: checking for uid_t in sys/types.h" >&5
+echo "configure:2245: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2130 "configure"
+#line 2250 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -2155,12 +2275,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2159: checking for size_t" >&5
+echo "configure:2279: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2164 "configure"
+#line 2284 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2188,12 +2308,12 @@ EOF
fi
echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:2192: checking for st_blksize in struct stat" >&5
+echo "configure:2312: checking for st_blksize in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2197 "configure"
+#line 2317 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -2201,7 +2321,7 @@ int main() {
struct stat s; s.st_blksize;
; return 0; }
EOF
-if { (eval echo configure:2205: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blksize=yes
else
@@ -2223,12 +2343,12 @@ fi
save_LIBOJBS="$LIBOBJS"
echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:2227: checking for st_blocks in struct stat" >&5
+echo "configure:2347: checking for st_blocks in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2232 "configure"
+#line 2352 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -2236,7 +2356,7 @@ int main() {
struct stat s; s.st_blocks;
; return 0; }
EOF
-if { (eval echo configure:2240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blocks=yes
else
@@ -2260,12 +2380,12 @@ fi
LIBOBJS="$save_LIBOBJS"
echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
-echo "configure:2264: checking for st_rdev in struct stat" >&5
+echo "configure:2384: checking for st_rdev in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2269 "configure"
+#line 2389 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -2273,7 +2393,7 @@ int main() {
struct stat s; s.st_rdev;
; return 0; }
EOF
-if { (eval echo configure:2277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_rdev=yes
else
@@ -2295,7 +2415,7 @@ fi
echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:2299: checking type of array argument to getgroups" >&5
+echo "configure:2419: checking type of array argument to getgroups" >&5
if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2303,7 +2423,7 @@ else
ac_cv_type_getgroups=cross
else
cat > conftest.$ac_ext <<EOF
-#line 2307 "configure"
+#line 2427 "configure"
#include "confdefs.h"
/* Thanks to Mike Rendell for this test. */
@@ -2328,7 +2448,7 @@ main()
}
EOF
-if { (eval echo configure:2332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_type_getgroups=gid_t
else
@@ -2342,7 +2462,7 @@ fi
if test $ac_cv_type_getgroups = cross; then
cat > conftest.$ac_ext <<EOF
-#line 2346 "configure"
+#line 2466 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -2366,12 +2486,12 @@ EOF
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2370: checking return type of signal handlers" >&5
+echo "configure:2490: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2375 "configure"
+#line 2495 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -2388,7 +2508,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:2392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -2409,19 +2529,19 @@ EOF
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:2413: checking for working alloca.h" >&5
+echo "configure:2533: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2418 "configure"
+#line 2538 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:2425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -2442,12 +2562,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2446: checking for alloca" >&5
+echo "configure:2566: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2451 "configure"
+#line 2571 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -2475,7 +2595,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:2479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -2507,12 +2627,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2511: checking whether alloca needs Cray hooks" >&5
+echo "configure:2631: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2516 "configure"
+#line 2636 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -2537,12 +2657,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2541: checking for $ac_func" >&5
+echo "configure:2661: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2546 "configure"
+#line 2666 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2565,7 +2685,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2592,7 +2712,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2596: checking stack direction for C alloca" >&5
+echo "configure:2716: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2600,7 +2720,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 2604 "configure"
+#line 2724 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -2619,7 +2739,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:2623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -2641,12 +2761,12 @@ EOF
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:2645: checking for pid_t" >&5
+echo "configure:2765: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2650 "configure"
+#line 2770 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2675,17 +2795,17 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:2679: checking for vfork.h" >&5
+echo "configure:2799: checking for vfork.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2684 "configure"
+#line 2804 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2710,18 +2830,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:2714: checking for working vfork" >&5
+echo "configure:2834: checking for working vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:2720: checking for vfork" >&5
+echo "configure:2840: checking for vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2725 "configure"
+#line 2845 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -2744,7 +2864,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:2748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vfork=yes"
else
@@ -2766,7 +2886,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 2770 "configure"
+#line 2890 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -2861,7 +2981,7 @@ main() {
}
}
EOF
-if { (eval echo configure:2865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_vfork_works=yes
else
@@ -2884,7 +3004,7 @@ EOF
fi
echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:2888: checking for 8-bit clean memcmp" >&5
+echo "configure:3008: checking for 8-bit clean memcmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2892,7 +3012,7 @@ else
ac_cv_func_memcmp_clean=no
else
cat > conftest.$ac_ext <<EOF
-#line 2896 "configure"
+#line 3016 "configure"
#include "confdefs.h"
main()
@@ -2902,7 +3022,7 @@ main()
}
EOF
-if { (eval echo configure:2906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_memcmp_clean=yes
else
@@ -2924,12 +3044,12 @@ for ac_func in dup2 memmove mkdir strcasecmp strncasecmp strerror strftime\
fnmatch isinf isnan finite
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2928: checking for $ac_func" >&5
+echo "configure:3048: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2933 "configure"
+#line 3053 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2952,7 +3072,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2985,12 +3105,12 @@ for ac_func in fmod killpg drand48 random wait4 waitpid syscall getcwd\
dlopen sigprocmask sigaction _setjmp setsid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2989: checking for $ac_func" >&5
+echo "configure:3109: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2994 "configure"
+#line 3114 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3013,7 +3133,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3038,12 +3158,12 @@ fi
done
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3042: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:3162: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3047 "configure"
+#line 3167 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -3051,7 +3171,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:3055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@@ -3072,12 +3192,12 @@ EOF
fi
echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:3076: checking for tm_zone in struct tm" >&5
+echo "configure:3196: checking for tm_zone in struct tm" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3081 "configure"
+#line 3201 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
@@ -3085,7 +3205,7 @@ int main() {
struct tm tm; tm.tm_zone;
; return 0; }
EOF
-if { (eval echo configure:3089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3209: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm_zone=yes
else
@@ -3105,12 +3225,12 @@ EOF
else
echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:3109: checking for tzname" >&5
+echo "configure:3229: checking for tzname" >&5
if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3114 "configure"
+#line 3234 "configure"
#include "confdefs.h"
#include <time.h>
#ifndef tzname /* For SGI. */
@@ -3120,7 +3240,7 @@ int main() {
atoi(*tzname);
; return 0; }
EOF
-if { (eval echo configure:3124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_var_tzname=yes
else
@@ -3143,14 +3263,14 @@ fi
if test "$ac_cv_func_strftime" = no; then
cat > conftest.$ac_ext <<EOF
-#line 3147 "configure"
+#line 3267 "configure"
#include "confdefs.h"
int main() {
extern int daylight; int i = daylight;
; return 0; }
EOF
-if { (eval echo configure:3154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_DAYLIGHT 1
@@ -3170,7 +3290,7 @@ EOF
else
echo $ac_n "checking for BSD signal semantics""... $ac_c" 1>&6
-echo "configure:3174: checking for BSD signal semantics" >&5
+echo "configure:3294: checking for BSD signal semantics" >&5
if eval "test \"`echo '$''{'rb_cv_bsd_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3178,7 +3298,7 @@ else
rb_cv_bsd_signal=no
else
cat > conftest.$ac_ext <<EOF
-#line 3182 "configure"
+#line 3302 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3200,7 +3320,7 @@ main()
}
EOF
-if { (eval echo configure:3204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_bsd_signal=yes
else
@@ -3224,7 +3344,7 @@ EOF
fi
echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:3228: checking whether getpgrp takes no argument" >&5
+echo "configure:3348: checking whether getpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3232,7 +3352,7 @@ else
{ echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3236 "configure"
+#line 3356 "configure"
#include "confdefs.h"
/*
@@ -3287,7 +3407,7 @@ main()
}
EOF
-if { (eval echo configure:3291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_getpgrp_void=yes
else
@@ -3311,7 +3431,7 @@ EOF
fi
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:3315: checking whether setpgrp takes no argument" >&5
+echo "configure:3435: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3319,7 +3439,7 @@ else
{ echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3323 "configure"
+#line 3443 "configure"
#include "confdefs.h"
#ifdef HAVE_UNISTD_H
@@ -3339,7 +3459,7 @@ main()
}
EOF
-if { (eval echo configure:3343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_setpgrp_void=no
else
@@ -3364,7 +3484,7 @@ fi
echo $ac_n "checking for working strtod""... $ac_c" 1>&6
-echo "configure:3368: checking for working strtod" >&5
+echo "configure:3488: checking for working strtod" >&5
if eval "test \"`echo '$''{'rb_cv_func_strtod'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3372,7 +3492,7 @@ else
rb_cv_func_strtod=no
else
cat > conftest.$ac_ext <<EOF
-#line 3376 "configure"
+#line 3496 "configure"
#include "confdefs.h"
double strtod ();
@@ -3402,7 +3522,7 @@ main()
}
EOF
-if { (eval echo configure:3406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_func_strtod=yes
else
@@ -3420,14 +3540,14 @@ echo "$ac_t""$rb_cv_func_strtod" 1>&6
test $rb_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o"
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3424: checking whether byte ordering is bigendian" >&5
+echo "configure:3544: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
-#line 3431 "configure"
+#line 3551 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3438,11 +3558,11 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
# It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF
-#line 3446 "configure"
+#line 3566 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3453,7 +3573,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -3473,7 +3593,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3477 "configure"
+#line 3597 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -3486,7 +3606,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:3490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian=no
else
@@ -3510,12 +3630,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3514: checking for working const" >&5
+echo "configure:3634: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3519 "configure"
+#line 3639 "configure"
#include "confdefs.h"
int main() {
@@ -3564,7 +3684,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:3568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -3585,14 +3705,14 @@ EOF
fi
echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
-echo "configure:3589: checking whether char is unsigned" >&5
+echo "configure:3709: checking whether char is unsigned" >&5
if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$GCC" = yes; then
# GCC predefines this symbol on systems where it applies.
cat > conftest.$ac_ext <<EOF
-#line 3596 "configure"
+#line 3716 "configure"
#include "confdefs.h"
#ifdef __CHAR_UNSIGNED__
yes
@@ -3614,7 +3734,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3618 "configure"
+#line 3738 "configure"
#include "confdefs.h"
/* volatile prevents gcc2 from optimizing the test away on sparcs. */
#if !defined(__STDC__) || __STDC__ != 1
@@ -3624,7 +3744,7 @@ main() {
volatile char c = 255; exit(c < 0);
}
EOF
-if { (eval echo configure:3628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_char_unsigned=yes
else
@@ -3649,7 +3769,7 @@ fi
echo $ac_n "checking whether right shift preserve sign bit""... $ac_c" 1>&6
-echo "configure:3653: checking whether right shift preserve sign bit" >&5
+echo "configure:3773: checking whether right shift preserve sign bit" >&5
if eval "test \"`echo '$''{'rb_cv_rshift_sign'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3657,7 +3777,7 @@ else
rb_cv_rshift_sign=yes
else
cat > conftest.$ac_ext <<EOF
-#line 3661 "configure"
+#line 3781 "configure"
#include "confdefs.h"
int
@@ -3669,7 +3789,7 @@ main()
}
EOF
-if { (eval echo configure:3673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_rshift_sign=yes
else
@@ -3697,19 +3817,19 @@ EOF
fi
echo $ac_n "checking count field in FILE structures""... $ac_c" 1>&6
-echo "configure:3701: checking count field in FILE structures" >&5
+echo "configure:3821: checking count field in FILE structures" >&5
if eval "test \"`echo '$''{'rb_cv_fcnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3706 "configure"
+#line 3826 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_cnt = 0;
; return 0; }
EOF
-if { (eval echo configure:3713: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="_cnt"
else
@@ -3719,14 +3839,14 @@ fi
rm -f conftest*
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3723 "configure"
+#line 3843 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->__cnt = 0;
; return 0; }
EOF
-if { (eval echo configure:3730: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="__cnt"
else
@@ -3737,14 +3857,14 @@ rm -f conftest*
fi
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3741 "configure"
+#line 3861 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_r = 0;
; return 0; }
EOF
-if { (eval echo configure:3748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="_r"
else
@@ -3755,14 +3875,14 @@ rm -f conftest*
fi
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3759 "configure"
+#line 3879 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->readCount = 0;
; return 0; }
EOF
-if { (eval echo configure:3766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="readCount"
else
@@ -3773,14 +3893,14 @@ rm -f conftest*
fi
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3777 "configure"
+#line 3897 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_rcount = 0;
; return 0; }
EOF
-if { (eval echo configure:3784: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3904: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="_rcount"
else
@@ -3842,126 +3962,6 @@ else
fi
-echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:3847: checking for Cygwin environment" >&5
-if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 3852 "configure"
-#include "confdefs.h"
-
-int main() {
-
-#ifndef __CYGWIN__
-#define __CYGWIN__ __CYGWIN32__
-#endif
-return __CYGWIN__;
-; return 0; }
-EOF
-if { (eval echo configure:3863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_cygwin=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_cygwin=no
-fi
-rm -f conftest*
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_cygwin" 1>&6
-CYGWIN=
-test "$ac_cv_cygwin" = yes && CYGWIN=yes
-echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:3880: checking for mingw32 environment" >&5
-if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 3885 "configure"
-#include "confdefs.h"
-
-int main() {
-return __MINGW32__;
-; return 0; }
-EOF
-if { (eval echo configure:3892: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_mingw32=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_mingw32=no
-fi
-rm -f conftest*
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_mingw32" 1>&6
-MINGW32=
-test "$ac_cv_mingw32" = yes && MINGW32=yes
-
-
-echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:3911: checking for executable suffix" >&5
-if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
- ac_cv_exeext=.exe
-else
- rm -f conftest*
- echo 'int main () { return 0; }' > conftest.$ac_ext
- ac_cv_exeext=
- if { (eval echo configure:3921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
- for file in conftest.*; do
- case $file in
- *.c | *.o | *.obj) ;;
- *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
- esac
- done
- else
- { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
- fi
- rm -f conftest*
- test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
-fi
-fi
-
-EXEEXT=""
-test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
-echo "$ac_t""${ac_cv_exeext}" 1>&6
-ac_exeext=$EXEEXT
-
-echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:3942: checking for object suffix" >&5
-if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- rm -f conftest*
-echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:3948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- for ac_file in conftest.*; do
- case $ac_file in
- *.c) ;;
- *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
- esac
- done
-else
- { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_objext" 1>&6
-OBJEXT=$ac_cv_objext
-ac_objext=$ac_cv_objext
-
-
case "$host_os" in
linux*)
@@ -4874,11 +4874,11 @@ s%@RANLIB@%$RANLIB%g
s%@AR@%$AR%g
s%@LN_S@%$LN_S%g
s%@SET_MAKE@%$SET_MAKE%g
+s%@EXEEXT@%$EXEEXT%g
+s%@OBJEXT@%$OBJEXT%g
s%@LIBOBJS@%$LIBOBJS%g
s%@ALLOCA@%$ALLOCA%g
s%@DEFAULT_KCODE@%$DEFAULT_KCODE%g
-s%@EXEEXT@%$EXEEXT%g
-s%@OBJEXT@%$OBJEXT%g
s%@XLDFLAGS@%$XLDFLAGS%g
s%@DLDFLAGS@%$DLDFLAGS%g
s%@STATIC@%$STATIC%g
diff --git a/configure.in b/configure.in
index 15f78f4e4be..b07e76fd45d 100644
--- a/configure.in
+++ b/configure.in
@@ -77,6 +77,9 @@ AC_CHECK_PROGS(AR, ar aal, ar)
AC_PROG_LN_S
AC_PROG_MAKE_SET
+AC_EXEEXT
+AC_OBJEXT
+
# checks for UNIX variants that set C preprocessor variables
AC_MINIX
@@ -151,9 +154,9 @@ dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(stdlib.h unistd.h limits.h sys/file.h sys/ioctl.h pwd.h \
- sys/select.h sys/time.h sys/times.h sys/param.h syscall.h\
- a.out.h string.h utime.h memory.h direct.h fnmatch.h)
+AC_CHECK_HEADERS(stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h\
+ fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
+ syscall.h pwd.h a.out.h utime.h memory.h direct.h fnmatch.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
@@ -321,9 +324,6 @@ AC_ARG_WITH(dln-a-out,
*) with_dln_a_out=no;;
esac], [with_dln_a_out=no])
-AC_EXEEXT
-AC_OBJEXT
-
AC_SUBST(XLDFLAGS)dnl
case "$host_os" in
diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in
index e6fd279412d..970e90e24a9 100644
--- a/cygwin/GNUmakefile.in
+++ b/cygwin/GNUmakefile.in
@@ -2,7 +2,7 @@ include Makefile
RUBYCWDLL=rubycw.dll
-miniruby$(binsuffix): $(RUBYCWDLL)
+miniruby$(EXEEXT): $(RUBYCWDLL)
$(RUBYCWDLL): $(OBJS) dmyext.o
dllwrap -o $(RUBYCWDLL) --export-all --output-lib=$(LIBRUBY_SO) --dllname=$(RUBYCWDLL) -Wl,-e,__cygwin_noncygwin_dll_entry@12 --add-stdcall-alias -s $(OBJS) dmyext.o
diff --git a/dir.c b/dir.c
index 93458a3b74f..e5b8ca779a8 100644
--- a/dir.c
+++ b/dir.c
@@ -485,6 +485,7 @@ push_braces(ary, s)
char buffer[MAXPATHLEN], *buf = buffer;
char *p, *t, *b;
char *lbrace, *rbrace;
+ int nest = 0;
p = s;
lbrace = rbrace = 0;
@@ -496,7 +497,8 @@ push_braces(ary, s)
p++;
}
while (*p) {
- if (*p == '}' && lbrace) {
+ if (*p == '{') nest++;
+ if (*p == '}' && --nest == 0) {
rbrace = p;
break;
}
diff --git a/dln.c b/dln.c
index 15c2a2e2e71..daf3a9d60ae 100644
--- a/dln.c
+++ b/dln.c
@@ -1191,11 +1191,11 @@ aix_loaderror(const char *pathname)
ERRBUF_APPEND(strerror(errno));
for(i = 0; message[i] && *message[i]; i++) {
int nerr = atoi(message[i]);
- for (j=0; j<LOAD_ERRTAB_LEN ; j++) {
+ for (j=0; j<LOAD_ERRTAB_LEN; j++) {
if (nerr == load_errtab[i].errno && load_errtab[i].errstr)
ERRBUF_APPEND(load_errtab[i].errstr);
}
- while (isdigit(*message[i])) message[i]++ ;
+ while (isdigit(*message[i])) message[i]++;
ERRBUF_APPEND(message[i]);
ERRBUF_APPEND("\n");
}
@@ -1362,12 +1362,12 @@ dln_load(file)
init_fct = (void(*)())init_address;
(*init_fct)();
- return ;
+ return;
}
#else/* OPENSTEP dyld functions */
{
- int dyld_result ;
- NSObjectFileImage obj_file ; /* handle, but not use it */
+ int dyld_result;
+ NSObjectFileImage obj_file; /* handle, but not use it */
/* "file" is module file name .
"buf" is initial function name with "_" . */
@@ -1392,7 +1392,7 @@ dln_load(file)
init_fct = NSAddressOfSymbol(NSLookupAndBindSymbol(buf));
(*init_fct)();
- return ;
+ return;
}
#endif /* rld or dyld */
#endif
diff --git a/eval.c b/eval.c
index 0318998f4c2..0a558769aad 100644
--- a/eval.c
+++ b/eval.c
@@ -1730,15 +1730,13 @@ rb_eval(self, node)
switch (nd_type(node)) {
case NODE_BLOCK:
- if (!node->nd_next) {
- node = node->nd_head;
- goto again;
- }
- while (node) {
- result = rb_eval(self, node->nd_head);
+ while (node->nd_next) {
+ rb_eval(self, node->nd_head);
node = node->nd_next;
}
- break;
+ node = node->nd_head;
+ goto again;
+
case NODE_POSTEXE:
rb_f_END();
nd_set_type(node, NODE_NIL); /* exec just once */
@@ -4586,6 +4584,7 @@ rb_load(fname, wrap)
POP_VARS();
ruby_wrapper = 0;
if (ruby_nerrs > 0) {
+ ruby_nerrs = 0;
rb_exc_raise(ruby_errinfo);
}
if (state) JUMP_TAG(state);
@@ -5120,9 +5119,6 @@ rb_exec_end_proc()
link = tmp;
}
end_proc_data = 0;
- if (top_scope && top_scope->local_tbl) {
- rb_mem_clear(top_scope->local_vars, top_scope->local_tbl[0]);
- }
}
void
@@ -6582,7 +6578,7 @@ rb_thread_join(thread)
VALUE oldbt = get_backtrace(th->errinfo);
VALUE errat = make_backtrace();
- if (TYPE(oldbt) == T_ARRAY) {
+ if (TYPE(oldbt) == T_ARRAY && RARRAY(oldbt)->len > 0) {
rb_ary_unshift(errat, rb_ary_entry(oldbt, 0));
}
set_backtrace(th->errinfo, errat);
diff --git a/ext/curses/extconf.rb b/ext/curses/extconf.rb
index 8356241f95f..e1bf24c4354 100644
--- a/ext/curses/extconf.rb
+++ b/ext/curses/extconf.rb
@@ -1,24 +1,21 @@
require 'mkmf'
-$CFLAGS="-I/usr/include/ncurses -I/usr/local/include/ncurses"
-$LDFLAGS="-L/usr/local/lib"
-make=FALSE
+make=false
have_library("mytinfo", "tgetent") if /bow/ =~ PLATFORM
if have_header("ncurses.h") and have_library("ncurses", "initscr")
- make=TRUE
+ make=true
elsif have_header("ncurses/curses.h") and have_library("ncurses", "initscr")
- make=TRUE
+ make=true
elsif have_header("curses_colr/curses.h") and have_library("cur_colr", "initscr")
- make=TRUE
+ make=true
else
- $CFLAGS=nil
have_library("termcap", "tgetent")
if have_library("curses", "initscr")
- make=TRUE
+ make=true
end
end
-if make then
+if make
for f in %w(isendwin ungetch beep doupdate flash deleteln wdeleteln)
have_func(f)
end
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index f873781d28a..4d83cec1b1b 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -332,7 +332,7 @@ fdbm_store(obj, keystr, valstr)
dbmp->di_size = -1;
dbm = dbmp->di_dbm;
if (dbm_store(dbm, key, val, DBM_REPLACE)) {
-#ifdef HAVE_DBM_CLAERERR
+#ifdef HAVE_DBM_CLEARERR
dbm_clearerr(dbm);
#endif
if (errno == EPERM) rb_sys_fail(0);
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index c75412e680d..22198910ccf 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -1,8 +1,5 @@
require 'mkmf'
-$LDFLAGS = "-L/usr/local/lib"
-if dir = with_config("dbm-include")
- $CFLAGS = "-I#{dir}"
-end
+dir_config("dbm")
have_library("gdbm", "dbm_open") or
have_library("db", "dbm_open") or
have_library("dbm", "dbm_open")
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index 30cff493a8f..3514ab25035 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -14,7 +14,7 @@ elsif ARGV[0] == 'clean'
ARGV.shift
end
-SRC_EXT = ["c", "cc", "cxx", "C"]
+SRC_EXT = ["c", "cc", "m", "cxx", "cpp", "C"]
$extlist = []
$cache_mod = false
@@ -60,9 +60,9 @@ def older(file1, file2)
end
if RUBY_PLATFORM == "m68k-human"
-CFLAGS = "@CFLAGS@".gsub(/-c..-stack=[0-9]+ */, '')
+ CFLAGS = "@CFLAGS@".gsub(/-c..-stack=[0-9]+ */, '')
else
-CFLAGS = "@CFLAGS@"
+ CFLAGS = "@CFLAGS@"
end
LINK = "@CC@ -o conftest -I#$topdir -I#$top_srcdir -I@includedir@ #{CFLAGS} @LDFLAGS@ %s %s conftest.c %s %s @LIBS@"
CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir -I@includedir@ #{CFLAGS} %s %s conftest.c"
@@ -160,10 +160,18 @@ def install_rb(mfile, srcdir = nil)
end
end
+def append_library(libs, lib)
+ if /mswin32/ =~ RUBY_PLATFORM
+ lib + ".lib " + libs
+ else
+ "-l" + lib + " " + libs
+ end
+end
+
def have_library(lib, func="main")
if $lib_cache[lib]
if $lib_cache[lib] == "yes"
- $libs = "-l" + lib + " " + $libs
+ $libs = append_library($libs, lib)
return true
else
return false
@@ -171,7 +179,7 @@ def have_library(lib, func="main")
end
if func && func != ""
- libs = "-l" + lib + " " + $libs
+ libs = append_library($libs, lib)
unless try_link(<<"SRC", libs)
int main() { return 0; }
int t() { #{func}(); return 0; }
@@ -181,7 +189,7 @@ SRC
return false
end
else
- libs = "-l" + lib + " " + $libs
+ libs = append_library($libs, lib)
end
$libs = libs
@@ -190,6 +198,23 @@ SRC
return true
end
+def find_library(lib, func, *paths)
+ ldflags = $LDFLAGS
+ libs = "-l" + lib + " " + $libs
+ until try_link(<<"SRC", libs)
+int main() { return 0; }
+int t() { #{func}(); return 0; }
+SRC
+ if paths.size == 0
+ $LDFLAGS = ldflags
+ return false
+ end
+ $LDFLAGS = ldflags + " -L"+paths.shift
+ end
+ $libs = libs
+ return true
+end
+
def have_func(func)
if $func_cache[func]
if $func_cache[func] == "yes"
@@ -285,9 +310,28 @@ def create_header()
end
end
+def dir_config(target)
+ dir = with_config("%s-dir"%target)
+ if dir
+ idir = " -I"+dir+"/include"
+ ldir = " -L"+dir+"/lib"
+ end
+ unless idir
+ dir = with_config("%s-include"%target)
+ idir = " -I"+dir if dir
+ end
+ unless ldir
+ dir = with_config("%s-lib"%target)
+ ldir = " -L"+dir if dir
+ end
+
+ $CFLAGS += idir if idir
+ $LDFLAGS += ldir if ldir
+end
+
def create_makefile(target)
system "rm -f conftest*"
- if "@DLEXT@" == "o"
+ if "@DLEXT@" == $OBJEXT
libs = $libs.split
for lib in libs
lib.sub!(/-l(.*)/, '"lib\1.a"')
@@ -347,14 +391,14 @@ archdir = $(pkglibdir)/@arch@
#### End of system configuration section. ####
"
- mfile.printf "LOCAL_LIBS = %s\n", $LOCAL_LIBS unless $LOCAL_LIBS == ""
+ mfile.printf "LOCAL_LIBS = %s %s\n", $LOCAL_LIBS, $local_flags
mfile.printf "LIBS = %s\n", $libs
mfile.printf "OBJS = "
if !$objs then
$objs = []
for f in Dir["#{$top_srcdir}/ext/#{$mdir}/*.{#{SRC_EXT.join(%q{,})}}"]
f = File.basename(f)
- f.sub!(/(#{SRC_EXT.join(%q{|})})$/, "o")
+ f.sub!(/(#{SRC_EXT.join(%q{|})})$/, $OBJEXT)
$objs.push f
end
end
@@ -365,15 +409,15 @@ archdir = $(pkglibdir)/@arch@
TARGET = #{target}
DLLIB = $(TARGET).#{$static ? "a" : "@DLEXT@"}
-RUBY = ../../miniruby@binsuffix@
+RUBY = ../../miniruby@EXEEXT@
-binsuffix = @binsuffix@
+EXEEXT = @EXEEXT@
all: $(DLLIB)
-clean:; @rm -f *.o *.so *.sl *.a $(DLLIB)
+clean:; @rm -f *.#{$OBJEXT} *.so *.sl *.a $(DLLIB)
@rm -f Makefile extconf.h conftest.*
- @rm -f core ruby$(binsuffix) *~
+ @rm -f core ruby$(EXEEXT) *~
realclean: clean
EOS
@@ -397,7 +441,7 @@ $(DLLIB): $(OBJS)
@AR@ cru $(DLLIB) $(OBJS)
@-@RANLIB@ $(DLLIB) 2> /dev/null || true
"
- elsif "@DLEXT@" != "o"
+ elsif "@DLEXT@" != $OBJEXT
mfile.printf "\
$(DLLIB): $(OBJS)
$(LDSHARED) $(DLDFLAGS) -o $(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)
@@ -445,29 +489,57 @@ def extmake(target)
$static = false
end
- return if $nodynamic and not $static
+ unless $install or $clean
+ return if $nodynamic and not $static
+ end
+ $OBJEXT = "@OBJEXT@"
$objs = nil
- $libs = RUBY_PLATFORM =~ /cygwin|beos|openstep|nextstep|rhapsody/ ? "" : "-lc"
+ $local_flags = ""
+ case RUBY_PLATFORM
+ when /cygwin|beos|openstep|nextstep|rhapsody/
+ $libs = ""
+ when /mswin32/
+ $libs = ""
+ $local_flags = "rubymw.lib -link /LIBPATH:$(topdir) /EXPORT:Init_$(TARGET)"
+ else
+ $libs = "-lc"
+ end
$LOCAL_LIBS = "" # to be assigned in extconf.rb
- $CFLAGS = ""
- $LDFLAGS = ""
+ dir = with_config("opt-dir")
+ if dir
+ idir = "-I"+dir+"/include"
+ ldir = "-L"+dir+"/lib"
+ end
+ unless idir
+ dir = with_config("opt-include")
+ idir = "-I"+dir if dir
+ end
+ unless ldir
+ dir = with_config("opt-lib")
+ ldir = "-L"+dir if dir
+ end
+
+ $CFLAGS = idir || ""
+ $LDFLAGS = ldir || ""
begin
system "mkdir", target unless File.directory?(target)
Dir.chdir target
$mdir = target
- if $static_ext.size > 0 ||
- !File.exist?("./Makefile") ||
- older("./Makefile", "#{$top_srcdir}/ext/@setup@") ||
- older("./Makefile", "../extmk.rb") ||
- older("./Makefile", "#{$top_srcdir}/ext/#{target}/extconf.rb")
- then
- $defs = []
- if File.exist?("#{$top_srcdir}/ext/#{target}/extconf.rb")
- load "#{$top_srcdir}/ext/#{target}/extconf.rb"
- else
- create_makefile(target)
+ unless $install or $clean
+ if $static_ext.size > 0 ||
+ !File.exist?("./Makefile") ||
+ older("./Makefile", "#{$top_srcdir}/ext/@setup@") ||
+ older("./Makefile", "../extmk.rb") ||
+ older("./Makefile", "#{$top_srcdir}/ext/#{target}/extconf.rb")
+ then
+ $defs = []
+ if File.exist?("#{$top_srcdir}/ext/#{target}/extconf.rb")
+ load "#{$top_srcdir}/ext/#{target}/extconf.rb"
+ else
+ create_makefile(target)
+ end
end
end
if File.exist?("./Makefile")
@@ -552,9 +624,10 @@ end
exit if $install or $clean
$extinit = "" unless $extinit
-ruby = "@RUBY_INSTALL_NAME@@binsuffix@"
-miniruby = "miniruby@binsuffix@"
+ruby = "@RUBY_INSTALL_NAME@@EXEEXT@"
+miniruby = "miniruby@EXEEXT@"
+$extobjs = "" unless $extobjs
if $extlist.size > 0
for s,t in $extlist
f = format("%s/%s.a", s, t)
@@ -563,7 +636,6 @@ if $extlist.size > 0
\tInit_%s();\n\
\trb_provide(\"%s.so\");\n\
", t, t)
- $extobjs = "" unless $extobjs
$extobjs += "ext/"
$extobjs += f
$extobjs += " "
@@ -579,7 +651,7 @@ if $extlist.size > 0
f.printf "}\n"
f.close
end
- if older("extinit.o", "extinit.c")
+ if older("extinit.#{$OBJEXT}", "extinit.c")
cmd = "@CC@ " + CFLAGS + " -c extinit.c"
print cmd, "\n"
system cmd or exit 1
@@ -591,11 +663,7 @@ if $extlist.size > 0
system("rm -f #{ruby}")
end
- if $extobjs
- $extobjs = "ext/extinit.o " + $extobjs
- else
- $extobjs = "ext/extinit.o "
- end
+ $extobjs = "ext/extinit.#{$OBJEXT} " + $extobjs
if RUBY_PLATFORM =~ /m68k-human|beos/
$extlibs.gsub!("-L/usr/local/lib", "") if $extlibs
end
@@ -604,7 +672,7 @@ else
Dir.chdir ".."
if older(ruby, miniruby)
system("rm -f #{ruby}")
- system("make #{ruby}")
+ system("#{$make} #{ruby}")
end
end
diff --git a/ext/extmk.rb.nt b/ext/extmk.rb.nt
index 531abf7b293..14165486496 100644
--- a/ext/extmk.rb.nt
+++ b/ext/extmk.rb.nt
@@ -14,16 +14,16 @@ elsif ARGV[0] == 'clean'
ARGV.shift
end
+SRC_EXT = ["c", "cc", "m", "cxx", "cpp", "C"]
$extlist = []
-$cache_mod = false;
+$cache_mod = false
$lib_cache = {}
$func_cache = {}
$hdr_cache = {}
$top_srcdir = File.expand_path("..")
$topdir = File.expand_path("..")
-$topdir = File.expand_path($topdir)
$ruby_inc = $top_srcdir
load "#{$top_srcdir}/lib/find.rb"
@@ -60,9 +60,8 @@ def older(file1, file2)
end
CFLAGS = ""
-#LINK = "cl -o conftest.exe -I../.. -Zi -O -I. %s conftest.c %s > nul"
-LINK = "cl -o conftest.exe -Zi -O %s conftest.c %s %s > nul"
-CPP = "cl -E -I#{$ruby_inc} -I#{$ruby_inc}/missing -I#{$ruby_inc}/win32 -I. -Zi -O %s conftest.c > nul"
+LINK = "cl -o conftest.exe %s conftest.c %s %s"
+CPP = "cl -E -I#{$ruby_inc} -I#{$ruby_inc}/missing -I#{$ruby_inc}/win32 -I. %s conftest.c"
$null = open("nul", "w")
$orgerr = $stderr.dup
@@ -132,21 +131,31 @@ def try_run(src, opt="")
end
end
-def install_rb(mfile)
+def install_rb(mfile, srcdir = nil)
+ libdir = "lib"
+ libdir = srcdir + "/" + libdir if srcdir
path = []
dir = []
- Find.find("lib") do |f|
+ Find.find(libdir) do |f|
next unless /\.rb$/ =~ f
- f = f[4..-1]
+ f = f[libdir.length+1..-1]
path.push f
dir |= File.dirname(f)
end
for f in dir
next if f == "."
- mfile.printf "\t@test -d $(DESTDIR)$(pkglibdir)/%s || mkdir $(DESTDIR)$(pkglibdir)/%s\n", f, f
+ mfile.printf "\t@$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(DESTDIR)$(pkglibdir)/%s\n", f
end
for f in path
- mfile.printf "\t$(INSTALL_DATA) lib/%s $(DESTDIR)$(pkglibdir)/%s\n", f, f
+ mfile.printf "\t@$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0644, true)' $(srcdir)/lib/%s $(DESTDIR)$(pkglibdir)/%s\n", f, f
+ end
+end
+
+def append_library(libs, lib)
+ if /mswin32/ =~ RUBY_PLATFORM
+ lib + ".lib " + libs
+ else
+ "-l" + lib + " " + libs
end
end
@@ -154,11 +163,7 @@ def have_library(lib, func="main")
#print format("have_library(%s, %s)\n", lib, func)
if $lib_cache[lib]
if $lib_cache[lib] == "yes"
- if $libs
- $libs = lib + ".lib " + $libs
- else
- $libs = lib + ".lib "
- end
+ $libs = append_library($libs, lib)
return true
else
return false
@@ -166,19 +171,23 @@ def have_library(lib, func="main")
end
if func && func != ""
- if $libs
- libs = lib + ".lib " + $libs
- else
- libs = lib + ".lib"
- end
+ libs = append_library($libs, lib)
#print "libs=#{libs}\n"
- unless try_link(<<"SRC", libs)
+ r = try_link(<<"SRC", libs)
#include <windows.h>
#include <winsock.h>
-//char #{func}();
int main() { return 0; }
int t() { #{func}(); return 0; }
SRC
+ unless r
+ r = try_link(<<"SRC", libs)
+#include <windows.h>
+#include <winsock.h>
+int main() { return 0; }
+int t() { void ((*p)()); p = (void ((*)()))#{func}; return 0; }
+SRC
+ end
+ unless r
#print "fail : #{libs}\n"
$lib_cache[lib] = 'no'
$cache_mod = true
@@ -202,28 +211,27 @@ def have_func(func)
end
end
- cfile = open("conftest.c", "w")
- cfile.printf "\
+ libs = $libs
+
+ #print "libs=#{libs}\n"
+ r = try_link(<<"SRC", libs)
#include <windows.h>
#include <winsock.h>
-//char %s();
int main() { return 0; }
-int t() { %s(); return 0; }
-", func, func
- cfile.close
-
- libs = $libs
- libs = "" if libs == nil
-
- begin
- #print "libs=#{libs}\n"
- unless try_link(libs)
- $func_cache[func] = 'no'
- $cache_mod = true
- return false
- end
- ensure
- system "rm -f conftest*"
+int t() { #{func}(); return 0; }
+SRC
+ unless r
+ try_link(<<"SRC", libs)
+#include <windows.h>
+#include <winsock.h>
+int main() { return 0; }
+int t() { void ((*p)()); p = (void ((*)()))#{func}; return 0; }
+SRC
+ end
+ unless r
+ $func_cache[func] = 'no'
+ $cache_mod = true
+ return false
end
$defs.push(format("-DHAVE_%s", func.upcase))
$func_cache[func] = 'yes'
@@ -280,7 +288,7 @@ def with_config(config, default=nil)
end
def enable_config(config, default=nil)
- if arg_config("--enable-"+config, true)
+ if arg_config("--enable-"+config, default)
true
elsif arg_config("--disable-"+config, false)
false
@@ -301,15 +309,15 @@ def create_header()
end
def create_makefile(target)
+ $target = target
- if $libs
+ if $libs != ""
libs = $libs.split
for lib in libs
lib.sub!(/(.*)/, '"\1.lib"') if /.lib$/ !~ lib
end
$defs.push(format("-DEXTLIB='%s'", libs.join(",")))
end
- $libs = "" unless $libs
mfile = open("Makefile", "w")
mfile.printf "\
@@ -320,25 +328,28 @@ SHELL = $(COMPSEC)
srcdir = .
VPATH = .
-CC = cl
+topdir = #{$topdir}
+hdrdir = #{$top_srcdir}
-CFLAGS = %s -I#{$ruby_inc} -I#{$ruby_inc}/missing -I#{$ruby_inc}/win32 -I. -O -DNT %s #{CFLAGS} #{$CFLAGS} %s
+CC = cl
+CFLAGS = %s -I#{$ruby_inc} -I#{$ruby_inc}/missing -I. -O -DNT %s #{CFLAGS} #{$CFLAGS} %s
+DLDFLAGS =
+LDSHARED = cl -LD
RUBYLIB = ../../ruby.lib
-DLDFLAGS = /DLL
-LDSHARED =
", if $static then "" else "-fpic" end, $dllopt, $defs.join(" ")
if $force_static
- print "static\n"
+ print "static\n"
else
- print "non static\n"
+ print "non static\n"
end
mfile.printf "\
-libdir = /usr/local/lib/ruby/i386-mswin32
-
+libdir = /usr/local/lib
+pkglibdir = $(libdir)/ruby/1.3
+archdir = $(pkglibdir)/i386-mswin32
#### End of system configuration section. ####
"
@@ -346,9 +357,11 @@ libdir = /usr/local/lib/ruby/i386-mswin32
mfile.printf "LIBS = %s\n", $libs
mfile.printf "OBJS = "
if !$objs then
- $objs = Dir["*.{c,cc}"]
- for f in $objs
- f.sub!(/\.(c|cc)$/, ".obj")
+ $objs = []
+ for f in Dir["*.{#{SRC_EXT.join(%q{,})}}"]
+ f = File.basename(f)
+ f.sub!(/(#{SRC_EXT.join(%q{|})})$/, $OBJEXT)
+ $objs.push f
end
end
mfile.printf $objs.join(" ")
@@ -357,28 +370,28 @@ libdir = /usr/local/lib/ruby/i386-mswin32
mfile.printf "\
TARGET = %s
DLLIB = $(TARGET).%s
-INSTALL = ginstall -c
-DEFFILE = %s.def
+DEFFILE = $(TARGET).def
+
+RUBY = ..\\..\\miniruby.exe
all: $(DLLIB)
-clean:; @rm -f *.obj *.lib *.exp vc*.pdb *.bak *.def
+clean:; @rm -f *.#{$OBJEXT} *.lib *.exp vc*.pdb *.bak *.def
@rm -f Makefile extconf.h conftest.*
realclean: clean
install:
- @test -d $(DESTDIR)$(libdir) || mkdir $(DESTDIR)$(libdir)
- @test -d $(DESTDIR)$(pkglibdir) || mkdir $(DESTDIR)$(pkglibdir)
- @test -d $(DESTDIR)$(archdir) || mkdir $(DESTDIR)$(archdir)
+ @$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(DESTDIR)$(libdir) $(DESTDIR)$(pkglibdir) $(DESTDIR)$(archdir)
", target,
- if $force_static then "lib" else "dll" end, target
+ if $force_static then "lib" else "dll" end
- if !$static
+ unless $static
mfile.printf "\
- $(INSTALL) $(DLLIB) $(libdir)/$(DLLIB)
+ @$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0555, true)' $(DLLIB) $(DESTDIR)$(archdir)/$(DLLIB)
"
end
+ install_rb(mfile, $srcdir)
if $force_static
mfile.printf "\
@@ -387,11 +400,11 @@ $(DLLIB): $(OBJS)
"
else
mfile.printf "\
-$(DEFFILE):
+$(DEFFILE):
echo $(DEFFILE)
-$(DLLIB): $(OBJS) $(DEFFILE)
- cl -DLL -o$(DLLIB) $(OBJS) $(RUBYLIB) -link /DEF:$(DEFFILE)
+$(DLLIB): $(OBJS) $(DEFFILE)
+ $(LDSHARED) -o $(DLLIB) $(OBJS) $(RUBYLIB) -link /DEF:$(DEFFILE)
"
end
@@ -399,14 +412,15 @@ $(DLLIB): $(OBJS) $(DEFFILE)
dfile = open("depend", "r")
mfile.printf "###\n"
while line = dfile.gets()
- mfile.printf "%s", line
+ mfile.printf "%s", line.gsub(/\.o/, ".#{$OBJEXT}")
end
dfile.close
end
mfile.close
- if $static
- #printf format("push %s,%s\n", $static, target); ##debug print##
- $extlist.push [$static,target]
+ unless $static
+ if !File.exist?("#{target}.def")
+ create_def(target)
+ end
end
end
@@ -434,59 +448,63 @@ def extmake(target)
$static = false
end
- return if $nodynamic and not $static
+ unless $install or $clean
+ return if $nodynamic and not $static
+ end
+ $OBJEXT = 'obj'
$objs = nil
+ $local_flags = ""
+ $libs = ""
$LOCAL_LIBS = "" # to be assigned in extconf.rb
$CFLAGS = ""
$LDFLAGS = ""
begin
Dir.chdir target
- if $static_ext.size > 0 ||
- !File.exist?("./Makefile") ||
- older("./Makefile", "../Setup") ||
- older("./Makefile", "../extmk.rb") ||
- older("./Makefile", "./extconf.rb")
- then
- $defs = []
- if File.exist?("extconf.rb")
- load "extconf.rb"
- else
- create_makefile(target);
+ $target = target
+ unless $install or $clean
+ if $static_ext.size > 0 ||
+ !File.exist?("./Makefile") ||
+ older("./Makefile", "../Setup") ||
+ older("./Makefile", "../extmk.rb") ||
+ older("./Makefile", "./extconf.rb")
+ then
+ $defs = []
+ if File.exist?("extconf.rb")
+ load "extconf.rb"
+ else
+ create_makefile(target)
+ end
end
end
-
- if !File.exist?("#{target}.def")
- create_def(target)
- end
-
if File.exist?("./Makefile")
+ if $static
+ $extlist.push [$static,$target]
+ end
if $install
- system "nmake install DESTDIR=#{$destdir}"
- if File.directory? "./lib"
- for i in Dir["./lib/*.rb"]
- system "ginstall -c #{i} /usr/local/lib/ruby/i386-mswin32"
- end
- end
+ system "#{$make} install DESTDIR=#{$destdir}"
elsif $clean
- system "nmake clean"
+ system "#{$make} clean"
else
- #print "!!!make!!!\n"
- system "nmake all"
+ system "#{$make} all" or exit
end
end
if $static
- $extlibs = " "
+ $extlibs ||= ""
$extlibs += " " + $LDFLAGS unless $LDFLAGS == ""
- $extlibs += " " + $libs if $libs
+ $extlibs += " " + $libs unless $libs == ""
$extlibs += " " + $LOCAL_LIBS unless $LOCAL_LIBS == ""
end
ensure
+ system "rm -f conftest*"
Dir.chdir ".."
end
end
+$make = ENV["MAKE"]
+$make ||= with_config("make-prog", "nmake -nologo")
+
# get static-link modules
$static_ext = {}
if File.file? "./Setup"
@@ -536,22 +554,22 @@ if $cache_mod
end
exit if $install or $clean
-$extinit = " " unless $extinit
-$extobjs = ""
+$extinit = "" unless $extinit
+
+ruby = "ruby.exe"
+miniruby = "miniruby.exe"
+
+$extobjs = "" unless $extobjs
if $extlist.size > 0
for s,t in $extlist
- #for s,t in $static_ext
- #f = format("%s/%s.obj", s, t)
- #f = format("%s/%s.obj", s, s)
- l = format("%s/%s.lib", s, s)
- if File.exist?(l)
+ f = format("%s/%s.lib", s, t)
+ if File.exist?(f)
$extinit += format("\
\tInit_%s();\n\
\trb_provide(\"%s.so\");\n\
-", s, s)
+", t, t)
$extobjs += "ext/"
- #$extobjs += f # *.obj
- $extobjs += l # *.lib
+ $extobjs += f
$extobjs += " "
else
false
@@ -565,7 +583,7 @@ if $extlist.size > 0
f.printf "}\n"
f.close
end
- if older("extinit.obj", "extinit.c")
+ if older("extinit.#{$OBJEXT}", "extinit.c")
cmd = "cl -Zi -O -I. -c extinit.c"
print cmd, "\n"
system cmd or exit 1
@@ -573,23 +591,23 @@ if $extlist.size > 0
Dir.chdir ".."
- if older("ruby.exe", "ext/Setup") or older("ruby.exe", "miniruby.exe")
- `rm -f ruby.exe`
+ if older(ruby, "ext/Setup") or older(ruby, miniruby)
+ system("rm -f #{ruby}")
end
- $extobjs = "ext/extinit.obj " + $extobjs
+ $extobjs = "ext/extinit.#{$OBJEXT} " + $extobjs
#$extlibs = ""
#print "EXTLIBS=#{$extlibs}\n"
$extlibs.gsub!("-L/usr/local/lib", "") if $extlibs
$extlibs.gsub!(" +", " ") if $extlibs
#print "EXTLIBS=#{$extlibs}\n"
- system format('nmake ruby.exe EXTOBJS="%s" EXTLIBS="%s"', $extobjs, $extlibs)
+ system format(%[#{$make} #{ruby} EXTOBJS="%s" EXTLIBS="%s"], $extobjs, $extlibs)
else
Dir.chdir ".."
- if older("ruby.exe", "miniruby.exe")
- `rm -f ruby.exe`
- `cp miniruby.exe ruby.exe`
+ if older(ruby, miniruby)
+ system("rm -f #{ruby}")
+ system("#{$make} #{ruby}")
end
end
#Local variables:
diff --git a/ext/gdbm/extconf.rb b/ext/gdbm/extconf.rb
index bb51ac89711..5a09492e5e8 100644
--- a/ext/gdbm/extconf.rb
+++ b/ext/gdbm/extconf.rb
@@ -1,7 +1,7 @@
require 'mkmf'
-$LDFLAGS = "-L/usr/local/lib"
+
+dir_config("gdbm")
if have_library("gdbm", "gdbm_open") and
- have_header("gdbm.h") and
- have_func("gdbm_open") then
+ have_header("gdbm.h")
create_makefile("gdbm")
end
diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb
index f532f8a21dd..3dd9c0fc1ec 100644
--- a/ext/readline/extconf.rb
+++ b/ext/readline/extconf.rb
@@ -1,21 +1,6 @@
require "mkmf"
-readline_dir = with_config("readline-dir")
-if readline_dir
- $CFLAGS = "-I#{readline_dir}/include"
- $LDFLAGS = "-L#{readline_dir}/lib"
-end
-
-readline_dir = with_config("readline-include-dir")
-if readline_dir
- $CFLAGS = "-I#{readline_dir}"
-end
-
-readline_dir = with_config("readline-lib-dir")
-if readline_dir
- $LDFLAGS = "-L#{readline_dir}"
-end
-
+dir_config("readline")
have_library("user32", nil) if /cygwin/ === PLATFORM
have_library("termcap", "tgetnum")
have_library("curses", "tgetnum")
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 1e41c022611..362679389f8 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -1,6 +1,6 @@
require 'mkmf'
-$LDFLAGS = "-L/usr/local/lib" if File.directory?("/usr/local/lib")
-$CFLAGS = "-Dss_family=__ss_family -Dss_len=__ss_len"
+$LDFLAGS += " -L/usr/local/lib" if File.directory?("/usr/local/lib")
+$CFLAGS += " -Dss_family=__ss_family -Dss_len=__ss_len"
case PLATFORM
when /mswin32/
@@ -245,7 +245,7 @@ EOS
end
-$objs = ["socket.o"]
+$objs = ["socket.#{$OBJEXT}"]
if $getaddr_info_ok and have_func("getaddrinfo") and have_func("getnameinfo")
have_getaddrinfo = true
@@ -255,8 +255,8 @@ if have_getaddrinfo
$CFLAGS="-DHAVE_GETADDRINFO "+$CFLAGS
else
$CFLAGS="-I. "+$CFLAGS
- $objs += ["getaddrinfo.o"]
- $objs += ["getnameinfo.o"]
+ $objs += ["getaddrinfo.#{$OBJEXT}"]
+ $objs += ["getnameinfo.#{$OBJEXT}"]
have_func("inet_ntop") or have_func("inet_ntoa")
have_func("inet_pton") or have_func("inet_aton")
end
diff --git a/ext/tcltklib/extconf.rb b/ext/tcltklib/extconf.rb
index 7a568edd103..ec06f8b2453 100644
--- a/ext/tcltklib/extconf.rb
+++ b/ext/tcltklib/extconf.rb
@@ -7,79 +7,41 @@ have_library("socket", "socket")
have_library("dl", "dlopen")
have_library("m", "log")
-$includes = []
-def search_header(include, *path)
- pwd = Dir.getwd
- begin
- for i in path.sort!.reverse!
- dir = Dir[i]
- for path in dir.sort!.reverse!
- next unless File.directory? path
- Dir.chdir path
- files = Dir[include]
- if files.size > 0
- unless $includes.include? path
- $includes << path
- end
- return
- end
- end
- end
- ensure
- Dir.chdir pwd
- end
-end
+dir_config("tk")
+dir_config("tcl")
+dir_config("X11")
-search_header("tcl.h",
- "/usr/include/tcl{,8*,7*}",
- "/usr/include",
- "/usr/local/include/tcl{,8*,7*}",
- "/usr/local/include")
-search_header("tk.h",
- "/usr/include/tk{,8*,4*}",
- "/usr/include",
- "/usr/local/include/tk{,8*,4*}",
- "/usr/local/include")
-search_header("X11/Xlib.h",
- "/usr/include/X11*",
- "/usr/include",
- "/usr/openwin/include",
- "/usr/X11*/include")
+tklib = with_config("tklib")
+tcllib = with_config("tcllib")
-$CFLAGS = $includes.collect{|path| "-I" + path}.join(" ")
+def find_tcl(tcllib)
+ paths = ["/usr/local/lib", "/usr/pkg"]
+ func = "Tcl_FindExecutable"
+ if tcllib
+ find_library(tcllib, func, *paths)
+ else
+ find_library("tcl", func, *paths) or
+ find_library("tcl8.0", func, *paths) or
+ find_library("tcl7.6", func, *paths)
+ end
+end
-$libraries = []
-def search_lib(file, func, *path)
- for i in path.reverse!
- dir = Dir[i]
- for path in dir.sort!.reverse!
- $LDFLAGS = $libraries.collect{|p| "-L" + p}.join(" ") + " -L" + path
- files = Dir[path+"/"+file]
- if files.size > 0
- for lib in files.sort!.reverse!
- lib = File::basename(lib)
- lib.sub!(/^lib/, '')
- lib.sub!(/\.(a|so(.[0-9.]+)?)$/, '')
- if have_library(lib, func)
- unless $libraries.include? path
- $libraries << path
- end
- return true
- end
- end
- end
- end
+def find_tk(tklib)
+ paths = ["/usr/local/lib", "/usr/pkg"]
+ func = "Tk_Init"
+ if tklib
+ find_library(tklib, func, *paths)
+ else
+ find_library("tk", func, *paths) or
+ find_library("tk8.0", func, *paths) or
+ find_library("tk4.2", func, *paths)
end
- return false;
end
if have_header("tcl.h") && have_header("tk.h") &&
- search_lib("libX11.{so*,a}", "XOpenDisplay",
- "/usr/lib", "/usr/openwin/lib", "/usr/X11*/lib") &&
- search_lib("libtcl{8*,7*,}.{so,a}", "Tcl_FindExecutable",
- "/usr/lib", "/usr/local/lib") &&
- search_lib("libtk{8*,4*,}.{so,a}", "Tk_Init",
- "/usr/lib", "/usr/local/lib")
- $LDFLAGS = $libraries.collect{|path| "-L" + path}.join(" ")
+ find_library("X11", "XOpenDisplay",
+ "/usr/X11/lib", "/usr/X11R6/lib", "/usr/openwin/lib") &&
+ find_tcl(tcllib) &&
+ find_tk(tklib)
create_makefile("tcltklib")
end
diff --git a/file.c b/file.c
index b32a27f5a6c..d9107a1757f 100644
--- a/file.c
+++ b/file.c
@@ -1045,6 +1045,16 @@ rb_file_s_umask(argc, argv)
#endif /* USE_CWGUSI */
}
+#if defined(MSDOS) || defined(_WIN32) || defined(__human68k__)
+#define DOSISH 1
+#endif
+
+#if defined DOSISH
+#define ispathsep(x) ((x) == '/' || (x) == '\\')
+#else
+#define ispathsep(x) ((x) == '/')
+#endif
+
VALUE
rb_file_s_expand_path(argc, argv)
int argc;
@@ -1059,11 +1069,7 @@ rb_file_s_expand_path(argc, argv)
s = STR2CSTR(fname);
p = buf;
if (s[0] == '~') {
- if (s[1] == '/' ||
-#if defined(MSDOS) || defined(NT) || defined(__human68k__)
- s[1] == '\\' ||
-#endif
- s[1] == '\0') {
+ if (ispathsep(s[1]) || s[1] == '\0') {
char *dir = getenv("HOME");
if (!dir) {
@@ -1078,7 +1084,7 @@ rb_file_s_expand_path(argc, argv)
struct passwd *pwPtr;
s++;
#endif
- while (*s && *s != '/') {
+ while (*s && !ispathsep(*s)) {
*p++ = *s++;
}
*p = '\0';
@@ -1094,6 +1100,13 @@ rb_file_s_expand_path(argc, argv)
#endif
}
}
+#if defined DOSISH
+ else if (isalpha(s[0]) && s[1] == ':' && ispathsep(s[2])) {
+ while (*s && !ispathsep(*s)) {
+ *p++ = *s++;
+ }
+ }
+#endif
else if (s[0] != '/') {
if (argc == 2) {
dname = rb_file_s_expand_path(1, &dname);
@@ -1117,10 +1130,10 @@ rb_file_s_expand_path(argc, argv)
if (*(s+1)) {
switch (*++s) {
case '.':
- if (*(s+1) == '\0' || *(s+1) == '/') {
+ if (*(s+1) == '\0' || ispathsep(*(s+1))) {
/* We must go back to the parent */
- if (*p == '/' && p > buf) p--;
- while (p > buf && *p != '/') p--;
+ if (ispathsep(*p) && p > buf) p--;
+ while (p > buf && !ispathsep(*p)) p--;
}
else {
*++p = '.';
@@ -1128,7 +1141,10 @@ rb_file_s_expand_path(argc, argv)
}
break;
case '/':
- if (*p != '/') *++p = '/';
+#if defined DOSISH
+ case '\\':
+#endif
+ if (!ispathsep(*p)) *++p = '/';
break;
default:
*++p = '.'; *++p = *s; break;
@@ -1136,14 +1152,17 @@ rb_file_s_expand_path(argc, argv)
}
break;
case '/':
- if (*p != '/') *++p = '/'; break;
+#if defined DOSISH
+ case '\\':
+#endif
+ if (!ispathsep(*p)) *++p = '/'; break;
default:
*++p = *s;
}
}
/* Place a \0 at end. If path ends with a "/", delete it */
- if (p == buf || *p != '/') p++;
+ if (p == buf || !ispathsep(*p)) p++;
*p = '\0';
return rb_tainted_str_new2(buf);
diff --git a/hash.c b/hash.c
index 3cfd2cc455e..68e90fe8dcd 100644
--- a/hash.c
+++ b/hash.c
@@ -490,8 +490,8 @@ rb_hash_delete_if(hash)
}
static int
-clear_i(key, value)
- VALUE key, value;
+clear_i(key, value, dummy)
+ VALUE key, value, dummy;
{
return ST_DELETE;
}
@@ -501,7 +501,7 @@ rb_hash_clear(hash)
VALUE hash;
{
rb_hash_modify(hash);
- st_foreach(RHASH(hash)->tbl, clear_i);
+ st_foreach(RHASH(hash)->tbl, clear_i, 0);
return hash;
}
diff --git a/instruby.rb b/instruby.rb
index 78b3afaeaec..52c7c2397f0 100644
--- a/instruby.rb
+++ b/instruby.rb
@@ -9,7 +9,7 @@ $:.unshift CONFIG["srcdir"]+"/lib"
require "ftools"
require "find"
-binsuffix = CONFIG["binsuffix"]
+exeext = CONFIG["EXEEXT"]
if ENV["prefix"]
prefix = ENV["prefix"]
else
@@ -25,8 +25,8 @@ mandir = destdir+CONFIG["mandir"] + "/man1"
wdir = Dir.getwd
File.makedirs bindir, true
-File.install ruby_install_name+binsuffix,
- "#{bindir}/#{ruby_install_name}#{binsuffix}", 0755, true
+File.install ruby_install_name+exeext,
+ "#{bindir}/#{ruby_install_name}#{exeext}", 0755, true
for dll in Dir['*.dll']
File.install dll, "#{bindir}/#{dll}", 0755, true
end
@@ -61,7 +61,7 @@ if RUBY_PLATFORM =~ /-aix/
end
Dir.chdir "ext"
-system "../miniruby#{binsuffix} extmk.rb install #{destdir}"
+system "../miniruby#{exeext} extmk.rb install #{destdir}"
Dir.chdir CONFIG["srcdir"]
Find.find("lib") do |f|
@@ -74,6 +74,13 @@ end
for f in Dir["*.h"]
File.install f, archdir, 0644, true
end
+if RUBY_PLATFORM =~ /mswin32/
+ File.makedirs archdir + "/win32", true
+ File.install "win32/win32.h", archdir + "/win32", 0644, true
+ if File.exist? wdir+'/rubymw.lib'
+ File.install wdir+'/rubymw.lib', archdir, 0644, true
+ end
+end
File.install wdir+'/'+CONFIG['LIBRUBY_A'], archdir, 0644, true
File.makedirs mandir, true
diff --git a/io.c b/io.c
index 688981aa4ef..5be3e40abd0 100644
--- a/io.c
+++ b/io.c
@@ -20,8 +20,10 @@
#if !defined(DJGPP) && !defined(NT) && !defined(__human68k__)
#include <sys/ioctl.h>
#endif
-#if defined(HAVE_FCNTL) || defined(NT)
+#if defined(HAVE_FCNTL_H) || defined(NT)
#include <fcntl.h>
+#elif defined(HAVE_SYS_FCNTL_H)
+#include <sys/fcntl.h>
#endif
#ifdef HAVE_SYS_TIME_H
@@ -422,7 +424,8 @@ read_all(port)
TRAP_BEG;
n = fread(RSTRING(str)->ptr+bytes, 1, siz-bytes, fptr->f);
TRAP_END;
- if (n < 0) {
+ if (n == 0) {
+ if (feof(fptr->f)) return Qnil;
rb_sys_fail(fptr->path);
}
bytes += n;
@@ -456,14 +459,15 @@ io_read(argc, argv, io)
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
- if (feof(fptr->f)) return Qtrue;
+ if (feof(fptr->f)) return Qnil;
str = rb_str_new(0, len);
READ_CHECK(fptr->f);
TRAP_BEG;
n = fread(RSTRING(str)->ptr, 1, len, fptr->f);
TRAP_END;
- if (n < 0) {
+ if (n == 0) {
+ if (feof(fptr->f)) return Qnil;
rb_sys_fail(fptr->path);
}
RSTRING(str)->len = n;
@@ -1047,7 +1051,9 @@ rb_io_sysread(io, len)
TRAP_END;
if (n == -1) rb_sys_fail(fptr->path);
- if (n == 0) rb_eof_error();
+ if (n == 0 && ilen > 0) {
+ rb_eof_error();
+ }
RSTRING(str)->len = n;
RSTRING(str)->ptr[n] = '\0';
diff --git a/lib/ftools.rb b/lib/ftools.rb
index 301bff6cee6..39d6ca94624 100644
--- a/lib/ftools.rb
+++ b/lib/ftools.rb
@@ -74,12 +74,16 @@ class << File
begin
rename from, to
rescue
- from_stat = stat(from)
- syscopy from, to and unlink from
- utime(from_stat.atime, from_stat.mtime, to)
begin
- chown(fstat.uid, fstat.gid, tpath)
+ symlink File.readlink(from), to and unlink from
rescue
+ from_stat = stat(from)
+ syscopy from, to and unlink from
+ utime(from_stat.atime, from_stat.mtime, to)
+ begin
+ chown(fstat.uid, fstat.gid, tpath)
+ rescue
+ end
end
end
end
@@ -109,7 +113,8 @@ class << File
if fr = from.read(fsize)
tr = to.read(fr.size)
else
- ret = !to.read(fsize)
+ ret = to.read(fsize)
+ ret = !ret || ret.length == 0
break
end
end
@@ -167,7 +172,7 @@ class << File
def install(from, to, mode = nil, verbose = false)
to = catname(from, to)
unless FileTest.exist? to and cmp from, to
- unlink to if FileTest.exist? to
+ safe_unlink to if FileTest.exist? to
cp from, to, verbose
chmod mode, to, verbose if mode
end
diff --git a/lib/jcode.rb b/lib/jcode.rb
index 5b5b80d7972..0bd63cf6f20 100644
--- a/lib/jcode.rb
+++ b/lib/jcode.rb
@@ -1,6 +1,6 @@
# jcode.rb - ruby code to handle japanese (EUC/SJIS) string
-$vsave, $VERBOSE = $VERBOSE, false
+$vsave, $VERBOSE = $VERBOSE, FALSE
class String
printf STDERR, "feel free for some warnings:\n" if $VERBOSE
@@ -12,9 +12,10 @@ class String
private :original_succ
def mbchar?
- if $KCODE =~ /^s/i
+ case $KCODE[0]
+ when ?s, ?S
self =~ /[\x81-\x9f\xe0-\xef][\x40-\x7e\x80-\xfc]/n
- elsif $KCODE =~ /^e/i
+ when ?e, ?E
self =~ /[\xa1-\xfe][\xa1-\xfe]/n
else
false
@@ -22,16 +23,15 @@ class String
end
def succ
- if self[-2] && self[-2] & 0x80 != 0
+ if self[-2] and self[-2, 2].mbchar?
s = self.dup
s[-1] += 1
- s[-1] += 1 if !s.mbchar?
+ s[-1] += 1 unless s[-2, 2].mbchar?
return s
else
original_succ
end
end
- alias next succ
def upto(to)
return if self > to
@@ -58,12 +58,11 @@ class String
return nil
end
- ExpandChCache = {}
+ private
- def _expand_ch
- return ExpandChCache[self] if ExpandChCache.key? self
+ def _expand_ch str
a = []
- self.scan(/(.|\n)-(.|\n)|(.|\n)/) do |r|
+ str.scan(/(.|\n)-(.|\n)|(.|\n)/) do |r|
if $3
a.push $3
elsif $1.length != $2.length
@@ -74,36 +73,41 @@ class String
$1.upto($2) { |c| a.push c }
end
end
- ExpandChCache[self] = a
a
end
+ HashCache = {}
+
+ def expand_ch_hash from, to = ""
+ key = from.intern.to_s + ":" + to.intern.to_s
+ return HashCache[key] if HashCache.key? key
+ afrom = _expand_ch(from)
+ h = {}
+ if to.length != 0
+ ato = _expand_ch(to)
+ afrom.each_with_index do |x,i| h[x] = ato[i] || ato[-1] end
+ else
+ afrom.each do |x| h[x] = true end
+ end
+ HashCache[key] = h
+ end
+
+ def bsquote(str)
+ str.gsub(/\\/, '\\\\\\\\')
+ end
+
+ public
+
def tr!(from, to)
return self.delete!(from) if to.length == 0
- if from =~ /^\^/
- comp=true
- from = $'
- end
- afrom = from._expand_ch
- ato = to._expand_ch
- i = 0
- if comp
- self.gsub!(/(.|\n)/) do |c|
- unless afrom.include?(c)
- ato[-1]
- else
- c
- end
- end
+ pattern = /[#{bsquote(from)}]/
+ if from[0] == ?^
+ last = /.$/.match(to)[0]
+ self.gsub!(pattern, last)
else
- self.gsub!(/(.|\n)/) do |c|
- if i = afrom.index(c)
- if i < ato.size then ato[i] else ato[-1] end
- else
- c
- end
- end
+ h = expand_ch_hash(from, to)
+ self.gsub!(pattern) do |c| h[c] end
end
end
@@ -112,22 +116,8 @@ class String
end
def delete!(del)
- if del =~ /^\^/
- comp=true
- del = $'
- end
- adel = del._expand_ch
- if comp
- self.gsub!(/(.|\n)/) do |c|
- next unless adel.include?(c)
- c
- end
- else
- self.gsub!(/(.|\n)/) do |c|
- next if adel.include?(c)
- c
- end
- end
+ pattern = /[#{bsquote(del)}]+/
+ self.gsub!(pattern, '')
end
def delete(del)
@@ -135,27 +125,13 @@ class String
end
def squeeze!(del=nil)
- if del
- if del =~ /^\^/
- comp=true
- del = $'
- end
- adel = del._expand_ch
- if comp
- self.gsub!(/(.|\n)\1+/) do
- next unless adel.include?($1)
- $&
- end
+ pattern =
+ if del
+ /([#{bsquote(del)}])\1+/
else
- for c in adel
- cq = Regexp.quote(c)
- self.gsub!(/#{cq}(#{cq})+/, cq)
- end
+ /(.|\n)\1+/
end
- self
- else
- self.gsub!(/(.|\n)\1+/, '\1')
- end
+ self.gsub!(pattern, '\1')
end
def squeeze(del=nil)
@@ -164,33 +140,14 @@ class String
def tr_s!(from, to)
return self.delete!(from) if to.length == 0
- if from =~ /^\^/
- comp=true
- from = $'
- end
- afrom = from._expand_ch
- ato = to._expand_ch
- i = 0
- c = nil
- last = nil
- self.gsub!(/(.|\n)/) do |c|
- if comp
- unless afrom.include?(c)
- c = ato[-1]
- next if c == last
- last = c
- else
- last = nil
- c
- end
- elsif i = afrom.index(c)
- c = if i < ato.size then ato[i] else ato[-1] end
- next if c == last
- last = c
- else
- last = nil
- c
- end
+
+ pattern = /([#{bsquote(from)}])\1+/
+ if from[0] == ?^
+ last = /.$/.match(to)[0]
+ self.gsub!(pattern, last)
+ else
+ h = expand_ch_hash(from, to)
+ self.gsub!(pattern) do h[$1] end
end
end
@@ -198,18 +155,17 @@ class String
(str = self.dup).tr_s!(from,to) or str
end
- alias original_chop! chop!
- private :original_chop!
-
def chop!
- if self =~ /(.)$/ and $1.size == 2
- original_chop!
- end
- original_chop!
+ self.gsub!(/(?:.|\n)\z/, '')
end
def chop
(str = self.dup).chop! or str
end
+
+ def jcount(str)
+ self.delete("^#{str}").jlength
+ end
+
end
$VERBOSE = $vsave
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index e35f17b7723..a3f2a8e6fe0 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -6,6 +6,8 @@ require 'find'
include Config
+SRC_EXT = ["c", "cc", "m", "cxx", "cpp", "C"]
+
$cache_mod = false
$lib_cache = {}
$lib_found = {}
@@ -42,6 +44,8 @@ else
STDERR.print "can't find header files for ruby.\n"
exit 1
end
+$topdir = $hdrdir
+$hdrdir.gsub!('/', '\\') if RUBY_PLATFORM =~ /mswin32/
CFLAGS = CONFIG["CFLAGS"]
if RUBY_PLATFORM == "m68k-human"
@@ -145,12 +149,20 @@ def install_rb(mfile, srcdir = nil)
end
end
+def append_library(libs, lib)
+ if /mswin32/ =~ RUBY_PLATFORM
+ lib + ".lib " + libs
+ else
+ "-l" + lib + " " + libs
+ end
+end
+
def have_library(lib, func="main")
printf "checking for %s() in -l%s... ", func, lib
STDOUT.flush
if $lib_cache[lib]
if $lib_cache[lib] == "yes"
- $libs = "-l" + lib + " " + $libs
+ $libs = append_library($libs, lib)
print "(cached) yes\n"
return true
else
@@ -160,18 +172,36 @@ def have_library(lib, func="main")
end
if func && func != ""
- libs = "-l" + lib + " " + $libs
- unless try_link(<<"SRC", libs)
+ libs = append_library($libs, lib)
+ if /mswin32/ =~ RUBY_PLATFORM
+ r = try_link(<<"SRC", libs)
+#include <windows.h>
+#include <winsock.h>
+int main() { return 0; }
+int t() { #{func}(); return 0; }
+SRC
+ unless r
+ r = try_link(<<"SRC", libs)
+#include <windows.h>
+#include <winsock.h>
+int main() { return 0; }
+int t() { void ((*p)()); p = (void ((*)()))#{func}; return 0; }
+SRC
+ end
+ else
+ r = try_link(<<"SRC", libs)
int main() { return 0; }
int t() { #{func}(); return 0; }
SRC
+ end
+ unless r
$lib_cache[lib] = 'no'
$cache_mod = true
print "no\n"
return false
end
else
- libs = "-l" + lib + " " + $libs
+ libs = append_library($libs, lib)
end
$libs = libs
@@ -181,6 +211,28 @@ SRC
return true
end
+def find_library(lib, func, *paths)
+ printf "checking for %s() in -l%s... ", func, lib
+ STDOUT.flush
+
+ ldflags = $LDFLAGS
+ libs = "-l" + lib + " " + $libs
+ until try_link(<<"SRC", libs)
+int main() { return 0; }
+int t() { #{func}(); return 0; }
+SRC
+ if paths.size == 0
+ $LDFLAGS = ldflags
+ print "no\n"
+ return false
+ end
+ $LDFLAGS = ldflags + " -L"+paths.shift
+ end
+ $libs = libs
+ print "yes\n"
+ return true
+end
+
def have_func(func)
printf "checking for %s()... ", func
STDOUT.flush
@@ -197,11 +249,28 @@ def have_func(func)
libs = $libs
- unless try_link(<<"SRC", libs)
-char #{func}();
+ if /mswin32/ =~ RUBY_PLATFORM
+ r = try_link(<<"SRC", libs)
+#include <windows.h>
+#include <winsock.h>
+int main() { return 0; }
+int t() { #{func}(); return 0; }
+SRC
+ unless r
+ r = try_link(<<"SRC", libs)
+#include <windows.h>
+#include <winsock.h>
+int main() { return 0; }
+int t() { void ((*p)()); p = (void ((*)()))#{func}; return 0; }
+SRC
+ end
+ else
+ r = try_link(<<"SRC", libs)
int main() { return 0; }
int t() { #{func}(); return 0; }
SRC
+ end
+ unless r
$func_found[func] = 'no'
$cache_mod = true
print "no\n"
@@ -246,7 +315,6 @@ SRC
end
def arg_config(config, default=nil)
- return default if /mswin32/i =~ RUBY_PLATFORM
unless defined? $configure_args
$configure_args = {}
for arg in CONFIG["configure_args"].split + ARGV
@@ -291,11 +359,30 @@ def create_header()
end
end
-def create_makefile(target, installpos = "")
+def dir_config(target)
+ dir = with_config("%s-dir"%target)
+ if dir
+ idir = " -I"+dir+"/include"
+ ldir = " -L"+dir+"/lib"
+ end
+ unless idir
+ dir = with_config("%s-include"%target)
+ idir = " -I"+dir if dir
+ end
+ unless ldir
+ dir = with_config("%s-lib"%target)
+ ldir = " -L"+dir if dir
+ end
+
+ $CFLAGS += idir if idir
+ $LDFLAGS += ldir if ldir
+end
+
+def create_makefile(target)
print "creating Makefile\n"
system "rm -f conftest*"
STDOUT.flush
- if CONFIG["DLEXT"] == "o"
+ if CONFIG["DLEXT"] == $OBJEXT
libs = $libs.split
for lib in libs
lib.sub!(/-l(.*)/, '"lib\1.a"')
@@ -319,9 +406,11 @@ def create_makefile(target, installpos = "")
end
unless $objs then
- $objs = Dir["*.{c,cc,m}"]
- for f in $objs
- f.sub!(/\.(c|cc|m)$/, ".o")
+ $objs = []
+ for f in Dir["*.{#{SRC_EXT.join(%q{,})}}"]
+ f = File.basename(f)
+ f.sub!(/(#{SRC_EXT.join(%q{|})})$/, $OBJEXT)
+ $objs.push f
end
end
$objs = $objs.join(" ")
@@ -333,7 +422,7 @@ SHELL = /bin/sh
#### Start of system configuration section. ####
srcdir = #{$srcdir}
-topdir = #{$hdrdir}
+topdir = #{$topdir}
hdrdir = #{$hdrdir}
CC = #{CONFIG["CC"]}
@@ -350,7 +439,7 @@ archdir = #{$archdir}
#### End of system configuration section. ####
-LOCAL_LIBS = #{$LOCAL_LIBS}
+LOCAL_LIBS = #{$LOCAL_LIBS} #{$local_flags}
LIBS = #{$libs}
OBJS = #{$objs}
@@ -359,13 +448,14 @@ DLLIB = $(TARGET).#{CONFIG["DLEXT"]}
RUBY = #{CONFIG["ruby_install_name"]}
-binsuffix = #{CONFIG["binsuffix"]}
+EXEEXT = #{CONFIG["EXEEXT"]}
all: $(DLLIB)
-clean:; @rm -f *.o *.so *.sl *.a $(DLLIB)
+clean:; @rm -f *.#{$OBJEXT} *.so *.sl *.a $(DLLIB)
+ @rm -f $(TARGET).lib $(TARGET).exp
@rm -f Makefile extconf.h conftest.*
- @rm -f core ruby$(binsuffix) *~
+ @rm -f core ruby$(EXEEXT) *~
realclean: clean
@@ -378,7 +468,7 @@ EOMF
install_rb(mfile)
mfile.printf "\n"
- if CONFIG["DLEXT"] != "o"
+ if CONFIG["DLEXT"] != $OBJEXT
mfile.printf <<EOMF
$(DLLIB): $(OBJS)
$(LDSHARED) $(DLDFLAGS) -o $(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)
@@ -397,7 +487,7 @@ EOMF
dfile = open("depend", "r")
mfile.printf "###\n"
while line = dfile.gets()
- mfile.print line
+ mfile.printf "%s", line.gsub(/\.o/, ".#{$OBJEXT}")
end
dfile.close
end
@@ -443,9 +533,33 @@ EOMF
end
end
-$libs = RUBY_PLATFORM =~ /cygwin|beos|openstep|nextstep|rhapsody/ ? "" : "-lc"
+$OBJEXT = CONFIG["OBJEXT"]
$objs = nil
+$libs = "-lc"
+$local_flags = ""
+case RUBY_PLATFORM
+when /cygwin|beos|openstep|nextstep|rhapsody/
+ $libs = ""
+when /mswin32/
+ $libs = ""
+ $local_flags = "rubymw.lib -link /LIBPATH:$(topdir) /EXPORT:Init_$(TARGET)"
+end
$LOCAL_LIBS = ""
-$CFLAGS = ""
-$LDFLAGS = ""
$defs = []
+
+dir = with_config("opt-dir")
+if dir
+ idir = "-I"+dir+"/include"
+ ldir = "-L"+dir+"/lib"
+end
+unless idir
+ dir = with_config("opt-include")
+ idir = "-I"+dir if dir
+end
+unless ldir
+ dir = with_config("opt-lib")
+ ldir = "-L"+dir if dir
+end
+
+$CFLAGS = idir || ""
+$LDFLAGS = ldir || ""
diff --git a/mkconfig.rb b/mkconfig.rb
index 400f7691af5..093d02344de 100644
--- a/mkconfig.rb
+++ b/mkconfig.rb
@@ -9,7 +9,7 @@ version = VERSION
config = open(rbconfig_rb, "w")
$stdout.reopen(config)
-fast = {'prefix'=>TRUE, 'INSTALL'=>TRUE, 'binsuffix'=>TRUE}
+fast = {'prefix'=>TRUE, 'INSTALL'=>TRUE, 'EXEEXT'=>TRUE}
print %[
module Config
@@ -23,6 +23,7 @@ module Config
print " CONFIG = {}\n"
v_fast = []
v_others = []
+has_version = false
File.foreach "config.status" do |$_|
next if /^#/
if /^s%@program_transform_name@%s,(.*)%g$/
@@ -41,6 +42,7 @@ File.foreach "config.status" do |$_|
else
v_others << v
end
+ has_version = true if name == "MAJOR"
if /DEFS/
val.split(/\s*-D/).each do |i|
if i =~ /(.*)=(\\")?([^\\]*)(\\")?/
@@ -62,6 +64,14 @@ File.foreach "config.status" do |$_|
# break if /^CEOF/
end
+if not has_version
+ VERSION.scan(/(\d+)\.(\d+)\.(\d+)/) {
+ print " CONFIG[\"MAJOR\"] = \"" + $1 + "\"\n"
+ print " CONFIG[\"MINOR\"] = \"" + $2 + "\"\n"
+ print " CONFIG[\"TEENY\"] = \"" + $3 + "\"\n"
+ }
+end
+
print v_fast, v_others
print <<EOS
CONFIG["compile_dir"] = "#{Dir.pwd}"
diff --git a/pack.c b/pack.c
index 5461aaddc1c..38e970cad10 100644
--- a/pack.c
+++ b/pack.c
@@ -41,7 +41,7 @@ TOKEN_PASTE(swap,x)(z) \
*zp = z; \
s = (char *)zp; \
t = (char *)malloc(sizeof(xtype)); \
- for (i=0 ; i<sizeof(xtype); i++) { \
+ for (i=0; i<sizeof(xtype); i++) { \
t[sizeof(xtype)-i-1] = s[i]; \
} \
r = *(xtype *)t; \
@@ -77,7 +77,7 @@ define_swapx(s,short);
+(((x)&0x0000000000FF0000)<<24) \
+(((x)&0x0000FF0000000000)>>24) \
+(((x)&0x00000000FF000000)<<8) \
- +(((x)&0x000000FF00000000)>>8) )
+ +(((x)&0x000000FF00000000)>>8))
#else
define_swapx(l,long);
#endif
diff --git a/parse.y b/parse.y
index 3206eccc190..af7ab6ffe6a 100644
--- a/parse.y
+++ b/parse.y
@@ -4189,7 +4189,7 @@ local_cnt(id)
if (id == 0) return lvtbl->cnt;
- for (cnt=1, max=lvtbl->cnt+1; cnt<max ;cnt++) {
+ for (cnt=1, max=lvtbl->cnt+1; cnt<max;cnt++) {
if (lvtbl->tbl[cnt] == id) return cnt-1;
}
return local_append(id);
diff --git a/process.c b/process.c
index 1258e93b58d..d5c2d5eb8a9 100644
--- a/process.c
+++ b/process.c
@@ -456,7 +456,7 @@ proc_spawn(sv)
if (*s != ' ' && !ISALPHA(*s) && strchr("*?{}[]<>()~&|\\$;'`\"\n",*s)) {
char *shell = dln_find_exe("sh", 0);
before_exec();
- state = shell ? spawnl(P_WAIT, shell, "sh", "-c", str, (char *) NULL) : system(str) ;
+ state = shell?spawnl(P_WAIT,shell,"sh","-c",str,(char*)NULL):system(str);
after_exec();
return state;
}
@@ -469,7 +469,7 @@ proc_spawn(sv)
*a++ = t;
*a = NULL;
}
- return argv[0] ? proc_spawn_v(argv, 0) : -1 ;
+ return argv[0] ? proc_spawn_v(argv, 0) : -1;
}
#endif /* __human68k__ */
@@ -662,7 +662,7 @@ rb_f_system(argc, argv)
state = proc_spawn_n(argc, argv, prog);
}
rb_last_status = state == -1 ? INT2FIX(127) : INT2FIX(state);
- return state == 0 ? Qtrue : Qfalse ;
+ return state == 0 ? Qtrue : Qfalse;
#else
#if defined(USE_CWGUSI)
rb_notimplement();
diff --git a/regex.c b/regex.c
index 97849a16554..d4eea4cb740 100644
--- a/regex.c
+++ b/regex.c
@@ -2225,7 +2225,7 @@ re_compile_pattern(pattern, size, bufp)
}
else if (*laststart == charset || *laststart == charset_not) {
p0 = laststart;
- mcnt = *++p0 ;
+ mcnt = *++p0;
p0 += mcnt+1;
mcnt = EXTRACT_UNSIGNED_AND_INCR(p0);
p0 += 8*mcnt;
@@ -4095,7 +4095,7 @@ re_match(bufp, string_arg, size, pos, regs)
}
break;
default:
- /* do nothing */ ;
+ /* do nothing */;
}
}
}
diff --git a/rubytest.rb b/rubytest.rb
index 32b2844a9fe..61b31ceaf1d 100644
--- a/rubytest.rb
+++ b/rubytest.rb
@@ -17,9 +17,8 @@ if File.exist? CONFIG['LIBRUBY_SO']
ENV[dldpath] = x
end
-if File.exist? CONFIG['LIBRUBY_SO']
- ENV["LD_PRELOAD"] ||= ""
- ENV["LD_PRELOAD"] += " ./#{CONFIG['LIBRUBY_SO']}"
+if /linux/ =~ RUBY_PLATFORM and File.exist? CONFIG['LIBRUBY_SO']
+ ENV["LD_PRELOAD"] = "./#{CONFIG['LIBRUBY_SO']}"
end
$stderr.reopen($stdout)
diff --git a/st.c b/st.c
index f4813558751..486b72a4349 100644
--- a/st.c
+++ b/st.c
@@ -179,7 +179,7 @@ st_free_table(table)
register st_table_entry *ptr, *next;
int i;
- for(i = 0; i < table->num_bins ; i++) {
+ for(i = 0; i < table->num_bins; i++) {
ptr = table->bins[i];
while (ptr != 0) {
next = ptr->next;
@@ -287,7 +287,7 @@ rehash(table)
new_num_bins = new_size(old_num_bins);
new_bins = (st_table_entry**)Calloc(new_num_bins, sizeof(st_table_entry*));
- for(i = 0; i < old_num_bins ; i++) {
+ for(i = 0; i < old_num_bins; i++) {
ptr = table->bins[i];
while (ptr != 0) {
next = ptr->next;
@@ -324,7 +324,7 @@ st_copy(old_table)
return 0;
}
- for(i = 0; i < num_bins ; i++) {
+ for(i = 0; i < num_bins; i++) {
new_table->bins[i] = 0;
ptr = old_table->bins[i];
while (ptr != 0) {
diff --git a/string.c b/string.c
index ae7c028cf92..94acc767fbb 100644
--- a/string.c
+++ b/string.c
@@ -2191,7 +2191,7 @@ rb_str_each_line(argc, argv, str)
}
if (s != pend) {
- if (p > pend) p = pend ;
+ if (p > pend) p = pend;
line = rb_str_new(s, p - s);
rb_yield(line);
}
diff --git a/top.sed b/top.sed
index c5c5ca0c57c..7c7943e37d7 100644
--- a/top.sed
+++ b/top.sed
@@ -35,6 +35,9 @@ s%@INSTALL_DATA@%${INSTALL} -m 644%g
s%@SET_MAKE@%%g
s%@LIBOBJS@% crypt.o flock.o vsnprintf.o%g
s%@ALLOCA@%%g
+s%@DEFAULT_KCODE@%%g
+s%@EXEEXT@%.exe%g
+s%@OBJEXT@%obj%g
s%@XLDFLAGS@%%g
s%@DLDFLAGS@%%g
s%@STATIC@%%g
diff --git a/util.c b/util.c
index d3f0a7dd614..f328b2f6aa6 100644
--- a/util.c
+++ b/util.c
@@ -266,7 +266,7 @@ ruby_add_suffix(str, suffix)
slen = extlen;
t = buf; baselen = 0; s = RSTRING(str)->ptr;
- while ( (*t = *s) && *s != '.') {
+ while ((*t = *s) && *s != '.') {
baselen++;
if (*s == '\\' || *s == '/') baselen = 0;
s++; t++;
@@ -579,7 +579,7 @@ static void mmprepare(base, size) void *base; int size;
mmsize = size;
high = (size & (-16));
- low = (size & 0x0C );
+ low = (size & 0x0c);
}
static void mmswap(a, b) register char *a, *b;
@@ -664,7 +664,7 @@ typedef struct { char *LL, *RR; } stack_node; /* Stack structure for L,l,R,r */
#define med3(a,b,c) ((*cmp)(a,b)<0 ? \
((*cmp)(b,c)<0 ? b : ((*cmp)(a,c)<0 ? c : a)) : \
- ((*cmp)(b,c)>0 ? b : ((*cmp)(a,c)<0 ? a : c)) )
+ ((*cmp)(b,c)>0 ? b : ((*cmp)(a,c)<0 ? a : c)))
void ruby_qsort (base, nel, size, cmp) void* base; int nel; int size; int (*cmp)();
{
@@ -676,7 +676,7 @@ void ruby_qsort (base, nel, size, cmp) void* base; int nel; int size; int (*cmp)
stack_node stack[32], *top = stack; /* 32 is enough for 32bit CPU */
if (nel <= 1) return; /* need not to sort */
- mmprepare( base, size );
+ mmprepare(base, size);
goto start;
nxt:
@@ -700,18 +700,18 @@ void ruby_qsort (base, nel, size, cmp) void* base; int nel; int size; int (*cmp)
register char *p1 = l + t;
register char *p2 = p1 + t;
register char *p3 = p2 + t;
- m1 = med3( p1, p2, p3 );
+ m1 = med3(p1, p2, p3);
p1 = m + t;
p2 = p1 + t;
p3 = p2 + t;
- m3 = med3( p1, p2, p3 );
+ m3 = med3(p1, p2, p3);
}
}else{
t = size*(t>>2); /* number of bytes in splitting 4 */
m1 = l + t;
m3 = m + t;
}
- m = med3( m1, m, m3 );
+ m = med3(m1, m, m3);
}
if ((t = (*cmp)(l,m)) < 0) { /*3-5-?*/
diff --git a/version.h b/version.h
index 7f50463e034..fc8a918d51d 100644
--- a/version.h
+++ b/version.h
@@ -1,4 +1,4 @@
-#define RUBY_VERSION "1.3.5"
-#define RUBY_RELEASE_DATE "1999-07-15"
-#define RUBY_VERSION_CODE 135
-#define RUBY_RELEASE_CODE 19990715
+#define RUBY_VERSION "1.3.6"
+#define RUBY_RELEASE_DATE "1999-07-28"
+#define RUBY_VERSION_CODE 136
+#define RUBY_RELEASE_CODE 19990728
diff --git a/win32/Makefile b/win32/Makefile
index 6fc60bb164f..4bf3d9be5a2 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -7,25 +7,26 @@ VPATH = .:./missing
CC = cl
YACC = byacc
-RANLIB =
-AR =
-INSTALL = ginstall -c
-INSTALL_PROGRAM = $(INSTALL)
-INSTALL_DATA = $(INSTALL) -m 644
PURIFY =
+AUTOCONF = autoconf
+prefix =
CFLAGS = -nologo -DNT=1 -Ox -I. -I./missing
-LDFLAGS = $(CFLAGS) -Fm
-#CFLAGS = -nologo -DNT=1 -Zi -MD
-#LDFLAGS = $(CFLAGS) -Fm -MD
-LIBS = advapi32.lib wsock32.lib
+LDFLAGS = $(CFLAGS) -Fm
+#CFLAGS = -nologo -DNT=1 -Zi -MD
+#LDFLAGS = $(CFLAGS) -Fm -MD
+XLDFLAGS =
+EXTLIBS =
+LIBS = advapi32.lib wsock32.lib $(EXTLIBS)
MISSING = crypt.obj alloca.obj win32.obj fnmatch.obj isinf.obj isnan.obj
+LDSHARED =
+DLDFLAGS =
+SOLIBS =
-prefix =
RUBY_INSTALL_NAME=ruby
-binsuffix = .exe
-PROGRAM=$(RUBY_INSTALL_NAME)$(binsuffix)
+EXEEXT = .exe
+PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
STACK = 0x200000
ORGLIBPATH = $(LIB)
@@ -77,14 +78,14 @@ OBJS = array.obj \
version.obj \
$(MISSING)
-all: miniruby$(binsuffix) rbconfig.rb ext/Setup $(MISCLIBS)
+all: miniruby$(EXEEXT) rbconfig.rb ext/Setup $(MISCLIBS)
set LIB=..\..\win32;$(ORGLIBPATH)
- @.\miniruby$(binsuffix) -Xext extmk.rb static
+ @.\miniruby$(EXEEXT) -Xext extmk.rb static
-miniruby$(binsuffix): $(OBJS) $(MAINOBJ) $(EXTOBJS)
+miniruby$(EXEEXT): $(OBJS) $(MAINOBJ) $(EXTOBJS)
@echo $(EXTOBJS)
@echo $(LIBS)
- @rm -f miniruby$(binsuffix)
+ @rm -f miniruby$(EXEEXT)
$(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) $(EXTOBJS) $(OBJS) $(LIBS) -o $@
$(PROGRAM): $(LIBRUBY) $(MAINOBJ) rubymw.dll
@@ -101,27 +102,28 @@ $(LIBRUBY): $(OBJS)
lib /OUT:$(LIBRUBY) $(OBJS)
install: rbconfig.rb
- ./miniruby.exe $(srcdir)/instruby.rb $(DESTDIR)
+ .\miniruby.exe $(srcdir)/instruby.rb $(DESTDIR)
clean:; @rm -f $(OBJS) $(LIBRUBY) rbconfig.rb
- @rm -f ext/extinit.c ext/extinit.obj *.obj
- @.\miniruby$(binsuffix) -Xext extmk.rb clean 2> nul || true
+ @rm -f ext/extinit.c ext/extinit.obj ext/vc*.pdb *.obj
+ @.\miniruby$(EXEEXT) -Xext extmk.rb clean
distclean: clean
@rm -f Makefile ext/extmk.rb config.h
@rm -f ext/config.cache config.cache config.log config.status
@rm -f *~ core *.core gmon.out y.tab.c y.output ruby.imp
- @rm -f $(PROGRAM) miniruby$(binsuffix)
+ @rm -f *.map rubymw.* ruby.def
+ @rm -f $(PROGRAM) miniruby$(EXEEXT)
realclean: distclean
@rm -f parse.c
@rm -f lex.c
-test: miniruby$(binsuffix)
- @.\miniruby$(binsuffix) $(srcdir)/rubytest.rb
+test: miniruby$(EXEEXT)
+ @.\miniruby$(EXEEXT) $(srcdir)/rubytest.rb
-rbconfig.rb: miniruby$(binsuffix)
- @.\miniruby$(binsuffix) $(srcdir)/mkconfig.rb rbconfig.rb
+rbconfig.rb: miniruby$(EXEEXT)
+ @.\miniruby$(EXEEXT) $(srcdir)/mkconfig.rb rbconfig.rb
config.status: $(srcdir)/configure
# $(SHELL) ./config.status --recheck
diff --git a/win32/config.status b/win32/config.status
index 3c5adfe823d..66af519615b 100644
--- a/win32/config.status
+++ b/win32/config.status
@@ -1,8 +1,12 @@
-s%@CFLAGS@% -O%g
+ac_given_srcdir=.
+ac_given_INSTALL="ginstall -c"
+s%@SHELL@%%g
+s%@CFLAGS@%-nologo -DNT=1 -Ox%g
s%@CPPFLAGS@%%g
s%@CXXFLAGS@%%g
+s%@FFLAGS@%%g
s%@DEFS@%
- -DUSE_THREAD -DSIZEOF_INT=4 -DSIZEOF_SHORT=2 -DSIZEOF_LONG=4 -DSIZEOF_VOIDP=4 -DSIZEOF_FLOAT= 4 -DSIZEOF_DOUBLE 8 -DHAVE_PROTOTYPES=1 -DHAVE_STDARG_PROTOTYPES=1 -DHAVE_STDLIB_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ST_RDEV=1 -DGETGROUPS_T=int -DRETSIGTYPE=void -DHAVE_ALLOCA=1 -DHAVE_FMOD=1 -DHAVE_WAITPID=1 -DHAVE_GETCWD=1 -DHAVE_CHSIZE=1 -DHAVE_GETGROUPS=1 -DHAVE_GETLOGIN=1 RSHIFT\(x,y\)\ \(\(x\)\>\>y\) FILE_COUNT _cnt DLEXT \".dll\" RUBY_LIB \";/usr/local/lib/ruby;.\" RUBY_ARCHLIB \"/usr/local/lib/ruby/i386-mswin32\" RUBY_PLATFORM \"i386-mswin32\" %g
+ -DUSE_THREAD -DSIZEOF_INT=4 -DSIZEOF_SHORT=2 -DSIZEOF_LONG=4 -DSIZEOF_VOIDP=4 -DSIZEOF_FLOAT=4 -DSIZEOF_DOUBLE=8 -DHAVE_PROTOTYPES=1 -DHAVE_STDARG_PROTOTYPES=1 -DHAVE_STDLIB_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ST_RDEV=1 -DGETGROUPS_T=int -DRETSIGTYPE=void -DHAVE_ALLOCA=1 -DHAVE_FMOD=1 -DHAVE_WAITPID=1 -DHAVE_GETCWD=1 -DHAVE_CHSIZE=1 -DHAVE_GETGROUPS=1 -DHAVE_GETLOGIN=1 -DRSHIFT=\(x,y\)\ \(\(x\)\>\>y\) -DFILE_COUNT=_cnt -DDLEXT=\".dll\" -DRUBY_LIB=\";/usr/local/lib/ruby;.\" -DRUBY_ARCHLIB=\"/usr/local/lib/ruby/i386-mswin32\" -DRUBY_PLATFORM=\"i386-mswin32\" %g
s%@LDFLAGS@%%g
s%@LIBS@%advapi32.lib wsock32.lib%g
s%@exec_prefix@%${prefix}%g
@@ -24,29 +28,45 @@ s%@host@%i386-pc-mswin32%g
s%@host_alias@%i386-mswin32%g
s%@host_cpu@%i386%g
s%@host_vendor@%pc%g
-s%@host_os@%i386-mswin32%g
+s%@host_os@%mswin32%g
s%@CC@%cl%g
s%@CPP@%cl -E%g
-s%@YACC@%bison -y%g
-s%@RANLIB@%ranlib%g
+s%@YACC@%byacc%g
+s%@RANLIB@%%g
s%@AR@%lib%g
s%@INSTALL_PROGRAM@%${INSTALL}%g
+s%@INSTALL_SCRIPT@%${INSTALL_PROGRAM}%g
s%@INSTALL_DATA@%${INSTALL} -m 644%g
+s%@INSTALL_DLLIB@%${INSTALL} -m 555%g
+s%@LN_S@%%g
s%@SET_MAKE@%%g
s%@LIBOBJS@% crypt.obj alloca.obj win32.obj fnmatch.obj isinf.obj isnan.obj%g
s%@ALLOCA@%%g
+s%@DEFAULT_KCODE@%%g
+s%@EXEEXT@%.exe%g
+s%@OBJEXT@%obj%g
+s%@XLDFLAGS@%%g
s%@DLDFLAGS@%%g
s%@STATIC@%%g
s%@CCDLFLAGS@%%g
-s%@LDSHARED@%ld%g
+s%@LDSHARED@%cl -LD%g
s%@DLEXT@%dll%g
s%@STRIP@%%g
s%@EXTSTATIC@%%g
s%@binsuffix@%.exe%g
s%@setup@%Setup%g
+s%@LIBRUBY_LDSHARED@%%g
+s%@LIBRUBY_DLDFLAGS@%%g
+s%@RUBY_INSTALL_NAME@%ruby%g
+s%@LIBRUBY_A@%lib$(RUBY_INSTALL_NAME).lib%g
+s%@LIBRUBY_SO@%%g
+s%@LIBRUBY_ALIASES@%%g
s%@LIBRUBY@%libruby.lib%g
s%@LIBRUBYARG@%libruby.lib%g
s%@SOLIBS@%%g
-s%@srcdir%.%g
s%@arch@%i386-mswin32%g
-ac_given_srcdir=.
+s%@configure_args@%%g
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g