diff --git a/ChangeLog b/ChangeLog index f5cc5e2bb7..0922c3854d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,67 @@ +Tue Feb 8 02:07:33 2000 Yukihiro Matsumoto + + * regex.c (re_search): optimize for \G at top. + + * regex.c (re_compile_pattern): \G introduced. + + * regex.c (re_match): ditto. + + * string.c (str_sub_bang): old behavior restored: bang method + returns nil if string not changed. + + * regex.c (re_compile_pattern): support independent subexpression + `(?>pattern)'. + + * regex.c (re_match): ditto. + +Mon Feb 7 15:51:08 2000 Yukihiro Matsumoto + + * regex.c (re_match): now understands interrupts under Ruby. + +Mon Feb 7 07:51:52 2000 Yukihiro Matsumoto + + * array.c (rb_ary_uniq_bang): always return an Array. + + * array.c (rb_ary_compact_bang): ditto. + + * array.c (rb_ary_flatten_bang): ditto. + + * hash.c (rb_hash_reject): returns a Hash, not an Array. + + * hash.c (env_reject): ditto. + +Fri Feb 4 10:20:25 2000 Yukihiro Matsumoto + + * string.c (scan_once): scan now leaves information about the last + successful pattern match in $&. + + * io.c (rb_io_close): should not check closed IO. + +Fri Feb 4 05:44:01 2000 Kentaro Inagaki + + * ext/socket/socket.c (s_recv): TRAP_BEG after retry entry. + +Wed Feb 2 22:33:45 Nobuyoshi Nakada + + * eval.c (rb_thread_start): receives argument from outside, like + `Thread::start(1,2,3){|a,b,c| ... }'. + +Wed Feb 2 22:14:40 2000 Yukihiro Matsumoto + + * re.c (rb_reg_regsub): should check regs->num_regs. + + * re.c (rb_reg_search): remove matchcache, use static struct + re_register instead. + + * re.c (match_getter): avoid cloning match data. + +Wed Feb 2 17:12:15 2000 Dave Thomas + + * samples/eval.rb: Rescue new ScriptError exception + Wed Feb 2 02:06:07 2000 Yukihiro Matsumoto - * string.c (str_gsub_bang): gsub! now leaves information about + * string.c (str_gsub_bang): gsub! now leaves information about the last successful pattern match in $&. Mon Jan 31 15:24:58 2000 Yukihiro Matsumoto diff --git a/MANIFEST b/MANIFEST index d67346f3ac..7793e60949 100644 --- a/MANIFEST +++ b/MANIFEST @@ -125,6 +125,7 @@ lib/matrix.rb lib/mkmf.rb lib/monitor.rb lib/mutex_m.rb +lib/net/http.rb lib/net/pop.rb lib/net/session.rb lib/net/smtp.rb diff --git a/ToDo b/ToDo index bccb5c2ad9..1d0e777872 100644 --- a/ToDo +++ b/ToDo @@ -52,9 +52,13 @@ Standard Libraries - SyntaxError, NameError, LoadError and NotImplementError are subclasses of ScriptError..) +* regexp: \G * Struct::new([name,]member,...) ?? * String#scanf(?) * Object#fmt(?) +* Integer#{bin,oct,hex,heX} * Time::strptime * Integer[num], Float[num]; Fixnum[num]? * method to retrieve non-number trailer for to_i/to_f. diff --git a/config.guess b/config.guess index 7e23afe37b..53ebbce1a9 100644 --- a/config.guess +++ b/config.guess @@ -1,6 +1,7 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 +# Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -23,6 +24,7 @@ # Written by Per Bothner . # The master version of this file is at the FSF in /home/gd/gnu/lib. +# Please send patches to the Autoconf mailing list . # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and @@ -35,6 +37,19 @@ # (but try to keep the structure clean). # +# Use $HOST_CC if defined. $CC may point to a cross-compiler +if test x"$CC_FOR_BUILD" = x; then + if test x"$HOST_CC" != x; then + CC_FOR_BUILD="$HOST_CC" + else + if test x"$CC" != x; then + CC_FOR_BUILD="$CC" + else + CC_FOR_BUILD=cc + fi + fi +fi + # Modified for Human68k by K.Okabe 1997.07.09 # Last change: 1997.07.09 @@ -57,7 +72,8 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 # Note: order is significant - the case branches are not exclusive. @@ -73,7 +89,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - cat <dummy.s + cat <$dummy.s .globl main .ent main main: @@ -90,9 +106,9 @@ main: ret \$31,(\$26),1 .end main EOF - ${CC-cc} dummy.s -o dummy 2>/dev/null + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then - ./dummy + ./$dummy case "$?" in 7) UNAME_MACHINE="alpha" @@ -111,8 +127,14 @@ EOF ;; esac fi - rm -f dummy.s dummy - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]` + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 @@ -156,7 +178,7 @@ EOF SR2?01:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; - Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*) + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 @@ -164,7 +186,7 @@ EOF echo pyramid-pyramid-bsd fi exit 0 ;; - NILE:*:*:dcosx) + NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; sun4H:SunOS:5.*:*) @@ -215,6 +237,32 @@ EOF atari*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; sun3*:NetBSD:*:*) echo m68k-sun-netbsd${UNAME_RELEASE} exit 0 ;; @@ -248,12 +296,16 @@ EOF VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; - 2020:CLIX:*:*) + 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) - sed 's/^ //' << EOF >dummy.c - int main (argc, argv) int argc; char **argv; { + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); @@ -268,10 +320,10 @@ EOF exit (-1); } EOF - ${CC-cc} dummy.c -o dummy \ - && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy + $CC_FOR_BUILD $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Night_Hawk:Power_UNIX:*:*) @@ -323,7 +375,7 @@ EOF exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - sed 's/^ //' << EOF >dummy.c + sed 's/^ //' << EOF >$dummy.c #include main() @@ -334,8 +386,8 @@ EOF exit(0); } EOF - ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 @@ -382,25 +434,25 @@ EOF case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678]?? ) - sed 's/^ //' << EOF >dummy.c + 9000/[678][0-9][0-9]) + sed 's/^ //' << EOF >$dummy.c #include #include - + int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); - #endif + #endif long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) + + switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: + case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) - switch (bits) + switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; @@ -408,20 +460,20 @@ EOF } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; - #endif + #endif default: puts ("hppa1.0"); break; } exit (0); } EOF - (${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy` - rm -f dummy.c dummy + ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + rm -f $dummy.c $dummy esac HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) - sed 's/^ //' << EOF >dummy.c + sed 's/^ //' << EOF >$dummy.c #include int main () @@ -446,8 +498,8 @@ EOF exit (0); } EOF - ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) @@ -456,6 +508,9 @@ EOF 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; + *9??*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; @@ -472,6 +527,9 @@ EOF parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; + hppa*:OpenBSD:*:*) + echo hppa-unknown-openbsd + exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; @@ -504,11 +562,14 @@ EOF CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} exit 0 ;; + CRAY*T3E:*:*:*) + echo t3e-cray-unicosmk${UNAME_RELEASE} + exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; F300:UNIX_System_V:*:*) - FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; @@ -521,16 +582,22 @@ EOF hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; i?86:BSD/386:*:* | i?86:BSD/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) + if test -x /usr/bin/objformat; then + if test "elf" = "`/usr/bin/objformat`"; then + echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` + exit 0 + fi + fi echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:NetBSD:*:*) @@ -548,6 +615,15 @@ EOF i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; @@ -561,12 +637,14 @@ EOF # uname on the ARM produces all sorts of strangeness, and we need to # filter it out. case "$UNAME_MACHINE" in + armv*) UNAME_MACHINE=$UNAME_MACHINE ;; arm* | sa110*) UNAME_MACHINE="arm" ;; esac # The BFD linker knows what the default object file format is, so - # first see if it will tell us. - ld_help_string=`ld --help 2>&1` + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + ld_help_string=`cd /; ld --help 2>&1` ld_supported_emulations=`echo $ld_help_string \ | sed -ne '/supported emulations:/!d s/[ ][ ]*/ /g @@ -577,12 +655,42 @@ EOF i?86linux) echo "${UNAME_MACHINE}-pc-linux-aout" ; exit 0 ;; i?86coff) echo "${UNAME_MACHINE}-pc-linux-coff" ; exit 0 ;; sparclinux) echo "${UNAME_MACHINE}-unknown-linux-aout" ; exit 0 ;; + armlinux) echo "${UNAME_MACHINE}-unknown-linux-aout" ; exit 0 ;; m68klinux) echo "${UNAME_MACHINE}-unknown-linux-aout" ; exit 0 ;; - elf32ppc) echo "powerpc-unknown-linux" ; exit 0 ;; + elf32ppc) + # Determine Lib Version + cat >$dummy.c < +#if defined(__GLIBC__) +extern char __libc_version[]; +extern char __libc_release[]; +#endif +main(argc, argv) + int argc; + char *argv[]; +{ +#if defined(__GLIBC__) + printf("%s %s\n", __libc_version, __libc_release); +#else + printf("unkown\n"); +#endif + return 0; +} +EOF + LIBC="" + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy | grep 1\.99 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.c $dummy + echo powerpc-unknown-linux-${LIBC} ; exit 0 ;; esac if test "${UNAME_MACHINE}" = "alpha" ; then - sed 's/^ //' <dummy.s + sed 's/^ //' <$dummy.s .globl main .ent main main: @@ -600,9 +708,9 @@ EOF .end main EOF LIBC="" - ${CC-cc} dummy.s -o dummy 2>/dev/null + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then - ./dummy + ./$dummy case "$?" in 7) UNAME_MACHINE="alpha" @@ -621,20 +729,21 @@ EOF ;; esac - objdump --private-headers dummy | \ + objdump --private-headers $dummy | \ grep ld.so.1 > /dev/null if test "$?" = 0 ; then LIBC="-libc1" fi - fi - rm -f dummy.s dummy - echo ${UNAME_MACHINE}-unknown-linux${LIBC} ; exit 0 + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-unknown-linux{LIBC} ; exit 0 elif test "${UNAME_MACHINE}" = "mips" ; then - cat >dummy.c <$dummy.c </dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy else + # Either a pre-BFD a.out linker (linux-oldld) + # or one that does not give us useful --help. + # GCC wants to distinguish between linux-oldld and linux-aout. + # If ld does not provide *any* "supported emulations:" + # that means it is oldld. + echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" + test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-oldld" && exit 0 + case "${UNAME_MACHINE}" in i?86) VENDOR=pc; @@ -655,8 +772,32 @@ EOF VENDOR=unknown; ;; esac - echo ${UNAME_MACHINE}-${VENDOR}-linux - exit 0 + # Determine whether the default compiler is a.out or elf + cat >$dummy.c < +#ifdef __cplusplus + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-${VENDOR}-linux\n", argv[1]); +# else + printf ("%s-${VENDOR}-linux-libc1\n", argv[1]); +# endif +# else + printf ("%s-${VENDOR}-linux-libc1\n", argv[1]); +# endif +#else + printf ("%s-${VENDOR}-linux-aout\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy fi ;; # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions # are messed up and put the nodename in both sysname and nodename. @@ -678,6 +819,14 @@ EOF echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} fi exit 0 ;; + i?86:*:5:7*) + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585 + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE} + exit 0 ;; i?86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 @@ -740,7 +893,7 @@ EOF mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i?86:LynxOS:2.*:*) + i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) @@ -752,6 +905,9 @@ EOF SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; @@ -782,7 +938,7 @@ EOF news*:NEWS-OS:*:6*) echo mips-sony-newsos6 exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*) + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv`echo ${UNAME_RELEASE} | sed -n 's/\([.0-9]*\).*/\1/p'` else @@ -801,27 +957,24 @@ EOF BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; - - *:Rhapsody:*:*) - arch=`/usr/bin/arch` - case "$arch" in - ppc) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - ;; - i[3456]86) - echo i386-apple-rhapsody${UNAME_RELEASE} - ;; - *) - echo $arch-apple-rhapsody${UNAME_RELEASE} - ;; - esac + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 -cat >dummy.c <$dummy.c < # include @@ -863,7 +1016,6 @@ main () printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); #endif @@ -923,8 +1075,8 @@ main () } EOF -${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0 -rm -f dummy.c dummy +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 +rm -f $dummy.c $dummy # Apollos put the system type in the environment. diff --git a/config.sub b/config.sub index c07e5d5cba..f853351cc4 100644 --- a/config.sub +++ b/config.sub @@ -1,6 +1,6 @@ #! /bin/sh # Configuration validation subroutine script, version 1.1. -# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc. +# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc. # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. @@ -98,11 +98,21 @@ case $os in os= basic_machine=$1 ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=vxworks + basic_machine=$1 + ;; -hiux*) os=-hiuxwe2 ;; -sco5) - os=sco3.2v5 + os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) @@ -121,6 +131,9 @@ case $os in os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -151,14 +164,21 @@ case $basic_machine in # Some are omitted here because they have special meanings below. tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ - | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w \ - | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \ - | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \ - | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ - | mipstx39 | mipstx39el \ - | sparc | sparclet | sparclite | sparc64 | v850) + | 580 | i960 | h8300 \ + | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ + | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \ + | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ + | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ + | mips64orion | mips64orionel | mipstx39 | mipstx39el \ + | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ + | mips64vr5000 | miprs64vr5000el \ + | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ + | thumb | d10v) basic_machine=$basic_machine-unknown ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65) + ;; + # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -177,24 +197,41 @@ case $basic_machine in vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ - | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ - | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0* | hppa2.0w-* \ - | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \ - | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ + | xmp-* | ymp-* \ + | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ + | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \ + | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ + | clipper-* | orion-* \ | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ - | sparc64-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* \ + | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ | mipstx39-* | mipstx39el-* \ - | f301-*) + | f301-* | armv*-* | t3e-* \ + | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ + | thumb-* | v850-* | d30v-* | tic30-* | c30-* ) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; alliant | fx80) basic_machine=fx80-alliant ;; @@ -224,6 +261,10 @@ case $basic_machine in basic_machine=m68k-apollo os=-sysv ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; aux) basic_machine=m68k-apple os=-aux @@ -300,6 +341,10 @@ case $basic_machine in encore | umax | mmax) basic_machine=ns32k-encore ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; fx2800) basic_machine=i860-alliant ;; @@ -318,6 +363,14 @@ case $basic_machine in basic_machine=h8300-hitachi os=-hms ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; harris) basic_machine=m88k-harris os=-sysv3 @@ -333,13 +386,30 @@ case $basic_machine in basic_machine=m68k-hp os=-hpux ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; - hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7) + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) @@ -348,6 +418,14 @@ case $basic_machine in hppa-next) os=-nextstep3 ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; i370-ibm* | ibm*) basic_machine=i370-ibm os=-mvs @@ -369,6 +447,22 @@ case $basic_machine in basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + i386-go32 | go32) + basic_machine=i386-unknown + os=-go32 + ;; + i386-mingw32 | mingw32) + basic_machine=i386-unknown + os=-mingw32 + ;; iris | iris4d) basic_machine=mips-sgi case $os in @@ -397,6 +491,10 @@ case $basic_machine in miniframe) basic_machine=m68000-convergent ;; + *mint | *MiNT) + basic_machine=m68k-atari + os=-mint + ;; mipsel*-linux*) basic_machine=mipsel-unknown os=-linux @@ -411,10 +509,26 @@ case $basic_machine in mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + msdos) + basic_machine=i386-unknown + os=-msdos + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-corel + os=-linux + ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos @@ -427,6 +541,10 @@ case $basic_machine in basic_machine=mips-sony os=-newsos ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; next | m*-next ) basic_machine=m68k-next case $os in @@ -452,9 +570,25 @@ case $basic_machine in basic_machine=i960-intel os=-nindy ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; np1) basic_machine=np1-gould ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 @@ -472,19 +606,19 @@ case $basic_machine in pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pentium | p5 | k5 | nexen) + pentium | p5 | k5 | k6 | nexen) basic_machine=i586-pc ;; - pentiumpro | p6 | k6 | 6x86) + pentiumpro | p6 | 6x86) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i786-pc ;; - pentium-* | p5-* | k5-* | nexen-*) + pentium-* | p5-* | k5-* | k6-* | nexen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumpro-* | p6-* | k6-* | 6x86-*) + pentiumpro-* | p6-* | 6x86-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) @@ -508,12 +642,20 @@ case $basic_machine in ps2) basic_machine=i386-ibm ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; sequent) basic_machine=i386-sequent ;; @@ -521,6 +663,10 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; + sparclite-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; sps7) basic_machine=m68k-bull os=-sysv2 @@ -528,6 +674,13 @@ case $basic_machine in spur) basic_machine=spur-unknown ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; sun2) basic_machine=m68000-sun ;; @@ -572,6 +725,10 @@ case $basic_machine in basic_machine=i386-sequent os=-dynix ;; + t3e) + basic_machine=t3e-cray + os=-unicos + ;; tx39) basic_machine=mipstx39-unknown ;; @@ -589,6 +746,10 @@ case $basic_machine in basic_machine=a29k-nyu os=-sym1 ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; vaxv) basic_machine=vax-dec os=-sysv @@ -612,6 +773,14 @@ case $basic_machine in basic_machine=a29k-wrs os=-vxworks ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; xmp) basic_machine=xmp-cray os=-unicos @@ -619,6 +788,10 @@ case $basic_machine in xps | xps100) basic_machine=xps100-honeywell ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; none) basic_machine=none-none os=-none @@ -626,6 +799,15 @@ case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; mips) if [ x$os = x-linux ]; then basic_machine=mips-unknown @@ -648,7 +830,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sparc) + sparc | sparcv9) basic_machine=sparc-sun ;; cydra) @@ -660,6 +842,16 @@ case $basic_machine in orion105) basic_machine=clipper-highlevel ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 @@ -674,10 +866,6 @@ case $basic_machine in *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; - human) - basic_machine=m68k-sharp - os=-human - ;; *) ;; esac @@ -705,8 +893,6 @@ case $os in -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; - -os2_emx) - ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. @@ -719,13 +905,21 @@ case $os in | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux* | -uxpv* | -beos* | -rhapsody* ) + | -mingw32* | -linux* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*) # Remember, each alternative MUST END IN *, to match a version number. ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; @@ -747,6 +941,9 @@ case $os in -acis*) os=-aos ;; + -386bsd) + os=-bsd + ;; -ctix* | -uts*) os=-sysv ;; @@ -778,9 +975,18 @@ case $os in # This must come after -sysvr4. -sysv*) ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; -xenix) os=-xenix ;; + -*mint | -*MiNT) + os=-mint + ;; -uxpds) os=-uxpds ;; @@ -814,6 +1020,9 @@ case $basic_machine in *-acorn) os=-riscix1.2 ;; + arm*-corel) + os=-linux + ;; arm*-semi) os=-aout ;; @@ -835,6 +1044,15 @@ case $basic_machine in # default. # os=-sunos4 ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; @@ -847,6 +1065,15 @@ case $basic_machine in *-ibm) os=-aix ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; *-hp) os=-hpux ;; @@ -910,6 +1137,18 @@ case $basic_machine in f301-fujitsu) os=-uxpv ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; *) os=-none ;; @@ -931,9 +1170,15 @@ case $basic_machine in -aix*) vendor=ibm ;; + -beos*) + vendor=be + ;; -hpux*) vendor=hp ;; + -mpeix*) + vendor=hp + ;; -hiux*) vendor=hitachi ;; @@ -961,6 +1206,15 @@ case $basic_machine in -aux*) vendor=apple ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -*MiNT) + vendor=atari + ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; diff --git a/configure b/configure index 681d65554a..6b40c2fc32 100644 --- a/configure +++ b/configure @@ -2014,10 +2014,13 @@ rhapsody*) ;; human*) ac_cv_func_getpgrp_void=yes;; beos*) ;; cygwin*) ;; +os2_emx*) LIBS="-lm $LIBS" + ac_cv_lib_xpg4_setlocale=no + ac_cv_lib_dir_opendir=no;; *) LIBS="-lm $LIBS";; esac echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:2021: checking for crypt in -lcrypt" >&5 +echo "configure:2024: 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 @@ -2025,7 +2028,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2043: \"$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 @@ -2064,7 +2067,7 @@ else fi echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2068: checking for dlopen in -ldl" >&5 +echo "configure:2071: 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 @@ -2072,7 +2075,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2090: \"$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 @@ -2111,7 +2114,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:2115: checking for shl_load in -ldld" >&5 +echo "configure:2118: 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 @@ -2119,7 +2122,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2137: \"$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 @@ -2158,7 +2161,7 @@ else fi # Dynamic linking for HP-UX echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6 -echo "configure:2162: checking for setlocale in -lxpg4" >&5 +echo "configure:2165: 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 @@ -2166,7 +2169,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lxpg4 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2184: \"$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 @@ -2210,12 +2213,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:2214: checking for $ac_hdr that defines DIR" >&5 +echo "configure:2217: 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 < #include <$ac_hdr> @@ -2223,7 +2226,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:2227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -2248,7 +2251,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:2252: checking for opendir in -ldir" >&5 +echo "configure:2255: 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 @@ -2256,7 +2259,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2274: \"$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 @@ -2289,7 +2292,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:2293: checking for opendir in -lx" >&5 +echo "configure:2296: 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 @@ -2297,7 +2300,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2315: \"$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 @@ -2331,12 +2334,12 @@ fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2335: checking for ANSI C header files" >&5 +echo "configure:2338: 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 < #include @@ -2344,7 +2347,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2351: \"$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* @@ -2361,7 +2364,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 @@ -2379,7 +2382,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 @@ -2400,7 +2403,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2411,7 +2414,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2435,12 +2438,12 @@ EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:2439: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:2442: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2456,7 +2459,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:2460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -2482,17 +2485,17 @@ for ac_hdr in stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h\ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2486: checking for $ac_hdr" >&5 +echo "configure:2489: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2496: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2499: \"$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* @@ -2520,12 +2523,12 @@ done echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:2524: checking for uid_t in sys/types.h" >&5 +echo "configure:2527: 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 @@ -2554,12 +2557,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2558: checking for size_t" >&5 +echo "configure:2561: 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 < #if STDC_HEADERS @@ -2587,12 +2590,12 @@ EOF fi echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:2591: checking for st_blksize in struct stat" >&5 +echo "configure:2594: 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 < #include @@ -2600,7 +2603,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:2604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2607: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else @@ -2622,12 +2625,12 @@ fi save_LIBOJBS="$LIBOBJS" echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 -echo "configure:2626: checking for st_blocks in struct stat" >&5 +echo "configure:2629: 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 < #include @@ -2635,7 +2638,7 @@ int main() { struct stat s; s.st_blocks; ; return 0; } EOF -if { (eval echo configure:2639: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blocks=yes else @@ -2659,12 +2662,12 @@ fi LIBOBJS="$save_LIBOBJS" echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 -echo "configure:2663: checking for st_rdev in struct stat" >&5 +echo "configure:2666: 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 < #include @@ -2672,7 +2675,7 @@ int main() { struct stat s; s.st_rdev; ; return 0; } EOF -if { (eval echo configure:2676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_rdev=yes else @@ -2694,7 +2697,7 @@ fi echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 -echo "configure:2698: checking type of array argument to getgroups" >&5 +echo "configure:2701: 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 @@ -2702,7 +2705,7 @@ else ac_cv_type_getgroups=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2734: \"$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 @@ -2741,7 +2744,7 @@ fi if test $ac_cv_type_getgroups = cross; then cat > conftest.$ac_ext < EOF @@ -2765,12 +2768,12 @@ EOF echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2769: checking return type of signal handlers" >&5 +echo "configure:2772: 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 < #include @@ -2787,7 +2790,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2808,19 +2811,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:2812: checking for working alloca.h" >&5 +echo "configure:2815: 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 < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2827: \"$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 @@ -2841,12 +2844,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2845: checking for alloca" >&5 +echo "configure:2848: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2881: \"$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 @@ -2906,12 +2909,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2910: checking whether alloca needs Cray hooks" >&5 +echo "configure:2913: 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 <&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:2940: checking for $ac_func" >&5 +echo "configure:2943: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2971: \"$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 @@ -2991,7 +2994,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2995: checking stack direction for C alloca" >&5 +echo "configure:2998: 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 @@ -2999,7 +3002,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3025: \"$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 @@ -3040,12 +3043,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:3044: checking for pid_t" >&5 +echo "configure:3047: 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 < #if STDC_HEADERS @@ -3074,17 +3077,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:3078: checking for vfork.h" >&5 +echo "configure:3081: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3088: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3091: \"$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* @@ -3109,18 +3112,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:3113: checking for working vfork" >&5 +echo "configure:3116: 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:3119: checking for vfork" >&5 +echo "configure:3122: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3150: \"$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 @@ -3165,7 +3168,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -3260,7 +3263,7 @@ main() { } } EOF -if { (eval echo configure:3264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3267: \"$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 @@ -3283,7 +3286,7 @@ EOF fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:3287: checking for 8-bit clean memcmp" >&5 +echo "configure:3290: 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 @@ -3291,7 +3294,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3308: \"$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 @@ -3323,12 +3326,12 @@ for ac_func in dup2 memmove mkdir strcasecmp strncasecmp strerror strftime\ isinf isnan finite do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3327: checking for $ac_func" >&5 +echo "configure:3330: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3358: \"$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 @@ -3384,12 +3387,12 @@ for ac_func in fmod killpg drand48 random wait4 waitpid syscall getcwd\ dlopen sigprocmask sigaction _setjmp setsid getrlimit do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3388: checking for $ac_func" >&5 +echo "configure:3391: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3419: \"$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 @@ -3437,12 +3440,12 @@ fi done echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:3441: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:3444: 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 < #include @@ -3450,7 +3453,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:3454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -3471,12 +3474,12 @@ EOF fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:3475: checking for tm_zone in struct tm" >&5 +echo "configure:3478: 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 < #include <$ac_cv_struct_tm> @@ -3484,7 +3487,7 @@ int main() { struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:3488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -3504,12 +3507,12 @@ EOF else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:3508: checking for tzname" >&5 +echo "configure:3511: 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 < #ifndef tzname /* For SGI. */ @@ -3519,7 +3522,7 @@ int main() { atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:3523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -3542,14 +3545,14 @@ fi if test "$ac_cv_func_strftime" = no; then cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3556: \"$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 @@ -3569,7 +3572,7 @@ EOF else echo $ac_n "checking for BSD signal semantics""... $ac_c" 1>&6 -echo "configure:3573: checking for BSD signal semantics" >&5 +echo "configure:3576: 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 @@ -3577,7 +3580,7 @@ else rb_cv_bsd_signal=no else cat > conftest.$ac_ext < @@ -3599,7 +3602,7 @@ main() } EOF -if { (eval echo configure:3603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3606: \"$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 @@ -3623,7 +3626,7 @@ EOF fi echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:3627: checking whether getpgrp takes no argument" >&5 +echo "configure:3630: 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 @@ -3631,7 +3634,7 @@ else { echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3693: \"$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 @@ -3710,7 +3713,7 @@ EOF fi echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:3714: checking whether setpgrp takes no argument" >&5 +echo "configure:3717: 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 @@ -3718,7 +3721,7 @@ else { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3745: \"$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 @@ -3763,7 +3766,7 @@ fi echo $ac_n "checking for working strtod""... $ac_c" 1>&6 -echo "configure:3767: checking for working strtod" >&5 +echo "configure:3770: 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 @@ -3771,7 +3774,7 @@ else rb_cv_func_strtod=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3808: \"$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 @@ -3819,14 +3822,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:3823: checking whether byte ordering is bigendian" >&5 +echo "configure:3826: 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 < #include @@ -3837,11 +3840,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:3841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3844: \"$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 < #include @@ -3852,7 +3855,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:3856: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -3872,7 +3875,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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3892: \"$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 @@ -3909,12 +3912,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3913: checking for working const" >&5 +echo "configure:3916: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3984,14 +3987,14 @@ EOF fi echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 -echo "configure:3988: checking whether char is unsigned" >&5 +echo "configure:3991: 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 <&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4030: \"$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 @@ -4048,7 +4051,7 @@ fi echo $ac_n "checking whether right shift preserve sign bit""... $ac_c" 1>&6 -echo "configure:4052: checking whether right shift preserve sign bit" >&5 +echo "configure:4055: 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 @@ -4056,7 +4059,7 @@ else rb_cv_rshift_sign=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4075: \"$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 @@ -4096,19 +4099,19 @@ EOF fi echo $ac_n "checking count field in FILE structures""... $ac_c" 1>&6 -echo "configure:4100: checking count field in FILE structures" >&5 +echo "configure:4103: 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 < int main() { FILE *f = stdin; f->_cnt = 0; ; return 0; } EOF -if { (eval echo configure:4112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="_cnt" else @@ -4118,14 +4121,14 @@ fi rm -f conftest* if test "$rb_cv_fcnt" = ""; then cat > conftest.$ac_ext < int main() { FILE *f = stdin; f->__cnt = 0; ; return 0; } EOF -if { (eval echo configure:4129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="__cnt" else @@ -4136,14 +4139,14 @@ rm -f conftest* fi if test "$rb_cv_fcnt" = ""; then cat > conftest.$ac_ext < int main() { FILE *f = stdin; f->_r = 0; ; return 0; } EOF -if { (eval echo configure:4147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="_r" else @@ -4154,14 +4157,14 @@ rm -f conftest* fi if test "$rb_cv_fcnt" = ""; then cat > conftest.$ac_ext < int main() { FILE *f = stdin; f->readCount = 0; ; return 0; } EOF -if { (eval echo configure:4165: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="readCount" else @@ -4172,14 +4175,14 @@ rm -f conftest* fi if test "$rb_cv_fcnt" = ""; then cat > conftest.$ac_ext < int main() { FILE *f = stdin; f->_rcount = 0; ; return 0; } EOF -if { (eval echo configure:4183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="_rcount" else @@ -4247,7 +4250,7 @@ fi echo $ac_n "checking whether ELF binaries are produced""... $ac_c" 1>&6 -echo "configure:4251: checking whether ELF binaries are produced" >&5 +echo "configure:4254: 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 @@ -4255,7 +4258,7 @@ else rb_cv_binary_elf=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4282: \"$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 @@ -4323,7 +4326,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:4327: checking whether OS depend dynamic link works" >&5 +echo "configure:4330: checking whether OS depend dynamic link works" >&5 if test "$GCC" = yes; then case "$target_os" in nextstep*) ;; @@ -4410,6 +4413,7 @@ echo "configure:4327: checking whether OS depend dynamic link works" >&5 aix*) LDSHARED='/usr/ccs/bin/ld' XLDFLAGS='-Wl,-bE:ruby.imp' DLDFLAGS='-eInit_$(TARGET) -bI:$(topdir)/ruby.imp -bM:SRE -T512 -H512 -lc' + LDFLAGS="-brtl" rb_cv_dlopen=yes ;; human*) DLDFLAGS='' @@ -4441,12 +4445,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:4445: checking whether matz's dln works" >&5 +echo "configure:4449: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4464: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_dln_a_out=yes else @@ -4518,9 +4522,9 @@ EOF #define DLEXT ".dll" EOF ;; - os2_emx) DLEXT=o + os2_emx*) DLEXT=dll cat >> confdefs.h <<\EOF -#define DLEXT ".so" +#define DLEXT ".dll" EOF ;; *) DLEXT=so @@ -4563,7 +4567,7 @@ fi case "$target_os" in human*) echo $ac_n "checking for _harderr in -lsignal""... $ac_c" 1>&6 -echo "configure:4567: checking for _harderr in -lsignal" >&5 +echo "configure:4571: 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 @@ -4571,7 +4575,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsignal $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4590: \"$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 @@ -4610,7 +4614,7 @@ else fi echo $ac_n "checking for hmemset in -lhmem""... $ac_c" 1>&6 -echo "configure:4614: checking for hmemset in -lhmem" >&5 +echo "configure:4618: 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 @@ -4618,7 +4622,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lhmem $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4637: \"$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 @@ -4659,12 +4663,12 @@ fi for ac_func in select gettimeofday do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4663: checking for $ac_func" >&5 +echo "configure:4667: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4695: \"$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 @@ -4712,7 +4716,7 @@ fi done echo $ac_n "checking whether PD libc _dtos18 fail to convert big number""... $ac_c" 1>&6 -echo "configure:4716: checking whether PD libc _dtos18 fail to convert big number" >&5 +echo "configure:4720: 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 @@ -4720,7 +4724,7 @@ else rb_cv_missing__dtos18=no else cat > conftest.$ac_ext < @@ -4732,7 +4736,7 @@ main () } EOF -if { (eval echo configure:4736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4740: \"$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 @@ -4754,7 +4758,7 @@ EOF fi echo $ac_n "checking whether PD libc fconvert fail to round""... $ac_c" 1>&6 -echo "configure:4758: checking whether PD libc fconvert fail to round" >&5 +echo "configure:4762: 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 @@ -4762,7 +4766,7 @@ else rb_cv_missing_fconvert=no else cat > conftest.$ac_ext < @@ -4775,7 +4779,7 @@ main () } EOF -if { (eval echo configure:4779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4783: \"$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 @@ -4803,7 +4807,7 @@ EOF setup=Setup.x68 ;; os2_emx) - LIBOBJS="$LIBOBJS os2.o" + LIBOBJS="$LIBOBJS os2.$OBJEXT" setup=Setup.emx ;; cygwin*) diff --git a/configure.in b/configure.in index 69ef552e44..0bae84de4c 100644 --- a/configure.in +++ b/configure.in @@ -158,6 +158,9 @@ rhapsody*) ;; human*) ac_cv_func_getpgrp_void=yes;; beos*) ;; cygwin*) ;; +os2_emx*) LIBS="-lm $LIBS" + ac_cv_lib_xpg4_setlocale=no + ac_cv_lib_dir_opendir=no;; *) LIBS="-lm $LIBS";; esac AC_CHECK_LIB(crypt, crypt) @@ -487,6 +490,7 @@ if test "$with_dln_a_out" != yes; then aix*) LDSHARED='/usr/ccs/bin/ld' XLDFLAGS='-Wl,-bE:ruby.imp' DLDFLAGS='-eInit_$(TARGET) -bI:$(topdir)/ruby.imp -bM:SRE -T512 -H512 -lc' + LDFLAGS="-brtl" rb_cv_dlopen=yes ;; human*) DLDFLAGS='' @@ -553,8 +557,8 @@ else AC_DEFINE(DLEXT, ".bundle");; cygwin*) DLEXT=dll AC_DEFINE(DLEXT, ".dll");; - os2_emx) DLEXT=o - AC_DEFINE(DLEXT, ".so");; + os2_emx*) DLEXT=dll + AC_DEFINE(DLEXT, ".dll");; *) DLEXT=so AC_DEFINE(DLEXT, ".so");; esac @@ -638,7 +642,7 @@ rb_cv_missing_fconvert=yes, rb_cv_missing_fconvert=no, rb_cv_missing_fconvert=no ;; dnl OS/2 environment w/ Autoconf 2.1x for EMX os2_emx) - LIBOBJS="$LIBOBJS os2.o" + LIBOBJS="$LIBOBJS os2.$OBJEXT" setup=Setup.emx ;; cygwin*) diff --git a/eval.c b/eval.c index 068e7e0ad4..d19f41f271 100644 --- a/eval.c +++ b/eval.c @@ -7266,21 +7266,21 @@ rb_thread_scope_shared_p() static VALUE rb_thread_yield(arg, th) - int arg; + VALUE arg; thread_t th; { scope_dup(ruby_block->scope); - return rb_yield_0(th->thread, 0, 0, Qfalse); + return rb_yield_0(arg, 0, 0, Qfalse); } static VALUE -rb_thread_start(klass) - VALUE klass; +rb_thread_start(klass, args) + VALUE klass, args; { if (!rb_iterator_p()) { rb_raise(rb_eThreadError, "must be called as iterator"); } - return rb_thread_create_0(rb_thread_yield, 0, klass); + return rb_thread_create_0(rb_thread_yield, args, klass); } static VALUE @@ -7708,9 +7708,9 @@ Init_Thread() rb_eThreadError = rb_define_class("ThreadError", rb_eStandardError); rb_cThread = rb_define_class("Thread", rb_cObject); - rb_define_singleton_method(rb_cThread, "new", rb_thread_start, 0); - rb_define_singleton_method(rb_cThread, "start", rb_thread_start, 0); - rb_define_singleton_method(rb_cThread, "fork", rb_thread_start, 0); + rb_define_singleton_method(rb_cThread, "new", rb_thread_start, -2); + rb_define_singleton_method(rb_cThread, "start", rb_thread_start, -2); + rb_define_singleton_method(rb_cThread, "fork", rb_thread_start, -2); rb_define_singleton_method(rb_cThread, "stop", rb_thread_stop, 0); rb_define_singleton_method(rb_cThread, "kill", rb_thread_s_kill, 1); diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in index 3e3ec3992e..e2c5d5bd3f 100644 --- a/ext/extmk.rb.in +++ b/ext/extmk.rb.in @@ -464,6 +464,7 @@ $(DLLIB): $(OBJS) dfile = open("#{$srcdir}/depend", "r") mfile.printf "###\n" while line = dfile.gets() + line.gsub!(/\.o/, ".#{$OBJEXT}") mfile.printf "%s", line.gsub('\$\(hdrdir\)/config.h', '$(topdir)/config.h') end dfile.close @@ -500,7 +501,7 @@ def extmake(target) $objs = nil $local_flags = "" case RUBY_PLATFORM - when /cygwin|beos|openstep|nextstep|rhapsody/ + when /cygwin|beos|openstep|nextstep|rhapsody|i386-os2_emx/ $libs = "" when /mswin32/ $LIBEXT = "lib" diff --git a/ext/pty/pty.c b/ext/pty/pty.c index 98be9044b7..b8c4e9acae 100644 --- a/ext/pty/pty.c +++ b/ext/pty/pty.c @@ -282,7 +282,9 @@ establishShell(shellname, info) dup2(slave,2); close(slave); +#if defined(HAVE_SETEUID) || defined(HAVE_SETREUID) || defined(HAVE_SETRESUID) seteuid(getuid()); +#endif argc = 0; for (i = 0; shellname[i];) { diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb index 3dd9c0fc1e..09d42f69c9 100644 --- a/ext/readline/extconf.rb +++ b/ext/readline/extconf.rb @@ -2,8 +2,9 @@ require "mkmf" dir_config("readline") have_library("user32", nil) if /cygwin/ === PLATFORM -have_library("termcap", "tgetnum") -have_library("curses", "tgetnum") +have_library("termcap", "tgetnum") or + have_library("curses", "tgetnum") or + have_library("ncurses", "tgetnum") if have_header("readline/readline.h") and have_header("readline/history.h") and have_library("readline", "readline") diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c index d89c7851be..d99ad12506 100644 --- a/ext/socket/getaddrinfo.c +++ b/ext/socket/getaddrinfo.c @@ -130,12 +130,6 @@ static struct afd { #define PTON_MAX 4 #endif -#ifndef INET6 -#ifndef NT -extern int h_errno; -#endif -#endif - static int get_name __P((const char *, struct afd *, struct addrinfo **, char *, struct addrinfo *, int)); diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c index 6a71d1d6f6..2fbb8d8037 100644 --- a/ext/socket/getnameinfo.c +++ b/ext/socket/getnameinfo.c @@ -64,12 +64,6 @@ #include "addrinfo.h" #include "sockport.h" -#ifndef INET6 -#ifndef NT -extern int h_errno; -#endif -#endif - #define SUCCESS 0 #define ANY 0 #define YES 1 diff --git a/ext/socket/socket.c b/ext/socket/socket.c index d680adc325..0a61160e99 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -399,8 +399,8 @@ s_recv(sock, argc, argv, from) str = rb_str_new(0, NUM2INT(len)); rb_thread_wait_fd(fd); - TRAP_BEG; retry: + TRAP_BEG; RSTRING(str)->len = recvfrom(fd, RSTRING(str)->ptr, RSTRING(str)->len, flags, (struct sockaddr*)buf, &alen); TRAP_END; diff --git a/gc.c b/gc.c index b20c84837b..4b337bc281 100644 --- a/gc.c +++ b/gc.c @@ -50,7 +50,6 @@ static unsigned long malloc_memories = 0; static unsigned long alloc_objects = 0; static int malloc_called = 0; -static int free_called = 0; static int second_mem_error = 0; static void @@ -133,12 +132,11 @@ xrealloc(ptr, size) return mem; } -static void +void xfree(x) void *x; { - free_called++; - free(x); + if (x) free(x); } #endif @@ -203,17 +201,47 @@ static struct gc_list { } *Global_List = 0; void -rb_global_variable(var) - VALUE *var; +rb_gc_register_address(addr) + VALUE *addr; { struct gc_list *tmp; tmp = ALLOC(struct gc_list); tmp->next = Global_List; - tmp->varptr = var; + tmp->varptr = addr; Global_List = tmp; } +void +rb_gc_unregister_address(addr) + VALUE *addr; +{ + struct gc_list *tmp = Global_List; + + if (tmp->varptr == addr) { + Global_List = tmp->next; + free(tmp); + return; + } + while (tmp->next) { + if (tmp->next->varptr == addr) { + struct gc_list *t = tmp->next; + + tmp->next = tmp->next->next; + free(t); + break; + } + tmp = tmp->next; + } +} + +void +rb_global_variable(var) + VALUE *var; +{ + rb_gc_register_address(var); +} + typedef struct RVALUE { union { struct { @@ -1219,6 +1247,8 @@ Init_GC() rb_define_module_function(rb_mObSpace, "call_finalizer", call_final, 1); rb_define_module_function(rb_mObSpace, "_id2ref", id2ref, 1); + rb_gc_register_address(&rb_mObSpace); rb_global_variable(&finalizers); + rb_gc_unregister_address(&rb_mObSpace); finalizers = rb_ary_new(); } diff --git a/hash.c b/hash.c index 77f7e3e6e2..4e3cf9974a 100644 --- a/hash.c +++ b/hash.c @@ -476,6 +476,13 @@ rb_hash_delete_if(hash) return hash; } +static VALUE +rb_hash_reject(hash) + VALUE hash; +{ + return rb_hash_delete_if(rb_hash_dup(hash)); +} + static int clear_i(key, value, dummy) VALUE key, value, dummy; @@ -1210,6 +1217,12 @@ env_delete_if() return envtbl; } +static VALUE +env_reject() +{ + return rb_hash_delete_if(env_to_hash()); +} + static VALUE env_to_s() { @@ -1331,8 +1344,7 @@ env_indexes(argc, argv) } static VALUE -env_to_hash(obj) - VALUE obj; +env_to_hash() { char **env; VALUE hash = rb_hash_new(); @@ -1397,6 +1409,7 @@ Init_Hash() rb_define_method(rb_cHash,"delete", rb_hash_delete, 1); rb_define_method(rb_cHash,"delete_if", rb_hash_delete_if, 0); rb_define_method(rb_cHash,"reject!", rb_hash_delete_if, 0); + rb_define_method(rb_cHash,"reject", rb_hash_reject, 0); rb_define_method(rb_cHash,"clear", rb_hash_clear, 0); rb_define_method(rb_cHash,"invert", rb_hash_invert, 0); rb_define_method(rb_cHash,"update", rb_hash_update, 1); @@ -1423,6 +1436,7 @@ Init_Hash() rb_define_singleton_method(envtbl,"delete", env_delete_m, 1); rb_define_singleton_method(envtbl,"delete_if", env_delete_if, 0); rb_define_singleton_method(envtbl,"reject!", env_delete_if, 0); + rb_define_singleton_method(envtbl,"reject", env_reject, 0); rb_define_singleton_method(envtbl,"to_s", env_to_s, 0); rb_define_singleton_method(envtbl,"rehash", env_none, 0); rb_define_singleton_method(envtbl,"to_a", env_to_a, 0); diff --git a/intern.h b/intern.h index 7dfc9f3032..cf3fe7425e 100644 --- a/intern.h +++ b/intern.h @@ -154,7 +154,6 @@ VALUE rb_file_s_expand_path _((int, VALUE *)); void rb_file_const _((const char*, VALUE)); char *rb_find_file _((char*)); /* gc.c */ -void rb_global_variable _((VALUE*)); void rb_gc_mark_locations _((VALUE*, VALUE*)); void rb_mark_tbl _((struct st_table*)); void rb_mark_hash _((struct st_table*)); @@ -248,10 +247,8 @@ VALUE rb_reg_new _((const char*, long, int)); VALUE rb_reg_match _((VALUE, VALUE)); VALUE rb_reg_match2 _((VALUE)); int rb_reg_options _((VALUE)); -const char* rb_get_kcode _((void)); void rb_set_kcode _((const char*)); -int rb_ignorecase_p _((void)); -void rb_match_busy _((VALUE, int)); +const char* rb_get_kcode _((void)); /* ruby.c */ EXTERN VALUE rb_argv; EXTERN VALUE rb_argv0; diff --git a/io.c b/io.c index 3476e1352c..cb81afdcf0 100644 --- a/io.c +++ b/io.c @@ -963,7 +963,7 @@ rb_io_close(io) { OpenFile *fptr; - GetOpenFile(io, fptr); + fptr = RFILE(io)->fptr; rb_io_fptr_close(fptr); if (fptr->pid) { rb_syswait(fptr->pid); @@ -2393,7 +2393,7 @@ rb_f_gets_internal(argc, argv) if (TYPE(current_file) != T_FILE) { line = rb_funcall3(current_file, rb_intern("gets"), argc, argv); } - if (argc == 0 && rb_rs == rb_default_rs) { + else if (argc == 0 && rb_rs == rb_default_rs) { line = rb_io_gets(current_file); } else { diff --git a/lib/debug.rb b/lib/debug.rb index 024365d174..7807ebd4da 100644 --- a/lib/debug.rb +++ b/lib/debug.rb @@ -97,7 +97,7 @@ class DEBUGGER__ begin val = eval(str, binding) val - rescue + rescue StandardError, ScriptError at = eval("caller(0)", binding) stdout.printf "%s:%s\n", at.shift, $!.to_s.sub(/\(eval\):1:(in `.*?':)?/, '') #` for i in at diff --git a/lib/jcode.rb b/lib/jcode.rb index 7a4cddd693..a7606d04ce 100644 --- a/lib/jcode.rb +++ b/lib/jcode.rb @@ -161,7 +161,7 @@ class String def tr_s!(from, to) return self.delete!(from) if to.length == 0 - pattern = SqueezePatternCache[from] ||= /([#{bsquote(from)}])\1+"/ + pattern = SqueezePatternCache[from] ||= /([#{bsquote(from)}])\1+"/ #" if from[0] == ?^ last = /.$/.match(to)[0] self.gsub!(pattern, last) diff --git a/lib/shellwords.rb b/lib/shellwords.rb index 60996be17c..7b16c6cb52 100644 --- a/lib/shellwords.rb +++ b/lib/shellwords.rb @@ -2,43 +2,46 @@ # original is shellwords.pl # # Usage: -# require 'shellwords.rb' +# require 'shellwords' # words = Shellwords.shellwords(line) # # or # +# require 'shellwords' # include Shellwords # words = shellwords(line) module Shellwords def shellwords(line) - return '' unless line - line.sub! /^\s+/, '' + unless line.kind_of?(String) + raise ArgumentError, "Argument must be String class object." + end + line.sub!(/^\s+/, '') words = [] while line != '' field = '' while true - if line.sub! /^"(([^"\\]|\\.)*)"/, '' then #" + if line.sub!(/^"(([^"\\]|\\.)*)"/, '') then #" snippet = $1 - snippet.gsub! /\\(.)/, '\1' + snippet.gsub!(/\\(.)/, '\1') elsif line =~ /^"/ then #" - raise ArgError, "Unmatched double quote: #{line}" - elsif line.sub! /^'(([^'\\]|\\.)*)'/, '' then #' + raise ArgumentError, "Unmatched double quote: #{line}" + elsif line.sub!(/^'(([^'\\]|\\.)*)'/, '') then #' snippet = $1 - snippet.gsub! /\\(.)/, '\1' + snippet.gsub!(/\\(.)/, '\1') elsif line =~ /^'/ then #' - raise ArgError, "Unmatched single quote: #{line}" - elsif line.sub! /^\\(.)/, '' then + raise ArgumentError, "Unmatched single quote: #{line}" + elsif line.sub!(/^\\(.)/, '') then snippet = $1 - elsif line.sub! /^([^\s\\'"]+)/, '' then #' + elsif line.sub!(/^([^\s\\'"]+)/, '') then #' snippet = $1 else - line.sub! /^\s+/, '' + line.sub!(/^\s+/, '') break end - field += snippet + field.concat(snippet) end - words += field + words.push(field) end words end diff --git a/lib/telnet.rb b/lib/telnet.rb index b6623513e0..47a0926f8e 100644 --- a/lib/telnet.rb +++ b/lib/telnet.rb @@ -1,11 +1,11 @@ =begin -$Date: 1999/10/04 22:51:26 $ +$Date: 2000/01/24 17:02:57 $ -== SIMPLE TELNET CLIANT LIBRARY +== SIMPLE TELNET CLIENT LIBRARY telnet.rb -Version 1.00 +Version 1.20 Wakou Aoyama @@ -155,6 +155,22 @@ of cource, set sync=true or flush is necessary. == HISTORY +=== Version 1.20 + +2000/01/24 17:02:57 + +- respond to "IAC WILL x" with "IAC DONT x" +- respond to "IAC WONT x" with "IAC DONT x" +- better dumplog format + thanks to WATANABE Hirofumi + +=== Version 1.10 + +2000/01/18 17:47:31 + +- bug fix: write method +- respond to "IAC WILL BINARY" with "IAC DO BINARY" + === Version 1.00 1999/10/04 22:51:26 @@ -338,74 +354,73 @@ if ommit password, then not require password prompt. require "socket" require "delegate" -require "thread" require "timeout" class Telnet < SimpleDelegator - IAC = 255.chr # "\377" # interpret as command: - DONT = 254.chr # "\376" # you are not to use option - DO = 253.chr # "\375" # please, you use option - WONT = 252.chr # "\374" # I won't use option - WILL = 251.chr # "\373" # I will use option - SB = 250.chr # "\372" # interpret as subnegotiation - GA = 249.chr # "\371" # you may reverse the line - EL = 248.chr # "\370" # erase the current line - EC = 247.chr # "\367" # erase the current character - AYT = 246.chr # "\366" # are you there - AO = 245.chr # "\365" # abort output--but let prog finish - IP = 244.chr # "\364" # interrupt process--permanently - BREAK = 243.chr # "\363" # break - DM = 242.chr # "\362" # data mark--for connect. cleaning - NOP = 241.chr # "\361" # nop - SE = 240.chr # "\360" # end sub negotiation - EOR = 239.chr # "\357" # end of record (transparent mode) - ABORT = 238.chr # "\356" # Abort process - SUSP = 237.chr # "\355" # Suspend process - EOF = 236.chr # "\354" # End of file - SYNCH = 242.chr # "\362" # for telfunc calls + IAC = 255.chr # "\377" # "\xff" # interpret as command: + DONT = 254.chr # "\376" # "\xfe" # you are not to use option + DO = 253.chr # "\375" # "\xfd" # please, you use option + WONT = 252.chr # "\374" # "\xfc" # I won't use option + WILL = 251.chr # "\373" # "\xfb" # I will use option + SB = 250.chr # "\372" # "\xfa" # interpret as subnegotiation + GA = 249.chr # "\371" # "\xf9" # you may reverse the line + EL = 248.chr # "\370" # "\xf8" # erase the current line + EC = 247.chr # "\367" # "\xf7" # erase the current character + AYT = 246.chr # "\366" # "\xf6" # are you there + AO = 245.chr # "\365" # "\xf5" # abort output--but let prog finish + IP = 244.chr # "\364" # "\xf4" # interrupt process--permanently + BREAK = 243.chr # "\363" # "\xf3" # break + DM = 242.chr # "\362" # "\xf2" # data mark--for connect. cleaning + NOP = 241.chr # "\361" # "\xf1" # nop + SE = 240.chr # "\360" # "\xf0" # end sub negotiation + EOR = 239.chr # "\357" # "\xef" # end of record (transparent mode) + ABORT = 238.chr # "\356" # "\xee" # Abort process + SUSP = 237.chr # "\355" # "\xed" # Suspend process + EOF = 236.chr # "\354" # "\xec" # End of file + SYNCH = 242.chr # "\362" # "\xf2" # for telfunc calls - OPT_BINARY = 0.chr # "\000" # Binary Transmission - OPT_ECHO = 1.chr # "\001" # Echo - OPT_RCP = 2.chr # "\002" # Reconnection - OPT_SGA = 3.chr # "\003" # Suppress Go Ahead - OPT_NAMS = 4.chr # "\004" # Approx Message Size Negotiation - OPT_STATUS = 5.chr # "\005" # Status - OPT_TM = 6.chr # "\006" # Timing Mark - OPT_RCTE = 7.chr # "\a" # Remote Controlled Trans and Echo - OPT_NAOL = 8.chr # "\010" # Output Line Width - OPT_NAOP = 9.chr # "\t" # Output Page Size - OPT_NAOCRD = 10.chr # "\n" # Output Carriage-Return Disposition - OPT_NAOHTS = 11.chr # "\v" # Output Horizontal Tab Stops - OPT_NAOHTD = 12.chr # "\f" # Output Horizontal Tab Disposition - OPT_NAOFFD = 13.chr # "\r" # Output Formfeed Disposition - OPT_NAOVTS = 14.chr # "\016" # Output Vertical Tabstops - OPT_NAOVTD = 15.chr # "\017" # Output Vertical Tab Disposition - OPT_NAOLFD = 16.chr # "\020" # Output Linefeed Disposition - OPT_XASCII = 17.chr # "\021" # Extended ASCII - OPT_LOGOUT = 18.chr # "\022" # Logout - OPT_BM = 19.chr # "\023" # Byte Macro - OPT_DET = 20.chr # "\024" # Data Entry Terminal - OPT_SUPDUP = 21.chr # "\025" # SUPDUP - OPT_SUPDUPOUTPUT = 22.chr # "\026" # SUPDUP Output - OPT_SNDLOC = 23.chr # "\027" # Send Location - OPT_TTYPE = 24.chr # "\030" # Terminal Type - OPT_EOR = 25.chr # "\031" # End of Record - OPT_TUID = 26.chr # "\032" # TACACS User Identification - OPT_OUTMRK = 27.chr # "\e" # Output Marking - OPT_TTYLOC = 28.chr # "\034" # Terminal Location Number - OPT_3270REGIME = 29.chr # "\035" # Telnet 3270 Regime - OPT_X3PAD = 30.chr # "\036" # X.3 PAD - OPT_NAWS = 31.chr # "\037" # Negotiate About Window Size - OPT_TSPEED = 32.chr # " " # Terminal Speed - OPT_LFLOW = 33.chr # "!" # Remote Flow Control - OPT_LINEMODE = 34.chr # "\"" # Linemode - OPT_XDISPLOC = 35.chr # "#" # X Display Location - OPT_OLD_ENVIRON = 36.chr # "$" # Environment Option - OPT_AUTHENTICATION = 37.chr # "%" # Authentication Option - OPT_ENCRYPT = 38.chr # "&" # Encryption Option - OPT_NEW_ENVIRON = 39.chr # "'" # New Environment Option - OPT_EXOPL = 255.chr # "\377" # Extended-Options-List + OPT_BINARY = 0.chr # "\000" # "\x00" # Binary Transmission + OPT_ECHO = 1.chr # "\001" # "\x01" # Echo + OPT_RCP = 2.chr # "\002" # "\x02" # Reconnection + OPT_SGA = 3.chr # "\003" # "\x03" # Suppress Go Ahead + OPT_NAMS = 4.chr # "\004" # "\x04" # Approx Message Size Negotiation + OPT_STATUS = 5.chr # "\005" # "\x05" # Status + OPT_TM = 6.chr # "\006" # "\x06" # Timing Mark + OPT_RCTE = 7.chr # "\a" # "\x07" # Remote Controlled Trans and Echo + OPT_NAOL = 8.chr # "\010" # "\x08" # Output Line Width + OPT_NAOP = 9.chr # "\t" # "\x09" # Output Page Size + OPT_NAOCRD = 10.chr # "\n" # "\x0a" # Output Carriage-Return Disposition + OPT_NAOHTS = 11.chr # "\v" # "\x0b" # Output Horizontal Tab Stops + OPT_NAOHTD = 12.chr # "\f" # "\x0c" # Output Horizontal Tab Disposition + OPT_NAOFFD = 13.chr # "\r" # "\x0d" # Output Formfeed Disposition + OPT_NAOVTS = 14.chr # "\016" # "\x0e" # Output Vertical Tabstops + OPT_NAOVTD = 15.chr # "\017" # "\x0f" # Output Vertical Tab Disposition + OPT_NAOLFD = 16.chr # "\020" # "\x10" # Output Linefeed Disposition + OPT_XASCII = 17.chr # "\021" # "\x11" # Extended ASCII + OPT_LOGOUT = 18.chr # "\022" # "\x12" # Logout + OPT_BM = 19.chr # "\023" # "\x13" # Byte Macro + OPT_DET = 20.chr # "\024" # "\x14" # Data Entry Terminal + OPT_SUPDUP = 21.chr # "\025" # "\x15" # SUPDUP + OPT_SUPDUPOUTPUT = 22.chr # "\026" # "\x16" # SUPDUP Output + OPT_SNDLOC = 23.chr # "\027" # "\x17" # Send Location + OPT_TTYPE = 24.chr # "\030" # "\x18" # Terminal Type + OPT_EOR = 25.chr # "\031" # "\x19" # End of Record + OPT_TUID = 26.chr # "\032" # "\x1a" # TACACS User Identification + OPT_OUTMRK = 27.chr # "\e" # "\x1b" # Output Marking + OPT_TTYLOC = 28.chr # "\034" # "\x1c" # Terminal Location Number + OPT_3270REGIME = 29.chr # "\035" # "\x1d" # Telnet 3270 Regime + OPT_X3PAD = 30.chr # "\036" # "\x1e" # X.3 PAD + OPT_NAWS = 31.chr # "\037" # "\x1f" # Negotiate About Window Size + OPT_TSPEED = 32.chr # " " # "\x20" # Terminal Speed + OPT_LFLOW = 33.chr # "!" # "\x21" # Remote Flow Control + OPT_LINEMODE = 34.chr # "\"" # "\x22" # Linemode + OPT_XDISPLOC = 35.chr # "#" # "\x23" # X Display Location + OPT_OLD_ENVIRON = 36.chr # "$" # "\x24" # Environment Option + OPT_AUTHENTICATION = 37.chr # "%" # "\x25" # Authentication Option + OPT_ENCRYPT = 38.chr # "&" # "\x26" # Encryption Option + OPT_NEW_ENVIRON = 39.chr # "'" # "\x27" # New Environment Option + OPT_EXOPL = 255.chr # "\377" # "\xff" # Extended-Options-List NULL = "\000" CR = "\015" @@ -413,35 +428,56 @@ class Telnet < SimpleDelegator EOL = CR + LF v = $-v $-v = false - VERSION = "1.00" - RELEASE_DATE = "$Date: 1999/10/04 22:51:26 $" + VERSION = "1.20" + RELEASE_DATE = "$Date: 2000/01/24 17:02:57 $" $-v = v def initialize(options) @options = options - @options["Binmode"] = false unless @options.key?("Binmode") - @options["Host"] = "localhost" unless @options.key?("Host") - @options["Port"] = 23 unless @options.key?("Port") - @options["Prompt"] = /[$%#>] \z/n unless @options.key?("Prompt") - @options["Telnetmode"] = true unless @options.key?("Telnetmode") - @options["Timeout"] = 10 unless @options.key?("Timeout") - @options["Waittime"] = 0 unless @options.key?("Waittime") + @options["Binmode"] = false unless @options.has_key?("Binmode") + @options["Host"] = "localhost" unless @options.has_key?("Host") + @options["Port"] = 23 unless @options.has_key?("Port") + @options["Prompt"] = /[$%#>] \z/n unless @options.has_key?("Prompt") + @options["Telnetmode"] = true unless @options.has_key?("Telnetmode") + @options["Timeout"] = 10 unless @options.has_key?("Timeout") + @options["Waittime"] = 0 unless @options.has_key?("Waittime") @telnet_option = { "SGA" => false, "BINARY" => false } - if @options.key?("Output_log") + if @options.has_key?("Output_log") @log = File.open(@options["Output_log"], 'a+') @log.sync = true @log.binmode end - if @options.key?("Dump_log") + if @options.has_key?("Dump_log") @dumplog = File.open(@options["Dump_log"], 'a+') @dumplog.sync = true @dumplog.binmode + def @dumplog.log_dump(dir, x) + len = x.length + addr = 0 + offset = 0 + while 0 < len + if len < 16 + line = x[offset, len] + else + line = x[offset, 16] + end + hexvals = line.unpack('H*')[0] + hexvals.concat ' ' * (32 - hexvals.length) + hexvals = format "%s %s %s %s " * 4, *hexvals.unpack('a2' * 16) + line.gsub! /[\000-\037\177-\377]/n, '.' + printf "%s 0x%5.5x: %s%s\n", dir, addr, hexvals, line + addr += 16 + offset += 16 + len -= 16 + end + print "\n" + end end - if @options.key?("Proxy") + if @options.has_key?("Proxy") if @options["Proxy"].kind_of?(Telnet) @sock = @options["Proxy"].sock elsif @options["Proxy"].kind_of?(TCPsocket) @@ -452,8 +488,8 @@ $-v = v else message = "Trying " + @options["Host"] + "...\n" yield(message) if iterator? - @log.write(message) if @options.key?("Output_log") - @dumplog.write(message) if @options.key?("Dump_log") + @log.write(message) if @options.has_key?("Output_log") + @dumplog.log_dump('#', message) if @options.has_key?("Dump_log") begin if @options["Timeout"] == false @@ -466,8 +502,8 @@ $-v = v rescue TimeoutError raise TimeoutError, "timed-out; opening of the host" rescue - @log.write($!.to_s + "\n") if @options.key?("Output_log") - @dumplog.write($!.to_s + "\n") if @options.key?("Dump_log") + @log.write($!.to_s + "\n") if @options.has_key?("Output_log") + @dumplog.log_dump('#', $!.to_s + "\n") if @options.has_key?("Dump_log") raise end @sock.sync = true @@ -475,8 +511,8 @@ $-v = v message = "Connected to " + @options["Host"] + ".\n" yield(message) if iterator? - @log.write(message) if @options.key?("Output_log") - @dumplog.write(message) if @options.key?("Dump_log") + @log.write(message) if @options.has_key?("Output_log") + @dumplog.log_dump('#', message) if @options.has_key?("Dump_log") end super(@sock) @@ -532,11 +568,15 @@ $-v = v self.write(IAC + WONT + $1[1..1]) '' elsif WILL[0] == $1[0] # respond to "IAC WILL x" - if OPT_ECHO[0] == $1[1] + if OPT_BINARY[0] == $1[1] + self.write(IAC + DO + OPT_BINARY) + elsif OPT_ECHO[0] == $1[1] self.write(IAC + DO + OPT_ECHO) elsif OPT_SGA[0] == $1[1] @telnet_option["SGA"] = true self.write(IAC + DO + OPT_SGA) + else + self.write(IAC + DONT + $1[1..1]) end '' elsif WONT[0] == $1[0] # respond to "IAC WON'T x" @@ -545,6 +585,8 @@ $-v = v elsif OPT_SGA[0] == $1[1] @telnet_option["SGA"] = false self.write(IAC + DONT + OPT_SGA) + else + self.write(IAC + DONT + $1[1..1]) end '' else @@ -560,15 +602,15 @@ $-v = v waittime = @options["Waittime"] if options.kind_of?(Hash) - prompt = if options.key?("Match") + prompt = if options.has_key?("Match") options["Match"] - elsif options.key?("Prompt") + elsif options.has_key?("Prompt") options["Prompt"] - elsif options.key?("String") + elsif options.has_key?("String") Regexp.new( Regexp.quote(options["String"]) ) end - time_out = options["Timeout"] if options.key?("Timeout") - waittime = options["Waittime"] if options.key?("Waittime") + time_out = options["Timeout"] if options.has_key?("Timeout") + waittime = options["Waittime"] if options.has_key?("Waittime") else prompt = options end @@ -586,7 +628,7 @@ $-v = v end begin c = @sock.sysread(1024 * 1024) - @dumplog.print(c) if @options.key?("Dump_log") + @dumplog.log_dump('<', c) if @options.has_key?("Dump_log") if @options["Telnetmode"] if Integer(c.rindex(/#{IAC}#{SE}/no)) < Integer(c.rindex(/#{IAC}#{SB}/no)) @@ -600,7 +642,7 @@ $-v = v rest = '' end end - @log.print(buf) if @options.key?("Output_log") + @log.print(buf) if @options.has_key?("Output_log") line.concat(buf) yield buf if iterator? rescue EOFError # End of file reached @@ -618,7 +660,8 @@ $-v = v length = string.length while 0 < length IO::select(nil, [@sock]) - length -= @sock.syswrite(string) + @dumplog.log_dump('>', string[-length..-1]) if @options.has_key?("Dump_log") + length -= @sock.syswrite(string[-length..-1]) end end @@ -649,8 +692,8 @@ $-v = v if options.kind_of?(Hash) string = options["String"] - match = options["Match"] if options.key?("Match") - time_out = options["Timeout"] if options.key?("Timeout") + match = options["Match"] if options.has_key?("Match") + time_out = options["Timeout"] if options.has_key?("Timeout") else string = options end diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el index 8f144cbd4c..cb85458b86 100644 --- a/misc/ruby-mode.el +++ b/misc/ruby-mode.el @@ -689,7 +689,7 @@ An end of a defun is found by moving forward from the beginning of one." '("\\(^\\|[^_]\\)\\b\\([A-Z]+\\(\\w\\|_\\)*\\)" 2 font-lock-type-face) ;; functions - '("^\\s *def\\s *\\([^( ]+\\)" + '("^\\s *def\\s +\\([^( ]+\\)" 1 font-lock-function-name-face) ;; symbols '("\\(^\\|[^:]\\)\\(:\\(\\w\\|_\\)+\\??\\)\\b" diff --git a/parse.y b/parse.y index 8f88b978eb..5c8e07058c 100644 --- a/parse.y +++ b/parse.y @@ -1120,7 +1120,7 @@ primary : literal $$ = NEW_UNLESS(cond($2), $4, $5); fixpos($$, $2); } - | kWHILE {cond_nest++;} expr do {cond_nest--;} + | kWHILE {cond_nest++;} expr do { cond_nest--; } compstmt kEND { @@ -1128,7 +1128,7 @@ primary : literal $$ = NEW_WHILE(cond($3), $6, 1); fixpos($$, $3); } - | kUNTIL {cond_nest++;} expr do {cond_nest--;} + | kUNTIL {cond_nest++;} expr do { cond_nest--; } compstmt kEND { diff --git a/random.c b/random.c index 99f4c59bf2..36ffd699e0 100644 --- a/random.c +++ b/random.c @@ -77,7 +77,7 @@ void srand48 _((long)); #endif /* not HAVE_DRAND48 */ static int first = 1; -#if !defined HAVE_DRAND48 && defined HAVE_RANDOM +#ifdef HAVE_RANDOM static char state[256]; #endif @@ -88,7 +88,7 @@ rand_init(seed) int old; static unsigned int saved_seed; -#if !defined HAVE_DRAND48 && defined HAVE_RANDOM +#ifdef HAVE_RANDOM if (first == 1) { initstate(1, state, sizeof state); } diff --git a/re.c b/re.c index 15eb0cef97..2685eaca32 100644 --- a/re.c +++ b/re.c @@ -183,7 +183,7 @@ kcode_reset_option() } int -rb_mbclen2(c, re) +rb_reg_mbclen2(c, re) unsigned char c; VALUE re; { @@ -455,21 +455,14 @@ match_end(match, n) #define MATCH_BUSY FL_USER2 void -rb_match_busy(match, busy) +rb_match_busy(match) VALUE match; - int busy; { - if (busy) { - FL_SET(match, MATCH_BUSY); - } - else { - FL_UNSET(match, MATCH_BUSY); - } + FL_SET(match, MATCH_BUSY); } int ruby_ignorecase; static int may_need_recompile; -static VALUE matchcache; static void rb_reg_prepare_re(reg) @@ -540,7 +533,7 @@ rb_reg_search(reg, str, pos, reverse) { int result; VALUE match; - struct re_registers *regs = 0; + static struct re_registers regs; int range; if (pos > RSTRING(str)->len) return -1; @@ -553,23 +546,6 @@ rb_reg_search(reg, str, pos, reverse) else if (reg_kcode != curr_kcode) kcode_reset_option(); - if (rb_thread_scope_shared_p()) { - match = Qnil; - } - else { - match = rb_backref_get(); - } - if (NIL_P(match) || FL_TEST(match, MATCH_BUSY)) { - if (matchcache) { - match = matchcache; - matchcache = 0; - } - else { - match = match_alloc(); - } - } - regs = RMATCH(match)->regs; - if (reverse) { range = -pos; } @@ -577,7 +553,7 @@ rb_reg_search(reg, str, pos, reverse) range = RSTRING(str)->len - pos; } result = re_search(RREGEXP(reg)->ptr,RSTRING(str)->ptr,RSTRING(str)->len, - pos, range, regs); + pos, range, ®s); if (FL_TEST(reg, KCODE_FIXED)) kcode_reset_option(); @@ -586,15 +562,24 @@ rb_reg_search(reg, str, pos, reverse) rb_reg_raise(RREGEXP(reg)->str, RREGEXP(reg)->len, "Stack overfow in regexp matcher", reg); } + if (result < 0) { - FL_UNSET(match, FL_TAINT); - matchcache = match; rb_backref_set(Qnil); + return result; + } + + if (rb_thread_scope_shared_p()) { + match = Qnil; } else { - RMATCH(match)->str = rb_str_new4(str); - rb_backref_set(match); + match = rb_backref_get(); } + if (NIL_P(match) || FL_TEST(match, MATCH_BUSY)) { + match = match_alloc(); + } + re_copy_registers(RMATCH(match)->regs, ®s); + RMATCH(match)->str = rb_str_new4(str); + rb_backref_set(match); OBJ_INFECT(match, reg); OBJ_INFECT(match, str); @@ -1150,6 +1135,7 @@ rb_reg_regsub(str, src, regs) } if (no >= 0) { + if (no >= regs->num_regs) continue; if (BEG(no) == -1) continue; rb_str_cat(val, RSTRING(src)->ptr+BEG(no), END(no)-BEG(no)); } @@ -1247,7 +1233,8 @@ match_getter() VALUE match = rb_backref_get(); if (NIL_P(match)) return Qnil; - return match_clone(match); + rb_match_busy(match); + return match; } static void @@ -1310,7 +1297,6 @@ Init_Regexp() rb_define_const(rb_cRegexp, "POSIXLINE", INT2FIX(RE_OPTION_POSIXLINE)); rb_global_variable(®_cache); - rb_global_variable(&matchcache); rb_cMatch = rb_define_class("MatchingData", rb_cObject); rb_undef_method(CLASS_OF(rb_cMatch), "new"); diff --git a/re.h b/re.h index a9daa72e0b..0774a74c27 100644 --- a/re.h +++ b/re.h @@ -35,9 +35,10 @@ VALUE rb_reg_regsub _((VALUE, VALUE, struct re_registers *)); int rb_reg_adjust_startpos _((VALUE, VALUE, int, int)); int rb_kcode _((void)); +void rb_match_busy _((VALUE)); extern int ruby_ignorecase; -int rb_mbclen2 _((unsigned char, VALUE)); -#define mbclen2(c,re) rb_mbclen2((c),(re)) +int rb_reg_mbclen2 _((unsigned char, VALUE)); +#define mbclen2(c,re) rb_reg_mbclen2((c),(re)) #endif diff --git a/regex.c b/regex.c index ea08cb5ede..21aa900960 100644 --- a/regex.c +++ b/regex.c @@ -24,6 +24,11 @@ #include "config.h" #ifdef RUBY_PLATFORM # define RUBY +extern int rb_prohibit_interrupt; +extern int rb_trap_pending; +# define CHECK_INTS if (!rb_prohibit_interrupt) {\ + if (rb_trap_pending) rb_trap_exec();\ +} #endif /* We write fatal error messages on standard error. */ @@ -59,13 +64,13 @@ #endif #ifndef xmalloc -void *xmalloc _((unsigned long)); -void *xcalloc _((unsigned long,unsigned long)); -void *xrealloc _((void*,unsigned long)); +void *xmalloc _((size_t)); +void *xcalloc _((size_t,size_t)); +void *xrealloc _((void*,size_t)); void free _((void*)); #endif -/* #define NO_ALLOCA */ /* try it out for now */ +#define NO_ALLOCA */ /* try it out for now */ #ifndef NO_ALLOCA /* Make alloca work the best possible way. */ #ifdef __GNUC__ @@ -109,13 +114,13 @@ char *alloca(); #define RE_ALLOCATE xmalloc -#define FREE_VAR(var) do { if (var) free(var); var = NULL; } while(0) #define FREE_VARIABLES() #define FREE_AND_RETURN_VOID(stackb) do { free(stackb); return; } while(0) #define FREE_AND_RETURN(stackb,val) do { free(stackb); return(val); } while(0) -#define DOUBLE_STACK(stackx,stackb,len,type) \ - (type*)xrealloc(stackb, 2 * len * sizeof(type)) +#define DOUBLE_STACK(stackx,stackb,len,type) do { \ + stackx = (type*)xrealloc(stackb, 2 * len * sizeof(type)); \ +} while (0) #endif /* NO_ALLOCA */ #define RE_TALLOC(n,t) ((t*)RE_ALLOCATE((n)*sizeof(t))) @@ -125,7 +130,7 @@ char *alloca(); #define EXPAND_FAIL_STACK(stackx,stackb,len) \ do { \ /* Roughly double the size of the stack. */ \ - stackx = DOUBLE_STACK(stackx,stackb,len,unsigned char*); \ + DOUBLE_STACK(stackx,stackb,len,unsigned char*); \ /* Rearrange the pointers. */ \ stackp = stackx + (stackp - stackb); \ stackb = stackx; \ @@ -273,6 +278,7 @@ enum regexpcode of string to be matched (if not). */ endbuf, /* Analogously, for end of buffer/string. */ endbuf2, /* End of buffer/string, or newline just before it. */ + begpos, /* Matches where last scan//gsub left off. */ jump, /* Followed by two bytes giving relative address to jump to. */ jump_past_alt,/* Same as jump, but marks the end of an alternative. */ on_failure_jump, /* Followed by two bytes giving relative address of @@ -337,6 +343,7 @@ enum regexpcode 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. */ + stop_backtrack, /* Restore backtrack stack at the point start_nowidth. */ duplicate, /* Match a duplicate of something remembered. Followed by one byte containing the index of the memory register. */ @@ -354,7 +361,7 @@ enum regexpcode so it is not a hard limit. */ #ifndef NFAILURES -#define NFAILURES 80 +#define NFAILURES 160 #endif /* Store NUMBER in two contiguous bytes starting at DESTINATION. */ @@ -767,6 +774,11 @@ print_partial_compiled_pattern(start, end) printf("/pop_and_fail"); break; + case stop_backtrack: + printf("/stop_backtrack//"); + p += 2; + break; + case duplicate: printf("/duplicate/%d", *p++); break; @@ -921,6 +933,10 @@ print_partial_compiled_pattern(start, end) printf("/endbuf2"); break; + case begpos: + printf("/begpos"); + break; + default: printf("?%d", *(p-1)); } @@ -993,6 +1009,7 @@ calculate_must_string(start, end) case begbuf: case endbuf: case endbuf2: + case begpos: case push_dummy_failure: case start_paren: case stop_paren: @@ -1030,6 +1047,7 @@ calculate_must_string(start, end) case start_nowidth: case stop_nowidth: + case stop_backtrack: case finalize_jump: case maybe_finalize_jump: case finalize_push: @@ -1650,6 +1668,7 @@ re_compile_pattern(pattern, size, bufp) case ':': case '=': case '!': + case '>': break; default: @@ -1665,7 +1684,7 @@ re_compile_pattern(pattern, size, bufp) int *stackx; unsigned int len = stacke - stackb; - stackx = DOUBLE_STACK(stackx,stackb,len,int); + DOUBLE_STACK(stackx,stackb,len,int); /* Rearrange the pointers. */ stackp = stackx + (stackp - stackb); stackb = stackx; @@ -1691,11 +1710,12 @@ re_compile_pattern(pattern, size, bufp) case '=': case '!': + case '>': BUFPUSH(start_nowidth); *stackp++ = b - bufp->buffer; BUFPUSH(0); /* temporary value */ BUFPUSH(0); - if (c == '=') break; + if (c != '!') break; BUFPUSH(on_failure_jump); *stackp++ = b - bufp->buffer; @@ -1766,6 +1786,15 @@ re_compile_pattern(pattern, size, bufp) stackp--; break; + case '>': + BUFPUSH(stop_backtrack); + /* tell stack-pos place to start_nowidth */ + STORE_NUMBER(bufp->buffer+stackp[-1], b - bufp->buffer - stackp[-1] - 2); + BUFPUSH(0); /* space to hold stack pos */ + BUFPUSH(0); + stackp--; + break; + case ':': BUFPUSH(stop_paren); break; @@ -2089,6 +2118,10 @@ re_compile_pattern(pattern, size, bufp) BUFPUSH(endbuf); break; + case 'G': + BUFPUSH(begpos); + break; + /* hex */ case 'x': had_mbchar = 0; @@ -2702,6 +2735,7 @@ re_compile_fastmap(bufp) case try_next: case start_nowidth: case stop_nowidth: + case stop_backtrack: p += 2; continue; @@ -3003,11 +3037,12 @@ re_search(bufp, string, size, startpos, range, regs) case begbuf: begbuf_match: if (range > 0) { - if (startpos > 0) - return -1; - else if (re_match(bufp, string, size, 0, regs) >= 0) - return 0; - return -1; + if (startpos > 0) return -1; + else { + val = re_match(bufp, string, size, 0, regs); + if (val >= 0) return 0; + return val; + } } break; @@ -3015,6 +3050,11 @@ re_search(bufp, string, size, startpos, range, regs) anchor = 1; break; + case begpos: + val = re_match(bufp, string, size, startpos, regs); + if (val >= 0) return startpos; + return val; + default: break; } @@ -3106,10 +3146,8 @@ re_search(bufp, string, size, startpos, range, regs) if (startpos > size) return -1; if (anchor && size > 0 && startpos == size) return -1; val = re_match(bufp, string, size, startpos, regs); - if (val >= 0) - return startpos; - if (val == -2) - return -2; + if (val >= 0) return startpos; + if (val == -2) return -2; #ifndef NO_ALLOCA #ifdef C_ALLOCA @@ -3617,6 +3655,12 @@ re_match(bufp, string_arg, size, pos, regs) POP_FAILURE_POINT(); continue; + case stop_backtrack: + EXTRACT_NUMBER_AND_INCR(mcnt, p); + stackp = stackb + mcnt; + POP_FAILURE_POINT(); + continue; + case pop_and_fail: EXTRACT_NUMBER(mcnt, p+1); stackp = stackb + mcnt; @@ -3747,6 +3791,12 @@ re_match(bufp, string_arg, size, pos, regs) /* A smart repeat is similar but loops back to the on_failure_jump so that each repetition makes another failure point. */ + /* Match at the starting position. */ + case begpos: + if (d - string == pos) + break; + goto fail; + case on_failure_jump: on_failure: EXTRACT_NUMBER_AND_INCR(mcnt, p); @@ -4089,6 +4139,9 @@ re_match(bufp, string_arg, size, pos, regs) SET_REGS_MATCHED; break; } +#ifdef RUBY + CHECK_INTS; +#endif continue; /* Successfully executed one pattern command; keep going. */ /* Jump here if any matching operation fails. */ diff --git a/ruby.h b/ruby.h index 4d307c5880..88eda6aa93 100644 --- a/ruby.h +++ b/ruby.h @@ -400,6 +400,10 @@ void rb_undef_method _((VALUE,const char*)); void rb_define_alias _((VALUE,const char*,const char*)); void rb_define_attr _((VALUE,const char*,int,int)); +void rb_global_variable _((VALUE*)); +void rb_gc_register_address _((VALUE*)); +void rb_gc_unregister_address _((VALUE*)); + ID rb_intern _((const char*)); char *rb_id2name _((ID)); ID rb_to_id _((VALUE)); diff --git a/sample/eval.rb b/sample/eval.rb index 216bf8ca39..b9a54df34c 100644 --- a/sample/eval.rb +++ b/sample/eval.rb @@ -31,7 +31,7 @@ while TRUE end begin print eval(line).inspect, "\n" - rescue + rescue ScriptError, StandardError $! = 'exception raised' unless $! print "ERR: ", $!, "\n" end diff --git a/sample/mkproto.rb b/sample/mkproto.rb index 8661240085..3423a15905 100644 --- a/sample/mkproto.rb +++ b/sample/mkproto.rb @@ -14,7 +14,7 @@ while gets() else type = "" end - while arg.sub!(/(\** *[\w\d_]+)(,|$)/, "") + while arg.sub!(/(\** *[\w\d_]+)(,|$)/, "") && $~ args.push type + " " + $1.strip end else diff --git a/string.c b/string.c index f71a9b63af..df483a2e1d 100644 --- a/string.c +++ b/string.c @@ -1030,20 +1030,19 @@ rb_str_sub_bang(argc, argv, str) pat = get_pat(argv[0]); if (rb_reg_search(pat, str, 0, 0) >= 0) { - rb_str_modify(str); match = rb_backref_get(); regs = RMATCH(match)->regs; if (iter) { - rb_match_busy(match, Qtrue); + rb_match_busy(match); repl = rb_obj_as_string(rb_yield(rb_reg_nth_match(0, match))); - rb_match_busy(match, Qfalse); rb_backref_set(match); } else { repl = rb_reg_regsub(repl, str, regs); } plen = END(0) - BEG(0); + rb_str_modify(str); if (RSTRING(repl)->len > plen) { REALLOC_N(RSTRING(str)->ptr, char, RSTRING(str)->len + RSTRING(repl)->len - plen + 1); @@ -1057,8 +1056,9 @@ rb_str_sub_bang(argc, argv, str) RSTRING(repl)->ptr, RSTRING(repl)->len); RSTRING(str)->len += RSTRING(repl)->len - plen; RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; + return str; } - return str; + return Qnil; } static VALUE @@ -1100,7 +1100,7 @@ rb_str_gsub_bang(argc, argv, str) pat = get_pat(argv[0]); offset=0; n=0; beg = rb_reg_search(pat, str, 0, 0); - if (beg < 0) return str; /* no match, no substitution */ + if (beg < 0) return Qnil; /* no match, no substitution */ blen = RSTRING(str)->len + 30; /* len + margin */ buf = ALLOC_N(char, blen); @@ -1110,9 +1110,9 @@ rb_str_gsub_bang(argc, argv, str) while (beg >= 0) { n++; match = rb_backref_get(); - rb_match_busy(match, Qtrue); regs = RMATCH(match)->regs; if (iter) { + rb_match_busy(match); val = rb_obj_as_string(rb_yield(rb_reg_nth_match(0, match))); rb_backref_set(match); } @@ -1160,7 +1160,6 @@ rb_str_gsub_bang(argc, argv, str) memcpy(bp, cp, RSTRING(str)->len - offset); bp += RSTRING(str)->len - offset; } - rb_match_busy(match, Qfalse); rb_backref_set(match); rb_str_modify(str); free(RSTRING(str)->ptr); @@ -1518,6 +1517,7 @@ rb_str_upcase_bang(str) VALUE str; { char *s, *send; + int modify = 0; rb_str_modify(str); s = RSTRING(str)->ptr; send = s + RSTRING(str)->len; @@ -1527,10 +1527,13 @@ rb_str_upcase_bang(str) } else if (islower(*s)) { *s = toupper(*s); + modify = 1; } s++; } - return str; + + if (modify) return str; + return Qnil; } static VALUE @@ -1547,6 +1550,7 @@ rb_str_downcase_bang(str) VALUE str; { char *s, *send; + int modify = 0; rb_str_modify(str); s = RSTRING(str)->ptr; send = s + RSTRING(str)->len; @@ -1556,10 +1560,13 @@ rb_str_downcase_bang(str) } else if (ISUPPER(*s)) { *s = tolower(*s); + modify = 1; } s++; } - return str; + + if (modify) return str; + return Qnil; } static VALUE @@ -1576,11 +1583,13 @@ rb_str_capitalize_bang(str) VALUE str; { char *s, *send; + int modify = 0; rb_str_modify(str); s = RSTRING(str)->ptr; send = s + RSTRING(str)->len; if (ISLOWER(*s)) { *s = toupper(*s); + modify = 1; } while (++s < send) { if (ismbchar(*s)) { @@ -1588,9 +1597,11 @@ rb_str_capitalize_bang(str) } else if (ISUPPER(*s)) { *s = tolower(*s); + modify = 1; } } - return str; + if (modify) return str; + return Qnil; } static VALUE @@ -1607,6 +1618,7 @@ rb_str_swapcase_bang(str) VALUE str; { char *s, *send; + int modify = 0; rb_str_modify(str); s = RSTRING(str)->ptr; send = s + RSTRING(str)->len; @@ -1616,14 +1628,17 @@ rb_str_swapcase_bang(str) } else if (ISUPPER(*s)) { *s = tolower(*s); + modify = 1; } else if (ISLOWER(*s)) { *s = toupper(*s); + modify = 1; } s++; } - return str; + if (modify) return str; + return Qnil; } static VALUE @@ -1675,7 +1690,7 @@ trnext(t) static VALUE rb_str_delete_bang _((int,VALUE*,VALUE)); -static void +static VALUE tr_trans(str, src, repl, sflag) VALUE str, src, repl; int sflag; @@ -1683,7 +1698,7 @@ tr_trans(str, src, repl, sflag) struct tr trsrc, trrepl; int cflag = 0; int trans[256]; - int i, c; + int i, c, modify = 0; char *s, *send; rb_str_modify(str); @@ -1695,8 +1710,7 @@ tr_trans(str, src, repl, sflag) } if (TYPE(repl) != T_STRING) repl = rb_str_to_str(repl); if (RSTRING(repl)->len == 0) { - rb_str_delete_bang(1, &src, str); - return; + return rb_str_delete_bang(1, &src, str); } trrepl.p = RSTRING(repl)->ptr; trrepl.pend = trrepl.p + RSTRING(repl)->len; @@ -1743,6 +1757,7 @@ tr_trans(str, src, repl, sflag) if (last == c) continue; last = c; *t++ = c & 0xff; + modify = 1; } else { last = -1; @@ -1751,6 +1766,7 @@ tr_trans(str, src, repl, sflag) } if (RSTRING(str)->len > (t - RSTRING(str)->ptr)) { RSTRING(str)->len = (t - RSTRING(str)->ptr); + modify = 1; *t = '\0'; } } @@ -1758,18 +1774,21 @@ tr_trans(str, src, repl, sflag) while (s < send) { if ((c = trans[*s & 0xff]) >= 0) { *s = c & 0xff; + modify = 1; } s++; } } + + if (modify) return str; + return Qnil; } static VALUE rb_str_tr_bang(str, src, repl) VALUE str, src, repl; { - tr_trans(str, src, repl, 0); - return str; + return tr_trans(str, src, repl, 0); } static VALUE @@ -1823,6 +1842,7 @@ rb_str_delete_bang(argc, argv, str) { char *s, *send, *t; char squeez[256]; + int modify = 0; int init = 1; int i; @@ -1839,14 +1859,17 @@ rb_str_delete_bang(argc, argv, str) s = t = RSTRING(str)->ptr; send = s + RSTRING(str)->len; while (s < send) { - if (!squeez[*s & 0xff]) + if (squeez[*s & 0xff]) + modify = 1; + else *t++ = *s; s++; } *t = '\0'; RSTRING(str)->len = t - RSTRING(str)->ptr; - return str; + if (modify) return str; + return Qnil; } static VALUE @@ -1868,7 +1891,7 @@ rb_str_squeeze_bang(argc, argv, str) { char squeez[256]; char *s, *send, *t; - int c, save; + int c, save, modify = 0; int init = 1; int i; @@ -1889,6 +1912,7 @@ rb_str_squeeze_bang(argc, argv, str) } rb_str_modify(str); + s = t = RSTRING(str)->ptr; send = s + RSTRING(str)->len; save = -1; @@ -1901,9 +1925,11 @@ rb_str_squeeze_bang(argc, argv, str) *t = '\0'; if (t - RSTRING(str)->ptr != RSTRING(str)->len) { RSTRING(str)->len = t - RSTRING(str)->ptr; + modify = 1; } - return str; + if (modify) return str; + return Qnil; } static VALUE @@ -1921,8 +1947,7 @@ static VALUE rb_str_tr_s_bang(str, src, repl) VALUE str, src, repl; { - tr_trans(str, src, repl, 1); - return str; + return tr_trans(str, src, repl, 1); } static VALUE @@ -2212,8 +2237,9 @@ rb_str_chop_bang(str) } } RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; + return str; } - return str; + return Qnil; } static VALUE @@ -2280,8 +2306,9 @@ rb_str_chomp_bang(argc, argv, str) memcmp(RSTRING(rs)->ptr, p+len-rslen, rslen) == 0)) { RSTRING(str)->len -= rslen; RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; + return str; } - return str; + return Qnil; } static VALUE @@ -2308,7 +2335,7 @@ rb_f_chomp(argc, argv) int argc; VALUE *argv; { - VALUE str = rb_str_dup(uscore_get());; + VALUE str = rb_str_dup(uscore_get()); rb_str_chomp_bang(argc, argv, str); rb_lastline_set(str); @@ -2344,6 +2371,10 @@ rb_str_strip_bang(str) else if (t < e) { RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; } + else { + return Qnil; + } + return str; } @@ -2396,20 +2427,27 @@ rb_str_scan(str, pat) { VALUE result; long start = 0; + VALUE match = Qnil; pat = get_pat(pat); if (!rb_iterator_p()) { VALUE ary = rb_ary_new(); while (!NIL_P(result = scan_once(str, pat, &start))) { + match = rb_backref_get(); rb_ary_push(ary, result); } + rb_backref_set(match); return ary; } - + while (!NIL_P(result = scan_once(str, pat, &start))) { + match = rb_backref_get(); + rb_match_busy(match); rb_yield(result); + rb_backref_set(match); } + rb_backref_set(match); return str; } diff --git a/version.h b/version.h index 6119937d51..f72af96121 100644 --- a/version.h +++ b/version.h @@ -1,4 +1,4 @@ #define RUBY_VERSION "1.5.2" -#define RUBY_RELEASE_DATE "2000-02-02" +#define RUBY_RELEASE_DATE "2000-02-08" #define RUBY_VERSION_CODE 152 -#define RUBY_RELEASE_CODE 20000202 +#define RUBY_RELEASE_CODE 20000208