summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-05-06 08:31:50 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-05-06 08:31:50 +0000
commite8505b64725b10f92e828d289ad0995bb23c1c8a (patch)
tree5c256f0d6b5f496ef0b348c4d3ebdb2988ba7e2b
parentcae09e71e575608c039212d8b1273bd14695f88c (diff)
downloadruby-e8505b64725b10f92e828d289ad0995bb23c1c8a.tar.gz
small fixes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog55
-rw-r--r--MANIFEST3
-rw-r--r--array.c11
-rw-r--r--configure628
-rw-r--r--configure.in2
-rw-r--r--error.c1
-rw-r--r--ext/Setup1
-rw-r--r--ext/curses/curses.c7
-rw-r--r--ext/extmk.rb.in81
-rw-r--r--ext/extmk.rb.nt500
-rw-r--r--ext/readline/extconf.rb1
-rw-r--r--ext/socket/addrinfo.h8
-rw-r--r--ext/socket/extconf.rb5
-rw-r--r--ext/socket/getaddrinfo.c27
-rw-r--r--ext/socket/getnameinfo.c17
-rw-r--r--ext/socket/socket.c176
-rw-r--r--ext/socket/sockport.h4
-rw-r--r--ext/tcltklib/extconf.rb4
-rw-r--r--instruby.rb2
-rw-r--r--io.c4
-rw-r--r--lib/mkmf.rb98
-rw-r--r--missing/strcasecmp.c1
-rw-r--r--missing/strncasecmp.c18
-rw-r--r--mkconfig.rb17
-rw-r--r--parse.c355
-rw-r--r--parse.y7
-rw-r--r--process.c7
-rw-r--r--range.c2
-rw-r--r--re.c35
-rw-r--r--regex.c79
-rw-r--r--regex.h6
-rw-r--r--rubyio.h11
-rw-r--r--sample/rename.rb4
-rw-r--r--string.c29
-rw-r--r--version.h2
-rw-r--r--win32/win32.h3
36 files changed, 1318 insertions, 893 deletions
diff --git a/ChangeLog b/ChangeLog
index 17669ef9b1..9f42364299 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,52 @@
+Thu May 6 13:21:41 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * array.c (rb_ary_indexes): should not use rb_ary_concat().
+
+Thu May 4 12:34:18 1999 Koji Arai <JCA02266@nifty.ne.jp>
+
+ * parse.y (parse_string): there shuould be newline escape by
+ backslashes in strings.
+
+ * parse.y (parse_qstring): ditto.
+
+Mon May 3 04:37:20 1999 Koji Arai <JCA02266@nifty.ne.jp>
+
+ * ext/tcltklib/extconf.rb: better search for libX11.
+
+ * range.c (range_s_new): embarrassing =/== typo.
+
+ * re.c (Init_Regexp): failed to set default kcode.
+
+Mon May 3 02:39:55 1999 WATANABE Tetsuya <tetsu@jpn.hp.com>
+
+ * ext/socket/socket.c (open_inet): typo (res and res0).
+
+Tue May 4 02:07:49 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * mkconfig.rb: leave undefined $(VARIABLE) unexpanded in the
+ Config::CONFIG hash table.
+
+Mon May 3 09:37:22 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * regex.c (re_compile_pattern): expand exactn{n} at compile time.
+ handles stop_paren specially.
+
+ * regex.c (re_compile_pattern): expand x{n} at compile time.
+
+ * regex.c (re_search): posix line match should be checked.
+
+ * regex.c (re_search): a bug in anchor condition.
+
+Fri Apr 30 18:57:41 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * string.c (rb_str_rindex): position should be END point, not
+ START point.
+
+ * re.c (rb_reg_search): pos means end point on reverse now.
+
+ * array.c (rb_ary_s_create): should clear ary->ptr to avoid
+ potential gc crash.
+
Fri Apr 30 15:24:58 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* ext/socket/addrinfo.h: compatibility hack for ipv4.
@@ -11,6 +60,10 @@ Fri Apr 30 15:24:58 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* lib/mkmf.rb (enable_config): ditto.
+Fri Apr 30 05:22:23 1999 Shugo Maeda <shugo@netlab.co.jp>
+
+ * string.c (rb_str_aset): last index should not append.
+
Thu Apr 29 18:55:31 1999 WATANABE Hirofumi <eban@os.rim.or.jp>
* dln.c (conv_to_posix_path): remove const from args.
@@ -23,6 +76,8 @@ Tue Apr 27 14:11:45 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* ext/extmk.rb.in: `--with-xxx=yyy' argument configuration.
+ * lib/mkmf.rb: ditto.
+
* misc/ruby-mode.el: forgot to handle $`.
* ext/extmk.rb.in: better AIX link support proposed by
diff --git a/MANIFEST b/MANIFEST
index 3fa09708fb..fde939ba12 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -79,9 +79,10 @@ version.h
beos/ruby.def.in
ext/Setup
ext/Setup.dj
+ext/Setup.emx
ext/Setup.nt
ext/Setup.x68
-ext/aix_ld.rb
+ext/aix_mksym.rb
ext/cygwin32_ld.rb
ext/extmk.rb.in
ext/extmk.rb.nt
diff --git a/array.c b/array.c
index 8cd516526b..426ef1b065 100644
--- a/array.c
+++ b/array.c
@@ -208,8 +208,7 @@ rb_ary_s_create(argc, argv, klass)
NEWOBJ(ary, struct RArray);
OBJSETUP(ary, klass, T_ARRAY);
- ary->len = argc;
- ary->capa = argc;
+ ary->len = ary->capa = 0;
if (argc == 0) {
ary->ptr = 0;
}
@@ -217,6 +216,7 @@ rb_ary_s_create(argc, argv, klass)
ary->ptr = ALLOC_N(VALUE, argc);
MEMCPY(ary->ptr, argv, VALUE, argc);
}
+ ary->len = ary->capa = argc;
return (VALUE)ary;
}
@@ -452,12 +452,7 @@ rb_ary_indexes(argc, argv, ary)
new_ary = rb_ary_new2(argc);
for (i=0; i<argc; i++) {
-#if 0
- rb_ary_store(new_ary, i, rb_ary_entry(ary, NUM2INT(argv[i])));
-#else
- VALUE v = argv[i];
- rb_ary_concat(new_ary, rb_ary_aref(1, &v, ary));
-#endif
+ rb_ary_push(new_ary, rb_ary_aref(1, argv+i, ary));
}
return new_ary;
diff --git a/configure b/configure
index a4761d6af1..22833f4a38 100644
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12
+# Generated automatically using autoconf version 2.13
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -61,6 +61,7 @@ mandir='${prefix}/man'
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
@@ -344,7 +345,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.12"
+ echo "configure generated by autoconf version 2.13"
exit 0 ;;
-with-* | --with-*)
@@ -514,9 +515,11 @@ ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
+ac_exeext=
+ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -581,26 +584,26 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# Make sure we can run config.sub.
-if $ac_config_sub sun4 >/dev/null 2>&1; then :
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:590: checking host system type" >&5
+echo "configure:593: checking host system type" >&5
host_alias=$host
case "$host_alias" in
NONE)
case $nonopt in
NONE)
- if host_alias=`$ac_config_guess`; then :
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
fi ;;
*) host_alias=$nonopt ;;
esac ;;
esac
-host=`$ac_config_sub $host_alias`
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
@@ -617,7 +620,7 @@ fi
if test "$fat_binary" = yes ; then
echo $ac_n "checking target architecture""... $ac_c" 1>&6
-echo "configure:621: checking target architecture" >&5
+echo "configure:624: checking target architecture" >&5
case "$host_os" in
rhapsody*)
@@ -682,15 +685,16 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:686: checking for $ac_word" >&5
+echo "configure:689: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="gcc"
@@ -711,16 +715,17 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:715: checking for $ac_word" >&5
+echo "configure:719: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_prog_rejected=no
- for ac_dir in $PATH; do
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -755,25 +760,61 @@ else
echo "$ac_t""no" 1>&6
fi
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:770: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:763: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:802: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
-cat > conftest.$ac_ext <<EOF
-#line 773 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 813 "configure"
#include "confdefs.h"
+
main(){return(0);}
EOF
-if { (eval echo configure:777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -787,18 +828,24 @@ else
ac_cv_prog_cc_works=no
fi
rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:797: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:844: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:802: checking whether we are using GNU C" >&5
+echo "configure:849: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -807,7 +854,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:811: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -818,11 +865,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
if test $ac_cv_prog_gcc = yes; then
GCC=yes
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:826: checking whether ${CC-cc} accepts -g" >&5
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:877: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -837,20 +888,24 @@ rm -f conftest*
fi
echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
- CFLAGS="-O2"
+ CFLAGS="-g"
fi
else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:854: checking how to run the C preprocessor" >&5
+echo "configure:909: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -865,14 +920,14 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 869 "configure"
+#line 924 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:875: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:930: \"$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
:
else
@@ -882,14 +937,31 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 886 "configure"
+#line 941 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:947: \"$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
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 958 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:964: \"$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
:
else
@@ -902,6 +974,8 @@ fi
rm -f conftest*
fi
rm -f conftest*
+fi
+rm -f conftest*
ac_cv_prog_CPP="$CPP"
fi
CPP="$ac_cv_prog_CPP"
@@ -912,13 +986,13 @@ echo "$ac_t""$CPP" 1>&6
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:916: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:990: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
-#line 922 "configure"
+#line 996 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@@ -936,7 +1010,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
-#line 940 "configure"
+#line 1014 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@@ -962,15 +1036,16 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:966: checking for $ac_word" >&5
+echo "configure:1040: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$YACC"; then
ac_cv_prog_YACC="$YACC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_YACC="$ac_prog"
@@ -994,15 +1069,16 @@ test -n "$YACC" || YACC="yacc"
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:998: checking for $ac_word" >&5
+echo "configure:1073: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_RANLIB="ranlib"
@@ -1026,15 +1102,16 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1030: checking for $ac_word" >&5
+echo "configure:1106: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$AR"; then
ac_cv_prog_AR="$AR" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_AR="$ac_prog"
@@ -1062,28 +1139,30 @@ test -n "$AR" || AR="ar"
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1070: checking for a BSD compatible install" >&5
+echo "configure:1148: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
case "$ac_dir/" in
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
if test -f $ac_dir/$ac_prog; then
if test $ac_prog = install &&
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
- # OSF/1 installbsd also uses dspmsg, but is usable.
:
else
ac_cv_path_install="$ac_dir/$ac_prog -c"
@@ -1113,10 +1192,12 @@ echo "$ac_t""$INSTALL" 1>&6
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1120: checking whether ln -s works" >&5
+echo "configure:1201: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1137,7 +1218,7 @@ else
fi
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1141: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1222: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1167,18 +1248,18 @@ fi
# 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:1171: checking for minix/config.h" >&5
+echo "configure:1252: 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 1176 "configure"
+#line 1257 "configure"
#include "confdefs.h"
#include <minix/config.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1262: \"$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*
eval "ac_cv_header_$ac_safe=yes"
@@ -1216,7 +1297,7 @@ fi
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:1220: checking size of int" >&5
+echo "configure:1301: 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
@@ -1224,7 +1305,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1228 "configure"
+#line 1309 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1235,7 +1316,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1320: \"$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
@@ -1255,7 +1336,7 @@ EOF
echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:1259: checking size of short" >&5
+echo "configure:1340: 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
@@ -1263,7 +1344,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1267 "configure"
+#line 1348 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1274,7 +1355,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1359: \"$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
@@ -1294,7 +1375,7 @@ EOF
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:1298: checking size of long" >&5
+echo "configure:1379: 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
@@ -1302,7 +1383,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1306 "configure"
+#line 1387 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1313,7 +1394,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1398: \"$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
@@ -1333,7 +1414,7 @@ EOF
echo $ac_n "checking size of void*""... $ac_c" 1>&6
-echo "configure:1337: checking size of void*" >&5
+echo "configure:1418: 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
@@ -1341,7 +1422,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1345 "configure"
+#line 1426 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1352,7 +1433,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1437: \"$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
@@ -1372,7 +1453,7 @@ EOF
echo $ac_n "checking size of float""... $ac_c" 1>&6
-echo "configure:1376: checking size of float" >&5
+echo "configure:1457: 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
@@ -1380,7 +1461,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1384 "configure"
+#line 1465 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1391,7 +1472,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1476: \"$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
@@ -1411,7 +1492,7 @@ EOF
echo $ac_n "checking size of double""... $ac_c" 1>&6
-echo "configure:1415: checking size of double" >&5
+echo "configure:1496: 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
@@ -1419,7 +1500,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1423 "configure"
+#line 1504 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1430,7 +1511,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1515: \"$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
@@ -1451,19 +1532,19 @@ EOF
echo $ac_n "checking for prototypes""... $ac_c" 1>&6
-echo "configure:1455: checking for prototypes" >&5
+echo "configure:1536: 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 1460 "configure"
+#line 1541 "configure"
#include "confdefs.h"
int foo(int x) { return 0; }
int main() {
return foo(10);
; return 0; }
EOF
-if { (eval echo configure:1467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_have_prototypes=yes
else
@@ -1484,19 +1565,19 @@ EOF
fi
echo $ac_n "checking token paste string""... $ac_c" 1>&6
-echo "configure:1488: checking token paste string" >&5
+echo "configure:1569: 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 1493 "configure"
+#line 1574 "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:1500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_tokenpaste=ansi
else
@@ -1522,12 +1603,12 @@ EOF
fi
echo $ac_n "checking for variable length prototypes and stdarg.h""... $ac_c" 1>&6
-echo "configure:1526: checking for variable length prototypes and stdarg.h" >&5
+echo "configure:1607: 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 1531 "configure"
+#line 1612 "configure"
#include "confdefs.h"
#include <stdarg.h>
@@ -1544,7 +1625,7 @@ int main() {
return foo(10, "", 3.14);
; return 0; }
EOF
-if { (eval echo configure:1548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_stdarg=yes
else
@@ -1565,19 +1646,19 @@ EOF
fi
echo $ac_n "checking for gcc attribute noreturn""... $ac_c" 1>&6
-echo "configure:1569: checking for gcc attribute noreturn" >&5
+echo "configure:1650: 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 1574 "configure"
+#line 1655 "configure"
#include "confdefs.h"
void exit(int x) __attribute__ ((noreturn));
int main() {
; return 0; }
EOF
-if { (eval echo configure:1581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_have_attr_noreturn=yes
else
@@ -1606,7 +1687,7 @@ beos*) ;;
*) LIBS="-lm $LIBS";;
esac
echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:1610: checking for crypt in -lcrypt" >&5
+echo "configure:1691: 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
@@ -1614,7 +1695,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcrypt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1618 "configure"
+#line 1699 "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
@@ -1625,7 +1706,7 @@ int main() {
crypt()
; return 0; }
EOF
-if { (eval echo configure:1629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1710: \"$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
@@ -1653,7 +1734,7 @@ else
fi
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:1657: checking for dlopen in -ldl" >&5
+echo "configure:1738: 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
@@ -1661,7 +1742,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1665 "configure"
+#line 1746 "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
@@ -1672,7 +1753,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:1676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1757: \"$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
@@ -1700,7 +1781,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:1704: checking for shl_load in -ldld" >&5
+echo "configure:1785: 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
@@ -1708,7 +1789,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1712 "configure"
+#line 1793 "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
@@ -1719,7 +1800,7 @@ int main() {
shl_load()
; return 0; }
EOF
-if { (eval echo configure:1723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1804: \"$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
@@ -1747,7 +1828,7 @@ else
fi
# Dynamic linking for HP-UX
echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6
-echo "configure:1751: checking for setlocale in -lxpg4" >&5
+echo "configure:1832: 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
@@ -1755,7 +1836,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lxpg4 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1759 "configure"
+#line 1840 "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
@@ -1766,7 +1847,7 @@ int main() {
setlocale()
; return 0; }
EOF
-if { (eval echo configure:1770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1851: \"$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
@@ -1799,12 +1880,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:1803: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1884: 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 1808 "configure"
+#line 1889 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -1812,7 +1893,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:1816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -1837,7 +1918,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:1841: checking for opendir in -ldir" >&5
+echo "configure:1922: 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
@@ -1845,7 +1926,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1849 "configure"
+#line 1930 "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
@@ -1856,7 +1937,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:1860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1941: \"$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
@@ -1878,7 +1959,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1882: checking for opendir in -lx" >&5
+echo "configure:1963: 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
@@ -1886,7 +1967,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1890 "configure"
+#line 1971 "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
@@ -1897,7 +1978,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:1901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1982: \"$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
@@ -1920,12 +2001,12 @@ fi
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1924: checking for ANSI C header files" >&5
+echo "configure:2005: 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 1929 "configure"
+#line 2010 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1933,8 +2014,8 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1937: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2018: \"$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*
ac_cv_header_stdc=yes
@@ -1950,7 +2031,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 1954 "configure"
+#line 2035 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1968,7 +2049,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 1972 "configure"
+#line 2053 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1989,7 +2070,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1993 "configure"
+#line 2074 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2000,7 +2081,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2029,18 +2110,18 @@ for ac_hdr in stdlib.h unistd.h limits.h sys/file.h sys/ioctl.h pwd.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2033: checking for $ac_hdr" >&5
+echo "configure:2114: 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 2038 "configure"
+#line 2119 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2124: \"$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*
eval "ac_cv_header_$ac_safe=yes"
@@ -2067,12 +2148,12 @@ done
echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2071: checking for uid_t in sys/types.h" >&5
+echo "configure:2152: 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 2076 "configure"
+#line 2157 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -2101,12 +2182,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2105: checking for size_t" >&5
+echo "configure:2186: 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 2110 "configure"
+#line 2191 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2115,7 +2196,7 @@ else
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_size_t=yes
else
@@ -2134,12 +2215,12 @@ EOF
fi
echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:2138: checking for st_blksize in struct stat" >&5
+echo "configure:2219: 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 2143 "configure"
+#line 2224 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -2147,7 +2228,7 @@ int main() {
struct stat s; s.st_blksize;
; return 0; }
EOF
-if { (eval echo configure:2151: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blksize=yes
else
@@ -2169,12 +2250,12 @@ fi
save_LIBOJBS="$LIBOBJS"
echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:2173: checking for st_blocks in struct stat" >&5
+echo "configure:2254: 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 2178 "configure"
+#line 2259 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -2182,7 +2263,7 @@ int main() {
struct stat s; s.st_blocks;
; return 0; }
EOF
-if { (eval echo configure:2186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blocks=yes
else
@@ -2201,17 +2282,17 @@ if test $ac_cv_struct_st_blocks = yes; then
EOF
else
- LIBOBJS="$LIBOBJS fileblocks.o"
+ LIBOBJS="$LIBOBJS fileblocks.${ac_objext}"
fi
LIBOBJS="$save_LIBOBJS"
echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
-echo "configure:2210: checking for st_rdev in struct stat" >&5
+echo "configure:2291: 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 2215 "configure"
+#line 2296 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -2219,7 +2300,7 @@ int main() {
struct stat s; s.st_rdev;
; return 0; }
EOF
-if { (eval echo configure:2223: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_rdev=yes
else
@@ -2241,7 +2322,7 @@ fi
echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:2245: checking type of array argument to getgroups" >&5
+echo "configure:2326: 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
@@ -2249,7 +2330,7 @@ else
ac_cv_type_getgroups=cross
else
cat > conftest.$ac_ext <<EOF
-#line 2253 "configure"
+#line 2334 "configure"
#include "confdefs.h"
/* Thanks to Mike Rendell for this test. */
@@ -2274,7 +2355,7 @@ main()
}
EOF
-if { (eval echo configure:2278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2359: \"$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
@@ -2288,7 +2369,7 @@ fi
if test $ac_cv_type_getgroups = cross; then
cat > conftest.$ac_ext <<EOF
-#line 2292 "configure"
+#line 2373 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -2312,12 +2393,12 @@ EOF
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2316: checking return type of signal handlers" >&5
+echo "configure:2397: 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 2321 "configure"
+#line 2402 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -2334,7 +2415,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:2338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -2355,19 +2436,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:2359: checking for working alloca.h" >&5
+echo "configure:2440: 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 2364 "configure"
+#line 2445 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:2371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2452: \"$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
@@ -2388,25 +2469,30 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2392: checking for alloca" >&5
+echo "configure:2473: 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 2397 "configure"
+#line 2478 "configure"
#include "confdefs.h"
#ifdef __GNUC__
# define alloca __builtin_alloca
#else
-# if HAVE_ALLOCA_H
-# include <alloca.h>
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
# else
-# ifdef _AIX
- #pragma alloca
+# if HAVE_ALLOCA_H
+# include <alloca.h>
# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
+# endif
# endif
# endif
# endif
@@ -2416,7 +2502,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:2420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2506: \"$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
@@ -2441,19 +2527,19 @@ if test $ac_cv_func_alloca_works = no; then
# that cause trouble. Some versions do not even contain alloca or
# contain a buggy version. If you still want to use their alloca,
# use ar to extract alloca.o from them instead of compiling alloca.c.
- ALLOCA=alloca.o
+ ALLOCA=alloca.${ac_objext}
cat >> confdefs.h <<\EOF
#define C_ALLOCA 1
EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2452: checking whether alloca needs Cray hooks" >&5
+echo "configure:2538: 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 2457 "configure"
+#line 2543 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -2478,12 +2564,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:2482: checking for $ac_func" >&5
+echo "configure:2568: 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 2487 "configure"
+#line 2573 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2506,7 +2592,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2596: \"$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
@@ -2533,7 +2619,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2537: checking stack direction for C alloca" >&5
+echo "configure:2623: 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
@@ -2541,7 +2627,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 2545 "configure"
+#line 2631 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -2560,7 +2646,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:2564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2650: \"$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
@@ -2582,12 +2668,12 @@ EOF
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:2586: checking for pid_t" >&5
+echo "configure:2672: 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 2591 "configure"
+#line 2677 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2596,7 +2682,7 @@ else
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_pid_t=yes
else
@@ -2616,18 +2702,18 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:2620: checking for vfork.h" >&5
+echo "configure:2706: 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 2625 "configure"
+#line 2711 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2630: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2716: \"$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*
eval "ac_cv_header_$ac_safe=yes"
@@ -2651,18 +2737,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:2655: checking for working vfork" >&5
+echo "configure:2741: 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:2661: checking for vfork" >&5
+echo "configure:2747: 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 2666 "configure"
+#line 2752 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -2685,7 +2771,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:2689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2775: \"$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
@@ -2704,9 +2790,10 @@ else
echo "$ac_t""no" 1>&6
fi
+ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 2710 "configure"
+#line 2797 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -2801,7 +2888,7 @@ main() {
}
}
EOF
-if { (eval echo configure:2805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2892: \"$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
@@ -2824,7 +2911,7 @@ EOF
fi
echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:2828: checking for 8-bit clean memcmp" >&5
+echo "configure:2915: 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
@@ -2832,7 +2919,7 @@ else
ac_cv_func_memcmp_clean=no
else
cat > conftest.$ac_ext <<EOF
-#line 2836 "configure"
+#line 2923 "configure"
#include "confdefs.h"
main()
@@ -2842,7 +2929,7 @@ main()
}
EOF
-if { (eval echo configure:2846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2933: \"$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
@@ -2857,19 +2944,19 @@ fi
fi
echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
-test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
+test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
-for ac_func in dup2 memmove mkdir strcasecmp strerror strftime\
+for ac_func in dup2 memmove mkdir strcasecmp strncasecmp strerror strftime\
strchr strstr strtoul strdup crypt flock vsnprintf\
fnmatch isinf isnan finite
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2868: checking for $ac_func" >&5
+echo "configure:2955: 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 2873 "configure"
+#line 2960 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2892,7 +2979,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2983: \"$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
@@ -2913,7 +3000,7 @@ EOF
else
echo "$ac_t""no" 1>&6
-LIBOBJS="$LIBOBJS ${ac_func}.o"
+LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
fi
done
@@ -2925,12 +3012,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:2929: checking for $ac_func" >&5
+echo "configure:3016: 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 2934 "configure"
+#line 3021 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2953,7 +3040,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3044: \"$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
@@ -2978,12 +3065,12 @@ fi
done
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:2982: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:3069: 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 2987 "configure"
+#line 3074 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -2991,7 +3078,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:2995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@@ -3012,12 +3099,12 @@ EOF
fi
echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:3016: checking for tm_zone in struct tm" >&5
+echo "configure:3103: 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 3021 "configure"
+#line 3108 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
@@ -3025,7 +3112,7 @@ int main() {
struct tm tm; tm.tm_zone;
; return 0; }
EOF
-if { (eval echo configure:3029: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3116: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm_zone=yes
else
@@ -3045,12 +3132,12 @@ EOF
else
echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:3049: checking for tzname" >&5
+echo "configure:3136: 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 3054 "configure"
+#line 3141 "configure"
#include "confdefs.h"
#include <time.h>
#ifndef tzname /* For SGI. */
@@ -3060,7 +3147,7 @@ int main() {
atoi(*tzname);
; return 0; }
EOF
-if { (eval echo configure:3064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_var_tzname=yes
else
@@ -3083,14 +3170,14 @@ fi
if test "$ac_cv_func_strftime" = no; then
cat > conftest.$ac_ext <<EOF
-#line 3087 "configure"
+#line 3174 "configure"
#include "confdefs.h"
int main() {
extern int daylight; int i = daylight;
; return 0; }
EOF
-if { (eval echo configure:3094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3181: \"$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
@@ -3110,7 +3197,7 @@ EOF
else
echo $ac_n "checking for BSD signal semantics""... $ac_c" 1>&6
-echo "configure:3114: checking for BSD signal semantics" >&5
+echo "configure:3201: 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
@@ -3118,7 +3205,7 @@ else
rb_cv_bsd_signal=no
else
cat > conftest.$ac_ext <<EOF
-#line 3122 "configure"
+#line 3209 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3140,7 +3227,7 @@ main()
}
EOF
-if { (eval echo configure:3144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3231: \"$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
@@ -3164,7 +3251,7 @@ EOF
fi
echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:3168: checking whether getpgrp takes no argument" >&5
+echo "configure:3255: 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
@@ -3172,7 +3259,7 @@ else
{ echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3176 "configure"
+#line 3263 "configure"
#include "confdefs.h"
/*
@@ -3227,7 +3314,7 @@ main()
}
EOF
-if { (eval echo configure:3231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3318: \"$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
@@ -3251,7 +3338,7 @@ EOF
fi
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:3255: checking whether setpgrp takes no argument" >&5
+echo "configure:3342: 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
@@ -3259,9 +3346,13 @@ else
{ echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3263 "configure"
+#line 3350 "configure"
#include "confdefs.h"
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
/*
* If this system has a BSD-style setpgrp, which takes arguments, exit
* successfully.
@@ -3275,7 +3366,7 @@ main()
}
EOF
-if { (eval echo configure:3279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3370: \"$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
@@ -3300,7 +3391,7 @@ fi
echo $ac_n "checking for working strtod""... $ac_c" 1>&6
-echo "configure:3304: checking for working strtod" >&5
+echo "configure:3395: 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
@@ -3308,7 +3399,7 @@ else
rb_cv_func_strtod=no
else
cat > conftest.$ac_ext <<EOF
-#line 3312 "configure"
+#line 3403 "configure"
#include "confdefs.h"
double strtod ();
@@ -3338,7 +3429,7 @@ main()
}
EOF
-if { (eval echo configure:3342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3433: \"$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
@@ -3356,14 +3447,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:3360: checking whether byte ordering is bigendian" >&5
+echo "configure:3451: 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 3367 "configure"
+#line 3458 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3374,11 +3465,11 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3469: \"$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 3382 "configure"
+#line 3473 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3389,7 +3480,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -3409,7 +3500,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 3413 "configure"
+#line 3504 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -3422,7 +3513,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:3426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3517: \"$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
@@ -3446,12 +3537,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3450: checking for working const" >&5
+echo "configure:3541: 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 3455 "configure"
+#line 3546 "configure"
#include "confdefs.h"
int main() {
@@ -3500,7 +3591,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:3504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -3521,14 +3612,14 @@ EOF
fi
echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
-echo "configure:3525: checking whether char is unsigned" >&5
+echo "configure:3616: 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 3532 "configure"
+#line 3623 "configure"
#include "confdefs.h"
#ifdef __CHAR_UNSIGNED__
yes
@@ -3550,7 +3641,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 3554 "configure"
+#line 3645 "configure"
#include "confdefs.h"
/* volatile prevents gcc2 from optimizing the test away on sparcs. */
#if !defined(__STDC__) || __STDC__ != 1
@@ -3560,7 +3651,7 @@ main() {
volatile char c = 255; exit(c < 0);
}
EOF
-if { (eval echo configure:3564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3655: \"$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
@@ -3585,7 +3676,7 @@ fi
echo $ac_n "checking whether right shift preserve sign bit""... $ac_c" 1>&6
-echo "configure:3589: checking whether right shift preserve sign bit" >&5
+echo "configure:3680: 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
@@ -3593,7 +3684,7 @@ else
rb_cv_rshift_sign=yes
else
cat > conftest.$ac_ext <<EOF
-#line 3597 "configure"
+#line 3688 "configure"
#include "confdefs.h"
int
@@ -3605,7 +3696,7 @@ main()
}
EOF
-if { (eval echo configure:3609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3700: \"$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
@@ -3633,19 +3724,19 @@ EOF
fi
echo $ac_n "checking count field in FILE structures""... $ac_c" 1>&6
-echo "configure:3637: checking count field in FILE structures" >&5
+echo "configure:3728: 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 3642 "configure"
+#line 3733 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_cnt = 0;
; return 0; }
EOF
-if { (eval echo configure:3649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="_cnt"
else
@@ -3655,14 +3746,14 @@ fi
rm -f conftest*
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3659 "configure"
+#line 3750 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->__cnt = 0;
; return 0; }
EOF
-if { (eval echo configure:3666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="__cnt"
else
@@ -3673,14 +3764,14 @@ rm -f conftest*
fi
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3677 "configure"
+#line 3768 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_r = 0;
; return 0; }
EOF
-if { (eval echo configure:3684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="_r"
else
@@ -3691,14 +3782,14 @@ rm -f conftest*
fi
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3695 "configure"
+#line 3786 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->readCount = 0;
; return 0; }
EOF
-if { (eval echo configure:3702: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="readCount"
else
@@ -3709,14 +3800,14 @@ rm -f conftest*
fi
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3713 "configure"
+#line 3804 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_rcount = 0;
; return 0; }
EOF
-if { (eval echo configure:3720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="_rcount"
else
@@ -3782,7 +3873,7 @@ fi
case "$host_os" in
linux*)
echo $ac_n "checking whether ELF binaries are produced""... $ac_c" 1>&6
-echo "configure:3786: checking whether ELF binaries are produced" >&5
+echo "configure:3877: checking whether ELF binaries are produced" >&5
if eval "test \"`echo '$''{'rb_cv_binary_elf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3790,7 +3881,7 @@ else
rb_cv_binary_elf=yes
else
cat > conftest.$ac_ext <<EOF
-#line 3794 "configure"
+#line 3885 "configure"
#include "confdefs.h"
/* Test for whether ELF binaries are produced */
@@ -3810,7 +3901,7 @@ main() {
}
EOF
-if { (eval echo configure:3814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_binary_elf=yes
else
@@ -3840,7 +3931,7 @@ STATIC=
if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=unknown
echo $ac_n "checking whether OS depend dynamic link works""... $ac_c" 1>&6
-echo "configure:3844: checking whether OS depend dynamic link works" >&5
+echo "configure:3935: checking whether OS depend dynamic link works" >&5
if test "$GCC" = yes; then
case "$host_os" in
nextstep*) ;;
@@ -3950,12 +4041,12 @@ if test "$ac_cv_header_a_out_h" = yes; then
if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then
cat confdefs.h > config.h
echo $ac_n "checking whether matz's dln works""... $ac_c" 1>&6
-echo "configure:3954: checking whether matz's dln works" >&5
+echo "configure:4045: checking whether matz's dln works" >&5
if eval "test \"`echo '$''{'rb_cv_dln_a_out'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3959 "configure"
+#line 4050 "configure"
#include "confdefs.h"
#define USE_DLN_A_OUT
@@ -3965,7 +4056,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:3969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4060: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_dln_a_out=yes
else
@@ -4072,7 +4163,7 @@ fi
case "$host_os" in
human*)
echo $ac_n "checking for _harderr in -lsignal""... $ac_c" 1>&6
-echo "configure:4076: checking for _harderr in -lsignal" >&5
+echo "configure:4167: checking for _harderr in -lsignal" >&5
ac_lib_var=`echo signal'_'_harderr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4080,7 +4171,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsignal $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4084 "configure"
+#line 4175 "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
@@ -4091,7 +4182,7 @@ int main() {
_harderr()
; return 0; }
EOF
-if { (eval echo configure:4095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4186: \"$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
@@ -4119,7 +4210,7 @@ else
fi
echo $ac_n "checking for hmemset in -lhmem""... $ac_c" 1>&6
-echo "configure:4123: checking for hmemset in -lhmem" >&5
+echo "configure:4214: checking for hmemset in -lhmem" >&5
ac_lib_var=`echo hmem'_'hmemset | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4127,7 +4218,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lhmem $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4131 "configure"
+#line 4222 "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
@@ -4138,7 +4229,7 @@ int main() {
hmemset()
; return 0; }
EOF
-if { (eval echo configure:4142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4233: \"$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
@@ -4168,12 +4259,12 @@ fi
for ac_func in select
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4172: checking for $ac_func" >&5
+echo "configure:4263: 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 4177 "configure"
+#line 4268 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4196,7 +4287,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4291: \"$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
@@ -4221,7 +4312,7 @@ fi
done
echo $ac_n "checking whether PD libc _dtos18 fail to convert big number""... $ac_c" 1>&6
-echo "configure:4225: checking whether PD libc _dtos18 fail to convert big number" >&5
+echo "configure:4316: checking whether PD libc _dtos18 fail to convert big number" >&5
if eval "test \"`echo '$''{'rb_cv_missing__dtos18'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4229,7 +4320,7 @@ else
rb_cv_missing__dtos18=no
else
cat > conftest.$ac_ext <<EOF
-#line 4233 "configure"
+#line 4324 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4241,7 +4332,7 @@ main ()
}
EOF
-if { (eval echo configure:4245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_missing__dtos18=yes
else
@@ -4263,7 +4354,7 @@ EOF
fi
echo $ac_n "checking whether PD libc fconvert fail to round""... $ac_c" 1>&6
-echo "configure:4267: checking whether PD libc fconvert fail to round" >&5
+echo "configure:4358: checking whether PD libc fconvert fail to round" >&5
if eval "test \"`echo '$''{'rb_cv_missing_fconvert'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4271,7 +4362,7 @@ else
rb_cv_missing_fconvert=no
else
cat > conftest.$ac_ext <<EOF
-#line 4275 "configure"
+#line 4366 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4284,7 +4375,7 @@ main ()
}
EOF
-if { (eval echo configure:4288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_missing_fconvert=yes
else
@@ -4496,7 +4587,7 @@ EOF
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- case `(ac_space=' '; set) 2>&1` in
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
@@ -4575,7 +4666,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.12"
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -4595,9 +4686,11 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
+s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
@@ -4630,6 +4723,7 @@ s%@YACC@%$YACC%g
s%@RANLIB@%$RANLIB%g
s%@AR@%$AR%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@LN_S@%$LN_S%g
s%@SET_MAKE@%$SET_MAKE%g
diff --git a/configure.in b/configure.in
index d81032660e..f3bf12b974 100644
--- a/configure.in
+++ b/configure.in
@@ -177,7 +177,7 @@ AC_TYPE_SIGNAL
AC_FUNC_ALLOCA
AC_FUNC_VFORK
AC_FUNC_MEMCMP
-AC_REPLACE_FUNCS(dup2 memmove mkdir strcasecmp strerror strftime\
+AC_REPLACE_FUNCS(dup2 memmove mkdir strcasecmp strncasecmp strerror strftime\
strchr strstr strtoul strdup crypt flock vsnprintf\
fnmatch isinf isnan finite)
AC_CHECK_FUNCS(fmod killpg drand48 random wait4 waitpid syscall getcwd\
diff --git a/error.c b/error.c
index 2d76a625e4..0b51d7c608 100644
--- a/error.c
+++ b/error.c
@@ -514,7 +514,6 @@ Init_Exception()
rb_eSystemExit = rb_define_class("SystemExit", rb_eException);
rb_eFatal = rb_define_class("fatal", rb_eException);
rb_eInterrupt = rb_define_class("Interrupt", rb_eException);
- rb_eInterrupt = rb_define_class("Interrupt", rb_eException);
rb_eSignal = rb_define_class("SignalException", rb_eException);
rb_eStandardError = rb_define_class("StandardError", rb_eException);
diff --git a/ext/Setup b/ext/Setup
index 9e3a2474c3..6373af370d 100644
--- a/ext/Setup
+++ b/ext/Setup
@@ -7,6 +7,7 @@
#fcntl
#kconv
#md5
+#pty
#socket
#tkutil
#tcltklib
diff --git a/ext/curses/curses.c b/ext/curses/curses.c
index 49fa07bd5c..5a515275bc 100644
--- a/ext/curses/curses.c
+++ b/ext/curses/curses.c
@@ -10,10 +10,11 @@
#else
# ifdef HAVE_NCURSES_CURSES_H
# include <ncurses/curses.h>
-# else
-#ifdef __hpux
-#include <curses_colr/curses.h>
#else
+# ifdef HAVE_CURSES_COLR_CURSES_H
+# include <varargs.h>
+# include <curses_colr/curses.h>
+# else
# include <curses.h>
# if (defined(__bsdi__) || defined(__NetBSD__)) && !defined(_maxx)
# define _maxx maxx
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index 19e94a8ae3..32e9bb2b2b 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -1,6 +1,6 @@
#! /usr/local/bin/ruby
-$".push 'mkmf.rb' #"
+$".push 'mkmf.rb'
if ARGV[0] == 'static'
$force_static = TRUE
@@ -25,11 +25,8 @@ if $top_srcdir !~ "^/"
# get absolute path
$top_srcdir = File.expand_path($top_srcdir)
end
-$topdir = ".."
-if $topdir !~ "^/"
- # get absolute path
- $topdir = File.expand_path($topdir)
-end
+# get absolute path
+$topdir = File.expand_path("..")
$ruby_inc = $top_srcdir
load "#{$top_srcdir}/lib/find.rb"
@@ -58,15 +55,15 @@ end
def older(file1, file2)
if !File.exist?(file1) then
- return TRUE
+ return true
end
if !File.exist?(file2) then
- return FALSE
+ return false
end
if File.mtime(file1) < File.mtime(file2)
- return TRUE
+ return true
end
- return FALSE
+ return false
end
if PLATFORM == "m68k-human"
@@ -97,12 +94,18 @@ def xsystem command
return r
end
-def try_link(src, opt="")
+def try_link0(src, opt="")
cfile = open("conftest.c", "w")
cfile.print src
cfile.close
+ xsystem(format(LINK, $CFLAGS, $LDFLAGS, opt))
+end
+
+def try_link(src, opt="")
begin
- xsystem(format(LINK, $CFLAGS, $LDFLAGS, opt))
+ try_link0(src, opt)
+ ensure
+ system "rm -f conftest*"
end
end
@@ -110,19 +113,27 @@ def try_cpp(src, opt=$CFLAGS)
cfile = open("conftest.c", "w")
cfile.print src
cfile.close
- xsystem(format(CPP, opt))
+ begin
+ xsystem(format(CPP, opt))
+ ensure
+ system "rm -f conftest*"
+ end
end
def egrep_cpp(pat, src, opt=$CFLAGS)
cfile = open("conftest.c", "w")
cfile.print src
cfile.close
- xsystem(format(CPP+"|egrep #{pat}", opt))
+ begin
+ xsystem(format(CPP+"|egrep #{pat}", opt))
+ ensure
+ system "rm -f conftest*"
+ end
end
def try_run(src, opt="")
begin
- if try_link(src, opt)
+ if try_link0(src, opt)
if xsystem("./conftest")
true
else
@@ -131,6 +142,8 @@ def try_run(src, opt="")
else
nil
end
+ ensure
+ system "rm -f conftest*"
end
end
@@ -160,9 +173,9 @@ def have_library(lib, func="main")
else
$libs = "-l" + lib
end
- return TRUE
+ return true
else
- return FALSE
+ return false
end
end
@@ -177,8 +190,8 @@ int main() { return 0; }
int t() { #{func}(); return 0; }
SRC
$lib_cache[lib] = 'no'
- $cache_mod = TRUE
- return FALSE
+ $cache_mod = true
+ return false
end
else
if $libs
@@ -190,17 +203,17 @@ SRC
$libs = libs
$lib_cache[lib] = 'yes'
- $cache_mod = TRUE
- return TRUE
+ $cache_mod = true
+ return true
end
def have_func(func)
if $func_cache[func]
if $func_cache[func] == "yes"
$defs.push(format("-DHAVE_%s", func.upcase))
- return TRUE
+ return true
else
- return FALSE
+ return false
end
end
@@ -213,13 +226,13 @@ int main() { return 0; }
int t() { #{func}(); return 0; }
SRC
$func_cache[func] = 'no'
- $cache_mod = TRUE
- return FALSE
+ $cache_mod = true
+ return false
end
$defs.push(format("-DHAVE_%s", func.upcase))
$func_cache[func] = 'yes'
- $cache_mod = TRUE
- return TRUE
+ $cache_mod = true
+ return true
end
def have_header(header)
@@ -227,9 +240,9 @@ def have_header(header)
if $hdr_cache[header] == "yes"
header.tr!("a-z./\055", "A-Z___")
$defs.push(format("-DHAVE_%s", header))
- return TRUE
+ return true
else
- return FALSE
+ return false
end
end
@@ -237,14 +250,14 @@ def have_header(header)
#include <#{header}>
SRC
$hdr_cache[header] = 'no'
- $cache_mod = TRUE
- return FALSE
+ $cache_mod = true
+ return false
end
$hdr_cache[header] = 'yes'
header.tr!("a-z./\055", "A-Z___")
$defs.push(format("-DHAVE_%s", header))
- $cache_mod = TRUE
- return TRUE
+ $cache_mod = true
+ return true
end
def arg_config(config, default=nil)
@@ -291,7 +304,7 @@ def create_header()
end
def create_makefile(target)
-
+ system "rm -f conftest*"
if $libs and "@DLEXT@" == "o"
libs = $libs.split
for lib in libs
diff --git a/ext/extmk.rb.nt b/ext/extmk.rb.nt
index dd979a45a3..1b7c88f5dd 100644
--- a/ext/extmk.rb.nt
+++ b/ext/extmk.rb.nt
@@ -1,12 +1,13 @@
#! /usr/local/bin/ruby
-$".push 'mkmf.rb' #"
+$".push 'mkmf.rb'
if ARGV[0] == 'static'
$force_static = TRUE
ARGV.shift
elsif ARGV[0] == 'install'
$install = TRUE
+ $destdir = ARGV[1] || ''
ARGV.shift
elsif ARGV[0] == 'clean'
$clean = TRUE
@@ -19,15 +20,22 @@ $cache_mod = FALSE;
$lib_cache = {}
$func_cache = {}
$hdr_cache = {}
+$top_srcdir = ".."
+if $top_srcdir !~ "^/"
+ # get absolute path
+ $top_srcdir = File.expand_path($top_srcdir)
+end
+$topdir = File.expand_path("..")
+$topdir = File.expand_path($topdir)
+$ruby_inc = $top_srcdir
-#$dllopt = '-MD'
-$dllopt = ''
+load "#{$top_srcdir}/lib/find.rb"
if File.exist?("config.cache") then
f = open("config.cache", "r")
while f.gets
case $_
- when /^lib: ([\w_]+) (yes|no)/
+ when /^lib: (.+) (yes|no)/
$lib_cache[$1] = $2
when /^func: ([\w_]+) (yes|no)/
$func_cache[$1] = $2
@@ -40,40 +48,98 @@ end
def older(file1, file2)
if !File.exist?(file1) then
- return TRUE
+ return true
end
if !File.exist?(file2) then
- return FALSE
+ return false
end
if File.mtime(file1) < File.mtime(file2)
- return TRUE
+ return true
+ end
+ return false
+end
+
+CFLAGS = "-g -O2"
+LINK = "gcc -o conftest -I#$topdir -I#$top_srcdir -I${prefix}/include #{CFLAGS} %s %s conftest.c -ldl -lcrypt -lm %s"
+CPP = "gcc -E -I#$topdir -I#$top_srcdir -I${prefix}/include #{CFLAGS} %s conftest.c"
+
+$null = open("nul", "w")
+$orgerr = $stderr.dup
+$orgout = $stdout.dup
+def xsystem command
+ if $DEBUG
+ return system(command)
end
- return FALSE
+ $stderr.reopen($null)
+ $stdout.reopen($null)
+ r = system(command)
+ $stderr.reopen($orgerr)
+ $stdout.reopen($orgout)
+ return r
end
-#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 > nul"
-CPP = "cl -E -I../.. -I../../missing -I../../win32 -I. -Zi -O %s conftest.c > nul"
+def try_link(src, opt="")
+ cfile = open("conftest.c", "w")
+ cfile.print src
+ cfile.close
+ begin
+ xsystem(format(LINK, $CFLAGS, $LDFLAGS, opt))
+ end
+end
-def try_link(libs)
- #print(format("try #{LINK}", $CFLAGS, $LDFLAGS, libs))
- #system(format(LINK, $CFLAGS, $LDFLAGS, libs))
- print(format("try #{LINK}\n", $CFLAGS, libs))
- system(format(LINK, $CFLAGS, libs))
+def try_cpp(src, opt=$CFLAGS)
+ cfile = open("conftest.c", "w")
+ cfile.print src
+ cfile.close
+ xsystem(format(CPP, opt))
end
-def try_cpp
- system(format(CPP, $CFLAGS))
+def egrep_cpp(pat, src, opt=$CFLAGS)
+ cfile = open("conftest.c", "w")
+ cfile.print src
+ cfile.close
+ xsystem(format(CPP+"|egrep #{pat}", opt))
end
-def have_library(lib, func)
- #print format("have_library(%s, %s)\n", lib, func)
+def try_run(src, opt="")
+ begin
+ if try_link(src, opt)
+ if xsystem("./conftest")
+ true
+ else
+ false
+ end
+ else
+ nil
+ end
+ end
+end
+
+def install_rb(mfile)
+ path = []
+ dir = []
+ Find.find("lib") do |f|
+ next unless /\.rb$/ =~ f
+ f = f[4..-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
+ end
+ for f in path
+ mfile.printf "\t$(INSTALL_DATA) lib/%s $(DESTDIR)$(pkglibdir)/%s\n", f, f
+ end
+end
+
+def have_library(lib, func="main")
if $lib_cache[lib]
if $lib_cache[lib] == "yes"
- if $libs#
- $libs = lib + ".lib " + $libs
+ if $libs
+ $libs = "-l" + lib + " " + $libs
else
- $libs = lib + ".lib "
+ $libs = "-l" + lib
end
return TRUE
else
@@ -81,30 +147,26 @@ def have_library(lib, func)
end
end
- cfile = open("conftest.c", "w")
- cfile.printf "\
-#include <windows.h>
-#include <winsock.h>
-int main() { return 0; }
-int t() { %s(); return 0; }
-", func
- cfile.close
-
- begin
+ if func && func != ""
if $libs
- libs = lib + ".lib " + $libs
+ libs = "-l" + lib + " " + $libs
else
- libs = lib + ".lib"
+ libs = "-l" + lib
end
- #print "libs=#{libs}\n"
- unless try_link(libs)
- #print "fail : #{libs}\n"
+ unless try_link(<<"SRC", libs)
+int main() { return 0; }
+int t() { #{func}(); return 0; }
+SRC
$lib_cache[lib] = 'no'
$cache_mod = TRUE
return FALSE
end
- ensure
- system "rm -f conftest*"
+ else
+ if $libs
+ libs = "-l" + lib + " " + $libs
+ else
+ libs = "-l" + lib
+ end
end
$libs = libs
@@ -123,28 +185,17 @@ def have_func(func)
end
end
- cfile = open("conftest.c", "w")
- cfile.printf "\
-#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*"
+ unless try_link(<<"SRC", libs)
+char #{func}();
+int main() { return 0; }
+int t() { #{func}(); return 0; }
+SRC
+ $func_cache[func] = 'no'
+ $cache_mod = TRUE
+ return FALSE
end
$defs.push(format("-DHAVE_%s", func.upcase))
$func_cache[func] = 'yes'
@@ -163,20 +214,12 @@ def have_header(header)
end
end
- cfile = open("conftest.c", "w")
- cfile.printf "\
-#include <%s>
-", header
- cfile.close
-
- begin
- unless try_cpp
- $hdr_cache[header] = 'no'
- $cache_mod = TRUE
- return FALSE
- end
- ensure
- system "rm -f conftest*"
+ unless try_cpp(<<"SRC")
+#include <#{header}>
+SRC
+ $hdr_cache[header] = 'no'
+ $cache_mod = TRUE
+ return FALSE
end
$hdr_cache[header] = 'yes'
header.tr!("a-z./\055", "A-Z___")
@@ -185,6 +228,38 @@ def have_header(header)
return TRUE
end
+def arg_config(config, default=nil)
+ unless defined? $configure_args
+ $configure_args = {}
+ for arg in " --prefix=/usr --with-dbm-include=/usr/include/db1".split
+ next unless /^--/ =~ arg
+ if /=/ =~ arg
+ $configure_args[$`] = $'
+ else
+ $configure_args[arg] = default
+ end
+ end
+ end
+ $configure_args.fetch(config, default)
+end
+
+def with_config(config, default=nil)
+ unless /^--with-/ =~ config
+ config = '--with-' + config
+ end
+ arg_config(config, default)
+end
+
+def enable_config(config, default=nil)
+ if arg_config("--enable-"+config, true)
+ true
+ elsif arg_config("--disable-"+config, false)
+ false
+ else
+ default
+ end
+end
+
def create_header()
if $defs.length > 0
hfile = open("extconf.h", "w")
@@ -198,103 +273,121 @@ end
def create_makefile(target)
- if $libs and "obj" == "obj"
+ if $libs and "so" == "o"
libs = $libs.split
for lib in libs
- lib.sub!(/(.*)/, '"\1.lib"') if /.lib$/ !~ lib
+ lib.sub!(/-l(.*)/, '"lib\1.a"')
end
$defs.push(format("-DEXTLIB='%s'", libs.join(",")))
end
- $libs = "" unless $libs
+ $DLDFLAGS = ''
+
+ if PLATFORM =~ /beos/
+ if $libs
+ $libs = $libs + " -lruby"
+ else
+ $libs = "-lruby"
+ end
+ $DLDFLAGS = $DLDFLAGS + " -L" + $topdir
+ end
+
+ $srcdir = $top_srcdir + "/ext/" + $mdir
mfile = open("Makefile", "w")
mfile.printf "\
-SHELL = $(COMPSEC)
+SHELL = /bin/sh
#### Start of system configuration section. ####
-srcdir = .
-VPATH = .
-
-CC = cl
+srcdir = #{$srcdir}
-CFLAGS = %s -I../.. -I../../missing -I../../win32 -I. -O -DNT %s #$CFLAGS %s
+hdrdir = #{$topdir}
-RUBYLIB = ../../ruby.lib
-DLDFLAGS = /DLL
-LDSHARED =
-", if $static then "" else "-fpic" end, $dllopt, $defs.join(" ")
+CC = gcc
- if $force_static
- print "static\n"
- else
- print "non static\n"
- end
+prefix = /usr
+CFLAGS = %s -I#{$topdir} -I#{$top_srcdir} -I${prefix}/include #{CFLAGS} #$CFLAGS %s
+DLDFLAGS = #$DLDFLAGS #$LDFLAGS
+LDSHARED = gcc -shared
+", if $static then "" else "-fPIC" end, $defs.join(" ")
mfile.printf "\
-libdir = /usr/local/lib/ruby/i386-mswin32
+RUBY_INSTALL_NAME = ruby
+
+prefix = /usr
+exec_prefix = ${prefix}
+libdir = ${exec_prefix}/lib
+pkglibdir = $(libdir)/ruby/1.3
+archdir = $(pkglibdir)/i586-linux
+ruby_inc = #{$ruby_inc}
#### End of system configuration section. ####
+
"
- mfile.printf "LOCAL_LIBS = %s\n", $local_libs if $local_libs
+ mfile.printf "LOCAL_LIBS = %s\n", $local_libs unless $local_libs == ""
mfile.printf "LIBS = %s\n", $libs
mfile.printf "OBJS = "
if !$objs then
- $objs = Dir["*.c"]
- for f in $objs
- f.sub!(/\.c$/, ".obj")
+ $objs = []
+ for f in Dir["#{$top_srcdir}/ext/#{$mdir}/*.{c,cc}"]
+ f = File.basename(f)
+ f.sub!(/\.(c|cc)$/, ".o")
+ $objs.push f
end
end
mfile.printf $objs.join(" ")
mfile.printf "\n"
- dots = if "ginstall -c" =~ /^\// then "" else "../" end
- mfile.printf "\
-TARGET = %s.%s
+ mfile.printf <<EOS
+TARGET = #{target}
+DLLIB = $(TARGET).#{$static ? "a" : "so"}
-INSTALL = %sginstall -c
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
-DEFFILE = %s.def
+binsuffix =
-all: $(TARGET)
+all: $(DLLIB)
-clean:; @rm -f *.obj *.lib *.exp vc*.pdb *.bak *.def
+clean:; @rm -f *.o *.a *.so *.sl
@rm -f Makefile extconf.h conftest.*
+ @rm -f core ruby$(binsuffix) *~
+
+realclean: clean
+EOS
-realclean: clean
-", target,
- if $force_static then "lib" else "dll" end, dots, target
+ mfile.printf <<EOS
+install:
+ @test -d $(DESTDIR)$(libdir) || mkdir $(DESTDIR)$(libdir)
+ @test -d $(DESTDIR)$(pkglibdir) || mkdir $(DESTDIR)$(pkglibdir)
+ @test -d $(DESTDIR)$(archdir) || mkdir $(DESTDIR)$(archdir)
+EOS
if !$static
mfile.printf "\
-
-install: $(libdir)/$(TARGET)
-
-$(libdir)/$(TARGET): $(TARGET)
- @test -d $(libdir) || mkdir $(libdir)
- $(INSTALL) $(TARGET) $(libdir)/$(TARGET)
-"
- else
- mfile.printf "\
-
-install:;
+ $(INSTALL) $(DLLIB) $(DESTDIR)$(archdir)/$(DLLIB)
"
end
+ install_rb(mfile)
+ mfile.printf "\n"
- if $force_static
- mfile.printf "\
-$(TARGET): $(OBJS)
- lib /OUT:$(TARGET) $(OBJS)
+ if $static
+ mfile.printf "\
+$(DLLIB): $(OBJS)
+ ar cru $(DLLIB) $(OBJS)
+ @-ranlib $(DLLIB) 2> /dev/null || true
"
else
mfile.printf "\
-$(DEFFILE):
- echo $(DEFFILE)
-
-$(TARGET): $(OBJS) $(DEFFILE)
- cl -DLL -o$(TARGET) $(OBJS) $(RUBYLIB) -link /DEF:$(DEFFILE)
+$(DLLIB): $(OBJS)
+ $(LDSHARED) $(DLDFLAGS) -o $(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)
+"
+ elsif not File.exist?(target + ".c") and not File.exist?(target + ".cc")
+ mfile.printf "\
+$(DLLIB): $(OBJS)
+ ld $(DLDFLAGS) -r -o $(DLLIB) $(OBJS)
"
end
@@ -307,27 +400,7 @@ $(TARGET): $(OBJS) $(DEFFILE)
dfile.close
end
mfile.close
- if $static
- #printf format("push %s,%s\n", $static, target); ##debug print##
- $extlist.push [$static,target]
- end
-end
-
-#template of .def file.
-def create_def(basename)
- defname = sprintf("%s.def", basename)
- f = open(defname, "w")
- f.printf "\
-LIBRARY %s.dll
-CODE LOADONCALL
-DATA LOADONCALL
-DESCRIPTION 'win32 %s.dll'
-EXPORTS
-
- Init_%s
-", basename, basename, basename
- f.close
-
+
end
def extmake(target)
@@ -339,88 +412,87 @@ def extmake(target)
return if $nodynamic and not $static
- $local_libs = nil
- $libs = nil
$objs = nil
- $CFLAGS = nil
- $LDFLAGS = nil
+ $libs = "-lc"
+ $local_libs = "" # to be assigned in extconf.rb
+ $CFLAGS = ""
+ $LDFLAGS = ""
begin
+ system "mkdir", target unless File.directory?(target)
Dir.chdir target
+ $mdir = target
if $static_ext.size > 0 ||
!File.exist?("./Makefile") ||
- older("./Makefile", "../Setup") ||
+ older("./Makefile", "#{$top_srcdir}/ext/Setup") ||
older("./Makefile", "../extmk.rb") ||
- older("./Makefile", "./extconf.rb")
+ older("./Makefile", "#{$top_srcdir}/ext/#{target}/extconf.rb")
then
$defs = []
- if File.exist?("extconf.rb")
- load "extconf.rb"
+ if File.exist?("#{$top_srcdir}/ext/#{target}/extconf.rb")
+ load "#{$top_srcdir}/ext/#{target}/extconf.rb"
else
create_makefile(target);
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"
- 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 += " " + $LDFLAGS if $LDFLAGS
- $extlibs += " " + $local_libs if $local_libs
+ $extlibs ||= ""
+ $extlibs += " " + $LDFLAGS unless $LDFLAGS == ""
$extlibs += " " + $libs if $libs
+ $extlibs += " " + $local_libs unless $local_libs == ""
end
ensure
+ system "rm -f conftest*"
Dir.chdir ".."
end
end
# get static-link modules
$static_ext = {}
-if File.file? "./Setup"
- f = open("./Setup")
- while f.gets()
- $_.chop!
- sub!(/#.*$/, '')
- next if /^\s*$/
- #print $_, "\n"
-
- if /^option +nodynamic/
- $nodynamic = TRUE
- next
+for setup in ["Setup", "#{$top_srcdir}/ext/Setup"]
+ if File.file? setup
+ f = open(setup)
+ while f.gets()
+ $_.chomp!
+ sub!(/#.*$/, '')
+ next if /^\s*$/
+ if /^option +nodynamic/
+ $nodynamic = TRUE
+ next
+ end
+ $static_ext[$_.split[0]] = TRUE
end
- $static_ext[$_.split[0]] = TRUE
+ f.close
+ break
end
- f.close
end
-for d in Dir["*"]
+for d in Dir["#{$top_srcdir}/ext/*"]
File.directory?(d) || next
File.file?(d + "/MANIFEST") || next
- d = $1 if d =~ /\/([\/]*)$/
+ d = File.basename(d)
if $install
print "installing ", d, "\n"
elsif $clean
print "cleaning ", d, "\n"
else
print "compiling ", d, "\n"
+ if PLATFORM =~ /-aix/ and older("../ruby.imp", "../miniruby")
+ load "#{$top_srcdir}/ext/aix_mksym.rb"
+ end
end
extmake(d)
end
@@ -440,62 +512,64 @@ if $cache_mod
end
exit if $install or $clean
-$extinit = " " unless $extinit
-$extobjs = ""
+$extinit = "" unless $extinit
+
+ruby = "ruby"
+miniruby = "miniruby"
+
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.a", s, t)
+ if File.exist?(f)
$extinit += format("\
\tInit_%s();\n\
\trb_provide(\"%s.so\");\n\
-", s, s)
+", t, t)
+ $extobjs = "" unless $extobjs
$extobjs += "ext/"
- #$extobjs += f # *.obj
- $extobjs += l # *.lib
+ $extobjs += f
$extobjs += " "
else
FALSE
end
end
- if older("extinit.c", "Setup")
+ if older("extinit.c", "#{$top_srcdir}/ext/Setup")
f = open("extinit.c", "w")
f.printf "void Init_ext() {\n"
f.printf $extinit
f.printf "}\n"
f.close
end
- if older("extinit.obj", "extinit.c")
- cmd = "cl -Zi -O -I. -c extinit.c"
+ if older("extinit.o", "extinit.c")
+ cmd = "gcc " + CFLAGS + " -c extinit.c"
print cmd, "\n"
system cmd or exit 1
end
Dir.chdir ".."
- if older("ruby.exe", "ext/Setup") or older("ruby.exe", "miniruby.exe")
- `rm -f ruby.exe`
+ if older(ruby, "#{$top_srcdir}/ext/Setup") or older(ruby, miniruby)
+ system("rm -f #{ruby}")
end
- $extobjs = "ext/extinit.obj " + $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)
+ if $extobjs
+ $extobjs = "ext/extinit.o " + $extobjs
+ else
+ $extobjs = "ext/extinit.o "
+ end
+ if PLATFORM =~ /m68k-human|beos/
+ $extlibs.gsub!("-L/usr/local/lib", "") if $extlibs
+ end
+ 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:
# mode: ruby
#end:
diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb
index 1cf55bb4d9..0bd11bb946 100644
--- a/ext/readline/extconf.rb
+++ b/ext/readline/extconf.rb
@@ -17,6 +17,7 @@ if readline_dir
end
have_library("termcap", "tgetnum")
+have_library("curses", "tgetnum")
if have_header("readline/readline.h") and
have_header("readline/history.h") and
have_library("readline", "readline")
diff --git a/ext/socket/addrinfo.h b/ext/socket/addrinfo.h
index 83cc6c6a7b..1236437897 100644
--- a/ext/socket/addrinfo.h
+++ b/ext/socket/addrinfo.h
@@ -65,6 +65,14 @@
#define freehostent freehostent__compat
#define freeaddrinfo freeaddrinfo__compat
+#ifndef __P
+# ifdef HAVE_PROTOTYPES 1
+# define __P(args) args
+# else
+# define __P(args)
+# endif
+#endif
+
/* special compatibility hack -- end*/
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 0ad85c5380..28a96f4b38 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -149,6 +149,8 @@ EOF
$CFLAGS="-DHAVE_SA_LEN "+$CFLAGS
end
+have_header("sys/sysctl.h")
+
$getaddr_info_ok = false
if try_run(<<EOF)
#include <sys/types.h>
@@ -270,6 +272,8 @@ else
$CFLAGS="-I. "+$CFLAGS
$objs += "getaddrinfo.o"
$objs += "getnameinfo.o"
+ have_func("inet_ntop")
+ have_func("inet_pton")
end
if sockaddr_storage
@@ -277,6 +281,7 @@ if sockaddr_storage
end
have_header("sys/un.h")
+
if have_func(test_func)
have_func("hsterror")
unless have_func("gethostname")
diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c
index 45657b6a96..fc3f654cee 100644
--- a/ext/socket/getaddrinfo.c
+++ b/ext/socket/getaddrinfo.c
@@ -40,7 +40,9 @@
#include <sys/types.h>
#include <sys/param.h>
+#ifdef HAVE_SYSCTL_H
#include <sys/sysctl.h>
+#endif
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -48,11 +50,13 @@
#include <netdb.h>
#include <resolv.h>
#include <string.h>
+#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <ctype.h>
#include <unistd.h>
+#include "config.h"
#include "addrinfo.h"
#include "sockport.h"
@@ -160,7 +164,7 @@ if (pai->ai_flags & AI_CANONNAME) {\
memcpy(ai, pai, sizeof(struct addrinfo));\
(ai)->ai_addr = (struct sockaddr *)((ai) + 1);\
memset((ai)->ai_addr, 0, (afd)->a_socklen);\
- SET_SA_LEN(*(ai)->ai_addr, (ai)->ai_addrlen = (afd)->a_socklen);\
+ SET_SA_LEN((ai)->ai_addr, (ai)->ai_addrlen = (afd)->a_socklen);\
(ai)->ai_addr->sa_family = (ai)->ai_family = (afd)->a_af;\
((struct sockinet *)(ai)->ai_addr)->si_port = port;\
p = (char *)((ai)->ai_addr);\
@@ -206,6 +210,27 @@ str_isnumber(p)
return YES;
}
+#ifndef HAVE_INET_PTON
+
+#ifndef INADDR_NONE
+# define INADDR_NONE 0xffffffff
+#endif
+
+static int
+inet_pton(af, hostname, pton)
+ int af;
+ const char *hostname;
+ char *pton;
+{
+ struct in_addr in;
+ in.s_addr = inet_addr(hostname);
+ if (in.s_addr == INADDR_NONE)
+ return 0;
+ memcpy(pton, &in, sizeof(in));
+ return 1;
+}
+#endif
+
int
getaddrinfo(hostname, servname, hints, res)
const char *hostname, *servname;
diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c
index 99404b157a..e217b50895 100644
--- a/ext/socket/getnameinfo.c
+++ b/ext/socket/getnameinfo.c
@@ -44,6 +44,7 @@
#include <string.h>
#include <stddef.h>
+#include "config.h"
#include "addrinfo.h"
#include "sockport.h"
@@ -81,6 +82,21 @@ struct sockinet {
#define ENI_FAMILY 5
#define ENI_SALEN 6
+#ifndef HAVE_INET_NTOP
+static char *
+inet_ntop(af, addr, numaddr, numaddr_len)
+ int af;
+ char *addr;
+ char *numaddr;
+ int numaddr_len;
+{
+ struct in_addr in;
+ memcpy(&in.s_addr, addr, sizeof(in.s_addr));
+ strcpy(numaddr, inet_ntoa(in));
+ return numaddr;
+}
+#endif
+
int
getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
const struct sockaddr *sa;
@@ -102,6 +118,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
int h_error;
char numserv[512];
char numaddr[512];
+ extern int h_errno;
if (sa == NULL)
return ENI_NOSOCKET;
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 7fb51f7bc9..b0f108a2c1 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -1042,7 +1042,7 @@ udp_connect(sock, host, port)
GetOpenFile(sock, fptr);
res0 = udp_addrsetup(fptr, host, port);
- for (res0 = res; res; res = res->ai_next) {
+ for (res = res0; res; res = res->ai_next) {
retry:
if (connect(fileno(fptr->f), res->ai_addr, res->ai_addrlen) >= 0) {
freeaddrinfo(res0);
@@ -1804,7 +1804,7 @@ gotsap:
static VALUE mConst;
static void
-sock_rb_define_const(name, value)
+sock_define_const(name, value)
char *name;
int value;
{
@@ -1904,248 +1904,248 @@ Init_socket()
/* constants */
mConst = rb_define_module_under(rb_cSocket, "Constants");
- sock_rb_define_const("SOCK_STREAM", SOCK_STREAM);
- sock_rb_define_const("SOCK_DGRAM", SOCK_DGRAM);
+ sock_define_const("SOCK_STREAM", SOCK_STREAM);
+ sock_define_const("SOCK_DGRAM", SOCK_DGRAM);
#ifdef SOCK_RAW
- sock_rb_define_const("SOCK_RAW", SOCK_RAW);
+ sock_define_const("SOCK_RAW", SOCK_RAW);
#endif
#ifdef SOCK_RDM
- sock_rb_define_const("SOCK_RDM", SOCK_RDM);
+ sock_define_const("SOCK_RDM", SOCK_RDM);
#endif
#ifdef SOCK_SEQPACKET
- sock_rb_define_const("SOCK_SEQPACKET", SOCK_SEQPACKET);
+ sock_define_const("SOCK_SEQPACKET", SOCK_SEQPACKET);
#endif
#ifdef SOCK_PACKET
- sock_rb_define_const("SOCK_PACKET", SOCK_PACKET);
+ sock_define_const("SOCK_PACKET", SOCK_PACKET);
#endif
- sock_rb_define_const("AF_INET", AF_INET);
+ sock_define_const("AF_INET", AF_INET);
#ifdef PF_INET
- sock_rb_define_const("PF_INET", PF_INET);
+ sock_define_const("PF_INET", PF_INET);
#endif
#ifdef AF_UNIX
- sock_rb_define_const("AF_UNIX", AF_UNIX);
- sock_rb_define_const("PF_UNIX", PF_UNIX);
+ sock_define_const("AF_UNIX", AF_UNIX);
+ sock_define_const("PF_UNIX", PF_UNIX);
#endif
#ifdef AF_AX25
- sock_rb_define_const("AF_AX25", AF_AX25);
- sock_rb_define_const("PF_AX25", PF_AX25);
+ sock_define_const("AF_AX25", AF_AX25);
+ sock_define_const("PF_AX25", PF_AX25);
#endif
#ifdef AF_IPX
- sock_rb_define_const("AF_IPX", AF_IPX);
- sock_rb_define_const("PF_IPX", PF_IPX);
+ sock_define_const("AF_IPX", AF_IPX);
+ sock_define_const("PF_IPX", PF_IPX);
#endif
#ifdef AF_APPLETALK
- sock_rb_define_const("AF_APPLETALK", AF_APPLETALK);
- sock_rb_define_const("PF_APPLETALK", PF_APPLETALK);
+ sock_define_const("AF_APPLETALK", AF_APPLETALK);
+ sock_define_const("PF_APPLETALK", PF_APPLETALK);
#endif
#ifdef AF_UNSPEC
- sock_rb_define_const("AF_UNSPEC", AF_UNSPEC);
- sock_rb_define_const("PF_UNSPEC", PF_UNSPEC);
+ sock_define_const("AF_UNSPEC", AF_UNSPEC);
+ sock_define_const("PF_UNSPEC", PF_UNSPEC);
#endif
#ifdef AF_INET6
- sock_rb_define_const("AF_INET6", AF_INET6);
- sock_rb_define_const("PF_INET6", PF_INET6);
+ sock_define_const("AF_INET6", AF_INET6);
+ sock_define_const("PF_INET6", PF_INET6);
#endif
- sock_rb_define_const("MSG_OOB", MSG_OOB);
+ sock_define_const("MSG_OOB", MSG_OOB);
#ifdef MSG_PEEK
- sock_rb_define_const("MSG_PEEK", MSG_PEEK);
+ sock_define_const("MSG_PEEK", MSG_PEEK);
#endif
#ifdef MSG_DONTROUTE
- sock_rb_define_const("MSG_DONTROUTE", MSG_DONTROUTE);
+ sock_define_const("MSG_DONTROUTE", MSG_DONTROUTE);
#endif
- sock_rb_define_const("SOL_SOCKET", SOL_SOCKET);
+ sock_define_const("SOL_SOCKET", SOL_SOCKET);
#ifdef SOL_IP
- sock_rb_define_const("SOL_IP", SOL_IP);
+ sock_define_const("SOL_IP", SOL_IP);
#endif
#ifdef SOL_IPX
- sock_rb_define_const("SOL_IPX", SOL_IPX);
+ sock_define_const("SOL_IPX", SOL_IPX);
#endif
#ifdef SOL_AX25
- sock_rb_define_const("SOL_AX25", SOL_AX25);
+ sock_define_const("SOL_AX25", SOL_AX25);
#endif
#ifdef SOL_ATALK
- sock_rb_define_const("SOL_ATALK", SOL_ATALK);
+ sock_define_const("SOL_ATALK", SOL_ATALK);
#endif
#ifdef SOL_TCP
- sock_rb_define_const("SOL_TCP", SOL_TCP);
+ sock_define_const("SOL_TCP", SOL_TCP);
#endif
#ifdef SOL_UDP
- sock_rb_define_const("SOL_UDP", SOL_UDP);
+ sock_define_const("SOL_UDP", SOL_UDP);
#endif
#ifdef SO_DEBUG
- sock_rb_define_const("SO_DEBUG", SO_DEBUG);
+ sock_define_const("SO_DEBUG", SO_DEBUG);
#endif
- sock_rb_define_const("SO_REUSEADDR", SO_REUSEADDR);
+ sock_define_const("SO_REUSEADDR", SO_REUSEADDR);
#ifdef SO_TYPE
- sock_rb_define_const("SO_TYPE", SO_TYPE);
+ sock_define_const("SO_TYPE", SO_TYPE);
#endif
#ifdef SO_ERROR
- sock_rb_define_const("SO_ERROR", SO_ERROR);
+ sock_define_const("SO_ERROR", SO_ERROR);
#endif
#ifdef SO_DONTROUTE
- sock_rb_define_const("SO_DONTROUTE", SO_DONTROUTE);
+ sock_define_const("SO_DONTROUTE", SO_DONTROUTE);
#endif
#ifdef SO_BROADCAST
- sock_rb_define_const("SO_BROADCAST", SO_BROADCAST);
+ sock_define_const("SO_BROADCAST", SO_BROADCAST);
#endif
#ifdef SO_SNDBUF
- sock_rb_define_const("SO_SNDBUF", SO_SNDBUF);
+ sock_define_const("SO_SNDBUF", SO_SNDBUF);
#endif
#ifdef SO_RCVBUF
- sock_rb_define_const("SO_RCVBUF", SO_RCVBUF);
+ sock_define_const("SO_RCVBUF", SO_RCVBUF);
#endif
#ifdef SO_KEEPALIVE
- sock_rb_define_const("SO_KEEPALIVE", SO_KEEPALIVE);
+ sock_define_const("SO_KEEPALIVE", SO_KEEPALIVE);
#endif
#ifdef SO_OOBINLINE
- sock_rb_define_const("SO_OOBINLINE", SO_OOBINLINE);
+ sock_define_const("SO_OOBINLINE", SO_OOBINLINE);
#endif
#ifdef SO_NO_CHECK
- sock_rb_define_const("SO_NO_CHECK", SO_NO_CHECK);
+ sock_define_const("SO_NO_CHECK", SO_NO_CHECK);
#endif
#ifdef SO_PRIORITY
- sock_rb_define_const("SO_PRIORITY", SO_PRIORITY);
+ sock_define_const("SO_PRIORITY", SO_PRIORITY);
#endif
#ifdef SO_LINGER
- sock_rb_define_const("SO_LINGER", SO_LINGER);
+ sock_define_const("SO_LINGER", SO_LINGER);
#endif
#ifdef SOPRI_INTERACTIVE
- sock_rb_define_const("SOPRI_INTERACTIVE", SOPRI_INTERACTIVE);
+ sock_define_const("SOPRI_INTERACTIVE", SOPRI_INTERACTIVE);
#endif
#ifdef SOPRI_NORMAL
- sock_rb_define_const("SOPRI_NORMAL", SOPRI_NORMAL);
+ sock_define_const("SOPRI_NORMAL", SOPRI_NORMAL);
#endif
#ifdef SOPRI_BACKGROUND
- sock_rb_define_const("SOPRI_BACKGROUND", SOPRI_BACKGROUND);
+ sock_define_const("SOPRI_BACKGROUND", SOPRI_BACKGROUND);
#endif
#ifdef IP_MULTICAST_IF
- sock_rb_define_const("IP_MULTICAST_IF", IP_MULTICAST_IF);
+ sock_define_const("IP_MULTICAST_IF", IP_MULTICAST_IF);
#endif
#ifdef IP_MULTICAST_TTL
- sock_rb_define_const("IP_MULTICAST_TTL", IP_MULTICAST_TTL);
+ sock_define_const("IP_MULTICAST_TTL", IP_MULTICAST_TTL);
#endif
#ifdef IP_MULTICAST_LOOP
- sock_rb_define_const("IP_MULTICAST_LOOP", IP_MULTICAST_LOOP);
+ sock_define_const("IP_MULTICAST_LOOP", IP_MULTICAST_LOOP);
#endif
#ifdef IP_ADD_MEMBERSHIP
- sock_rb_define_const("IP_ADD_MEMBERSHIP", IP_ADD_MEMBERSHIP);
+ sock_define_const("IP_ADD_MEMBERSHIP", IP_ADD_MEMBERSHIP);
#endif
#ifdef IP_DEFAULT_MULTICAST_TTL
- sock_rb_define_const("IP_DEFAULT_MULTICAST_TTL", IP_DEFAULT_MULTICAST_TTL);
+ sock_define_const("IP_DEFAULT_MULTICAST_TTL", IP_DEFAULT_MULTICAST_TTL);
#endif
#ifdef IP_DEFAULT_MULTICAST_LOOP
- sock_rb_define_const("IP_DEFAULT_MULTICAST_LOOP", IP_DEFAULT_MULTICAST_LOOP);
+ sock_define_const("IP_DEFAULT_MULTICAST_LOOP", IP_DEFAULT_MULTICAST_LOOP);
#endif
#ifdef IP_MAX_MEMBERSHIPS
- sock_rb_define_const("IP_MAX_MEMBERSHIPS", IP_MAX_MEMBERSHIPS);
+ sock_define_const("IP_MAX_MEMBERSHIPS", IP_MAX_MEMBERSHIPS);
#endif
#ifdef IPX_TYPE
- sock_rb_define_const("IPX_TYPE", IPX_TYPE);
+ sock_define_const("IPX_TYPE", IPX_TYPE);
#endif
#ifdef TCP_NODELAY
- sock_rb_define_const("TCP_NODELAY", TCP_NODELAY);
+ sock_define_const("TCP_NODELAY", TCP_NODELAY);
#endif
#ifdef TCP_MAXSEG
- sock_rb_define_const("TCP_MAXSEG", TCP_MAXSEG);
+ sock_define_const("TCP_MAXSEG", TCP_MAXSEG);
#endif
#ifdef EAI_ADDRFAMILY
- sock_rb_define_const("EAI_ADDRFAMILY", EAI_ADDRFAMILY);
+ sock_define_const("EAI_ADDRFAMILY", EAI_ADDRFAMILY);
#endif
#ifdef EAI_AGAIN
- sock_rb_define_const("EAI_AGAIN", EAI_AGAIN);
+ sock_define_const("EAI_AGAIN", EAI_AGAIN);
#endif
#ifdef EAI_BADFLAGS
- sock_rb_define_const("EAI_BADFLAGS", EAI_BADFLAGS);
+ sock_define_const("EAI_BADFLAGS", EAI_BADFLAGS);
#endif
#ifdef EAI_FAIL
- sock_rb_define_const("EAI_FAIL", EAI_FAIL);
+ sock_define_const("EAI_FAIL", EAI_FAIL);
#endif
#ifdef EAI_FAMILY
- sock_rb_define_const("EAI_FAMILY", EAI_FAMILY);
+ sock_define_const("EAI_FAMILY", EAI_FAMILY);
#endif
#ifdef EAI_MEMORY
- sock_rb_define_const("EAI_MEMORY", EAI_MEMORY);
+ sock_define_const("EAI_MEMORY", EAI_MEMORY);
#endif
#ifdef EAI_NODATA
- sock_rb_define_const("EAI_NODATA", EAI_NODATA);
+ sock_define_const("EAI_NODATA", EAI_NODATA);
#endif
#ifdef EAI_NONAME
- sock_rb_define_const("EAI_NONAME", EAI_NONAME);
+ sock_define_const("EAI_NONAME", EAI_NONAME);
#endif
#ifdef EAI_SERVICE
- sock_rb_define_const("EAI_SERVICE", EAI_SERVICE);
+ sock_define_const("EAI_SERVICE", EAI_SERVICE);
#endif
#ifdef EAI_SOCKTYPE
- sock_rb_define_const("EAI_SOCKTYPE", EAI_SOCKTYPE);
+ sock_define_const("EAI_SOCKTYPE", EAI_SOCKTYPE);
#endif
#ifdef EAI_SYSTEM
- sock_rb_define_const("EAI_SYSTEM", EAI_SYSTEM);
+ sock_define_const("EAI_SYSTEM", EAI_SYSTEM);
#endif
#ifdef EAI_BADHINTS
- sock_rb_define_const("EAI_BADHINTS", EAI_BADHINTS);
+ sock_define_const("EAI_BADHINTS", EAI_BADHINTS);
#endif
#ifdef EAI_PROTOCOL
- sock_rb_define_const("EAI_PROTOCOL", EAI_PROTOCOL);
+ sock_define_const("EAI_PROTOCOL", EAI_PROTOCOL);
#endif
#ifdef EAI_MAX
- sock_rb_define_const("EAI_MAX", EAI_MAX);
+ sock_define_const("EAI_MAX", EAI_MAX);
#endif
#ifdef AI_PASSIVE
- sock_rb_define_const("AI_PASSIVE", AI_PASSIVE);
+ sock_define_const("AI_PASSIVE", AI_PASSIVE);
#endif
#ifdef AI_CANONNAME
- sock_rb_define_const("AI_CANONNAME", AI_CANONNAME);
+ sock_define_const("AI_CANONNAME", AI_CANONNAME);
#endif
#ifdef AI_NUMERICHOST
- sock_rb_define_const("AI_NUMERICHOST", AI_NUMERICHOST);
+ sock_define_const("AI_NUMERICHOST", AI_NUMERICHOST);
#endif
#ifdef AI_MASK
- sock_rb_define_const("AI_MASK", AI_MASK);
+ sock_define_const("AI_MASK", AI_MASK);
#endif
#ifdef AI_ALL
- sock_rb_define_const("AI_ALL", AI_ALL);
+ sock_define_const("AI_ALL", AI_ALL);
#endif
#ifdef AI_V4MAPPED_CFG
- sock_rb_define_const("AI_V4MAPPED_CFG", AI_V4MAPPED_CFG);
+ sock_define_const("AI_V4MAPPED_CFG", AI_V4MAPPED_CFG);
#endif
#ifdef AI_ADDRCONFIG
- sock_rb_define_const("AI_ADDRCONFIG", AI_ADDRCONFIG);
+ sock_define_const("AI_ADDRCONFIG", AI_ADDRCONFIG);
#endif
#ifdef AI_V4MAPPED
- sock_rb_define_const("AI_V4MAPPED", AI_V4MAPPED);
+ sock_define_const("AI_V4MAPPED", AI_V4MAPPED);
#endif
#ifdef AI_DEFAULT
- sock_rb_define_const("AI_DEFAULT", AI_DEFAULT);
+ sock_define_const("AI_DEFAULT", AI_DEFAULT);
#endif
#ifdef NI_MAXHOST
- sock_rb_define_const("NI_MAXHOST", NI_MAXHOST);
+ sock_define_const("NI_MAXHOST", NI_MAXHOST);
#endif
#ifdef NI_MAXSERV
- sock_rb_define_const("NI_MAXSERV", NI_MAXSERV);
+ sock_define_const("NI_MAXSERV", NI_MAXSERV);
#endif
#ifdef NI_NOFQDN
- sock_rb_define_const("NI_NOFQDN", NI_NOFQDN);
+ sock_define_const("NI_NOFQDN", NI_NOFQDN);
#endif
#ifdef NI_NUMERICHOST
- sock_rb_define_const("NI_NUMERICHOST", NI_NUMERICHOST);
+ sock_define_const("NI_NUMERICHOST", NI_NUMERICHOST);
#endif
#ifdef NI_NAMEREQD
- sock_rb_define_const("NI_NAMEREQD", NI_NAMEREQD);
+ sock_define_const("NI_NAMEREQD", NI_NAMEREQD);
#endif
#ifdef NI_NUMERICSERV
- sock_rb_define_const("NI_NUMERICSERV", NI_NUMERICSERV);
+ sock_define_const("NI_NUMERICSERV", NI_NUMERICSERV);
#endif
#ifdef NI_DGRAM
- sock_rb_define_const("NI_DGRAM", NI_DGRAM);
+ sock_define_const("NI_DGRAM", NI_DGRAM);
#endif
}
diff --git a/ext/socket/sockport.h b/ext/socket/sockport.h
index bb3b371670..3a2007362f 100644
--- a/ext/socket/sockport.h
+++ b/ext/socket/sockport.h
@@ -13,7 +13,7 @@
#ifndef SA_LEN
# ifdef HAVE_SA_LEN
-# define SA_LEN(sa) (sa)->sin_len
+# define SA_LEN(sa) (sa)->sa_len
# else
# ifdef INET6
# define SA_LEN(sa) \
@@ -27,7 +27,7 @@
#endif
#ifdef HAVE_SA_LEN
-# define SET_SA_LEN(sa, len) (sa)->sin_len = (len)
+# define SET_SA_LEN(sa, len) (sa)->sa_len = (len)
#else
# define SET_SA_LEN(sa, len) (len)
#endif
diff --git a/ext/tcltklib/extconf.rb b/ext/tcltklib/extconf.rb
index e34e549ca0..7a568edd10 100644
--- a/ext/tcltklib/extconf.rb
+++ b/ext/tcltklib/extconf.rb
@@ -59,7 +59,7 @@ def search_lib(file, func, *path)
for lib in files.sort!.reverse!
lib = File::basename(lib)
lib.sub!(/^lib/, '')
- lib.sub!(/\.(a|so)$/, '')
+ lib.sub!(/\.(a|so(.[0-9.]+)?)$/, '')
if have_library(lib, func)
unless $libraries.include? path
$libraries << path
@@ -74,7 +74,7 @@ def search_lib(file, func, *path)
end
if have_header("tcl.h") && have_header("tk.h") &&
- search_lib("libX11.{so,a}", "XOpenDisplay",
+ 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") &&
diff --git a/instruby.rb b/instruby.rb
index 59872268e7..2c182b23f7 100644
--- a/instruby.rb
+++ b/instruby.rb
@@ -60,7 +60,7 @@ Find.find("lib") do |f|
File.install f, dir, 0644, true
end
-if PLATFORM =~ /ibm-aix/
+if PLATFORM =~ /-aix/
File.install "ruby.imp", archdir, 0644, true
end
for f in Dir["*.h"]
diff --git a/io.c b/io.c
index 4c9bbcf038..aacccd4e13 100644
--- a/io.c
+++ b/io.c
@@ -1056,9 +1056,9 @@ rb_io_binmode(io)
return io;
}
-static int
+int
rb_io_mode_flags(mode)
- char *mode;
+ const char *mode;
{
int flags = 0;
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 396e2c8a81..aceb665e0b 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -31,9 +31,7 @@ if File.exist?($config_cache) then
end
$srcdir = CONFIG["srcdir"]
-#$libdir = CONFIG["libdir"]+"/"+CONFIG["ruby_install_name"]
-$libdir = CONFIG["libdir"]+"/ruby"
-$libdir += "/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
+$libdir = CONFIG["libdir"]+"/ruby/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
$archdir = $libdir+"/"+CONFIG["arch"]
$install = CONFIG["INSTALL_PROGRAM"]
$install_data = CONFIG["INSTALL_DATA"]
@@ -79,14 +77,18 @@ def xsystem command
return r
end
-def try_link(src, opt="")
+def try_link0(src, opt="")
cfile = open("conftest.c", "w")
cfile.print src
cfile.close
+ xsystem(format(LINK, $CFLAGS, $LDFLAGS, opt))
+end
+
+def try_link(src, opt="")
begin
- xsystem(format(LINK, $CFLAGS, $LDFLAGS, opt))
+ try_link0(src, opt)
ensure
- system "rm -f conftest.*"
+ system "rm -f conftest*"
end
end
@@ -105,12 +107,8 @@ def egrep_cpp(pat, src, opt=$CFLAGS)
end
def try_run(src, opt="")
- begin
- if try_link(src, opt)
- xsystem("./conftest")
- end
- ensure
- system "rm -f conftest*"
+ if try_link0(src, opt)
+ xsystem("./conftest")
end
end
@@ -158,23 +156,19 @@ int t() { %s(); return 0; }
", func
cfile.close
- begin
- if $libs
- libs = "-l" + lib + " " + $libs
- else
- libs = "-l" + lib
- end
- unless try_link(<<"SRC", libs)
+ if $libs
+ libs = "-l" + lib + " " + $libs
+ else
+ libs = "-l" + lib
+ end
+ unless try_link(<<"SRC", libs)
int main() { return 0; }
int t() { #{func}(); return 0; }
SRC
- $lib_cache[lib] = 'no'
- $cache_mod = TRUE
- print "no\n"
- return FALSE
- end
- ensure
- system "rm -f conftest*"
+ $lib_cache[lib] = 'no'
+ $cache_mod = TRUE
+ print "no\n"
+ return FALSE
end
else
if $libs
@@ -208,19 +202,15 @@ def have_func(func)
libs = $libs
libs = "" if libs == nil
- begin
- unless try_link(<<"SRC", libs)
+ unless try_link(<<"SRC", libs)
char #{func}();
int main() { return 0; }
int t() { #{func}(); return 0; }
SRC
- $func_found[func] = 'no'
- $found = TRUE
- print "no\n"
- return FALSE
- end
- ensure
- system "rm -f conftest*"
+ $func_found[func] = 'no'
+ $found = TRUE
+ print "no\n"
+ return FALSE
end
$defs.push(format("-DHAVE_%s", func.upcase))
$func_found[func] = 'yes'
@@ -244,17 +234,13 @@ def have_header(header)
end
end
- begin
- unless try_cpp(<<"SRC")
+ unless try_cpp(<<"SRC")
#include <#{header}>
SRC
- $hdr_found[header] = 'no'
- $found = TRUE
- print "no\n"
- return FALSE
- end
- ensure
- system "rm -f conftest*"
+ $hdr_found[header] = 'no'
+ $found = TRUE
+ print "no\n"
+ return FALSE
end
$hdr_found[header] = 'yes'
header.tr!("a-z./\055", "A-Z___")
@@ -311,6 +297,7 @@ end
def create_makefile(target)
print "creating Makefile\n"
+ system "rm -f conftest*"
STDOUT.flush
if $libs and CONFIG["DLEXT"] == "o"
libs = $libs.split
@@ -363,14 +350,15 @@ LOCAL_LIBS = #{$local_libs}
LIBS = #{$libs}
OBJS = #{$objs}
-TARGET = #{target}.#{CONFIG["DLEXT"]}
+TARGET = #{target}
+DLLIB = $(TARGET).#{CONFIG["DLEXT"]}
INSTALL = #{$install}
INSTALL_DATA = #{$install_data}
binsuffix = #{CONFIG["binsuffix"]}
-all: $(TARGET)
+all: $(DLLIB)
clean:; @rm -f *.o *.so *.sl
@rm -f Makefile extconf.h conftest.*
@@ -378,30 +366,30 @@ clean:; @rm -f *.o *.so *.sl
realclean: clean
-install: $(archdir)/$(TARGET)
+install: $(archdir)/$(DLLIB)
-$(archdir)/$(TARGET): $(TARGET)
+$(archdir)/$(DLLIB): $(DLLIB)
@test -d $(libdir) || mkdir $(libdir)
@test -d $(archdir) || mkdir $(archdir)
- $(INSTALL) $(TARGET) $(archdir)/$(TARGET)
+ $(INSTALL) $(DLLIB) $(archdir)/$(DLLIB)
EOMF
install_rb(mfile)
mfile.printf "\n"
if CONFIG["DLEXT"] != "o"
mfile.printf <<EOMF
-$(TARGET): $(OBJS)
- $(LDSHARED) $(DLDFLAGS) -o $(TARGET) $(OBJS) $(LIBS) $(LOCAL_LIBS)
+$(DLLIB): $(OBJS)
+ $(LDSHARED) $(DLDFLAGS) -o $(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)
EOMF
elsif not File.exist?(target + ".c") and not File.exist?(target + ".cc") or
- mfile.print "$(TARGET): $(OBJS)\n"
+ mfile.print "$(DLLIB): $(OBJS)\n"
case PLATFORM
when "m68k-human"
- mfile.printf "ar cru $(TARGET) $(OBJS)\n"
+ mfile.printf "ar cru $(DLLIB) $(OBJS)\n"
when /-nextstep/
- mfile.printf "cc -r $(CFLAGS) -o $(TARGET) $(OBJS)\n"
+ mfile.printf "cc -r $(CFLAGS) -o $(DLLIB) $(OBJS)\n"
else
- mfile.printf "ld $(DLDFLAGS) -r -o $(TARGET) $(OBJS)\n"
+ mfile.printf "ld $(DLDFLAGS) -r -o $(DLLIB) $(OBJS)\n"
end
end
diff --git a/missing/strcasecmp.c b/missing/strcasecmp.c
index 83aa50d9c3..ba7bf78ea4 100644
--- a/missing/strcasecmp.c
+++ b/missing/strcasecmp.c
@@ -1,6 +1,5 @@
#include <ctype.h>
-#define min(a,b) (((a)>(b))?(b):(a))
int
strcasecmp(p1, p2)
char *p1, *p2;
diff --git a/missing/strncasecmp.c b/missing/strncasecmp.c
new file mode 100644
index 0000000000..c136703415
--- /dev/null
+++ b/missing/strncasecmp.c
@@ -0,0 +1,18 @@
+#include <ctype.h>
+
+int
+strncasecmp(p1, p2, len)
+ char *p1;
+ char *p2;
+ int len;
+{
+ for (; len != 0; len--, p1++, p2++) {
+ if (toupper(*p1) != toupper(*p2)) {
+ return toupper(*p1) - toupper(*p2);
+ }
+ if (*p1 == '\0') {
+ return 0;
+ }
+ }
+ return 0;
+}
diff --git a/mkconfig.rb b/mkconfig.rb
index 0610020912..370523d97b 100644
--- a/mkconfig.rb
+++ b/mkconfig.rb
@@ -63,7 +63,20 @@ File.foreach "config.status" do |$_|
end
print v_fast, v_others
-print " CONFIG[\"compile_dir\"] = \"#{File.expand_path(File.dirname($0))}\"\n"
-print "end\n"
+print <<EOS
+ CONFIG["compile_dir"] = "#{File.expand_path(File.dirname($0))}"
+ CONFIG.each_value do |val|
+ val.gsub!(/\\$\\(([^()]+)\\)/) do |var|
+ key = $1
+ if CONFIG.key? key
+ "\#{CONFIG[\\\"\#{key}\\\"]}"
+ else
+ var
+ end
+ end
+ end
+end
+EOS
config.close
+
# vi:set sw=2:
diff --git a/parse.c b/parse.c
index a36c9e4194..40a586d84c 100644
--- a/parse.c
+++ b/parse.c
@@ -1,99 +1,99 @@
/* A Bison parser, made from parse.y
- by GNU Bison version 1.25
+ by GNU Bison version 1.25.90
*/
#define YYBISON 1 /* Identify Bison output. */
-#define kCLASS 258
-#define kMODULE 259
-#define kDEF 260
-#define kUNDEF 261
-#define kBEGIN 262
-#define kRESCUE 263
-#define kENSURE 264
-#define kEND 265
-#define kIF 266
-#define kUNLESS 267
-#define kTHEN 268
-#define kELSIF 269
-#define kELSE 270
-#define kCASE 271
-#define kWHEN 272
-#define kWHILE 273
-#define kUNTIL 274
-#define kFOR 275
-#define kBREAK 276
-#define kNEXT 277
-#define kREDO 278
-#define kRETRY 279
-#define kIN 280
-#define kDO 281
-#define kRETURN 282
-#define kYIELD 283
-#define kSUPER 284
-#define kSELF 285
-#define kNIL 286
-#define kTRUE 287
-#define kFALSE 288
-#define kAND 289
-#define kOR 290
-#define kNOT 291
-#define kIF_MOD 292
-#define kUNLESS_MOD 293
-#define kWHILE_MOD 294
-#define kUNTIL_MOD 295
-#define kALIAS 296
-#define kDEFINED 297
-#define klBEGIN 298
-#define klEND 299
-#define k__LINE__ 300
-#define k__FILE__ 301
-#define tIDENTIFIER 302
-#define tFID 303
-#define tGVAR 304
-#define tIVAR 305
-#define tCONSTANT 306
-#define tINTEGER 307
-#define tFLOAT 308
-#define tSTRING 309
-#define tXSTRING 310
-#define tREGEXP 311
-#define tDSTRING 312
-#define tDXSTRING 313
-#define tDREGEXP 314
-#define tNTH_REF 315
-#define tBACK_REF 316
-#define tUPLUS 317
-#define tUMINUS 318
-#define tPOW 319
-#define tCMP 320
-#define tEQ 321
-#define tEQQ 322
-#define tNEQ 323
-#define tGEQ 324
-#define tLEQ 325
-#define tANDOP 326
-#define tOROP 327
-#define tMATCH 328
-#define tNMATCH 329
-#define tDOT2 330
-#define tDOT3 331
-#define tAREF 332
-#define tASET 333
-#define tLSHFT 334
-#define tRSHFT 335
-#define tCOLON2 336
-#define tCOLON3 337
-#define tOP_ASGN 338
-#define tASSOC 339
-#define tLPAREN 340
-#define tLBRACK 341
-#define tLBRACE 342
-#define tSTAR 343
-#define tAMPER 344
-#define tSYMBEG 345
-#define LAST_TOKEN 346
+#define kCLASS 257
+#define kMODULE 258
+#define kDEF 259
+#define kUNDEF 260
+#define kBEGIN 261
+#define kRESCUE 262
+#define kENSURE 263
+#define kEND 264
+#define kIF 265
+#define kUNLESS 266
+#define kTHEN 267
+#define kELSIF 268
+#define kELSE 269
+#define kCASE 270
+#define kWHEN 271
+#define kWHILE 272
+#define kUNTIL 273
+#define kFOR 274
+#define kBREAK 275
+#define kNEXT 276
+#define kREDO 277
+#define kRETRY 278
+#define kIN 279
+#define kDO 280
+#define kRETURN 281
+#define kYIELD 282
+#define kSUPER 283
+#define kSELF 284
+#define kNIL 285
+#define kTRUE 286
+#define kFALSE 287
+#define kAND 288
+#define kOR 289
+#define kNOT 290
+#define kIF_MOD 291
+#define kUNLESS_MOD 292
+#define kWHILE_MOD 293
+#define kUNTIL_MOD 294
+#define kALIAS 295
+#define kDEFINED 296
+#define klBEGIN 297
+#define klEND 298
+#define k__LINE__ 299
+#define k__FILE__ 300
+#define tIDENTIFIER 301
+#define tFID 302
+#define tGVAR 303
+#define tIVAR 304
+#define tCONSTANT 305
+#define tINTEGER 306
+#define tFLOAT 307
+#define tSTRING 308
+#define tXSTRING 309
+#define tREGEXP 310
+#define tDSTRING 311
+#define tDXSTRING 312
+#define tDREGEXP 313
+#define tNTH_REF 314
+#define tBACK_REF 315
+#define tUPLUS 316
+#define tUMINUS 317
+#define tPOW 318
+#define tCMP 319
+#define tEQ 320
+#define tEQQ 321
+#define tNEQ 322
+#define tGEQ 323
+#define tLEQ 324
+#define tANDOP 325
+#define tOROP 326
+#define tMATCH 327
+#define tNMATCH 328
+#define tDOT2 329
+#define tDOT3 330
+#define tAREF 331
+#define tASET 332
+#define tLSHFT 333
+#define tRSHFT 334
+#define tCOLON2 335
+#define tCOLON3 336
+#define tOP_ASGN 337
+#define tASSOC 338
+#define tLPAREN 339
+#define tLBRACK 340
+#define tLBRACE 341
+#define tSTAR 342
+#define tAMPER 343
+#define tSYMBEG 344
+#define LAST_TOKEN 345
#line 13 "parse.y"
@@ -219,7 +219,7 @@ typedef union {
#define YYFLAG -32768
#define YYNTBASE 118
-#define YYTRANSLATE(x) ((unsigned)(x) <= 346 ? yytranslate[x] : 212)
+#define YYTRANSLATE(x) ((unsigned)(x) <= 345 ? yytranslate[x] : 212)
static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 116,
@@ -247,16 +247,16 @@ static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
- 86, 87, 88, 89, 90, 106
+ 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
+ 87, 88, 89, 90, 106
};
#if YYDEBUG != 0
@@ -2182,6 +2182,7 @@ static const short yycheck[] = { 1,
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/share/misc/bison.simple"
+/* This file comes from bison-1.25.90. */
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -2198,46 +2199,65 @@ static const short yycheck[] = { 1,
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
-#ifndef alloca
+/* This is the parser code that is written into each bison parser
+ when the %semantic_parser declaration is not specified in the grammar.
+ It was written by Richard Stallman by simplifying the hairy parser
+ used when %semantic_parser is specified. */
+
+#ifndef YYSTACK_USE_ALLOCA
+#ifdef alloca
+#define YYSTACK_USE_ALLOCA
+#else /* alloca not defined */
#ifdef __GNUC__
+#define YYSTACK_USE_ALLOCA
#define alloca __builtin_alloca
#else /* not GNU C. */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
+#define YYSTACK_USE_ALLOCA
#include <alloca.h>
#else /* not sparc */
-#if defined (MSDOS) && !defined (__TURBOC__)
+/* We think this test detects Watcom and Microsoft C. */
+/* This used to test MSDOS, but that is a bad idea
+ since that symbol is in the user namespace. */
+#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
+#if 0 /* No need for malloc.h, which pollutes the namespace;
+ instead, just don't use alloca. */
#include <malloc.h>
+#endif
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
-#include <malloc.h>
+/* I don't know what this was needed for, but it pollutes the namespace.
+ So I turned it off. rms, 2 May 1997. */
+/* #include <malloc.h> */
#pragma alloca
-#else /* not MSDOS, __TURBOC__, or _AIX */
-#ifdef __hpux
-#ifdef __cplusplus
-extern "C" {
-void *alloca (unsigned int);
-};
-#else /* not __cplusplus */
-void *alloca ();
-#endif /* not __cplusplus */
+#define YYSTACK_USE_ALLOCA
+#else /* not MSDOS, or __TURBOC__, or _AIX */
+#if 0
+#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
+ and on HPUX 10. Eventually we can turn this on. */
+#define YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
#endif /* __hpux */
+#endif
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
-#endif /* not sparc. */
-#endif /* not GNU C. */
-#endif /* alloca not defined. */
+#endif /* not sparc */
+#endif /* not GNU C */
+#endif /* alloca not defined */
+#endif /* YYSTACK_USE_ALLOCA not defined */
-/* This is the parser code that is written into each bison parser
- when the %semantic_parser declaration is not specified in the grammar.
- It was written by Richard Stallman by simplifying the hairy parser
- used when %semantic_parser is specified. */
+#ifdef YYSTACK_USE_ALLOCA
+#define YYSTACK_ALLOC alloca
+#else
+#define YYSTACK_ALLOC malloc
+#endif
/* Note: there must be only one dollar sign in this file.
It is replaced by the list of actions, each action
@@ -2247,8 +2267,8 @@ void *alloca ();
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
-#define YYACCEPT return(0)
-#define YYABORT return(1)
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
#define YYERROR goto yyerrlab1
/* Like YYERROR except do call yyerror.
This remains here temporarily to ease the
@@ -2329,12 +2349,12 @@ int yydebug; /* nonzero means print parse trace */
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif
-
-/* Prevent warning if -Wstrict-prototypes. */
-#ifdef __GNUC__
-int yyparse (void);
-#endif
+/* Define __yy_memcpy. Note that the size argument
+ should be passed with type unsigned int, because that is what the non-GCC
+ definitions require. With GCC, __builtin_memcpy takes an arg
+ of type size_t, but it can handle unsigned int. */
+
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
#else /* not GNU C or C++ */
@@ -2346,7 +2366,7 @@ static void
__yy_memcpy (to, from, count)
char *to;
char *from;
- int count;
+ unsigned int count;
{
register char *f = from;
register char *t = to;
@@ -2361,10 +2381,10 @@ __yy_memcpy (to, from, count)
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
-__yy_memcpy (char *to, char *from, int count)
+__yy_memcpy (char *to, char *from, unsigned int count)
{
- register char *f = from;
register char *t = to;
+ register char *f = from;
register int i = count;
while (i-- > 0)
@@ -2374,7 +2394,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif
#endif
-#line 196 "/usr/share/misc/bison.simple"
+#line 216 "/usr/share/misc/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
@@ -2395,6 +2415,15 @@ __yy_memcpy (char *to, char *from, int count)
#define YYPARSE_PARAM_DECL
#endif /* not YYPARSE_PARAM */
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+#ifdef YYPARSE_PARAM
+int yyparse (void *);
+#else
+int yyparse (void);
+#endif
+#endif
+
int
yyparse(YYPARSE_PARAM_ARG)
YYPARSE_PARAM_DECL
@@ -2423,6 +2452,7 @@ yyparse(YYPARSE_PARAM_ARG)
#endif
int yystacksize = YYINITDEPTH;
+ int yyfree_stacks = 0;
#ifdef YYPURE
int yychar;
@@ -2507,18 +2537,32 @@ yynewstate:
if (yystacksize >= YYMAXDEPTH)
{
yyerror("parser stack overflow");
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
return 2;
}
yystacksize *= 2;
if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
- yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
- __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
- yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
- __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
+#ifndef YYSTACK_USE_ALLOCA
+ yyfree_stacks = 1;
+#endif
+ yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
+ __yy_memcpy ((char *)yyss, (char *)yyss1,
+ size * (unsigned int) sizeof (*yyssp));
+ yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
+ __yy_memcpy ((char *)yyvs, (char *)yyvs1,
+ size * (unsigned int) sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
- yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
- __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
+ yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
+ __yy_memcpy ((char *)yyls, (char *)yyls1,
+ size * (unsigned int) sizeof (*yylsp));
#endif
#endif /* no yyoverflow */
@@ -4401,7 +4445,7 @@ case 373:
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 498 "/usr/share/misc/bison.simple"
+#line 542 "/usr/share/misc/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
@@ -4596,6 +4640,30 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
+
+ yyacceptlab:
+ /* YYACCEPT comes here. */
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 0;
+
+ yyabortlab:
+ /* YYABORT comes here. */
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 1;
}
#line 1606 "parse.y"
@@ -5045,7 +5113,7 @@ parse_regx(term, paren)
options |= RE_OPTION_EXTENDED;
break;
case 'p':
- options |= RE_OPTION_POSIX;
+ options |= RE_OPTION_POSIXLINE;
break;
case 'o':
once = 1;
@@ -5137,6 +5205,8 @@ parse_string(func, term, paren)
}
else if (c == '\\') {
c = nextc();
+ if (c == '\n')
+ continue;
if (c == term) {
tokadd(c);
}
@@ -5208,6 +5278,9 @@ parse_qstring(term, paren)
else if (c == '\\') {
c = nextc();
switch (c) {
+ case '\n':
+ continue;
+
case '\\':
c = '\\';
break;
diff --git a/parse.y b/parse.y
index 75bc6b59cf..cabced742b 100644
--- a/parse.y
+++ b/parse.y
@@ -2050,7 +2050,7 @@ parse_regx(term, paren)
options |= RE_OPTION_EXTENDED;
break;
case 'p':
- options |= RE_OPTION_POSIX;
+ options |= RE_OPTION_POSIXLINE;
break;
case 'o':
once = 1;
@@ -2142,6 +2142,8 @@ parse_string(func, term, paren)
}
else if (c == '\\') {
c = nextc();
+ if (c == '\n')
+ continue;
if (c == term) {
tokadd(c);
}
@@ -2213,6 +2215,9 @@ parse_qstring(term, paren)
else if (c == '\\') {
c = nextc();
switch (c) {
+ case '\n':
+ continue;
+
case '\\':
c = '\\';
break;
diff --git a/process.c b/process.c
index e7e165a251..91b0e4cebf 100644
--- a/process.c
+++ b/process.c
@@ -480,13 +480,6 @@ rb_f_exec(argc, argv)
if (argc == 0) {
rb_raise(rb_eArgError, "wrong # of arguments");
}
- if (TYPE(argv[0]) == T_ARRAY) {
- if (RARRAY(argv[0])->len != 2) {
- rb_raise(rb_eArgError, "wrong first argument");
- }
- prog = RARRAY(argv[0])->ptr[0];
- argv[0] = RARRAY(argv[0])->ptr[1];
- }
if (TYPE(argv[0]) == T_ARRAY) {
if (RARRAY(argv[0])->len != 2) {
diff --git a/range.c b/range.c
index 7f0e0c581f..dd023cc23b 100644
--- a/range.c
+++ b/range.c
@@ -74,7 +74,7 @@ range_s_new(argc, argv, klass)
VALUE beg, end, flag, range;
rb_scan_args(argc, argv, "21", &beg, &end, &flag);
- if (argc == 2) flag == Qtrue;
+ if (argc == 2) flag = Qfalse;
return range_new(klass, beg, end, RTEST(flag));
}
diff --git a/re.c b/re.c
index 92cf09245e..845428b787 100644
--- a/re.c
+++ b/re.c
@@ -90,7 +90,7 @@ rb_str_cicmp(str1, str2)
#define REG_CASESTATE FL_USER0
#define REG_IGNORECASE FL_USER1
#define REG_EXTENDED FL_USER2
-#define REG_POSIX FL_USER3
+#define REG_POSIXLINE FL_USER3
#define KCODE_NONE 0
#define KCODE_EUC FL_USER4
@@ -234,7 +234,7 @@ rb_reg_desc(s, len, re)
rb_str_cat(str, "i", 1);
if (FL_TEST(re, REG_EXTENDED))
rb_str_cat(str, "x", 1);
- if (FL_TEST(re, REG_POSIX))
+ if (FL_TEST(re, REG_POSIXLINE))
rb_str_cat(str, "p", 1);
if (FL_TEST(re, KCODE_FIXED)) {
switch ((RBASIC(re)->flags & KCODE_MASK)) {
@@ -494,16 +494,16 @@ rb_reg_prepare_re(reg)
}
int
-rb_reg_search(reg, str, start, reverse)
+rb_reg_search(reg, str, pos, reverse)
VALUE reg, str;
- int start, reverse;
+ int pos, reverse;
{
int result;
VALUE match;
struct re_registers *regs = 0;
int range;
- if (start > RSTRING(str)->len) return -1;
+ if (pos > RSTRING(str)->len) return -1;
if (may_need_recompile)
rb_reg_prepare_re(reg);
@@ -530,14 +530,13 @@ rb_reg_search(reg, str, start, reverse)
}
regs = RMATCH(match)->regs;
+ range = RSTRING(str)->len - pos;
if (reverse) {
- range = -start;
- }
- else {
- range = RSTRING(str)->len - start;
+ range = -range;
+ pos = RSTRING(str)->len;
}
result = re_search(RREGEXP(reg)->ptr,RSTRING(str)->ptr,RSTRING(str)->len,
- start, range, regs);
+ pos, range, regs);
if (FL_TEST(reg, KCODE_FIXED))
kcode_reset_option();
@@ -722,7 +721,7 @@ rb_reg_new_1(klass, s, len, options)
int len;
int options; /* CASEFOLD = 1 */
/* EXTENDED = 2 */
- /* POSIX = 4 */
+ /* POSIXLINE = 4 */
/* CODE_NONE = 8 */
/* CODE_EUC = 16 */
/* CODE_SJIS = 24 */
@@ -739,8 +738,8 @@ rb_reg_new_1(klass, s, len, options)
if (options & RE_OPTION_EXTENDED) {
FL_SET(re, REG_EXTENDED);
}
- if (options & RE_OPTION_POSIX) {
- FL_SET(re, REG_POSIX);
+ if (options & RE_OPTION_POSIXLINE) {
+ FL_SET(re, REG_POSIXLINE);
}
switch (options & ~0x7) {
case 0:
@@ -1216,13 +1215,13 @@ Init_Regexp()
rb_eRegxpError = rb_define_class("RegxpError", rb_eStandardError);
re_set_casetable(casetable);
-#ifdef RUBY_USE_EUC
+#if DEFAULT_KCODE == KCODE_EUC
re_mbcinit(MBCTYPE_EUC);
#else
-#ifdef RUBY_USE_SJIS
+#if DEFAULT_KCODE == KCODE_SJIS
re_mbcinit(MBCTYPE_SJIS);
#else
-#ifdef RUBY_USE_UTF8
+#if DEFAULT_KCODE == KCODE_UTF8
re_mbcinit(MBCTYPE_UTF8);
#else
re_mbcinit(MBCTYPE_ASCII);
@@ -1259,7 +1258,7 @@ Init_Regexp()
rb_define_const(rb_cRegexp, "IGNORECASE", INT2FIX(RE_OPTION_IGNORECASE));
rb_define_const(rb_cRegexp, "EXTENDED", INT2FIX(RE_OPTION_EXTENDED));
- rb_define_const(rb_cRegexp, "POSIX", INT2FIX(RE_OPTION_POSIX));
+ rb_define_const(rb_cRegexp, "POSIXLINE", INT2FIX(RE_OPTION_POSIXLINE));
rb_global_variable(&reg_cache);
rb_global_variable(&matchcache);
@@ -1276,6 +1275,6 @@ Init_Regexp()
rb_define_method(rb_cMatch, "pre_match", rb_reg_match_pre, 0);
rb_define_method(rb_cMatch, "post_match", rb_reg_match_post, 0);
rb_define_method(rb_cMatch, "to_s", match_to_s, 0);
- rb_define_method(rb_cMatch, "string_s", match_string, 0);
+ rb_define_method(rb_cMatch, "string", match_string, 0);
rb_define_method(rb_cMatch, "inspect", rb_any_to_s, 0);
}
diff --git a/regex.c b/regex.c
index 86db3fc8df..530701b2d5 100644
--- a/regex.c
+++ b/regex.c
@@ -352,8 +352,8 @@ enum regexpcode
stop_paren, /* Place holder at the end of (?:..). */
casefold_on, /* Turn on casefold flag. */
casefold_off, /* Turn off casefold flag. */
- posix_on, /* Turn on POSIXified match (match with newlines). */
- posix_off, /* Turn off POSIXified match. */
+ posix_on, /* Turn on POSIXified line match (match with newlines). */
+ posix_off, /* Turn off POSIXified line match. */
start_nowidth, /* Save string point to the stack. */
stop_nowidth, /* Restore string place at the point start_nowidth. */
pop_and_fail, /* Fail after popping nowidth entry from stack. */
@@ -1295,7 +1295,7 @@ re_compile_pattern(pattern, size, bufp)
/* charset_not matches newline according to a syntax bit. */
if ((enum regexpcode)b[-2] == charset_not) {
- if (bufp->options & RE_OPTION_POSIX)
+ if (bufp->options & RE_OPTION_POSIXLINE)
SET_LIST_BIT ('\n');
else
SET_LIST_BIT ('\0');
@@ -1554,13 +1554,13 @@ re_compile_pattern(pattern, size, bufp)
break;
case 'p':
if (negative) {
- if (options&RE_OPTION_POSIX) {
- options &= ~RE_OPTION_POSIX;
+ if (options&RE_OPTION_POSIXLINE) {
+ options &= ~RE_OPTION_POSIXLINE;
BUFPUSH(posix_off);
}
}
- else if (!(options&RE_OPTION_POSIX)) {
- options |= RE_OPTION_POSIX;
+ else if (!(options&RE_OPTION_POSIXLINE)) {
+ options |= RE_OPTION_POSIXLINE;
BUFPUSH(posix_on);
}
break;
@@ -1671,8 +1671,8 @@ re_compile_pattern(pattern, size, bufp)
if ((options ^ stackp[-1]) & RE_OPTION_IGNORECASE) {
BUFPUSH((options&RE_OPTION_IGNORECASE)?casefold_off:casefold_on);
}
- if ((options ^ stackp[-1]) & RE_OPTION_POSIX) {
- BUFPUSH((options&RE_OPTION_POSIX)?posix_off:posix_on);
+ if ((options ^ stackp[-1]) & RE_OPTION_POSIXLINE) {
+ BUFPUSH((options&RE_OPTION_POSIXLINE)?posix_off:posix_on);
}
pending_exact = 0;
if (fixup_alt_jump) {
@@ -1766,9 +1766,9 @@ re_compile_pattern(pattern, size, bufp)
break;
case '{':
- /* If there is no previous pattern, this isn't an interval. */
+ /* If there is no previous pattern, this is an invalid pattern. */
if (!laststart || p == pend) {
- goto normal_char;
+ goto invalid_pattern;
}
beg_interval = p - 1;
@@ -1836,6 +1836,44 @@ re_compile_pattern(pattern, size, bufp)
break;
}
+ /* If lower_bound == upper_bound, repeat cound can be removed */
+ if (lower_bound == upper_bound) {
+ int mcnt;
+ int skip_stop_paren = 0;
+
+ if (b[-1] == stop_paren) {
+ skip_stop_paren = 1;
+ b--;
+ }
+
+ if (*laststart == exactn && laststart[1]+2 == b - laststart
+ && laststart[1]*lower_bound < 256) {
+ mcnt = laststart[1];
+ GET_BUFFER_SPACE((lower_bound-1)*mcnt);
+ laststart[1] = lower_bound*mcnt;
+ while (--lower_bound) {
+ memcpy(b, laststart+2, mcnt);
+ b += mcnt;
+ }
+ if (skip_stop_paren) BUFPUSH(stop_paren);
+ break;
+ }
+
+ if (lower_bound < 5 && b - laststart < 10) {
+ /* 5 and 10 are the magic numbers */
+
+ mcnt = b - laststart;
+ GET_BUFFER_SPACE((lower_bound-1)*mcnt);
+ while (--lower_bound) {
+ memcpy(b, laststart, mcnt);
+ b += mcnt;
+ }
+ if (skip_stop_paren) BUFPUSH(stop_paren);
+ break;
+ }
+ if (skip_stop_paren) b++; /* push back stop_paren */
+ }
+
/* Otherwise, we have a nontrivial interval. When
we're all done, the pattern will look like:
set_number_at <jump count> <upper bound>
@@ -2120,7 +2158,7 @@ re_compile_pattern(pattern, size, bufp)
laststart++;
EXTRACT_NUMBER_AND_INCR(mcnt, laststart);
if (mcnt == 4 && *laststart == anychar) {
- switch ((enum regexpcode)laststart[4]) {
+ switch ((enum regexpcode)laststart[1]) {
case jump_n:
case finalize_jump:
case maybe_finalize_jump:
@@ -2539,7 +2577,7 @@ re_compile_fastmap(bufp)
case posix_on:
case posix_off:
- options ^= RE_OPTION_POSIX;
+ options ^= RE_OPTION_POSIXLINE;
continue;
case endline:
@@ -2639,7 +2677,7 @@ re_compile_fastmap(bufp)
fastmap['\n'] = 1;
case anychar:
for (j = 0; j < (1 << BYTEWIDTH); j++) {
- if (j != '\n' || (options & RE_OPTION_POSIX))
+ if (j != '\n' || (options & RE_OPTION_POSIXLINE))
fastmap[j] = 1;
}
if (bufp->can_be_null) {
@@ -2836,6 +2874,7 @@ re_search(bufp, string, size, startpos, range, regs)
if (bufp->used>0) {
switch ((enum regexpcode)bufp->buffer[0]) {
case begbuf:
+ begbuf_match:
if (range > 0) {
if (startpos > 0)
return -1;
@@ -2854,6 +2893,9 @@ re_search(bufp, string, size, startpos, range, regs)
}
}
if (bufp->options & RE_OPTIMIZE_ANCHOR) {
+ if (bufp->options&RE_OPTION_POSIXLINE) {
+ goto begbuf_match;
+ }
anchor = 1;
}
@@ -2945,7 +2987,8 @@ re_search(bufp, string, size, startpos, range, regs)
#endif /* NO_ALLOCA */
if (range > 0) {
- if (anchor && startpos < size && startpos > 0 && string[startpos-1] != '\n') {
+ if (anchor && startpos < size &&
+ (startpos < 1 || string[startpos-1] != '\n')) {
while (range > 0 && string[startpos] != '\n') {
range--;
startpos++;
@@ -3549,7 +3592,7 @@ re_match(bufp, string_arg, size, pos, regs)
d += mbclen(*d);
break;
}
- if (!(options&RE_OPTION_POSIX) &&
+ if (!(options&RE_OPTION_POSIXLINE) &&
(TRANSLATE_P() ? translate[*d] : *d) == '\n')
goto fail;
SET_REGS_MATCHED;
@@ -3850,11 +3893,11 @@ re_match(bufp, string_arg, size, pos, regs)
continue;
case posix_on:
- options |= RE_OPTION_POSIX;
+ options |= RE_OPTION_POSIXLINE;
continue;
case posix_off:
- options &= ~RE_OPTION_POSIX;
+ options &= ~RE_OPTION_POSIXLINE;
continue;
case wordbound:
diff --git a/regex.h b/regex.h
index 70ba23bd02..e116f63c9f 100644
--- a/regex.h
+++ b/regex.h
@@ -64,12 +64,12 @@
/* perl-style extended pattern available */
#define RE_OPTION_EXTENDED (RE_OPTION_IGNORECASE<<1)
/* newline will be included for . and invert charclass matches */
-#define RE_OPTION_POSIX (RE_OPTION_EXTENDED<<1)
+#define RE_OPTION_POSIXLINE (RE_OPTION_EXTENDED<<1)
-#define RE_MAY_IGNORECASE (RE_OPTION_POSIX<<1)
+#define RE_MAY_IGNORECASE (RE_OPTION_POSIXLINE<<1)
#define RE_OPTIMIZE_ANCHOR (RE_MAY_IGNORECASE<<1)
#define RE_OPTIMIZE_EXACTN (RE_OPTIMIZE_ANCHOR<<1)
-#define RE_OPTIMIZE_NO_BM (RE_OPTIMIZE_ANCHOR<<1)
+#define RE_OPTIMIZE_NO_BM (RE_OPTIMIZE_EXACTN<<1)
/* For multi-byte char support */
#define MBCTYPE_ASCII 0
diff --git a/rubyio.h b/rubyio.h
index 77c37fc45f..8bb75b6972 100644
--- a/rubyio.h
+++ b/rubyio.h
@@ -50,11 +50,12 @@ typedef struct OpenFile {
FILE *rb_fopen _((const char*, const char*));
FILE *rb_fdopen _((int, const char*));
-void rb_io_check_writable _((OpenFile *));
-void rb_io_check_readable _((OpenFile *));
-void rb_io_fptr_finalize _((OpenFile *));
-void rb_io_unbuffered _((OpenFile *));
-void rb_io_check_closed _((OpenFile *));
+int rb_io_mode_flags _((const char*));
+void rb_io_check_writable _((OpenFile*));
+void rb_io_check_readable _((OpenFile*));
+void rb_io_fptr_finalize _((OpenFile*));
+void rb_io_unbuffered _((OpenFile*));
+void rb_io_check_closed _((OpenFile*));
void rb_eof_error _((void));
#endif
diff --git a/sample/rename.rb b/sample/rename.rb
index 4174c382c4..8b2a0be67e 100644
--- a/sample/rename.rb
+++ b/sample/rename.rb
@@ -248,8 +248,8 @@ gsub!(/\bstr_plus\b/,"rb_str_plus")
gsub!(/\bstr_resize\b/,"rb_str_resize")
gsub!(/\bstr_split\b/,"rb_str_split")
gsub!(/\bstr_substr\b/,"rb_str_substr")
-gsub!(/\bstr_taint\b/,"rb_str_taint")
-gsub!(/\bstr_tainted\b/,"rb_str_tainted")
+gsub!(/\bstr_taint\b/,"rb_obj_taint")
+gsub!(/\bstr_tainted\b/,"rb_obj_tainted")
gsub!(/\bstr_times\b/,"rb_str_times")
gsub!(/\bstr_to_str\b/,"rb_str_to_str")
gsub!(/\bstr_upto\b/,"rb_str_upto")
diff --git a/string.c b/string.c
index a17503384a..7b8a55aa94 100644
--- a/string.c
+++ b/string.c
@@ -616,16 +616,16 @@ rb_str_rindex(argc, argv, str)
VALUE str;
{
VALUE sub;
- VALUE initpos;
+ VALUE position;
int pos, len;
char *s, *sbeg, *t;
- if (rb_scan_args(argc, argv, "11", &sub, &initpos) == 2) {
- pos = NUM2INT(initpos);
- if (pos >= RSTRING(str)->len) pos = RSTRING(str)->len;
+ if (rb_scan_args(argc, argv, "11", &sub, &position) == 2) {
+ pos = NUM2INT(position);
+ if (pos > RSTRING(str)->len) return Qnil;
}
else {
- pos = RSTRING(str)->len;
+ pos = 0;
}
switch (TYPE(sub)) {
@@ -636,13 +636,14 @@ rb_str_rindex(argc, argv, str)
case T_STRING:
/* substring longer than string */
- if (pos > RSTRING(str)->len) return Qnil;
- sbeg = RSTRING(str)->ptr; s = sbeg + pos - RSTRING(sub)->len;
+ if (RSTRING(str)->len - pos < RSTRING(sub)->len) return Qnil;
+ sbeg = RSTRING(str)->ptr + pos;
+ s = RSTRING(str)->ptr + RSTRING(str)->len - RSTRING(sub)->len;
t = RSTRING(sub)->ptr;
len = RSTRING(sub)->len;
while (sbeg <= s) {
if (*s == *t && memcmp(s, t, len) == 0) {
- return INT2FIX(s - sbeg);
+ return INT2FIX(s - RSTRING(str)->ptr);
}
s--;
}
@@ -651,10 +652,12 @@ rb_str_rindex(argc, argv, str)
case T_FIXNUM:
{
int c = FIX2INT(sub);
- char *p = RSTRING(str)->ptr;
+ char *p = RSTRING(str)->ptr + RSTRING(str)->len - 1;
+ char *pbeg = RSTRING(str)->ptr + pos;
- for (;pos>=0;pos--) {
- if (p[pos] == c) return INT2FIX(pos);
+ while (pbeg <= p) {
+ if (*p == c) return INT2FIX(p - RSTRING(str)->ptr);
+ p--;
}
return Qnil;
}
@@ -865,8 +868,8 @@ rb_str_aset(str, indx, val)
if (idx < 0) {
idx += RSTRING(str)->len;
}
- if (idx < 0 || RSTRING(str)->len < idx) {
- rb_raise(rb_eIndexError, "index %d out of string", NUM2INT(beg));
+ if (idx < 0 || RSTRING(str)->len <= idx) {
+ rb_raise(rb_eIndexError, "index %d out of string", idx);
}
if (FIXNUM_P(val)) {
if (RSTRING(str)->len == idx) {
diff --git a/version.h b/version.h
index 2a04aace62..b77518f4ac 100644
--- a/version.h
+++ b/version.h
@@ -1,2 +1,2 @@
#define RUBY_VERSION "1.3.3"
-#define RUBY_RELEASE_DATE "1999-04-20"
+#define RUBY_RELEASE_DATE "1999-04-30"
diff --git a/win32/win32.h b/win32/win32.h
index 8304946eaf..b5933a6e02 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -148,7 +148,8 @@
#define snprintf _snprintf
#define popen _popen
#define pclose _pclose
-#define strcasecmp _strcmpi
+#define strcasecmp _stricmp
+#define strncasecmp _strnicmp
/* these are defined in nt.c */