mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* regex.c (re_search): should consider reverse search.
* dir.c (dir_s_chdir): warn only when invoked from multiple threads or block is not given. * object.c (rb_convert_type): should use rb_rescue(), not rb_rescue2(). * range.c (range_init): ditto. * object.c (rb_obj_dup): should free generic_ivar if original owns them. * string.c (rb_str_each_line): should propagate taint mark. * ext/nkf/nkf.c (rb_nkf_kconv): ditto. * eval.c (rb_f_require): revamp for simpler implementation. * file.c (rb_find_file_noext): use String object, instead of passing char* around. * file.c (rb_find_file): ditto. * dln.c (dln_load): should use NSLINKMODULE_OPTION_BINDNOW. * ruby.c (load_file): local variables 'c' remain uninitialized on xflag. * regex.c (re_match): prefetched escaped character too early. * eval.c (rb_call0): add argument check for attr_readers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f4b516777b
commit
03d1c9cd82
18 changed files with 959 additions and 446 deletions
52
ChangeLog
52
ChangeLog
|
@ -16,6 +16,10 @@ Sat Jul 14 02:55:02 2001 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* ext/.cvsignore: let cvs ignore extinit.c.
|
* ext/.cvsignore: let cvs ignore extinit.c.
|
||||||
|
|
||||||
|
Fri Jul 13 23:47:35 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* regex.c (re_search): should consider reverse search.
|
||||||
|
|
||||||
Fri Jul 13 22:26:09 2001 Akinori MUSHA <knu@iDaemons.org>
|
Fri Jul 13 22:26:09 2001 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* lib/mkmf.rb: use File::split to split a target into a prefix and
|
* lib/mkmf.rb: use File::split to split a target into a prefix and
|
||||||
|
@ -24,6 +28,11 @@ Fri Jul 13 22:26:09 2001 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* ext/extmk.rb.in: ditto.
|
* ext/extmk.rb.in: ditto.
|
||||||
|
|
||||||
|
Fri Jul 13 02:36:10 2001 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
|
* dir.c (dir_s_chdir): warn only when invoked from multiple
|
||||||
|
threads or block is not given.
|
||||||
|
|
||||||
Thu Jul 12 15:11:48 2001 WATANABE Hirofumi <eban@ruby-lang.org>
|
Thu Jul 12 15:11:48 2001 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
* ext/socket/socket.c (ruby_connect): workaround for the setup of
|
* ext/socket/socket.c (ruby_connect): workaround for the setup of
|
||||||
|
@ -45,10 +54,53 @@ Sun Jul 8 16:04:35 2001 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
* lib/net/protocol.rb (ProtoSocket#read): modify typo.
|
* lib/net/protocol.rb (ProtoSocket#read): modify typo.
|
||||||
|
|
||||||
|
Sat Jul 7 17:45:35 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* object.c (rb_convert_type): should use rb_rescue(), not rb_rescue2().
|
||||||
|
|
||||||
|
* range.c (range_init): ditto.
|
||||||
|
|
||||||
|
Fri Jul 6 18:01:10 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* object.c (rb_obj_dup): should free generic_ivar if original owns
|
||||||
|
them.
|
||||||
|
|
||||||
Fri Jul 6 02:15:06 2001 Akinori MUSHA <knu@iDaemons.org>
|
Fri Jul 6 02:15:06 2001 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* lib/tempfile.rb: a tempfile must be created with mode 0600.
|
* lib/tempfile.rb: a tempfile must be created with mode 0600.
|
||||||
|
|
||||||
|
Thu Jul 5 20:28:53 2001 Tietew <tietew@tietew.net>
|
||||||
|
|
||||||
|
* string.c (rb_str_each_line): should propagate taint mark.
|
||||||
|
|
||||||
|
* ext/nkf/nkf.c (rb_nkf_kconv): ditto.
|
||||||
|
|
||||||
|
Fri Jul 6 14:54:27 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* eval.c (rb_f_require): revamp for simpler implementation.
|
||||||
|
|
||||||
|
* file.c (rb_find_file_noext): use String object, instead of
|
||||||
|
passing char* around.
|
||||||
|
|
||||||
|
* file.c (rb_find_file): ditto.
|
||||||
|
|
||||||
|
Thu Jul 5 22:01:02 2001 Mitsuhiro Kondo <kondo@nik-prt.co.jp>
|
||||||
|
|
||||||
|
* dln.c (dln_load): should use NSLINKMODULE_OPTION_BINDNOW.
|
||||||
|
|
||||||
|
Thu Jul 5 13:44:03 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* ruby.c (load_file): local variables 'c' remain uninitialized on
|
||||||
|
xflag.
|
||||||
|
|
||||||
|
Thu Jul 5 10:00:59 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* regex.c (re_match): prefetched escaped character too early.
|
||||||
|
|
||||||
|
Wed Jul 4 08:58:30 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* eval.c (rb_call0): add argument check for attr_readers.
|
||||||
|
|
||||||
Wed Jul 4 04:22:44 2001 Minero Aoki <aamine@loveruby.net>
|
Wed Jul 4 04:22:44 2001 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
* lib/net/http.rb (HTTP#request_by_name): arg order changes.
|
* lib/net/http.rb (HTTP#request_by_name): arg order changes.
|
||||||
|
|
26
array.c
26
array.c
|
@ -726,6 +726,18 @@ rb_ary_clone(ary)
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VALUE
|
||||||
|
rb_ary_dup(ary)
|
||||||
|
VALUE ary;
|
||||||
|
{
|
||||||
|
VALUE dup = rb_ary_new2(RARRAY(ary)->len);
|
||||||
|
|
||||||
|
OBJSETUP(dup, rb_obj_type(ary), T_ARRAY);
|
||||||
|
MEMCPY(RARRAY(dup)->ptr, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
|
||||||
|
RARRAY(dup)->len = RARRAY(ary)->len;
|
||||||
|
return dup;
|
||||||
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
to_ary(ary)
|
to_ary(ary)
|
||||||
VALUE ary;
|
VALUE ary;
|
||||||
|
@ -973,7 +985,7 @@ static VALUE
|
||||||
rb_ary_reverse_m(ary)
|
rb_ary_reverse_m(ary)
|
||||||
VALUE ary;
|
VALUE ary;
|
||||||
{
|
{
|
||||||
return rb_ary_reverse(rb_obj_dup(ary));
|
return rb_ary_reverse(rb_ary_dup(ary));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -1034,7 +1046,7 @@ VALUE
|
||||||
rb_ary_sort(ary)
|
rb_ary_sort(ary)
|
||||||
VALUE ary;
|
VALUE ary;
|
||||||
{
|
{
|
||||||
ary = rb_obj_dup(ary);
|
ary = rb_ary_dup(ary);
|
||||||
rb_ary_sort_bang(ary);
|
rb_ary_sort_bang(ary);
|
||||||
return ary;
|
return ary;
|
||||||
}
|
}
|
||||||
|
@ -1047,7 +1059,7 @@ rb_ary_collect(ary)
|
||||||
VALUE collect;
|
VALUE collect;
|
||||||
|
|
||||||
if (!rb_block_given_p()) {
|
if (!rb_block_given_p()) {
|
||||||
return rb_obj_dup(ary);
|
return rb_ary_new4(RARRAY(ary)->len, RARRAY(ary)->ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
len = RARRAY(ary)->len;
|
len = RARRAY(ary)->len;
|
||||||
|
@ -1566,7 +1578,7 @@ static VALUE
|
||||||
rb_ary_uniq(ary)
|
rb_ary_uniq(ary)
|
||||||
VALUE ary;
|
VALUE ary;
|
||||||
{
|
{
|
||||||
ary = rb_obj_dup(ary);
|
ary = rb_ary_dup(ary);
|
||||||
rb_ary_uniq_bang(ary);
|
rb_ary_uniq_bang(ary);
|
||||||
return ary;
|
return ary;
|
||||||
}
|
}
|
||||||
|
@ -1597,7 +1609,7 @@ static VALUE
|
||||||
rb_ary_compact(ary)
|
rb_ary_compact(ary)
|
||||||
VALUE ary;
|
VALUE ary;
|
||||||
{
|
{
|
||||||
ary = rb_obj_dup(ary);
|
ary = rb_ary_dup(ary);
|
||||||
rb_ary_compact_bang(ary);
|
rb_ary_compact_bang(ary);
|
||||||
return ary;
|
return ary;
|
||||||
}
|
}
|
||||||
|
@ -1675,7 +1687,7 @@ static VALUE
|
||||||
rb_ary_flatten(ary)
|
rb_ary_flatten(ary)
|
||||||
VALUE ary;
|
VALUE ary;
|
||||||
{
|
{
|
||||||
ary = rb_obj_dup(ary);
|
ary = rb_ary_dup(ary);
|
||||||
rb_ary_flatten_bang(ary);
|
rb_ary_flatten_bang(ary);
|
||||||
return ary;
|
return ary;
|
||||||
}
|
}
|
||||||
|
@ -1724,6 +1736,7 @@ Init_Array()
|
||||||
rb_define_method(rb_cArray, "indexes", rb_ary_indexes, -1);
|
rb_define_method(rb_cArray, "indexes", rb_ary_indexes, -1);
|
||||||
rb_define_method(rb_cArray, "indices", rb_ary_indexes, -1);
|
rb_define_method(rb_cArray, "indices", rb_ary_indexes, -1);
|
||||||
rb_define_method(rb_cArray, "clone", rb_ary_clone, 0);
|
rb_define_method(rb_cArray, "clone", rb_ary_clone, 0);
|
||||||
|
rb_define_method(rb_cArray, "clone", rb_ary_dup, 0);
|
||||||
rb_define_method(rb_cArray, "join", rb_ary_join_m, -1);
|
rb_define_method(rb_cArray, "join", rb_ary_join_m, -1);
|
||||||
rb_define_method(rb_cArray, "reverse", rb_ary_reverse_m, 0);
|
rb_define_method(rb_cArray, "reverse", rb_ary_reverse_m, 0);
|
||||||
rb_define_method(rb_cArray, "reverse!", rb_ary_reverse_bang, 0);
|
rb_define_method(rb_cArray, "reverse!", rb_ary_reverse_bang, 0);
|
||||||
|
@ -1731,6 +1744,7 @@ Init_Array()
|
||||||
rb_define_method(rb_cArray, "sort!", rb_ary_sort_bang, 0);
|
rb_define_method(rb_cArray, "sort!", rb_ary_sort_bang, 0);
|
||||||
rb_define_method(rb_cArray, "collect", rb_ary_collect, 0);
|
rb_define_method(rb_cArray, "collect", rb_ary_collect, 0);
|
||||||
rb_define_method(rb_cArray, "collect!", rb_ary_collect_bang, 0);
|
rb_define_method(rb_cArray, "collect!", rb_ary_collect_bang, 0);
|
||||||
|
rb_define_method(rb_cArray, "map", rb_ary_collect, 0);
|
||||||
rb_define_method(rb_cArray, "map!", rb_ary_collect_bang, 0);
|
rb_define_method(rb_cArray, "map!", rb_ary_collect_bang, 0);
|
||||||
rb_define_method(rb_cArray, "filter", rb_ary_filter, 0);
|
rb_define_method(rb_cArray, "filter", rb_ary_filter, 0);
|
||||||
rb_define_method(rb_cArray, "delete", rb_ary_delete, 1);
|
rb_define_method(rb_cArray, "delete", rb_ary_delete, 1);
|
||||||
|
|
705
config.guess
vendored
705
config.guess
vendored
File diff suppressed because it is too large
Load diff
299
config.sub
vendored
299
config.sub
vendored
|
@ -1,6 +1,10 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Configuration validation subroutine script, version 1.1.
|
# Configuration validation subroutine script.
|
||||||
# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
|
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||||
|
# Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
timestamp='2001-04-20'
|
||||||
|
|
||||||
# This file is (in principle) common to ALL GNU software.
|
# This file is (in principle) common to ALL GNU software.
|
||||||
# The presence of a machine in this file suggests that SOME GNU software
|
# The presence of a machine in this file suggests that SOME GNU software
|
||||||
# can handle that machine. It does not imply ALL GNU software can.
|
# can handle that machine. It does not imply ALL GNU software can.
|
||||||
|
@ -25,6 +29,8 @@
|
||||||
# configuration script generated by Autoconf, you may include it under
|
# configuration script generated by Autoconf, you may include it under
|
||||||
# the same distribution terms that you use for the rest of that program.
|
# the same distribution terms that you use for the rest of that program.
|
||||||
|
|
||||||
|
# Please send patches to <config-patches@gnu.org>.
|
||||||
|
#
|
||||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||||
# Supply the specified configuration type as an argument.
|
# Supply the specified configuration type as an argument.
|
||||||
# If it is invalid, we print an error message on stderr and exit with code 1.
|
# If it is invalid, we print an error message on stderr and exit with code 1.
|
||||||
|
@ -45,30 +51,73 @@
|
||||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||||
# It is wrong to echo any other type of specification.
|
# It is wrong to echo any other type of specification.
|
||||||
|
|
||||||
if [ x$1 = x ]
|
me=`echo "$0" | sed -e 's,.*/,,'`
|
||||||
then
|
|
||||||
echo Configuration name missing. 1>&2
|
|
||||||
echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
|
|
||||||
echo "or $0 ALIAS" 1>&2
|
|
||||||
echo where ALIAS is a recognized configuration type. 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# First pass through any local machine types.
|
usage="\
|
||||||
|
Usage: $0 [OPTION] CPU-MFR-OPSYS
|
||||||
|
$0 [OPTION] ALIAS
|
||||||
|
|
||||||
|
Canonicalize a configuration name.
|
||||||
|
|
||||||
|
Operation modes:
|
||||||
|
-h, --help print this help, then exit
|
||||||
|
-t, --time-stamp print date of last modification, then exit
|
||||||
|
-v, --version print version number, then exit
|
||||||
|
|
||||||
|
Report bugs and patches to <config-patches@gnu.org>."
|
||||||
|
|
||||||
|
version="\
|
||||||
|
GNU config.sub ($timestamp)
|
||||||
|
|
||||||
|
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||||
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This is free software; see the source for copying conditions. There is NO
|
||||||
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||||
|
|
||||||
|
help="
|
||||||
|
Try \`$me --help' for more information."
|
||||||
|
|
||||||
|
# Parse command line
|
||||||
|
while test $# -gt 0 ; do
|
||||||
case $1 in
|
case $1 in
|
||||||
|
--time-stamp | --time* | -t )
|
||||||
|
echo "$timestamp" ; exit 0 ;;
|
||||||
|
--version | -v )
|
||||||
|
echo "$version" ; exit 0 ;;
|
||||||
|
--help | --h* | -h )
|
||||||
|
echo "$usage"; exit 0 ;;
|
||||||
|
-- ) # Stop option processing
|
||||||
|
shift; break ;;
|
||||||
|
- ) # Use stdin as input.
|
||||||
|
break ;;
|
||||||
|
-* )
|
||||||
|
echo "$me: invalid option $1$help"
|
||||||
|
exit 1 ;;
|
||||||
|
|
||||||
*local*)
|
*local*)
|
||||||
|
# First pass through any local machine types.
|
||||||
echo $1
|
echo $1
|
||||||
exit 0
|
exit 0;;
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
;;
|
break ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
case $# in
|
||||||
|
0) echo "$me: missing argument$help" >&2
|
||||||
|
exit 1;;
|
||||||
|
1) ;;
|
||||||
|
*) echo "$me: too many arguments$help" >&2
|
||||||
|
exit 1;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
|
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
|
||||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||||
case $maybe_os in
|
case $maybe_os in
|
||||||
linux*)
|
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*)
|
||||||
os=-$maybe_os
|
os=-$maybe_os
|
||||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||||
;;
|
;;
|
||||||
|
@ -94,7 +143,7 @@ case $os in
|
||||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||||
-apple)
|
-apple | -axis)
|
||||||
os=
|
os=
|
||||||
basic_machine=$1
|
basic_machine=$1
|
||||||
;;
|
;;
|
||||||
|
@ -105,7 +154,7 @@ case $os in
|
||||||
-scout)
|
-scout)
|
||||||
;;
|
;;
|
||||||
-wrs)
|
-wrs)
|
||||||
os=vxworks
|
os=-vxworks
|
||||||
basic_machine=$1
|
basic_machine=$1
|
||||||
;;
|
;;
|
||||||
-hiux*)
|
-hiux*)
|
||||||
|
@ -156,61 +205,83 @@ case $os in
|
||||||
-psos*)
|
-psos*)
|
||||||
os=-psos
|
os=-psos
|
||||||
;;
|
;;
|
||||||
|
-mint | -mint[0-9]*)
|
||||||
|
basic_machine=m68k-atari
|
||||||
|
os=-mint
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Decode aliases for certain CPU-COMPANY combinations.
|
# Decode aliases for certain CPU-COMPANY combinations.
|
||||||
case $basic_machine in
|
case $basic_machine in
|
||||||
# Recognize the basic CPU types without company name.
|
# Recognize the basic CPU types without company name.
|
||||||
# Some are omitted here because they have special meanings below.
|
# Some are omitted here because they have special meanings below.
|
||||||
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
|
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
|
||||||
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
|
| arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
|
||||||
|
| pyramid | mn10200 | mn10300 | tron | a29k \
|
||||||
| 580 | i960 | h8300 \
|
| 580 | i960 | h8300 \
|
||||||
|
| x86 | ppcbe | mipsbe | mipsle | shbe | shle \
|
||||||
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
|
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
|
||||||
| alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
|
| hppa64 \
|
||||||
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
|
| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
|
||||||
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
|
| alphaev6[78] \
|
||||||
|
| we32k | ns16k | clipper | i370 | sh | sh[34] \
|
||||||
|
| powerpc | powerpcle \
|
||||||
|
| 1750a | dsp16xx | pdp10 | pdp11 \
|
||||||
|
| mips16 | mips64 | mipsel | mips64el \
|
||||||
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
|
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
|
||||||
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
|
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
|
||||||
| mips64vr5000 | miprs64vr5000el \
|
| mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \
|
||||||
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
|
| sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
|
||||||
| thumb | d10v)
|
| v850 | c4x \
|
||||||
|
| thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
|
||||||
|
| pj | pjl | h8500)
|
||||||
basic_machine=$basic_machine-unknown
|
basic_machine=$basic_machine-unknown
|
||||||
;;
|
;;
|
||||||
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65)
|
m6811 | m68hc11 | m6812 | m68hc12)
|
||||||
|
# Motorola 68HC11/12.
|
||||||
|
basic_machine=$basic_machine-unknown
|
||||||
|
os=-none
|
||||||
|
;;
|
||||||
|
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# We use `pc' rather than `unknown'
|
# We use `pc' rather than `unknown'
|
||||||
# because (1) that's what they normally are, and
|
# because (1) that's what they normally are, and
|
||||||
# (2) the word "unknown" tends to confuse beginning users.
|
# (2) the word "unknown" tends to confuse beginning users.
|
||||||
i[34567]86)
|
i*86 | x86_64)
|
||||||
basic_machine=$basic_machine-pc
|
basic_machine=$basic_machine-pc
|
||||||
;;
|
;;
|
||||||
i[3456]86-TOWNS*)
|
|
||||||
basic_machine=`echo $basic_machine | sed -e 's/-TOWNS.*/-TOWNS/'`
|
|
||||||
;;
|
|
||||||
# Object if more than one company name word.
|
# Object if more than one company name word.
|
||||||
*-*-*)
|
*-*-*)
|
||||||
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
# Recognize the basic CPU types with company name.
|
# Recognize the basic CPU types with company name.
|
||||||
vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
|
# FIXME: clean up the formatting here.
|
||||||
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
|
vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
|
||||||
|
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
|
||||||
|
| arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
|
||||||
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
|
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
|
||||||
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
|
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
|
||||||
| xmp-* | ymp-* \
|
| xmp-* | ymp-* \
|
||||||
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
|
| x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
|
||||||
| alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
|
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
|
||||||
|
| hppa2.0n-* | hppa64-* \
|
||||||
|
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
|
||||||
|
| alphaev6[78]-* \
|
||||||
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
|
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
|
||||||
| clipper-* | orion-* \
|
| clipper-* | orion-* \
|
||||||
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
|
| sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
|
||||||
| sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
|
| sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
|
||||||
|
| mips16-* | mips64-* | mipsel-* \
|
||||||
| mips64el-* | mips64orion-* | mips64orionel-* \
|
| mips64el-* | mips64orion-* | mips64orionel-* \
|
||||||
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
|
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
|
||||||
| mipstx39-* | mipstx39el-* \
|
| mipstx39-* | mipstx39el-* | mcore-* \
|
||||||
| f301-* | armv*-* | t3e-* \
|
| f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
|
||||||
|
| [cjt]90-* \
|
||||||
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
|
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
|
||||||
| thumb-* | v850-* | d30v-* | tic30-* | c30-* )
|
| thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
|
||||||
|
| bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
|
||||||
;;
|
;;
|
||||||
# Recognize the various machine names and aliases which stand
|
# Recognize the various machine names and aliases which stand
|
||||||
# for a CPU type and a company and sometimes even an OS.
|
# for a CPU type and a company and sometimes even an OS.
|
||||||
|
@ -247,14 +318,14 @@ case $basic_machine in
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
amiga | amiga-*)
|
amiga | amiga-*)
|
||||||
basic_machine=m68k-cbm
|
basic_machine=m68k-unknown
|
||||||
;;
|
;;
|
||||||
amigaos | amigados)
|
amigaos | amigados)
|
||||||
basic_machine=m68k-cbm
|
basic_machine=m68k-unknown
|
||||||
os=-amigaos
|
os=-amigaos
|
||||||
;;
|
;;
|
||||||
amigaunix | amix)
|
amigaunix | amix)
|
||||||
basic_machine=m68k-cbm
|
basic_machine=m68k-unknown
|
||||||
os=-sysv4
|
os=-sysv4
|
||||||
;;
|
;;
|
||||||
apollo68)
|
apollo68)
|
||||||
|
@ -301,13 +372,16 @@ case $basic_machine in
|
||||||
basic_machine=cray2-cray
|
basic_machine=cray2-cray
|
||||||
os=-unicos
|
os=-unicos
|
||||||
;;
|
;;
|
||||||
[ctj]90-cray)
|
[cjt]90)
|
||||||
basic_machine=c90-cray
|
basic_machine=${basic_machine}-cray
|
||||||
os=-unicos
|
os=-unicos
|
||||||
;;
|
;;
|
||||||
crds | unos)
|
crds | unos)
|
||||||
basic_machine=m68k-crds
|
basic_machine=m68k-crds
|
||||||
;;
|
;;
|
||||||
|
cris | cris-* | etrax*)
|
||||||
|
basic_machine=cris-axis
|
||||||
|
;;
|
||||||
da30 | da30-*)
|
da30 | da30-*)
|
||||||
basic_machine=m68k-da30
|
basic_machine=m68k-da30
|
||||||
;;
|
;;
|
||||||
|
@ -355,6 +429,10 @@ case $basic_machine in
|
||||||
basic_machine=tron-gmicro
|
basic_machine=tron-gmicro
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
|
go32)
|
||||||
|
basic_machine=i386-pc
|
||||||
|
os=-go32
|
||||||
|
;;
|
||||||
h3050r* | hiux*)
|
h3050r* | hiux*)
|
||||||
basic_machine=hppa1.1-hitachi
|
basic_machine=hppa1.1-hitachi
|
||||||
os=-hiuxwe2
|
os=-hiuxwe2
|
||||||
|
@ -428,22 +506,21 @@ case $basic_machine in
|
||||||
;;
|
;;
|
||||||
i370-ibm* | ibm*)
|
i370-ibm* | ibm*)
|
||||||
basic_machine=i370-ibm
|
basic_machine=i370-ibm
|
||||||
os=-mvs
|
|
||||||
;;
|
;;
|
||||||
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
||||||
i[34567]86v32)
|
i*86v32)
|
||||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||||
os=-sysv32
|
os=-sysv32
|
||||||
;;
|
;;
|
||||||
i[34567]86v4*)
|
i*86v4*)
|
||||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||||
os=-sysv4
|
os=-sysv4
|
||||||
;;
|
;;
|
||||||
i[34567]86v)
|
i*86v)
|
||||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
i[34567]86sol2)
|
i*86sol2)
|
||||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||||
os=-solaris2
|
os=-solaris2
|
||||||
;;
|
;;
|
||||||
|
@ -455,14 +532,6 @@ case $basic_machine in
|
||||||
basic_machine=i386-unknown
|
basic_machine=i386-unknown
|
||||||
os=-vsta
|
os=-vsta
|
||||||
;;
|
;;
|
||||||
i386-go32 | go32)
|
|
||||||
basic_machine=i386-unknown
|
|
||||||
os=-go32
|
|
||||||
;;
|
|
||||||
i386-mingw32 | mingw32)
|
|
||||||
basic_machine=i386-unknown
|
|
||||||
os=-mingw32
|
|
||||||
;;
|
|
||||||
iris | iris4d)
|
iris | iris4d)
|
||||||
basic_machine=mips-sgi
|
basic_machine=mips-sgi
|
||||||
case $os in
|
case $os in
|
||||||
|
@ -488,10 +557,14 @@ case $basic_machine in
|
||||||
basic_machine=ns32k-utek
|
basic_machine=ns32k-utek
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
|
mingw32)
|
||||||
|
basic_machine=i386-pc
|
||||||
|
os=-mingw32
|
||||||
|
;;
|
||||||
miniframe)
|
miniframe)
|
||||||
basic_machine=m68000-convergent
|
basic_machine=m68000-convergent
|
||||||
;;
|
;;
|
||||||
*mint | *MiNT)
|
*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
|
||||||
basic_machine=m68k-atari
|
basic_machine=m68k-atari
|
||||||
os=-mint
|
os=-mint
|
||||||
;;
|
;;
|
||||||
|
@ -509,14 +582,22 @@ case $basic_machine in
|
||||||
mips3*)
|
mips3*)
|
||||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
|
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
|
||||||
;;
|
;;
|
||||||
|
mmix*)
|
||||||
|
basic_machine=mmix-knuth
|
||||||
|
os=-mmixware
|
||||||
|
;;
|
||||||
monitor)
|
monitor)
|
||||||
basic_machine=m68k-rom68k
|
basic_machine=m68k-rom68k
|
||||||
os=-coff
|
os=-coff
|
||||||
;;
|
;;
|
||||||
msdos)
|
msdos)
|
||||||
basic_machine=i386-unknown
|
basic_machine=i386-pc
|
||||||
os=-msdos
|
os=-msdos
|
||||||
;;
|
;;
|
||||||
|
mvs)
|
||||||
|
basic_machine=i370-ibm
|
||||||
|
os=-mvs
|
||||||
|
;;
|
||||||
ncr3000)
|
ncr3000)
|
||||||
basic_machine=i486-ncr
|
basic_machine=i486-ncr
|
||||||
os=-sysv4
|
os=-sysv4
|
||||||
|
@ -525,12 +606,8 @@ case $basic_machine in
|
||||||
basic_machine=i386-unknown
|
basic_machine=i386-unknown
|
||||||
os=-netbsd
|
os=-netbsd
|
||||||
;;
|
;;
|
||||||
hpcmips*-*)
|
|
||||||
basic_machine=hpcmips-unknown
|
|
||||||
os=-netbsd
|
|
||||||
;;
|
|
||||||
netwinder)
|
netwinder)
|
||||||
basic_machine=armv4l-corel
|
basic_machine=armv4l-rebel
|
||||||
os=-linux
|
os=-linux
|
||||||
;;
|
;;
|
||||||
news | news700 | news800 | news900)
|
news | news700 | news800 | news900)
|
||||||
|
@ -578,9 +655,16 @@ case $basic_machine in
|
||||||
basic_machine=i960-intel
|
basic_machine=i960-intel
|
||||||
os=-mon960
|
os=-mon960
|
||||||
;;
|
;;
|
||||||
|
nonstopux)
|
||||||
|
basic_machine=mips-compaq
|
||||||
|
os=-nonstopux
|
||||||
|
;;
|
||||||
np1)
|
np1)
|
||||||
basic_machine=np1-gould
|
basic_machine=np1-gould
|
||||||
;;
|
;;
|
||||||
|
nsr-tandem)
|
||||||
|
basic_machine=nsr-tandem
|
||||||
|
;;
|
||||||
op50n-* | op60c-*)
|
op50n-* | op60c-*)
|
||||||
basic_machine=hppa1.1-oki
|
basic_machine=hppa1.1-oki
|
||||||
os=-proelf
|
os=-proelf
|
||||||
|
@ -610,28 +694,28 @@ case $basic_machine in
|
||||||
pc532 | pc532-*)
|
pc532 | pc532-*)
|
||||||
basic_machine=ns32k-pc532
|
basic_machine=ns32k-pc532
|
||||||
;;
|
;;
|
||||||
pentium | p5 | k5 | k6 | nexen)
|
pentium | p5 | k5 | k6 | nexgen)
|
||||||
basic_machine=i586-pc
|
basic_machine=i586-pc
|
||||||
;;
|
;;
|
||||||
pentiumpro | p6 | 6x86)
|
pentiumpro | p6 | 6x86 | athlon)
|
||||||
basic_machine=i686-pc
|
basic_machine=i686-pc
|
||||||
;;
|
;;
|
||||||
pentiumii | pentium2)
|
pentiumii | pentium2)
|
||||||
basic_machine=i786-pc
|
basic_machine=i686-pc
|
||||||
;;
|
;;
|
||||||
pentium-* | p5-* | k5-* | k6-* | nexen-*)
|
pentium-* | p5-* | k5-* | k6-* | nexgen-*)
|
||||||
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
pentiumpro-* | p6-* | 6x86-*)
|
pentiumpro-* | p6-* | 6x86-* | athlon-*)
|
||||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
pentiumii-* | pentium2-*)
|
pentiumii-* | pentium2-*)
|
||||||
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
|
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
pn)
|
pn)
|
||||||
basic_machine=pn-gould
|
basic_machine=pn-gould
|
||||||
;;
|
;;
|
||||||
power) basic_machine=rs6000-ibm
|
power) basic_machine=power-ibm
|
||||||
;;
|
;;
|
||||||
ppc) basic_machine=powerpc-unknown
|
ppc) basic_machine=powerpc-unknown
|
||||||
;;
|
;;
|
||||||
|
@ -646,6 +730,10 @@ case $basic_machine in
|
||||||
ps2)
|
ps2)
|
||||||
basic_machine=i386-ibm
|
basic_machine=i386-ibm
|
||||||
;;
|
;;
|
||||||
|
pw32)
|
||||||
|
basic_machine=i586-unknown
|
||||||
|
os=-pw32
|
||||||
|
;;
|
||||||
rom68k)
|
rom68k)
|
||||||
basic_machine=m68k-rom68k
|
basic_machine=m68k-rom68k
|
||||||
os=-coff
|
os=-coff
|
||||||
|
@ -725,6 +813,10 @@ case $basic_machine in
|
||||||
sun386 | sun386i | roadrunner)
|
sun386 | sun386i | roadrunner)
|
||||||
basic_machine=i386-sun
|
basic_machine=i386-sun
|
||||||
;;
|
;;
|
||||||
|
sv1)
|
||||||
|
basic_machine=sv1-cray
|
||||||
|
os=-unicos
|
||||||
|
;;
|
||||||
symmetry)
|
symmetry)
|
||||||
basic_machine=i386-sequent
|
basic_machine=i386-sequent
|
||||||
os=-dynix
|
os=-dynix
|
||||||
|
@ -733,6 +825,10 @@ case $basic_machine in
|
||||||
basic_machine=t3e-cray
|
basic_machine=t3e-cray
|
||||||
os=-unicos
|
os=-unicos
|
||||||
;;
|
;;
|
||||||
|
tic54x | c54x*)
|
||||||
|
basic_machine=tic54x-unknown
|
||||||
|
os=-coff
|
||||||
|
;;
|
||||||
tx39)
|
tx39)
|
||||||
basic_machine=mipstx39-unknown
|
basic_machine=mipstx39-unknown
|
||||||
;;
|
;;
|
||||||
|
@ -828,13 +924,20 @@ case $basic_machine in
|
||||||
vax)
|
vax)
|
||||||
basic_machine=vax-dec
|
basic_machine=vax-dec
|
||||||
;;
|
;;
|
||||||
|
pdp10)
|
||||||
|
# there are many clones, so DEC is not a safe bet
|
||||||
|
basic_machine=pdp10-unknown
|
||||||
|
;;
|
||||||
pdp11)
|
pdp11)
|
||||||
basic_machine=pdp11-dec
|
basic_machine=pdp11-dec
|
||||||
;;
|
;;
|
||||||
we32k)
|
we32k)
|
||||||
basic_machine=we32k-att
|
basic_machine=we32k-att
|
||||||
;;
|
;;
|
||||||
sparc | sparcv9)
|
sh3 | sh4)
|
||||||
|
basic_machine=sh-unknown
|
||||||
|
;;
|
||||||
|
sparc | sparcv9 | sparcv9b)
|
||||||
basic_machine=sparc-sun
|
basic_machine=sparc-sun
|
||||||
;;
|
;;
|
||||||
cydra)
|
cydra)
|
||||||
|
@ -856,6 +959,9 @@ case $basic_machine in
|
||||||
basic_machine=c4x-none
|
basic_machine=c4x-none
|
||||||
os=-coff
|
os=-coff
|
||||||
;;
|
;;
|
||||||
|
*-unknown)
|
||||||
|
# Make sure to match an already-canonicalized machine name.
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -914,13 +1020,26 @@ case $os in
|
||||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||||
| -mingw32* | -linux* | -uxpv* | -beos* | -mpeix* | -udk* \
|
| -mingw32* | -linux* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||||
| -interix* | -uwin* | -rhapsody* | -openstep* | -oskit* \
|
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
|
||||||
| -darwin*)
|
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||||
|
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
|
||||||
# Remember, each alternative MUST END IN *, to match a version number.
|
# Remember, each alternative MUST END IN *, to match a version number.
|
||||||
;;
|
;;
|
||||||
|
-qnx*)
|
||||||
|
case $basic_machine in
|
||||||
|
x86-* | i*86-*)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
os=-nto$os
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
-nto*)
|
||||||
|
os=-nto-qnx
|
||||||
|
;;
|
||||||
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
||||||
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
|
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
|
||||||
| -macos* | -mpw* | -magic* | -mon960* | -lnews*)
|
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
|
||||||
;;
|
;;
|
||||||
-mac*)
|
-mac*)
|
||||||
os=`echo $os | sed -e 's|mac|macos|'`
|
os=`echo $os | sed -e 's|mac|macos|'`
|
||||||
|
@ -931,6 +1050,12 @@ case $os in
|
||||||
-sunos6*)
|
-sunos6*)
|
||||||
os=`echo $os | sed -e 's|sunos6|solaris3|'`
|
os=`echo $os | sed -e 's|sunos6|solaris3|'`
|
||||||
;;
|
;;
|
||||||
|
-opened*)
|
||||||
|
os=-openedition
|
||||||
|
;;
|
||||||
|
-wince*)
|
||||||
|
os=-wince
|
||||||
|
;;
|
||||||
-osfrose*)
|
-osfrose*)
|
||||||
os=-osfrose
|
os=-osfrose
|
||||||
;;
|
;;
|
||||||
|
@ -955,6 +1080,9 @@ case $os in
|
||||||
-ns2 )
|
-ns2 )
|
||||||
os=-nextstep2
|
os=-nextstep2
|
||||||
;;
|
;;
|
||||||
|
-nsk*)
|
||||||
|
os=-nsk
|
||||||
|
;;
|
||||||
# Preserve the version number of sinix5.
|
# Preserve the version number of sinix5.
|
||||||
-sinix5.*)
|
-sinix5.*)
|
||||||
os=`echo $os | sed -e 's|sinix|sysv|'`
|
os=`echo $os | sed -e 's|sinix|sysv|'`
|
||||||
|
@ -989,7 +1117,7 @@ case $os in
|
||||||
-xenix)
|
-xenix)
|
||||||
os=-xenix
|
os=-xenix
|
||||||
;;
|
;;
|
||||||
-mint* | -MiNT*)
|
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||||
os=-mint
|
os=-mint
|
||||||
;;
|
;;
|
||||||
-uxpds)
|
-uxpds)
|
||||||
|
@ -1025,12 +1153,15 @@ case $basic_machine in
|
||||||
*-acorn)
|
*-acorn)
|
||||||
os=-riscix1.2
|
os=-riscix1.2
|
||||||
;;
|
;;
|
||||||
arm*-corel)
|
arm*-rebel)
|
||||||
os=-linux
|
os=-linux
|
||||||
;;
|
;;
|
||||||
arm*-semi)
|
arm*-semi)
|
||||||
os=-aout
|
os=-aout
|
||||||
;;
|
;;
|
||||||
|
pdp10-*)
|
||||||
|
os=-tops20
|
||||||
|
;;
|
||||||
pdp11-*)
|
pdp11-*)
|
||||||
os=-none
|
os=-none
|
||||||
;;
|
;;
|
||||||
|
@ -1139,7 +1270,7 @@ case $basic_machine in
|
||||||
*-masscomp)
|
*-masscomp)
|
||||||
os=-rtu
|
os=-rtu
|
||||||
;;
|
;;
|
||||||
f301-fujitsu)
|
f30[01]-fujitsu | f700-fujitsu)
|
||||||
os=-uxpv
|
os=-uxpv
|
||||||
;;
|
;;
|
||||||
*-rom68k)
|
*-rom68k)
|
||||||
|
@ -1199,7 +1330,7 @@ case $basic_machine in
|
||||||
-genix*)
|
-genix*)
|
||||||
vendor=ns
|
vendor=ns
|
||||||
;;
|
;;
|
||||||
-mvs*)
|
-mvs* | -opened*)
|
||||||
vendor=ibm
|
vendor=ibm
|
||||||
;;
|
;;
|
||||||
-ptx*)
|
-ptx*)
|
||||||
|
@ -1217,7 +1348,7 @@ case $basic_machine in
|
||||||
-mpw* | -macos*)
|
-mpw* | -macos*)
|
||||||
vendor=apple
|
vendor=apple
|
||||||
;;
|
;;
|
||||||
-*mint | -*MiNT)
|
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||||
vendor=atari
|
vendor=atari
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -1226,3 +1357,11 @@ case $basic_machine in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo $basic_machine$os
|
echo $basic_machine$os
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
# Local variables:
|
||||||
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
# time-stamp-start: "timestamp='"
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d"
|
||||||
|
# time-stamp-end: "'"
|
||||||
|
# End:
|
||||||
|
|
15
dir.c
15
dir.c
|
@ -399,12 +399,15 @@ dir_chdir(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int chdir_blocking = 0;
|
static int chdir_blocking = 0;
|
||||||
|
static VALUE chdir_thread = Qnil;
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
chdir_restore(path)
|
chdir_restore(path)
|
||||||
const char *path;
|
const char *path;
|
||||||
{
|
{
|
||||||
chdir_blocking--;
|
chdir_blocking--;
|
||||||
|
if (chdir_blocking == 0)
|
||||||
|
chdir_thread = Qnil;
|
||||||
dir_chdir(path);
|
dir_chdir(path);
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
@ -436,14 +439,18 @@ dir_s_chdir(argc, argv, obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chdir_blocking > 0)
|
if (chdir_blocking > 0) {
|
||||||
rb_warn("chdir during chdir block");
|
if (!rb_block_given_p() || rb_thread_current() != chdir_thread)
|
||||||
|
rb_warn("conflicting chdir during another chdir block");
|
||||||
|
}
|
||||||
|
|
||||||
if (rb_block_given_p()) {
|
if (rb_block_given_p()) {
|
||||||
char cwd[MAXPATHLEN];
|
char cwd[MAXPATHLEN];
|
||||||
|
|
||||||
GETCWD(cwd);
|
GETCWD(cwd);
|
||||||
chdir_blocking++;
|
chdir_blocking++;
|
||||||
|
if (chdir_thread == Qnil)
|
||||||
|
chdir_thread = rb_thread_current();
|
||||||
dir_chdir(dist);
|
dir_chdir(dist);
|
||||||
return rb_ensure(rb_yield, path, chdir_restore, (VALUE)cwd);
|
return rb_ensure(rb_yield, path, chdir_restore, (VALUE)cwd);
|
||||||
}
|
}
|
||||||
|
@ -618,7 +625,7 @@ static void
|
||||||
glob_helper(path, flags, func, arg)
|
glob_helper(path, flags, func, arg)
|
||||||
char *path;
|
char *path;
|
||||||
int flags;
|
int flags;
|
||||||
void (*func)();
|
void (*func) _((const char*, VALUE));
|
||||||
VALUE arg;
|
VALUE arg;
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
@ -763,7 +770,7 @@ rb_glob(path, func, arg)
|
||||||
void
|
void
|
||||||
rb_globi(path, func, arg)
|
rb_globi(path, func, arg)
|
||||||
char *path;
|
char *path;
|
||||||
void (*func)();
|
void (*func) _((const char*, VALUE));
|
||||||
VALUE arg;
|
VALUE arg;
|
||||||
{
|
{
|
||||||
glob_helper(path, FNM_PERIOD|FNM_CASEFOLD, func, arg);
|
glob_helper(path, FNM_PERIOD|FNM_CASEFOLD, func, arg);
|
||||||
|
|
2
dln.c
2
dln.c
|
@ -1383,7 +1383,7 @@ dln_load(file)
|
||||||
rb_loaderror("Failed to load %.200s", file);
|
rb_loaderror("Failed to load %.200s", file);
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLinkModule(obj_file, file, TRUE);
|
NSLinkModule(obj_file, file, NSLINKMODULE_OPTION_BINDNOW);
|
||||||
|
|
||||||
/* lookup the initial function */
|
/* lookup the initial function */
|
||||||
/*NSIsSymbolNameDefined require function name without "_" */
|
/*NSIsSymbolNameDefined require function name without "_" */
|
||||||
|
|
135
eval.c
135
eval.c
|
@ -2584,7 +2584,7 @@ rb_eval(self, n)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NODE_ARGSPUSH:
|
case NODE_ARGSPUSH:
|
||||||
result = rb_ary_push(rb_obj_dup(rb_eval(self, node->nd_head)),
|
result = rb_ary_push(rb_ary_dup(rb_eval(self, node->nd_head)),
|
||||||
rb_eval(self, node->nd_body));
|
rb_eval(self, node->nd_body));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -4421,11 +4421,14 @@ rb_call0(klass, recv, id, argc, argv, body, nosuper)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* for attr get/set */
|
||||||
|
case NODE_IVAR:
|
||||||
|
if (argc != 0) {
|
||||||
|
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)", argc);
|
||||||
|
}
|
||||||
|
case NODE_ATTRSET:
|
||||||
/* for re-scoped/renamed method */
|
/* for re-scoped/renamed method */
|
||||||
case NODE_ZSUPER:
|
case NODE_ZSUPER:
|
||||||
/* for attr get/set */
|
|
||||||
case NODE_ATTRSET:
|
|
||||||
case NODE_IVAR:
|
|
||||||
result = rb_eval(recv, body);
|
result = rb_eval(recv, body);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -5217,8 +5220,8 @@ rb_load(fname, wrap)
|
||||||
VALUE fname;
|
VALUE fname;
|
||||||
int wrap;
|
int wrap;
|
||||||
{
|
{
|
||||||
|
VALUE tmp;
|
||||||
int state;
|
int state;
|
||||||
char *file;
|
|
||||||
volatile ID last_func;
|
volatile ID last_func;
|
||||||
volatile VALUE wrapper = 0;
|
volatile VALUE wrapper = 0;
|
||||||
volatile VALUE self = ruby_top_self;
|
volatile VALUE self = ruby_top_self;
|
||||||
|
@ -5231,10 +5234,11 @@ rb_load(fname, wrap)
|
||||||
else {
|
else {
|
||||||
SafeStringValue(fname);
|
SafeStringValue(fname);
|
||||||
}
|
}
|
||||||
file = rb_find_file(RSTRING(fname)->ptr);
|
tmp = rb_find_file(fname);
|
||||||
if (!file) {
|
if (!tmp) {
|
||||||
rb_raise(rb_eLoadError, "No such file to load -- %s", RSTRING(fname)->ptr);
|
rb_raise(rb_eLoadError, "No such file to load -- %s", RSTRING(fname)->ptr);
|
||||||
}
|
}
|
||||||
|
fname = tmp;
|
||||||
|
|
||||||
ruby_errinfo = Qnil; /* ensure */
|
ruby_errinfo = Qnil; /* ensure */
|
||||||
PUSH_VARS();
|
PUSH_VARS();
|
||||||
|
@ -5269,7 +5273,7 @@ rb_load(fname, wrap)
|
||||||
|
|
||||||
DEFER_INTS;
|
DEFER_INTS;
|
||||||
ruby_in_eval++;
|
ruby_in_eval++;
|
||||||
rb_load_file(file);
|
rb_load_file(RSTRING(fname)->ptr);
|
||||||
ruby_in_eval--;
|
ruby_in_eval--;
|
||||||
node = ruby_eval_tree;
|
node = ruby_eval_tree;
|
||||||
ALLOW_INTS;
|
ALLOW_INTS;
|
||||||
|
@ -5382,33 +5386,39 @@ rb_provided(feature)
|
||||||
return rb_feature_p(feature, Qfalse);
|
return rb_feature_p(feature, Qfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
rb_provide(feature)
|
rb_provide_feature(feature)
|
||||||
const char *feature;
|
VALUE feature;
|
||||||
{
|
{
|
||||||
char *buf, *ext;
|
char *ext;
|
||||||
|
char *f = RSTRING(feature)->ptr;
|
||||||
|
|
||||||
ext = strrchr(feature, '.');
|
ext = strrchr(f, '.');
|
||||||
if (ext && (strcmp(DLEXT, ext) == 0
|
if (ext && (strcmp(DLEXT, ext) == 0
|
||||||
#ifdef DLEXT2
|
#ifdef DLEXT2
|
||||||
|| strcmp(DLEXT2, ext) == 0
|
|| strcmp(DLEXT2, ext) == 0
|
||||||
#endif
|
#endif
|
||||||
)) {
|
)) {
|
||||||
buf = ALLOCA_N(char, strlen(feature)+4);
|
feature = rb_str_new(RSTRING(feature)->ptr, ext-RSTRING(feature)->ptr);
|
||||||
strcpy(buf, feature);
|
rb_str_cat2(feature, ".so");
|
||||||
ext = strrchr(buf, '.');
|
|
||||||
strcpy(ext, ".so");
|
|
||||||
feature = buf;
|
|
||||||
}
|
}
|
||||||
if (rb_feature_p(feature, Qtrue)) return;
|
if (rb_feature_p(RSTRING(feature)->ptr, Qtrue)) return;
|
||||||
rb_ary_push(rb_features, rb_str_new2(feature));
|
rb_ary_push(rb_features, feature);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
rb_provide(feature)
|
||||||
|
const char *feature;
|
||||||
|
{
|
||||||
|
rb_provide_feature(rb_str_new2(feature));
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_f_require(obj, fname)
|
rb_f_require(obj, fname)
|
||||||
VALUE obj, fname;
|
VALUE obj, fname;
|
||||||
{
|
{
|
||||||
char *ext, *file, *feature, *buf; /* OK */
|
VALUE feature, tmp;
|
||||||
|
char *ext, *ftptr; /* OK */
|
||||||
volatile VALUE load;
|
volatile VALUE load;
|
||||||
int state;
|
int state;
|
||||||
volatile int safe = ruby_safe_level;
|
volatile int safe = ruby_safe_level;
|
||||||
|
@ -5418,68 +5428,70 @@ rb_f_require(obj, fname)
|
||||||
return Qfalse;
|
return Qfalse;
|
||||||
ext = strrchr(RSTRING(fname)->ptr, '.');
|
ext = strrchr(RSTRING(fname)->ptr, '.');
|
||||||
if (ext) {
|
if (ext) {
|
||||||
feature = file = RSTRING(fname)->ptr;
|
|
||||||
if (strcmp(".rb", ext) == 0) {
|
if (strcmp(".rb", ext) == 0) {
|
||||||
file = rb_find_file(file);
|
feature = rb_str_dup(fname);
|
||||||
if (file) goto load_rb;
|
tmp = rb_find_file(fname);
|
||||||
|
if (tmp) {
|
||||||
|
fname = tmp;
|
||||||
|
goto load_rb;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (strcmp(".so", ext) == 0 || strcmp(".o", ext) == 0) {
|
else if (strcmp(".so", ext) == 0 || strcmp(".o", ext) == 0) {
|
||||||
if (strcmp(ext, DLEXT) != 0) {
|
fname = rb_str_new(RSTRING(fname)->ptr, ext-RSTRING(fname)->ptr);
|
||||||
buf = ALLOCA_N(char, strlen(file)+sizeof(DLEXT)+4);
|
tmp = rb_str_dup(fname);
|
||||||
strcpy(buf, feature);
|
rb_str_cat2(tmp, DLEXT);
|
||||||
ext = strrchr(buf, '.');
|
tmp = rb_find_file(tmp);
|
||||||
strcpy(ext, DLEXT);
|
if (tmp) {
|
||||||
file = feature = buf;
|
feature = fname = tmp;
|
||||||
|
goto load_dyna;
|
||||||
}
|
}
|
||||||
file = rb_find_file(file);
|
|
||||||
if (file) goto load_dyna;
|
|
||||||
#ifdef DLEXT2
|
#ifdef DLEXT2
|
||||||
file = feature = RSTRING(fname)->ptr;
|
tmp = rb_str_dup(fname);
|
||||||
if (strcmp(ext, DLEXT2) != 0) {
|
rb_str_cat2(tmp, DLEXT);
|
||||||
buf = ALLOCA_N(char, strlen(file)+sizeof(DLEXT2)+4);
|
tmp = rb_find_file(tmp);
|
||||||
strcpy(buf, feature);
|
if (tmp) {
|
||||||
ext = strrchr(buf, '.');
|
feature = fname = tmp;
|
||||||
strcpy(ext, DLEXT2);
|
goto load_dyna;
|
||||||
file = feature = buf;
|
|
||||||
}
|
}
|
||||||
file = rb_find_file(file);
|
|
||||||
if (file) goto load_dyna;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (strcmp(DLEXT, ext) == 0) {
|
else if (strcmp(DLEXT, ext) == 0) {
|
||||||
feature = RSTRING(fname)->ptr;
|
tmp = rb_find_file(fname);
|
||||||
file = rb_find_file(feature);
|
if (tmp) {
|
||||||
if (file) goto load_dyna;
|
feature = fname = tmp;
|
||||||
|
goto load_dyna;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#ifdef DLEXT2
|
#ifdef DLEXT2
|
||||||
else if (strcmp(DLEXT2, ext) == 0) {
|
else if (strcmp(DLEXT2, ext) == 0) {
|
||||||
feature = RSTRING(fname)->ptr;
|
tmp = rb_find_file(fname);
|
||||||
file = rb_find_file(feature);
|
if (tmp) {
|
||||||
if (file) goto load_dyna;
|
feature = fname = tmp;
|
||||||
|
goto load_dyna;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
buf = ALLOCA_N(char, strlen(RSTRING(fname)->ptr) + 5);
|
tmp = fname;
|
||||||
strcpy(buf, RSTRING(fname)->ptr);
|
switch (rb_find_file_noext(&tmp)) {
|
||||||
switch (rb_find_file_noext(buf)) {
|
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
fname = rb_str_new2(buf);
|
feature = fname;
|
||||||
file = feature = buf;
|
fname = tmp;
|
||||||
goto load_rb;
|
goto load_rb;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
feature = buf;
|
feature = fname;
|
||||||
file = rb_find_file(buf);
|
fname = rb_find_file(tmp);
|
||||||
goto load_dyna;
|
goto load_dyna;
|
||||||
}
|
}
|
||||||
rb_raise(rb_eLoadError, "No such file to load -- %s",
|
rb_raise(rb_eLoadError, "No such file to load -- %s",
|
||||||
RSTRING(fname)->ptr);
|
RSTRING(fname)->ptr);
|
||||||
|
|
||||||
load_dyna:
|
load_dyna:
|
||||||
rb_provide(feature);
|
rb_provide_feature(feature);
|
||||||
{
|
{
|
||||||
int volatile old_vmode = scope_vmode;
|
int volatile old_vmode = scope_vmode;
|
||||||
|
|
||||||
|
@ -5488,9 +5500,7 @@ rb_f_require(obj, fname)
|
||||||
void *handle;
|
void *handle;
|
||||||
|
|
||||||
SCOPE_SET(SCOPE_PUBLIC);
|
SCOPE_SET(SCOPE_PUBLIC);
|
||||||
load = rb_str_new2(file);
|
handle = dln_load(RSTRING(fname)->ptr);
|
||||||
file = RSTRING(load)->ptr;
|
|
||||||
handle = dln_load(file);
|
|
||||||
rb_ary_push(ruby_dln_librefs, INT2NUM((long)handle));
|
rb_ary_push(ruby_dln_librefs, INT2NUM((long)handle));
|
||||||
}
|
}
|
||||||
POP_TAG();
|
POP_TAG();
|
||||||
|
@ -5502,21 +5512,22 @@ rb_f_require(obj, fname)
|
||||||
|
|
||||||
load_rb:
|
load_rb:
|
||||||
ruby_safe_level = 0;
|
ruby_safe_level = 0;
|
||||||
rb_provide(feature);
|
rb_provide_feature(feature);
|
||||||
/* loading ruby library should be serialized. */
|
/* loading ruby library should be serialized. */
|
||||||
if (!loading_tbl) {
|
if (!loading_tbl) {
|
||||||
loading_tbl = st_init_strtable();
|
loading_tbl = st_init_strtable();
|
||||||
}
|
}
|
||||||
/* partial state */
|
/* partial state */
|
||||||
st_insert(loading_tbl, strdup(feature), curr_thread);
|
ftptr = ruby_strdup(RSTRING(feature)->ptr);
|
||||||
|
st_insert(loading_tbl, ftptr, curr_thread);
|
||||||
|
|
||||||
PUSH_TAG(PROT_NONE);
|
PUSH_TAG(PROT_NONE);
|
||||||
if ((state = EXEC_TAG()) == 0) {
|
if ((state = EXEC_TAG()) == 0) {
|
||||||
rb_load(fname, 0);
|
rb_load(fname, 0);
|
||||||
}
|
}
|
||||||
POP_TAG();
|
POP_TAG();
|
||||||
st_delete(loading_tbl, &feature, 0); /* loading done */
|
st_delete(loading_tbl, &ftptr, 0); /* loading done */
|
||||||
free(feature);
|
free(ftptr);
|
||||||
ruby_safe_level = safe;
|
ruby_safe_level = safe;
|
||||||
if (state) JUMP_TAG(state);
|
if (state) JUMP_TAG(state);
|
||||||
|
|
||||||
|
|
96
file.c
96
file.c
|
@ -2202,26 +2202,27 @@ is_macos_native_path(path)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char*
|
static int
|
||||||
file_load_ok(file)
|
file_load_ok(file)
|
||||||
char *file;
|
char *file;
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
|
if (!f) return 0;
|
||||||
f = fopen(file, "r");
|
f = fopen(file, "r");
|
||||||
if (f == NULL) return 0;
|
if (f == NULL) return 0;
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return file;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern VALUE rb_load_path;
|
extern VALUE rb_load_path;
|
||||||
|
|
||||||
int
|
int
|
||||||
rb_find_file_noext(file)
|
rb_find_file_noext(filep)
|
||||||
char *file;
|
VALUE *filep;
|
||||||
{
|
{
|
||||||
char *path, *e, *found;
|
char *path, *e, *found;
|
||||||
char *fend = file + strlen(file);
|
char *f = RSTRING(*filep)->ptr;
|
||||||
VALUE fname;
|
VALUE fname;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
@ -2233,16 +2234,22 @@ rb_find_file_noext(file)
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
if (file[0] == '~') {
|
if (f[0] == '~') {
|
||||||
fname = rb_str_new2(file);
|
fname = *filep;
|
||||||
fname = rb_file_s_expand_path(1, &fname);
|
fname = rb_file_s_expand_path(1, &fname);
|
||||||
file = StringValuePtr(fname);
|
if (rb_safe_level() >= 2 && OBJ_TAINTED(fname)) {
|
||||||
|
rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_absolute_path(file)) {
|
if (is_absolute_path(f)) {
|
||||||
for (i=0; ext[i]; i++) {
|
for (i=0; ext[i]; i++) {
|
||||||
strcpy(fend, ext[i]);
|
fname = rb_str_dup(*filep);
|
||||||
if (file_load_ok(file)) return i+1;
|
rb_str_cat2(fname, ext[i]);
|
||||||
|
if (file_load_ok(RSTRING(fname)->ptr)) {
|
||||||
|
*filep = fname;
|
||||||
|
return i+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2256,71 +2263,76 @@ rb_find_file_noext(file)
|
||||||
SafeStringValue(str);
|
SafeStringValue(str);
|
||||||
path = RSTRING(str)->ptr;
|
path = RSTRING(str)->ptr;
|
||||||
for (j=0; ext[j]; j++) {
|
for (j=0; ext[j]; j++) {
|
||||||
strcpy(fend, ext[j]);
|
fname = rb_str_dup(*filep);
|
||||||
found = dln_find_file(file, path);
|
rb_str_cat2(fname, ext[j]);
|
||||||
if (found && file_load_ok(found)) return j+1;
|
found = dln_find_file(RSTRING(fname)->ptr, path);
|
||||||
|
if (found && file_load_ok(found)) {
|
||||||
|
*filep = fname;
|
||||||
|
return j+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
char*
|
VALUE
|
||||||
rb_find_file(file)
|
rb_find_file(path)
|
||||||
char *file;
|
VALUE path;
|
||||||
{
|
{
|
||||||
VALUE vpath, fname;
|
VALUE tmp, fname;
|
||||||
char *path;
|
char *f = RSTRING(path)->ptr;
|
||||||
|
char *lpath;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
if (file[0] == '~') {
|
if (f[0] == '~') {
|
||||||
fname = rb_str_new2(file);
|
tmp = rb_file_s_expand_path(1, &path);
|
||||||
fname = rb_file_s_expand_path(1, &fname);
|
if (rb_safe_level() >= 2 && OBJ_TAINTED(tmp)) {
|
||||||
if (rb_safe_level() >= 2 && OBJ_TAINTED(fname)) {
|
rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
|
||||||
rb_raise(rb_eSecurityError, "loading from unsafe file %s", file);
|
|
||||||
}
|
}
|
||||||
file = StringValuePtr(fname);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__MACOS__) || defined(riscos)
|
#if defined(__MACOS__) || defined(riscos)
|
||||||
if (is_macos_native_path(file)) {
|
if (is_macos_native_path(f)) {
|
||||||
if (rb_safe_level() >= 2 && !rb_path_check(file)) {
|
if (rb_safe_level() >= 2 && !rb_path_check(f)) {
|
||||||
rb_raise(rb_eSecurityError, "loading from unsafe file %s", file);
|
rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
|
||||||
}
|
}
|
||||||
return file_load_ok(file);
|
if (file_load_ok(f)) return path;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (is_absolute_path(file)) {
|
if (is_absolute_path(f)) {
|
||||||
if (rb_safe_level() >= 2 && !rb_path_check(file)) {
|
if (rb_safe_level() >= 2 && !rb_path_check(f)) {
|
||||||
rb_raise(rb_eSecurityError, "loading from unsafe file %s", file);
|
rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
|
||||||
}
|
}
|
||||||
return file_load_ok(file);
|
if (file_load_ok(f)) return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rb_load_path) {
|
if (rb_load_path) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
Check_Type(rb_load_path, T_ARRAY);
|
Check_Type(rb_load_path, T_ARRAY);
|
||||||
vpath = rb_ary_new();
|
tmp = rb_ary_new();
|
||||||
for (i=0;i<RARRAY(rb_load_path)->len;i++) {
|
for (i=0;i<RARRAY(rb_load_path)->len;i++) {
|
||||||
VALUE str = RARRAY(rb_load_path)->ptr[i];
|
VALUE str = RARRAY(rb_load_path)->ptr[i];
|
||||||
SafeStringValue(str);
|
SafeStringValue(str);
|
||||||
if (RSTRING(str)->len > 0) {
|
if (RSTRING(str)->len > 0) {
|
||||||
rb_ary_push(vpath, str);
|
rb_ary_push(tmp, str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
vpath = rb_ary_join(vpath, rb_str_new2(PATH_SEP));
|
tmp = rb_ary_join(tmp, rb_str_new2(PATH_SEP));
|
||||||
path = StringValuePtr(vpath);
|
lpath = StringValuePtr(tmp);
|
||||||
if (rb_safe_level() >= 2 && !rb_path_check(path)) {
|
if (rb_safe_level() >= 2 && !rb_path_check(lpath)) {
|
||||||
rb_raise(rb_eSecurityError, "loading from unsafe path %s", path);
|
rb_raise(rb_eSecurityError, "loading from unsafe path %s", lpath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
path = 0;
|
lpath = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
path = dln_find_file(file, path);
|
f = dln_find_file(f, lpath);
|
||||||
return file_load_ok(path);
|
if (file_load_ok(f)) {
|
||||||
|
return rb_str_new2(f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
9
intern.h
9
intern.h
|
@ -27,6 +27,7 @@ VALUE rb_ary_new4 _((long, VALUE *));
|
||||||
VALUE rb_ary_freeze _((VALUE));
|
VALUE rb_ary_freeze _((VALUE));
|
||||||
VALUE rb_ary_aref _((int, VALUE*, VALUE));
|
VALUE rb_ary_aref _((int, VALUE*, VALUE));
|
||||||
void rb_ary_store _((VALUE, long, VALUE));
|
void rb_ary_store _((VALUE, long, VALUE));
|
||||||
|
VALUE rb_ary_dup _((VALUE));
|
||||||
VALUE rb_ary_to_ary _((VALUE));
|
VALUE rb_ary_to_ary _((VALUE));
|
||||||
VALUE rb_ary_to_s _((VALUE));
|
VALUE rb_ary_to_s _((VALUE));
|
||||||
VALUE rb_ary_push _((VALUE, VALUE));
|
VALUE rb_ary_push _((VALUE, VALUE));
|
||||||
|
@ -181,8 +182,8 @@ void rb_thread_atfork _((void));
|
||||||
int eaccess _((const char*, int));
|
int eaccess _((const char*, int));
|
||||||
VALUE rb_file_s_expand_path _((int, VALUE *));
|
VALUE rb_file_s_expand_path _((int, VALUE *));
|
||||||
void rb_file_const _((const char*, VALUE));
|
void rb_file_const _((const char*, VALUE));
|
||||||
int rb_find_file_noext _((char*));
|
int rb_find_file_noext _((VALUE*));
|
||||||
char *rb_find_file _((char*));
|
VALUE rb_find_file _((VALUE));
|
||||||
/* gc.c */
|
/* gc.c */
|
||||||
void rb_gc_mark_locations _((VALUE*, VALUE*));
|
void rb_gc_mark_locations _((VALUE*, VALUE*));
|
||||||
void rb_mark_tbl _((struct st_table*));
|
void rb_mark_tbl _((struct st_table*));
|
||||||
|
@ -240,6 +241,8 @@ VALUE rb_obj_tainted _((VALUE));
|
||||||
VALUE rb_obj_untaint _((VALUE));
|
VALUE rb_obj_untaint _((VALUE));
|
||||||
VALUE rb_obj_freeze _((VALUE));
|
VALUE rb_obj_freeze _((VALUE));
|
||||||
VALUE rb_obj_id _((VALUE));
|
VALUE rb_obj_id _((VALUE));
|
||||||
|
VALUE rb_obj_type _((VALUE));
|
||||||
|
VALUE rb_class_real _((VALUE));
|
||||||
VALUE rb_convert_type _((VALUE,int,const char*,const char*));
|
VALUE rb_convert_type _((VALUE,int,const char*,const char*));
|
||||||
VALUE rb_to_int _((VALUE));
|
VALUE rb_to_int _((VALUE));
|
||||||
VALUE rb_Integer _((VALUE));
|
VALUE rb_Integer _((VALUE));
|
||||||
|
@ -364,7 +367,7 @@ VALUE rb_f_untrace_var _((int, VALUE*));
|
||||||
VALUE rb_f_global_variables _((void));
|
VALUE rb_f_global_variables _((void));
|
||||||
void rb_alias_variable _((ID, ID));
|
void rb_alias_variable _((ID, ID));
|
||||||
struct st_table* rb_generic_ivar_table _((VALUE));
|
struct st_table* rb_generic_ivar_table _((VALUE));
|
||||||
void rb_clone_generic_ivar _((VALUE,VALUE));
|
void rb_copy_generic_ivar _((VALUE,VALUE));
|
||||||
void rb_mark_generic_ivar _((VALUE));
|
void rb_mark_generic_ivar _((VALUE));
|
||||||
void rb_mark_generic_ivar_tbl _((void));
|
void rb_mark_generic_ivar_tbl _((void));
|
||||||
void rb_free_generic_ivar _((VALUE));
|
void rb_free_generic_ivar _((VALUE));
|
||||||
|
|
10
io.c
10
io.c
|
@ -190,7 +190,7 @@ rb_read_check(fp)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
rb_dup(orig)
|
ruby_dup(orig)
|
||||||
int orig;
|
int orig;
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
|
@ -329,7 +329,7 @@ rb_io_seek(io, offset, whence)
|
||||||
long pos;
|
long pos;
|
||||||
|
|
||||||
GetOpenFile(io, fptr);
|
GetOpenFile(io, fptr);
|
||||||
pos = fseek(fptr->f, NUM2INT(offset), whence);
|
pos = fseek(fptr->f, NUM2LONG(offset), whence);
|
||||||
if (pos != 0) rb_sys_fail(fptr->path);
|
if (pos != 0) rb_sys_fail(fptr->path);
|
||||||
clearerr(fptr->f);
|
clearerr(fptr->f);
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ rb_io_set_pos(io, offset)
|
||||||
long pos;
|
long pos;
|
||||||
|
|
||||||
GetOpenFile(io, fptr);
|
GetOpenFile(io, fptr);
|
||||||
pos = fseek(fptr->f, NUM2INT(offset), SEEK_SET);
|
pos = fseek(fptr->f, NUM2LONG(offset), SEEK_SET);
|
||||||
if (pos != 0) rb_sys_fail(fptr->path);
|
if (pos != 0) rb_sys_fail(fptr->path);
|
||||||
clearerr(fptr->f);
|
clearerr(fptr->f);
|
||||||
|
|
||||||
|
@ -2042,11 +2042,11 @@ rb_io_clone(io)
|
||||||
else mode = "r+";
|
else mode = "r+";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fd = rb_dup(fileno(orig->f));
|
fd = ruby_dup(fileno(orig->f));
|
||||||
fptr->f = rb_fdopen(fd, mode);
|
fptr->f = rb_fdopen(fd, mode);
|
||||||
if (fptr->f2) {
|
if (fptr->f2) {
|
||||||
if (fileno(orig->f) != fileno(orig->f2)) {
|
if (fileno(orig->f) != fileno(orig->f2)) {
|
||||||
fd = rb_dup(fileno(orig->f2));
|
fd = ruby_dup(fileno(orig->f2));
|
||||||
}
|
}
|
||||||
fptr->f = rb_fdopen(fd, "w");
|
fptr->f = rb_fdopen(fd, "w");
|
||||||
}
|
}
|
||||||
|
|
20
object.c
20
object.c
|
@ -70,18 +70,23 @@ rb_obj_id(obj)
|
||||||
return (VALUE)((long)obj|FIXNUM_FLAG);
|
return (VALUE)((long)obj|FIXNUM_FLAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
VALUE
|
||||||
rb_obj_type(obj)
|
rb_class_real(cl)
|
||||||
VALUE obj;
|
VALUE cl;
|
||||||
{
|
{
|
||||||
VALUE cl = CLASS_OF(obj);
|
|
||||||
|
|
||||||
while (FL_TEST(cl, FL_SINGLETON) || TYPE(cl) == T_ICLASS) {
|
while (FL_TEST(cl, FL_SINGLETON) || TYPE(cl) == T_ICLASS) {
|
||||||
cl = RCLASS(cl)->super;
|
cl = RCLASS(cl)->super;
|
||||||
}
|
}
|
||||||
return cl;
|
return cl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VALUE
|
||||||
|
rb_obj_type(obj)
|
||||||
|
VALUE obj;
|
||||||
|
{
|
||||||
|
return rb_class_real(CLASS_OF(obj));
|
||||||
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_obj_clone(obj)
|
rb_obj_clone(obj)
|
||||||
VALUE obj;
|
VALUE obj;
|
||||||
|
@ -113,6 +118,9 @@ rb_obj_dup(obj)
|
||||||
if (!SPECIAL_CONST_P(dup)) {
|
if (!SPECIAL_CONST_P(dup)) {
|
||||||
OBJSETUP(dup, rb_obj_type(obj), BUILTIN_TYPE(obj));
|
OBJSETUP(dup, rb_obj_type(obj), BUILTIN_TYPE(obj));
|
||||||
OBJ_INFECT(dup, obj);
|
OBJ_INFECT(dup, obj);
|
||||||
|
if (FL_TEST(obj, FL_EXIVAR)) {
|
||||||
|
FL_SET(dup, FL_EXIVAR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return dup;
|
return dup;
|
||||||
}
|
}
|
||||||
|
@ -866,7 +874,7 @@ rb_convert_type(val, type, tname, method)
|
||||||
arg1.val = arg2.val = val;
|
arg1.val = arg2.val = val;
|
||||||
arg1.s = method;
|
arg1.s = method;
|
||||||
arg2.s = tname;
|
arg2.s = tname;
|
||||||
val = rb_rescue2(to_type, (VALUE)&arg1, fail_to_type, (VALUE)&arg2);
|
val = rb_rescue(to_type, (VALUE)&arg1, fail_to_type, (VALUE)&arg2);
|
||||||
if (TYPE(val) != type) {
|
if (TYPE(val) != type) {
|
||||||
rb_raise(rb_eTypeError, "%s#%s should return %s",
|
rb_raise(rb_eTypeError, "%s#%s should return %s",
|
||||||
rb_class2name(CLASS_OF(arg1.val)), method, tname);
|
rb_class2name(CLASS_OF(arg1.val)), method, tname);
|
||||||
|
|
2
range.c
2
range.c
|
@ -45,7 +45,7 @@ range_init(obj, beg, end, exclude_end)
|
||||||
|
|
||||||
args[0] = beg; args[1] = end;
|
args[0] = beg; args[1] = end;
|
||||||
if (!FIXNUM_P(beg) || !FIXNUM_P(end)) {
|
if (!FIXNUM_P(beg) || !FIXNUM_P(end)) {
|
||||||
rb_rescue2(range_check, (VALUE)args, range_failed, 0);
|
rb_rescue(range_check, (VALUE)args, range_failed, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_EXCL(obj, exclude_end);
|
SET_EXCL(obj, exclude_end);
|
||||||
|
|
4
regex.c
4
regex.c
|
@ -3264,7 +3264,7 @@ re_search(bufp, string, size, startpos, range, regs)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startpos > size) return -1;
|
if (startpos > size) return -1;
|
||||||
if ((anchor || !bufp->can_be_null) && size > 0 && startpos == size)
|
if ((anchor || !bufp->can_be_null) && range > 0 && size > 0 && startpos == size)
|
||||||
return -1;
|
return -1;
|
||||||
val = re_match(bufp, string, size, startpos, regs);
|
val = re_match(bufp, string, size, startpos, regs);
|
||||||
if (val >= 0) return startpos;
|
if (val >= 0) return startpos;
|
||||||
|
@ -4237,7 +4237,6 @@ re_match(bufp, string_arg, size, pos, regs)
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
|
|
||||||
PREFETCH;
|
PREFETCH;
|
||||||
c = *d++;
|
|
||||||
if (*p == 0xff) {
|
if (*p == 0xff) {
|
||||||
p++;
|
p++;
|
||||||
if (!--mcnt
|
if (!--mcnt
|
||||||
|
@ -4246,6 +4245,7 @@ re_match(bufp, string_arg, size, pos, regs)
|
||||||
goto fail;
|
goto fail;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
c = *d++;
|
||||||
if (ismbchar(c)) {
|
if (ismbchar(c)) {
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
|
|
2
ruby.c
2
ruby.c
|
@ -770,7 +770,7 @@ load_file(fname, script)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (script) {
|
if (script) {
|
||||||
VALUE c;
|
VALUE c = 1; /* something not nil */
|
||||||
VALUE line;
|
VALUE line;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
|
|
2
ruby.h
2
ruby.h
|
@ -244,7 +244,7 @@ VALUE rb_newobj _((void));
|
||||||
#define CLONESETUP(clone,obj) do {\
|
#define CLONESETUP(clone,obj) do {\
|
||||||
OBJSETUP(clone,rb_singleton_class_clone(RBASIC(obj)->klass),RBASIC(obj)->flags);\
|
OBJSETUP(clone,rb_singleton_class_clone(RBASIC(obj)->klass),RBASIC(obj)->flags);\
|
||||||
rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);\
|
rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);\
|
||||||
if (FL_TEST(obj, FL_EXIVAR)) rb_clone_generic_ivar((VALUE)clone,(VALUE)obj);\
|
if (FL_TEST(obj, FL_EXIVAR)) rb_copy_generic_ivar((VALUE)clone,(VALUE)obj);\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
struct RBasic {
|
struct RBasic {
|
||||||
|
|
13
string.c
13
string.c
|
@ -100,11 +100,7 @@ rb_str_new4(orig)
|
||||||
{
|
{
|
||||||
VALUE klass;
|
VALUE klass;
|
||||||
|
|
||||||
klass = CLASS_OF(orig);
|
klass = rb_obj_type(orig);
|
||||||
while (TYPE(klass) == T_ICLASS || FL_TEST(klass, FL_SINGLETON)) {
|
|
||||||
klass = (VALUE)RCLASS(klass)->super;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (RSTRING(orig)->orig) {
|
if (RSTRING(orig)->orig) {
|
||||||
VALUE str;
|
VALUE str;
|
||||||
|
|
||||||
|
@ -252,10 +248,7 @@ rb_str_dup(str)
|
||||||
VALUE klass;
|
VALUE klass;
|
||||||
|
|
||||||
StringValue(str);
|
StringValue(str);
|
||||||
klass = CLASS_OF(str);
|
klass = rb_obj_type(str);
|
||||||
while (TYPE(klass) == T_ICLASS || FL_TEST(klass, FL_SINGLETON)) {
|
|
||||||
klass = (VALUE)RCLASS(klass)->super;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (OBJ_FROZEN(str)) str2 = rb_str_new3(str);
|
if (OBJ_FROZEN(str)) str2 = rb_str_new3(str);
|
||||||
else if (FL_TEST(str, STR_NO_ORIG)) {
|
else if (FL_TEST(str, STR_NO_ORIG)) {
|
||||||
|
@ -267,6 +260,8 @@ rb_str_dup(str)
|
||||||
else {
|
else {
|
||||||
str2 = rb_str_new3(rb_str_new4(str));
|
str2 = rb_str_new3(rb_str_new4(str));
|
||||||
}
|
}
|
||||||
|
if (FL_TEST(str, FL_EXIVAR))
|
||||||
|
rb_copy_generic_ivar(str2, str);
|
||||||
OBJ_INFECT(str2, str);
|
OBJ_INFECT(str2, str);
|
||||||
RBASIC(str2)->klass = klass;
|
RBASIC(str2)->klass = klass;
|
||||||
return str2;
|
return str2;
|
||||||
|
|
|
@ -142,9 +142,6 @@ classname(klass)
|
||||||
VALUE path = Qnil;
|
VALUE path = Qnil;
|
||||||
ID classpath = rb_intern("__classpath__");
|
ID classpath = rb_intern("__classpath__");
|
||||||
|
|
||||||
while (TYPE(klass) == T_ICLASS || FL_TEST(klass, FL_SINGLETON)) {
|
|
||||||
klass = (VALUE)RCLASS(klass)->super;
|
|
||||||
}
|
|
||||||
if (!klass) klass = rb_cObject;
|
if (!klass) klass = rb_cObject;
|
||||||
if (!ROBJECT(klass)->iv_tbl)
|
if (!ROBJECT(klass)->iv_tbl)
|
||||||
ROBJECT(klass)->iv_tbl = st_init_numtable();
|
ROBJECT(klass)->iv_tbl = st_init_numtable();
|
||||||
|
@ -173,7 +170,7 @@ VALUE
|
||||||
rb_mod_name(mod)
|
rb_mod_name(mod)
|
||||||
VALUE mod;
|
VALUE mod;
|
||||||
{
|
{
|
||||||
VALUE path = classname(mod);
|
VALUE path = classname(rb_obj_type(mod));
|
||||||
|
|
||||||
if (path) return rb_str_dup(path);
|
if (path) return rb_str_dup(path);
|
||||||
return rb_str_new(0,0);
|
return rb_str_new(0,0);
|
||||||
|
@ -183,7 +180,7 @@ VALUE
|
||||||
rb_class_path(klass)
|
rb_class_path(klass)
|
||||||
VALUE klass;
|
VALUE klass;
|
||||||
{
|
{
|
||||||
VALUE path = classname(klass);
|
VALUE path = classname(rb_class_real(klass));
|
||||||
|
|
||||||
if (path) return path;
|
if (path) return path;
|
||||||
else {
|
else {
|
||||||
|
@ -871,7 +868,7 @@ rb_free_generic_ivar(obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rb_clone_generic_ivar(clone, obj)
|
rb_copy_generic_ivar(clone, obj)
|
||||||
VALUE clone, obj;
|
VALUE clone, obj;
|
||||||
{
|
{
|
||||||
st_table *tbl;
|
st_table *tbl;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#define RUBY_VERSION "1.7.1"
|
#define RUBY_VERSION "1.7.1"
|
||||||
#define RUBY_RELEASE_DATE "2001-07-12"
|
#define RUBY_RELEASE_DATE "2001-07-15"
|
||||||
#define RUBY_VERSION_CODE 171
|
#define RUBY_VERSION_CODE 171
|
||||||
#define RUBY_RELEASE_CODE 20010712
|
#define RUBY_RELEASE_CODE 20010715
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue