diff options
-rw-r--r-- | ChangeLog | 35 | ||||
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | Makefile.in | 5 | ||||
-rw-r--r-- | configure | 453 | ||||
-rw-r--r-- | configure.in | 109 | ||||
-rw-r--r-- | ext/extmk.rb.in | 2 | ||||
-rw-r--r-- | lib/README | 23 | ||||
-rw-r--r-- | lib/cgi-lib.rb | 41 | ||||
-rw-r--r-- | lib/parsedate.rb | 15 | ||||
-rw-r--r-- | lib/telnet.rb | 267 | ||||
-rw-r--r-- | missing/strtod.c | 266 | ||||
-rw-r--r-- | missing/vsnprintf.c | 10 | ||||
-rw-r--r-- | numeric.c | 24 | ||||
-rw-r--r-- | pack.c | 9 | ||||
-rw-r--r-- | parse.c | 8 | ||||
-rw-r--r-- | parse.y | 8 | ||||
-rw-r--r-- | re.c | 3 | ||||
-rw-r--r-- | regex.c | 22 | ||||
-rw-r--r-- | ruby.c | 18 | ||||
-rw-r--r-- | sample/test.rb | 20 | ||||
-rw-r--r-- | string.c | 2 | ||||
-rw-r--r-- | version.h | 2 |
22 files changed, 894 insertions, 449 deletions
@@ -1,3 +1,38 @@ +Fri Feb 5 03:26:56 1999 Yasuhiro Fukuma <yasuf@big.or.jp> + + * ruby.c (proc_options): -e without program prints error. + +Fri Feb 5 00:01:50 1999 Yukihiro Matsumoto <matz@netlab.co.jp> + + * parse.y (terms): needed to clear heredoc_end. + + * numeric.c (flo_div): allow float division by zero. + +Thu Feb 4 11:56:24 1999 Yukihiro Matsumoto <matz@netlab.co.jp> + + * missing/strtod.c: for compatibility. + + * configure.in (strtod): add strtod compatible check. + + * numeric.c (rb_num2long): missing/vsnprintf.c does not supprt + floating points. + + * numeric.c (flo_to_s): ditto. + +Wed Feb 3 23:02:12 1999 Yoshida Masato <yoshidam@yoshidam.net> + + * regex.c (re_compile_pattern): use ismbchar() to get next char. + + * regex.c (re_search): wrong mbchar shift. + + * re.c (rb_reg_search): needed to reset $KCODE after match. + + * regex.c (re_compile_fastmap): mbchars should match with \w. + +Wed Feb 3 22:35:12 1999 EGUCHI Osamu <eguchi@shizuokanet.ne.jp> + + * parse.y (yylex): too big float raise warning, not error. + Tue Feb 2 23:41:42 1999 Yoshida Masato <yoshidam@yoshidam.net> * regex.c (re_match): wrong boundary. @@ -153,6 +153,7 @@ missing/strdup.c missing/strerror.c missing/strftime.c missing/strstr.c +missing/strtod.c missing/strtol.c missing/strtoul.c missing/vsnprintf.c diff --git a/Makefile.in b/Makefile.in index 25a0acacd3..15649a24f3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -18,7 +18,7 @@ AUTOCONF = autoconf @SET_MAKE@ prefix = @prefix@ -CFLAGS = @CFLAGS@ -I@srcdir@ -I@includedir@ +CFLAGS = @CFLAGS@ -I. -I@srcdir@ -I@includedir@ LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@ EXTLIBS = LIBS = @LIBS@ $(EXTLIBS) @@ -186,6 +186,9 @@ strftime.o: @srcdir@/missing/strftime.c strstr.o: @srcdir@/missing/strstr.c $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strstr.c +strtod.o: @srcdir@/missing/strtod.c + $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strtod.c + strtol.o: @srcdir@/missing/strtol.c $(CC) $(CFLAGS) $(CPPFLAGS) -c @srcdir@/missing/strtol.c @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.12.2 +# Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -343,7 +343,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.12.2" + echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) @@ -628,13 +628,13 @@ fat_binary=no # Check whether --enable-fat-binary or --disable-fat-binary was given. if test "${enable_fat_binary+set}" = set; then enableval="$enable_fat_binary" - fat_binary=$enableval + fat_binary=$enableval fi if test "$fat_binary" = yes ; then - echo $ac_n "checking target architecture ""... $ac_c" 1>&6 -echo "configure:638: checking target architecture " >&5 + echo $ac_n "checking target architecture""... $ac_c" 1>&6 +echo "configure:638: checking target architecture" >&5 case "$host_os" in rhapsody*) @@ -1580,38 +1580,49 @@ fi echo $ac_n "checking token paste string""... $ac_c" 1>&6 echo "configure:1583: checking token paste string" >&5 -cat > conftest.$ac_ext <<EOF -#line 1585 "configure" +if eval "test \"`echo '$''{'rb_cv_tokenpaste'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1588 "configure" #include "confdefs.h" #define paste(a,b) a##b int main() { - int xy = 1; return paste(x,y); +int xy = 1; return paste(x,y); ; return 0; } EOF -if { (eval echo configure:1592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - cat >> confdefs.h <<\EOF -#define TOKEN_PASTE(x,y) x##y -EOF - echo "$ac_t""ANSI" 1>&6 + rb_cv_tokenpaste=ansi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* + rb_cv_tokenpaste=knr +fi +rm -f conftest* +fi + +echo "$ac_t""$rb_cv_tokenpaste" 1>&6 +if test "$rb_cv_tokenpaste" = ansi; then + cat >> confdefs.h <<\EOF +#define TOKEN_PASTE(x,y) x##y +EOF + +else cat >> confdefs.h <<\EOF #define TOKEN_PASTE(x,y) x/**/y EOF - echo "$ac_t""KnR1" 1>&6 + fi -rm -f conftest* echo $ac_n "checking for variable length prototypes and stdarg.h""... $ac_c" 1>&6 -echo "configure:1610: checking for variable length prototypes and stdarg.h" >&5 +echo "configure:1621: checking for variable length prototypes and stdarg.h" >&5 if eval "test \"`echo '$''{'rb_cv_stdarg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1615 "configure" +#line 1626 "configure" #include "confdefs.h" #include <stdarg.h> @@ -1628,7 +1639,7 @@ int main() { return foo(10, "", 3.14); ; return 0; } EOF -if { (eval echo configure:1632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1643: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_stdarg=yes else @@ -1649,19 +1660,19 @@ EOF fi echo $ac_n "checking for gcc attribute noreturn""... $ac_c" 1>&6 -echo "configure:1653: checking for gcc attribute noreturn" >&5 +echo "configure:1664: checking for gcc attribute noreturn" >&5 if eval "test \"`echo '$''{'rb_cv_have_attr_noreturn'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1658 "configure" +#line 1669 "configure" #include "confdefs.h" void exit(int x) __attribute__ ((noreturn)); int main() { ; return 0; } EOF -if { (eval echo configure:1665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_have_attr_noreturn=yes else @@ -1690,7 +1701,7 @@ beos*) ;; *) LIBS="-lm $LIBS";; esac echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:1694: checking for crypt in -lcrypt" >&5 +echo "configure:1705: 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 @@ -1698,7 +1709,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <<EOF -#line 1702 "configure" +#line 1713 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1709,7 +1720,7 @@ int main() { crypt() ; return 0; } EOF -if { (eval echo configure:1713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1724: \"$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 @@ -1737,7 +1748,7 @@ else fi echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:1741: checking for dlopen in -ldl" >&5 +echo "configure:1752: 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 @@ -1745,7 +1756,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 1749 "configure" +#line 1760 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1756,7 +1767,7 @@ int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:1760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1771: \"$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 @@ -1784,7 +1795,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:1788: checking for shl_load in -ldld" >&5 +echo "configure:1799: 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 @@ -1792,7 +1803,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <<EOF -#line 1796 "configure" +#line 1807 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1803,7 +1814,7 @@ int main() { shl_load() ; return 0; } EOF -if { (eval echo configure:1807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1818: \"$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 @@ -1831,7 +1842,7 @@ else fi # Dynamic linking for HP-UX echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6 -echo "configure:1835: checking for setlocale in -lxpg4" >&5 +echo "configure:1846: 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 @@ -1839,7 +1850,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lxpg4 $LIBS" cat > conftest.$ac_ext <<EOF -#line 1843 "configure" +#line 1854 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1850,7 +1861,7 @@ int main() { setlocale() ; return 0; } EOF -if { (eval echo configure:1854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1865: \"$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 @@ -1883,12 +1894,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:1887: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1898: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1892 "configure" +#line 1903 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_hdr> @@ -1896,7 +1907,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1911: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1921,7 +1932,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:1925: checking for opendir in -ldir" >&5 +echo "configure:1936: 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 @@ -1929,7 +1940,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <<EOF -#line 1933 "configure" +#line 1944 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1940,7 +1951,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:1944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1955: \"$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 @@ -1962,7 +1973,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1966: checking for opendir in -lx" >&5 +echo "configure:1977: 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 @@ -1970,7 +1981,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <<EOF -#line 1974 "configure" +#line 1985 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1981,7 +1992,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:1985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1996: \"$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 @@ -2004,12 +2015,12 @@ fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2008: checking for ANSI C header files" >&5 +echo "configure:2019: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2013 "configure" +#line 2024 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -2017,7 +2028,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2021: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2032: \"$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* @@ -2034,7 +2045,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 2038 "configure" +#line 2049 "configure" #include "confdefs.h" #include <string.h> EOF @@ -2052,7 +2063,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 2056 "configure" +#line 2067 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -2073,7 +2084,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 2077 "configure" +#line 2088 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2084,7 +2095,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2113,17 +2124,17 @@ for ac_hdr in stdlib.h unistd.h limits.h sys/file.h sys/ioctl.h pwd.h \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2117: checking for $ac_hdr" >&5 +echo "configure:2128: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2122 "configure" +#line 2133 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2127: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2138: \"$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* @@ -2151,12 +2162,12 @@ done echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:2155: checking for uid_t in sys/types.h" >&5 +echo "configure:2166: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2160 "configure" +#line 2171 "configure" #include "confdefs.h" #include <sys/types.h> EOF @@ -2185,12 +2196,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2189: checking for size_t" >&5 +echo "configure:2200: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2194 "configure" +#line 2205 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -2218,12 +2229,12 @@ EOF fi echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:2222: checking for st_blksize in struct stat" >&5 +echo "configure:2233: checking for st_blksize in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2227 "configure" +#line 2238 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/stat.h> @@ -2231,7 +2242,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:2235: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else @@ -2253,12 +2264,12 @@ fi save_LIBOJBS="$LIBOBJS" echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 -echo "configure:2257: checking for st_blocks in struct stat" >&5 +echo "configure:2268: checking for st_blocks in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2262 "configure" +#line 2273 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/stat.h> @@ -2266,7 +2277,7 @@ int main() { struct stat s; s.st_blocks; ; return 0; } EOF -if { (eval echo configure:2270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blocks=yes else @@ -2290,12 +2301,12 @@ fi LIBOBJS="$save_LIBOBJS" echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 -echo "configure:2294: checking for st_rdev in struct stat" >&5 +echo "configure:2305: checking for st_rdev in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2299 "configure" +#line 2310 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/stat.h> @@ -2303,7 +2314,7 @@ int main() { struct stat s; s.st_rdev; ; return 0; } EOF -if { (eval echo configure:2307: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_rdev=yes else @@ -2325,7 +2336,7 @@ fi echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 -echo "configure:2329: checking type of array argument to getgroups" >&5 +echo "configure:2340: 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 @@ -2333,7 +2344,7 @@ else ac_cv_type_getgroups=cross else cat > conftest.$ac_ext <<EOF -#line 2337 "configure" +#line 2348 "configure" #include "confdefs.h" /* Thanks to Mike Rendell for this test. */ @@ -2358,7 +2369,7 @@ main() } EOF -if { (eval echo configure:2362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2373: \"$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 @@ -2372,7 +2383,7 @@ fi if test $ac_cv_type_getgroups = cross; then cat > conftest.$ac_ext <<EOF -#line 2376 "configure" +#line 2387 "configure" #include "confdefs.h" #include <unistd.h> EOF @@ -2396,12 +2407,12 @@ EOF echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2400: checking return type of signal handlers" >&5 +echo "configure:2411: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2405 "configure" +#line 2416 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -2418,7 +2429,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2433: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2439,19 +2450,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:2443: checking for working alloca.h" >&5 +echo "configure:2454: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2448 "configure" +#line 2459 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2466: \"$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 @@ -2472,12 +2483,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2476: checking for alloca" >&5 +echo "configure:2487: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2481 "configure" +#line 2492 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -2505,7 +2516,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:2509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2520: \"$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 @@ -2537,12 +2548,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2541: checking whether alloca needs Cray hooks" >&5 +echo "configure:2552: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2546 "configure" +#line 2557 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -2567,12 +2578,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2571: checking for $ac_func" >&5 +echo "configure:2582: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2576 "configure" +#line 2587 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2595,7 +2606,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2610: \"$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 @@ -2622,7 +2633,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2626: checking stack direction for C alloca" >&5 +echo "configure:2637: 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 @@ -2630,7 +2641,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 2634 "configure" +#line 2645 "configure" #include "confdefs.h" find_stack_direction () { @@ -2649,7 +2660,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2664: \"$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 @@ -2671,12 +2682,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2675: checking for pid_t" >&5 +echo "configure:2686: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2680 "configure" +#line 2691 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -2705,17 +2716,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2709: checking for vfork.h" >&5 +echo "configure:2720: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2714 "configure" +#line 2725 "configure" #include "confdefs.h" #include <vfork.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2719: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2730: \"$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* @@ -2740,18 +2751,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2744: checking for working vfork" >&5 +echo "configure:2755: 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:2750: checking for vfork" >&5 +echo "configure:2761: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2755 "configure" +#line 2766 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char vfork(); below. */ @@ -2774,7 +2785,7 @@ vfork(); ; return 0; } EOF -if { (eval echo configure:2778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2789: \"$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 @@ -2796,7 +2807,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext <<EOF -#line 2800 "configure" +#line 2811 "configure" #include "confdefs.h" /* Thanks to Paul Eggert for this test. */ #include <stdio.h> @@ -2891,7 +2902,7 @@ main() { } } EOF -if { (eval echo configure:2895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2906: \"$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 @@ -2914,7 +2925,7 @@ EOF fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:2918: checking for 8-bit clean memcmp" >&5 +echo "configure:2929: 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 @@ -2922,7 +2933,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <<EOF -#line 2926 "configure" +#line 2937 "configure" #include "confdefs.h" main() @@ -2932,7 +2943,7 @@ main() } EOF -if { (eval echo configure:2936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2947: \"$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 @@ -2953,12 +2964,12 @@ for ac_func in dup2 memmove mkdir strcasecmp strerror strftime\ strchr strstr strtoul strdup crypt flock vsnprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2957: checking for $ac_func" >&5 +echo "configure:2968: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2962 "configure" +#line 2973 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2981,7 +2992,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2996: \"$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 @@ -3014,12 +3025,12 @@ for ac_func in fmod killpg drand48 random wait4 waitpid syscall getcwd\ dlopen sigprocmask sigaction _setjmp setpgrp setsid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3018: checking for $ac_func" >&5 +echo "configure:3029: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3023 "configure" +#line 3034 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3042,7 +3053,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3057: \"$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 @@ -3068,12 +3079,12 @@ done if test "$ac_cv_func_strftime" = no; then echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:3072: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:3083: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3077 "configure" +#line 3088 "configure" #include "confdefs.h" #include <sys/types.h> #include <time.h> @@ -3081,7 +3092,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:3085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -3102,12 +3113,12 @@ EOF fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:3106: checking for tm_zone in struct tm" >&5 +echo "configure:3117: checking for tm_zone in struct tm" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3111 "configure" +#line 3122 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_cv_struct_tm> @@ -3115,7 +3126,7 @@ int main() { struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:3119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -3135,12 +3146,12 @@ EOF else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:3139: checking for tzname" >&5 +echo "configure:3150: checking for tzname" >&5 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3144 "configure" +#line 3155 "configure" #include "confdefs.h" #include <time.h> #ifndef tzname /* For SGI. */ @@ -3150,7 +3161,7 @@ int main() { atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:3154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -3172,14 +3183,14 @@ EOF fi cat > conftest.$ac_ext <<EOF -#line 3176 "configure" +#line 3187 "configure" #include "confdefs.h" int main() { extern int daylight; int i = daylight; ; return 0; } EOF -if { (eval echo configure:3183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3194: \"$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 @@ -3199,15 +3210,15 @@ EOF else echo $ac_n "checking for BSD signal semantics""... $ac_c" 1>&6 -echo "configure:3203: checking for BSD signal semantics" >&5 - if eval "test \"`echo '$''{'rb_cv_bsd_signal'+set}'`\" = set"; then +echo "configure:3214: 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 if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + rb_cv_bsd_signal=no else cat > conftest.$ac_ext <<EOF -#line 3211 "configure" +#line 3222 "configure" #include "confdefs.h" #include <stdio.h> @@ -3229,7 +3240,7 @@ main() } EOF -if { (eval echo configure:3233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3244: \"$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 @@ -3243,7 +3254,7 @@ fi fi - echo "$ac_t""$rb_cv_bsd_signal" 1>&6 +echo "$ac_t""$rb_cv_bsd_signal" 1>&6 if test "$rb_cv_bsd_signal" = yes; then cat >> confdefs.h <<\EOF #define BSD_SIGNAL 1 @@ -3263,19 +3274,19 @@ EOF else echo $ac_n "checking whether getpgrp() has arg""... $ac_c" 1>&6 -echo "configure:3267: checking whether getpgrp() has arg" >&5 - if eval "test \"`echo '$''{'rb_cv_bsdgetpgrp'+set}'`\" = set"; then +echo "configure:3278: checking whether getpgrp() has arg" >&5 +if eval "test \"`echo '$''{'rb_cv_bsdgetpgrp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3272 "configure" +#line 3283 "configure" #include "confdefs.h" #include <unistd.h> int main() { getpgrp(0); ; return 0; } EOF -if { (eval echo configure:3279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_bsdgetpgrp=yes else @@ -3287,7 +3298,7 @@ fi rm -f conftest* fi - echo "$ac_t""$rb_cv_bsdgetpgrp" 1>&6 +echo "$ac_t""$rb_cv_bsdgetpgrp" 1>&6 if test "$rb_cv_bsdgetpgrp" = yes; then cat >> confdefs.h <<\EOF #define BSD_GETPGRP getpgrp @@ -3296,19 +3307,19 @@ EOF fi echo $ac_n "checking whether setpgrp() has args""... $ac_c" 1>&6 -echo "configure:3300: checking whether setpgrp() has args" >&5 - if eval "test \"`echo '$''{'rb_cv_bsdsetpgrp'+set}'`\" = set"; then +echo "configure:3311: checking whether setpgrp() has args" >&5 +if eval "test \"`echo '$''{'rb_cv_bsdsetpgrp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3305 "configure" +#line 3316 "configure" #include "confdefs.h" #include <unistd.h> int main() { setpgrp(1, 1); ; return 0; } EOF -if { (eval echo configure:3312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_bsdsetpgrp=yes else @@ -3320,7 +3331,7 @@ fi rm -f conftest* fi - echo "$ac_t""$rb_cv_bsdsetpgrp" 1>&6 +echo "$ac_t""$rb_cv_bsdsetpgrp" 1>&6 if test "$rb_cv_bsdsetpgrp" = yes; then cat >> confdefs.h <<\EOF #define BSD_SETPGRP setpgrp @@ -3329,15 +3340,71 @@ EOF fi fi +echo $ac_n "checking for working strtod""... $ac_c" 1>&6 +echo "configure:3345: 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 + if test "$cross_compiling" = yes; then + rb_cv_func_strtod=no +else + cat > conftest.$ac_ext <<EOF +#line 3353 "configure" +#include "confdefs.h" + +double strtod (); +int +main() +{ + { + /* Some versions of Linux strtod mis-parse strings with leading '+'. */ + char *string = " +69"; + char *term; + double value; + value = strtod(string, &term); + if (value != 69 || term != (string + 4)) + exit(1); + } + + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + char *string = "NaN"; + char *term; + strtod(string, &term); + if (term != string && *(term - 1) == 0) + exit(1); + } + exit(0); +} + +EOF +if { (eval echo configure:3383: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + rb_cv_func_strtod=no +fi +rm -fr conftest* +fi + +fi + +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:3334: checking whether byte ordering is bigendian" >&5 +echo "configure:3401: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext <<EOF -#line 3341 "configure" +#line 3408 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/param.h> @@ -3348,11 +3415,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:3352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext <<EOF -#line 3356 "configure" +#line 3423 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/param.h> @@ -3363,7 +3430,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:3367: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -3383,7 +3450,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 3387 "configure" +#line 3454 "configure" #include "confdefs.h" main () { /* Are we little or big endian? From Harbison&Steele. */ @@ -3396,7 +3463,7 @@ main () { exit (u.c[sizeof (long) - 1] == 1); } EOF -if { (eval echo configure:3400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3467: \"$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 @@ -3420,14 +3487,14 @@ EOF fi echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 -echo "configure:3424: checking whether char is unsigned" >&5 +echo "configure:3491: checking whether char is unsigned" >&5 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$GCC" = yes; then # GCC predefines this symbol on systems where it applies. cat > conftest.$ac_ext <<EOF -#line 3431 "configure" +#line 3498 "configure" #include "confdefs.h" #ifdef __CHAR_UNSIGNED__ yes @@ -3449,7 +3516,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 3453 "configure" +#line 3520 "configure" #include "confdefs.h" /* volatile prevents gcc2 from optimizing the test away on sparcs. */ #if !defined(__STDC__) || __STDC__ != 1 @@ -3459,7 +3526,7 @@ main() { volatile char c = 255; exit(c < 0); } EOF -if { (eval echo configure:3463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3530: \"$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 @@ -3484,15 +3551,15 @@ fi echo $ac_n "checking whether right shift preserve sign bit""... $ac_c" 1>&6 -echo "configure:3488: checking whether right shift preserve sign bit" >&5 +echo "configure:3555: 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 if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + rb_cv_rshift_sign=yes else cat > conftest.$ac_ext <<EOF -#line 3496 "configure" +#line 3563 "configure" #include "confdefs.h" int @@ -3504,7 +3571,7 @@ main() } EOF -if { (eval echo configure:3508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3575: \"$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 @@ -3518,7 +3585,7 @@ fi fi - echo "$ac_t""$rb_cv_rshift_sign" 1>&6 +echo "$ac_t""$rb_cv_rshift_sign" 1>&6 if test "$rb_cv_rshift_sign" = yes; then cat >> confdefs.h <<\EOF #define RSHIFT(x,y) ((x)>>y) @@ -3532,19 +3599,19 @@ EOF fi echo $ac_n "checking count field in FILE structures""... $ac_c" 1>&6 -echo "configure:3536: checking count field in FILE structures" >&5 +echo "configure:3603: checking count field in FILE structures" >&5 if eval "test \"`echo '$''{'rb_cv_fcnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3541 "configure" +#line 3608 "configure" #include "confdefs.h" #include <stdio.h> int main() { FILE *f = stdin; f->_cnt = 0; ; return 0; } EOF -if { (eval echo configure:3548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="_cnt" else @@ -3554,14 +3621,14 @@ fi rm -f conftest* if test "$rb_cv_fcnt" = ""; then cat > conftest.$ac_ext <<EOF -#line 3558 "configure" +#line 3625 "configure" #include "confdefs.h" #include <stdio.h> int main() { FILE *f = stdin; f->__cnt = 0; ; return 0; } EOF -if { (eval echo configure:3565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="__cnt" else @@ -3572,14 +3639,14 @@ rm -f conftest* fi if test "$rb_cv_fcnt" = ""; then cat > conftest.$ac_ext <<EOF -#line 3576 "configure" +#line 3643 "configure" #include "confdefs.h" #include <stdio.h> int main() { FILE *f = stdin; f->_r = 0; ; return 0; } EOF -if { (eval echo configure:3583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="_r" else @@ -3590,14 +3657,14 @@ rm -f conftest* fi if test "$rb_cv_fcnt" = ""; then cat > conftest.$ac_ext <<EOF -#line 3594 "configure" +#line 3661 "configure" #include "confdefs.h" #include <stdio.h> int main() { FILE *f = stdin; f->readCount = 0; ; return 0; } EOF -if { (eval echo configure:3601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="readCount" else @@ -3636,15 +3703,15 @@ fi case "$host_os" in linux*) echo $ac_n "checking whether ELF binaries are produced""... $ac_c" 1>&6 -echo "configure:3640: checking whether ELF binaries are produced" >&5 - if eval "test \"`echo '$''{'rb_cv_binary_elf'+set}'`\" = set"; then +echo "configure:3707: 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 if test "$cross_compiling" = yes; then - : + rb_cv_binary_elf=yes else cat > conftest.$ac_ext <<EOF -#line 3648 "configure" +#line 3715 "configure" #include "confdefs.h" /* Test for whether ELF binaries are produced */ @@ -3664,7 +3731,7 @@ main() { } EOF -if { (eval echo configure:3668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3735: \"$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 @@ -3678,7 +3745,7 @@ fi fi - echo "$ac_t""$rb_cv_binary_elf" 1>&6 +echo "$ac_t""$rb_cv_binary_elf" 1>&6 if test "$rb_cv_binary_elf" = no; then with_dln_a_out=yes host_os=${host_os}-a_out @@ -3694,7 +3761,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:3698: checking whether OS depend dynamic link works" >&5 +echo "configure:3765: checking whether OS depend dynamic link works" >&5 if test "$GCC" = yes; then case "$host_os" in nextstep*) ;; @@ -3774,14 +3841,14 @@ fi dln_a_out_works=no if test "$ac_cv_header_a_out_h" = yes; then if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then - echo $ac_n "checking whether matz's dln works""... $ac_c" 1>&6 -echo "configure:3779: checking whether matz's dln works" >&5 cat confdefs.h > config.h - if eval "test \"`echo '$''{'rb_cv_dln_a_out'+set}'`\" = set"; then + echo $ac_n "checking whether matz's dln works""... $ac_c" 1>&6 +echo "configure:3847: checking whether matz's dln works" >&5 +if eval "test \"`echo '$''{'rb_cv_dln_a_out'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3785 "configure" +#line 3852 "configure" #include "confdefs.h" #define USE_DLN_A_OUT @@ -3791,7 +3858,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_dln_a_out=yes else @@ -3803,7 +3870,7 @@ fi rm -f conftest* fi - echo "$ac_t""$rb_cv_dln_a_out" 1>&6 +echo "$ac_t""$rb_cv_dln_a_out" 1>&6 if test "$rb_cv_dln_a_out" = yes; then dln_a_out_works=yes cat >> confdefs.h <<\EOF @@ -3893,7 +3960,7 @@ fi case "$host_os" in human*) echo $ac_n "checking for _harderr in -lsignal""... $ac_c" 1>&6 -echo "configure:3897: checking for _harderr in -lsignal" >&5 +echo "configure:3964: 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 @@ -3901,7 +3968,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsignal $LIBS" cat > conftest.$ac_ext <<EOF -#line 3905 "configure" +#line 3972 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3912,7 +3979,7 @@ int main() { _harderr() ; return 0; } EOF -if { (eval echo configure:3916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3983: \"$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 @@ -3940,7 +4007,7 @@ else fi echo $ac_n "checking for hmemset in -lhmem""... $ac_c" 1>&6 -echo "configure:3944: checking for hmemset in -lhmem" >&5 +echo "configure:4011: 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 @@ -3948,7 +4015,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lhmem $LIBS" cat > conftest.$ac_ext <<EOF -#line 3952 "configure" +#line 4019 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3959,7 +4026,7 @@ int main() { hmemset() ; return 0; } EOF -if { (eval echo configure:3963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4030: \"$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 @@ -3989,12 +4056,12 @@ fi for ac_func in select do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3993: checking for $ac_func" >&5 +echo "configure:4060: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3998 "configure" +#line 4065 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4017,7 +4084,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4088: \"$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 @@ -4042,15 +4109,15 @@ fi done echo $ac_n "checking whether PD libc _dtos18 fail to convert big number""... $ac_c" 1>&6 -echo "configure:4046: checking whether PD libc _dtos18 fail to convert big number" >&5 - if eval "test \"`echo '$''{'rb_cv_missing__dtos18'+set}'`\" = set"; then +echo "configure:4113: 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 if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + rb_cv_missing__dtos18=no else cat > conftest.$ac_ext <<EOF -#line 4054 "configure" +#line 4121 "configure" #include "confdefs.h" #include <stdio.h> @@ -4062,7 +4129,7 @@ main () } EOF -if { (eval echo configure:4066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4133: \"$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 @@ -4076,7 +4143,7 @@ fi fi - echo "$ac_t""$rb_cv_missing__dtos18" 1>&6 +echo "$ac_t""$rb_cv_missing__dtos18" 1>&6 if test "$rb_cv_missing__dtos18" = yes; then cat >> confdefs.h <<\EOF #define MISSING__DTOS18 1 @@ -4084,15 +4151,15 @@ EOF fi echo $ac_n "checking whether PD libc fconvert fail to round""... $ac_c" 1>&6 -echo "configure:4088: checking whether PD libc fconvert fail to round" >&5 - if eval "test \"`echo '$''{'rb_cv_missing_fconvert'+set}'`\" = set"; then +echo "configure:4155: 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 if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + rb_cv_missing_fconvert=no else cat > conftest.$ac_ext <<EOF -#line 4096 "configure" +#line 4163 "configure" #include "confdefs.h" #include <stdio.h> @@ -4105,7 +4172,7 @@ main () } EOF -if { (eval echo configure:4109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4176: \"$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 @@ -4119,7 +4186,7 @@ fi fi - echo "$ac_t""$rb_cv_missing_fconvert" 1>&6 +echo "$ac_t""$rb_cv_missing_fconvert" 1>&6 if test "$rb_cv_missing_fconvert" = yes; then cat >> confdefs.h <<\EOF #define MISSING_FCONVERT 1 @@ -4381,7 +4448,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.12.2" + echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; diff --git a/configure.in b/configure.in index ca9ae1b7c3..60d860bdb3 100644 --- a/configure.in +++ b/configure.in @@ -38,12 +38,12 @@ AC_CANONICAL_HOST dnl checks for fat-binary fat_binary=no -AC_ARG_ENABLE( fat-binary, +AC_ARG_ENABLE(fat-binary, [--enable-fat-binary build a NeXT/Apple Multi Architecture Binary. ], - [ fat_binary=$enableval ] ) + [fat_binary=$enableval]) if test "$fat_binary" = yes ; then - AC_MSG_CHECKING( target architecture ) + AC_MSG_CHECKING(target architecture) case "$host_os" in rhapsody*) @@ -105,24 +105,26 @@ AC_CHECK_SIZEOF(void*) AC_CHECK_SIZEOF(float) AC_CHECK_SIZEOF(double) -AC_MSG_CHECKING(for prototypes) -AC_CACHE_VAL(rb_cv_have_prototypes, +AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes, [AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);], rb_cv_have_prototypes=yes, rb_cv_have_prototypes=no)]) -AC_MSG_RESULT($rb_cv_have_prototypes) if test "$rb_cv_have_prototypes" = yes; then AC_DEFINE(HAVE_PROTOTYPES) fi -AC_MSG_CHECKING(token paste string) -AC_TRY_COMPILE([#define paste(a,b) a##b], -[ int xy = 1; return paste(x,y);], -AC_DEFINE(TOKEN_PASTE(x,y),[x##y]) AC_MSG_RESULT(ANSI), -AC_DEFINE(TOKEN_PASTE(x,y),[x/**/y]) AC_MSG_RESULT(KnR1)) +AC_CACHE_CHECK(token paste string, rb_cv_tokenpaste, + [AC_TRY_COMPILE([#define paste(a,b) a##b], + [int xy = 1; return paste(x,y);], + rb_cv_tokenpaste=ansi, + rb_cv_tokenpaste=knr)]) +if test "$rb_cv_tokenpaste" = ansi; then + AC_DEFINE(TOKEN_PASTE(x,y),[x##y]) +else + AC_DEFINE(TOKEN_PASTE(x,y),[x/**/y]) +fi -AC_MSG_CHECKING(for variable length prototypes and stdarg.h) -AC_CACHE_VAL(rb_cv_stdarg, +AC_CACHE_CHECK(for variable length prototypes and stdarg.h, rb_cv_stdarg, [AC_TRY_COMPILE([ #include <stdarg.h> int foo(int x, ...) { @@ -136,17 +138,14 @@ int foo(int x, ...) { ], [return foo(10, "", 3.14);], rb_cv_stdarg=yes, rb_cv_stdarg=no)]) -AC_MSG_RESULT($rb_cv_stdarg) if test "$rb_cv_stdarg" = yes; then AC_DEFINE(HAVE_STDARG_PROTOTYPES) fi -AC_MSG_CHECKING(for gcc attribute noreturn) -AC_CACHE_VAL(rb_cv_have_attr_noreturn, +AC_CACHE_CHECK(for gcc attribute noreturn, rb_cv_have_attr_noreturn, [AC_TRY_COMPILE([void exit(int x) __attribute__ ((noreturn));], [], rb_cv_have_attr_noreturn=yes, rb_cv_have_attr_noreturn=no)]) -AC_MSG_RESULT($rb_cv_have_attr_noreturn) if test "$rb_cv_have_attr_noreturn" = yes; then AC_DEFINE(HAVE_ATTR_NORETURN) fi @@ -203,8 +202,7 @@ fi if test "$ac_cv_func_sigprocmask" = yes && test "$ac_cv_func_sigaction" = yes; then AC_DEFINE(POSIX_SIGNAL) else - AC_MSG_CHECKING(for BSD signal semantics) - AC_CACHE_VAL(rb_cv_bsd_signal, + AC_CACHE_CHECK(for BSD signal semantics, rb_cv_bsd_signal, [AC_TRY_RUN([ #include <stdio.h> #include <signal.h> @@ -225,8 +223,8 @@ main() } ], rb_cv_bsd_signal=yes, + rb_cv_bsd_signal=no, rb_cv_bsd_signal=no)]) - AC_MSG_RESULT($rb_cv_bsd_signal) if test "$rb_cv_bsd_signal" = yes; then AC_DEFINE(BSD_SIGNAL) fi @@ -236,32 +234,57 @@ if test "$ac_cv_func_setpgrp2" = yes; then AC_DEFINE(BSD_GETPGRP, getpgrp2) AC_DEFINE(BSD_SETPGRP, setpgrp2) else - AC_MSG_CHECKING(whether getpgrp() has arg) - AC_CACHE_VAL(rb_cv_bsdgetpgrp, + AC_CACHE_CHECK(whether getpgrp() has arg, rb_cv_bsdgetpgrp, [AC_TRY_COMPILE([#include <unistd.h>], [getpgrp(0);], rb_cv_bsdgetpgrp=yes, rb_cv_bsdgetpgrp=no)]) - AC_MSG_RESULT($rb_cv_bsdgetpgrp) if test "$rb_cv_bsdgetpgrp" = yes; then AC_DEFINE(BSD_GETPGRP, getpgrp) fi - AC_MSG_CHECKING(whether setpgrp() has args) - AC_CACHE_VAL(rb_cv_bsdsetpgrp, + AC_CACHE_CHECK(whether setpgrp() has args, rb_cv_bsdsetpgrp, [AC_TRY_COMPILE([#include <unistd.h>], [setpgrp(1, 1);], rb_cv_bsdsetpgrp=yes, rb_cv_bsdsetpgrp=no)]) - AC_MSG_RESULT($rb_cv_bsdsetpgrp) if test "$rb_cv_bsdsetpgrp" = yes; then AC_DEFINE(BSD_SETPGRP, setpgrp) fi fi +AC_CACHE_CHECK(for working strtod, rb_cv_func_strtod, +[AC_TRY_RUN([ +double strtod (); +int +main() +{ + { + /* Some versions of Linux strtod mis-parse strings with leading '+'. */ + char *string = " +69"; + char *term; + double value; + value = strtod(string, &term); + if (value != 69 || term != (string + 4)) + exit(1); + } + + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + char *string = "NaN"; + char *term; + strtod(string, &term); + if (term != string && *(term - 1) == 0) + exit(1); + } + exit(0); +} +], rb_cv_func_strtod=yes, rb_cv_func_strtod=no, rb_cv_func_strtod=no)]) +test $rb_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o" + AC_C_BIGENDIAN AC_CHAR_UNSIGNED -AC_MSG_CHECKING(whether right shift preserve sign bit) -AC_CACHE_VAL(rb_cv_rshift_sign, +AC_CACHE_CHECK(whether right shift preserve sign bit, rb_cv_rshift_sign, [AC_TRY_RUN([ int main() @@ -272,15 +295,15 @@ main() } ], rb_cv_rshift_sign=yes, - rb_cv_rshift_sign=no)]) - AC_MSG_RESULT($rb_cv_rshift_sign) + rb_cv_rshift_sign=no, + rb_cv_rshift_sign=yes)]) if test "$rb_cv_rshift_sign" = yes; then AC_DEFINE(RSHIFT(x,y), ((x)>>y)) else AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>y) : (x)>>y)) fi -AC_MSG_CHECKING([count field in FILE structures]) +AC_MSG_CHECKING(count field in FILE structures) AC_CACHE_VAL(rb_cv_fcnt, [AC_TRY_COMPILE([#include <stdio.h>], [FILE *f = stdin; f->_cnt = 0;], rb_cv_fcnt="_cnt", ) @@ -313,8 +336,7 @@ AC_ARG_WITH(dln-a-out, [--with-dln-a-out use dln_a_out if possible], [ case "$host_os" in linux*) - AC_MSG_CHECKING(whether ELF binaries are produced) - AC_CACHE_VAL(rb_cv_binary_elf, + AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf, [AC_TRY_RUN([ /* Test for whether ELF binaries are produced */ #include <fcntl.h> @@ -334,8 +356,7 @@ main() { ], rb_cv_binary_elf=yes, rb_cv_binary_elf=no, - [:])]) - AC_MSG_RESULT($rb_cv_binary_elf) + rb_cv_binary_elf=yes)]) if test "$rb_cv_binary_elf" = no; then with_dln_a_out=yes host_os=${host_os}-a_out @@ -435,9 +456,8 @@ fi dln_a_out_works=no if test "$ac_cv_header_a_out_h" = yes; then if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then - AC_MSG_CHECKING(whether matz's dln works) cat confdefs.h > config.h - AC_CACHE_VAL(rb_cv_dln_a_out, + AC_CACHE_CHECK(whether matz's dln works, rb_cv_dln_a_out, [AC_TRY_COMPILE([ #define USE_DLN_A_OUT #include "dln.c" @@ -445,7 +465,6 @@ if test "$ac_cv_header_a_out_h" = yes; then [], rb_cv_dln_a_out=yes, rb_cv_dln_a_out=no)]) - AC_MSG_RESULT($rb_cv_dln_a_out) if test "$rb_cv_dln_a_out" = yes; then dln_a_out_works=yes AC_DEFINE(USE_DLN_A_OUT) @@ -512,8 +531,8 @@ case "$host_os" in AC_CHECK_LIB(signal, _harderr) AC_CHECK_LIB(hmem, hmemset) AC_CHECK_FUNCS(select) - AC_MSG_CHECKING(whether PD libc _dtos18 fail to convert big number) - AC_CACHE_VAL(rb_cv_missing__dtos18, + AC_CACHE_CHECK(whether PD libc _dtos18 fail to convert big number, + rb_cv_missing__dtos18, [AC_TRY_RUN( changequote(<<, >>)dnl << @@ -526,13 +545,12 @@ main () } >>, changequote([, ])dnl -rb_cv_missing__dtos18=yes, rb_cv_missing__dtos18=no)]) - AC_MSG_RESULT($rb_cv_missing__dtos18) +rb_cv_missing__dtos18=yes, rb_cv_missing__dtos18=no, rb_cv_missing__dtos18=no)]) if test "$rb_cv_missing__dtos18" = yes; then AC_DEFINE(MISSING__DTOS18) fi - AC_MSG_CHECKING(whether PD libc fconvert fail to round) - AC_CACHE_VAL(rb_cv_missing_fconvert, + AC_CACHE_CHECK(whether PD libc fconvert fail to round, + rb_cv_missing_fconvert, [AC_TRY_RUN( changequote(<<, >>)dnl << @@ -546,8 +564,7 @@ main () } >>, changequote([, ])dnl -rb_cv_missing_fconvert=yes, rb_cv_missing_fconvert=no)]) - AC_MSG_RESULT($rb_cv_missing_fconvert) +rb_cv_missing_fconvert=yes, rb_cv_missing_fconvert=no, rb_cv_missing_fconvert=no)]) if test "$rb_cv_missing_fconvert" = yes; then AC_DEFINE(MISSING_FCONVERT) fi diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in index f166766a29..feee1c6d94 100644 --- a/ext/extmk.rb.in +++ b/ext/extmk.rb.in @@ -519,7 +519,7 @@ if $extlist.size > 0 if File.exist?(f) $extinit += format("\ \tInit_%s();\n\ -\trb_provide(\"%s.o\");\n\ +\trb_provide(\"%s.so\");\n\ ", t, t) $extobjs = "" unless $extobjs $extobjs += "ext/" diff --git a/lib/README b/lib/README index 09e5946ccb..765c380f7d 100644 --- a/lib/README +++ b/lib/README @@ -1,11 +1,11 @@ English.rb access global variables by english names Env.rb access environment variables as globals README this file -base64.rb encode/decode base64 (bit obsolete) +base64.rb encode/decode base64 (obsolete) cgi-lib.rb decode CGI data complex.rb complex number suppor date.rb date object (compatible) -date2.rb date object based on Julian date +date2.rb yet another (better) date object debug.rb ruby debugger delegate.rb delegate messages to other object e2mmap.rb exception utilities @@ -15,6 +15,7 @@ finalize.rb add finalizer to the object find.rb traverse directory tree ftools.rb file tools ftplib.rb ftp access library +getoptlong.rb GNU getoptlong compatible getopts.rb parse command line options importenv.rb access environment variables as globals jcode.rb japanese text handling (replace String methods) @@ -29,12 +30,12 @@ open3.rb open subprocess connection stdin/stdout/stderr ostruct.rb python style object parsearg.rb argument parser using getopts parsedate.rb parse date string -ping.rb +ping.rb check whether host is up, using TCP echo. profile.rb ruby profiler pstore.rb persistent object strage using marshal rational.rb rational number support readbytes.rb define IO#readbytes -shell.rb shell like operation under Ruby (imcomlete) +shell.rb shell like operation under Ruby (imcomplete) shellwords.rb split into words like shell singleton.rb singleton design pattern library sync.rb 2 phase lock @@ -43,19 +44,5 @@ tempfile.rb temporary file that automatically removed thread.rb thread support thwait.rb thread syncronization class timeout.rb provids timeout -tk.rb Tk interface -tkafter.rb -tkbgerror.rb Tk error module -tkcanvas.rb Tk canvas interface -tkclass.rb provides generic names for Tk classes -tkdialog.rb Tk dialog class -tkentry.rb Tk entry class -tkfont.rb Tk font support -tkmenubar.rb TK menubar utility -tkmngfocus.rb focus manager -tkpalette.rb pallete support -tkscrollbox.rb scroll box, also example of compound widget -tktext.rb text classes -tkvirtevent.rb virtual event support tracer.rb execution tracer weakref.rb weak reference class diff --git a/lib/cgi-lib.rb b/lib/cgi-lib.rb index ef717b20bf..2089a9c9a5 100644 --- a/lib/cgi-lib.rb +++ b/lib/cgi-lib.rb @@ -25,6 +25,20 @@ # # print CGI.header("HTTP/1.0 200 OK", "Content-Type: text/html") # print CGI.header # == print CGI.header("Content-Type: text/html") +# +# make HTML tag string +# CGI.tag("element", {"attribute_name"=>"attribute_value"}){"content"} +# +# print CGI.tag("HTML"){ +# CGI.tag("HEAD"){ CGI.tag("TITLE"){"TITLE"} } + +# CGI.tag("BODY"){ +# CGI.tag("FORM", {"ACTION"=>"test.rb", "METHOD"=>"POST"}){ +# CGI.tag("INPUT", {"TYPE"=>"submit", "VALUE"=>"submit"}) +# } + +# CGI.tag("HR") +# } +# } + # if running on Windows(IIS or PWS) then change cwd. if ENV['SERVER_SOFTWARE'] =~ /^Microsoft-/ then @@ -67,7 +81,13 @@ class CGI < SimpleDelegator str.gsub!(/%([0-9a-fA-F]{2})/){ [$1.hex].pack("c") } str end - module_function :escape, :unescape + + # escape HTML + def escapeHTML(str) + str.gsub(/&/, "&").gsub(/\"/, """).gsub(/>/, ">").gsub(/</, "<") + end + + module_function :escape, :unescape, :escapeHTML def initialize(input = $stdin) @@ -97,12 +117,12 @@ class CGI < SimpleDelegator if ENV.has_key?('HTTP_COOKIE') @cookie = {} ENV['HTTP_COOKIE'].split("; ").each do |x| - key, val = x.split(/=/,2).collect{|x|unescape(x)} - if @cookie.include?(key) - @cookie[key] += "\0" + (val or "") - else - @cookie[key] = (val or "") - end + key, val = x.split(/=/,2).collect{|x|unescape(x)} + if @cookie.include?(key) + @cookie[key] += "\0" + (val or "") + else + @cookie[key] = (val or "") + end end end end @@ -123,6 +143,13 @@ class CGI < SimpleDelegator (options['secure'] ? '; secure' : '') end + def CGI.tag(element, attributes = {}) + "<" + escapeHTML(element) + attributes.collect{|name, value| + " " + escapeHTML(name) + '="' + escapeHTML(value) + '"' + }.to_s + ">" + + (iterator? ? yield.to_s + "</" + escapeHTML(element) + ">" : "") + end + def CGI.message(msg, title = "", header = ["Content-Type: text/html"]) print CGI.header(*header) print "<html><head><title>" diff --git a/lib/parsedate.rb b/lib/parsedate.rb index 5ffd2da47c..e27735b755 100644 --- a/lib/parsedate.rb +++ b/lib/parsedate.rb @@ -9,7 +9,7 @@ module ParseDate 'thu' => 4, 'fri' => 5, 'sat' => 6 } DAYPAT = DAYS.keys.join('|') - def parsedate(date) + def parsedate(date, guess=false) # part of ISO 8601 # yyyy-mm-dd | yyyy-mm | yyyy # date hh:mm:ss | date Thh:mm:ss @@ -63,6 +63,19 @@ module ParseDate mon = MONTHS[$2.downcase] year = $3.to_i end + if guess + if year < 100 + if year >= 69 + year += 1900 + else + year += 2000 + end + end + elsif date.sub!(/(\d+)-(#{MONTHPAT})-(\d+)/i, ' ') + mday = $1.to_i + mon = MONTHS[$2.downcase] + year = $3.to_i + end return year, mon, mday, hour, min, sec, zone, wday end diff --git a/lib/telnet.rb b/lib/telnet.rb index 0336bda801..10a528ed43 100644 --- a/lib/telnet.rb +++ b/lib/telnet.rb @@ -1,134 +1,139 @@ -# -# telnet.rb -# ver0.16 1998/10/09 -# Wakou Aoyama <wakou@fsinet.or.jp> -# -# ver0.16 1998/10/09 -# preprocess method change for the better -# add binmode method. -# change default Binmode -# TRUE --> FALSE -# -# ver0.15 1998/10/04 -# add telnetmode method. -# -# ver0.141 1998/09/22 -# change default prompt -# /[$%#>] $/ --> /[$%#>] \Z/ -# -# ver0.14 1998/09/01 -# IAC WILL SGA send EOL --> CR+NULL -# IAC WILL SGA IAC DO BIN send EOL --> CR -# NONE send EOL --> LF -# add Dump_log option. -# -# ver0.13 1998/08/25 -# add print method. -# -# ver0.122 1998/08/05 -# support for HP-UX 10.20 thanks to WATANABE Tetsuya <tetsu@jpn.hp.com> -# socket.<< --> socket.write -# -# ver0.121 1998/07/15 -# string.+= --> string.concat -# -# ver0.12 1998/06/01 -# add timeout, waittime. -# -# ver0.11 1998/04/21 -# add realtime output. -# -# ver0.10 1998/04/13 -# first release. -# -# == make new Telnet object -# host = Telnet.new({"Binmode" => FALSE, default: FALSE -# "Host" => "localhost", default: "localhost" -# "Output_log" => "output_log", default: not output -# "Dump_log" => "dump_log", default: not output -# "Port" => 23, default: 23 -# "Prompt" => /[$%#>] \Z/, default: /[$%#>] \Z/ -# "Telnetmode" => TRUE, default: TRUE -# "Timeout" => 10, default: 10 -# "Waittime" => 0}) default: 0 -# -# if set "Telnetmode" option FALSE. not TELNET command interpretation. -# "Waittime" is time to confirm "Prompt". There is a possibility that -# the same character as "Prompt" is included in the data, and, when -# the network or the host is very heavy, the value is enlarged. -# -# == wait for match -# line = host.waitfor(/match/) -# line = host.waitfor({"Match" => /match/, -# "String" => "string", -# "Timeout" => secs}) -# if set "String" option. Match = Regexp.new(quote(string)) -# -# realtime output. of cource, set sync=TRUE or flush is necessary. -# host.waitfor(/match/){|c| print c } -# host.waitfor({"Match" => /match/, -# "String" => "string", -# "Timeout" => secs}){|c| print c} -# -# == send string and wait prompt -# line = host.cmd("string") -# line = host.cmd({"String" => "string", -# "Prompt" => /[$%#>] \Z/, -# "Timeout" => 10}) -# -# realtime output. of cource, set sync=TRUE or flush is necessary. -# host.cmd("string"){|c| print c } -# host.cmd({"String" => "string", -# "Prompt" => /[$%#>] \Z/, -# "Timeout" => 10}){|c| print c } -# -# == send string -# host.print("string") -# -# == turn telnet command interpretation -# host.telnetmode # turn on/off -# host.telnetmode(TRUE) # on -# host.telnetmode(FALSE) # off -# -# == toggle newline translation -# host.binmode # turn TRUE/FALSE -# host.binmode(TRUE) # no translate newline -# host.binmode(FALSE) # translate newline -# -# == login -# host.login("username", "password") -# host.login({"Name" => "username", -# "Password" => "password", -# "Prompt" => /[$%#>] \Z/, -# "Timeout" => 10}) -# -# realtime output. of cource, set sync=TRUE or flush is necessary. -# host.login("username", "password"){|c| print c } -# host.login({"Name" => "username", -# "Password" => "password", -# "Prompt" => /[$%#>] \Z/, -# "Timeout" => 10}){|c| print c } -# -# and Telnet object has socket class methods -# -# == sample -# localhost = Telnet.new({"Host" => "localhost", -# "Timeout" => 10, -# "Prompt" => /[$%#>] \Z/}) -# localhost.login("username", "password"){|c| print c } -# localhost.cmd("command"){|c| print c } -# localhost.close -# -# == sample 2 -# checks a POP server to see if you have mail. -# -# pop = Telnet.new({"Host" => "your_destination_host_here", -# "Port" => 110, -# "Telnetmode" => FALSE, -# "Prompt" => /^\+OK/}) -# pop.cmd("user " + "your_username_here"){|c| print c} -# pop.cmd("pass " + "your_password_here"){|c| print c} -# pop.cmd("list"){|c| print c} +=begin + +telnet.rb ver0.161 1999/02/03 +Wakou Aoyama <wakou@fsinet.or.jp> + +ver0.161 1999/02/03 +select --> IO::select + +ver0.16 1998/10/09 +preprocess method change for the better +add binmode method. +change default Binmode +TRUE --> FALSE + +ver0.15 1998/10/04 +add telnetmode method. + +ver0.141 1998/09/22 +change default prompt +/[$%#>] $/ --> /[$%#>] \Z/ + +ver0.14 1998/09/01 +IAC WILL SGA send EOL --> CR+NULL +IAC WILL SGA IAC DO BIN send EOL --> CR +NONE send EOL --> LF +add Dump_log option. + +ver0.13 1998/08/25 +add print method. + +ver0.122 1998/08/05 +support for HP-UX 10.20 thanks to WATANABE Tetsuya <tetsu@jpn.hp.com> +socket.<< --> socket.write + +ver0.121 1998/07/15 +string.+= --> string.concat + +ver0.12 1998/06/01 +add timeout, waittime. + +ver0.11 1998/04/21 +add realtime output. + +ver0.10 1998/04/13 +first release. + +== make new Telnet object +host = Telnet.new({"Binmode" => FALSE, default: FALSE + "Host" => "localhost", default: "localhost" + "Output_log" => "output_log", default: not output + "Dump_log" => "dump_log", default: not output + "Port" => 23, default: 23 + "Prompt" => /[$%#>] \Z/, default: /[$%#>] \Z/ + "Telnetmode" => TRUE, default: TRUE + "Timeout" => 10, default: 10 + "Waittime" => 0}) default: 0 + +if set "Telnetmode" option FALSE. not TELNET command interpretation. +"Waittime" is time to confirm "Prompt". There is a possibility that +the same character as "Prompt" is included in the data, and, when +the network or the host is very heavy, the value is enlarged. + +== wait for match +line = host.waitfor(/match/) +line = host.waitfor({"Match" => /match/, + "String" => "string", + "Timeout" => secs}) +if set "String" option. Match = Regexp.new(quote(string)) + +realtime output. of cource, set sync=TRUE or flush is necessary. +host.waitfor(/match/){|c| print c } +host.waitfor({"Match" => /match/, + "String" => "string", + "Timeout" => secs}){|c| print c} + +== send string and wait prompt +line = host.cmd("string") +line = host.cmd({"String" => "string", + "Prompt" => /[$%#>] \Z/, + "Timeout" => 10}) + +realtime output. of cource, set sync=TRUE or flush is necessary. +host.cmd("string"){|c| print c } +host.cmd({"String" => "string", + "Prompt" => /[$%#>] \Z/, + "Timeout" => 10}){|c| print c } + +== send string +host.print("string") + +== turn telnet command interpretation +host.telnetmode # turn on/off +host.telnetmode(TRUE) # on +host.telnetmode(FALSE) # off + +== toggle newline translation +host.binmode # turn TRUE/FALSE +host.binmode(TRUE) # no translate newline +host.binmode(FALSE) # translate newline + +== login +host.login("username", "password") +host.login({"Name" => "username", + "Password" => "password", + "Prompt" => /[$%#>] \Z/, + "Timeout" => 10}) + +realtime output. of cource, set sync=TRUE or flush is necessary. +host.login("username", "password"){|c| print c } +host.login({"Name" => "username", + "Password" => "password", + "Prompt" => /[$%#>] \Z/, + "Timeout" => 10}){|c| print c } + +and Telnet object has socket class methods + +== sample +localhost = Telnet.new({"Host" => "localhost", + "Timeout" => 10, + "Prompt" => /[$%#>] \Z/}) +localhost.login("username", "password"){|c| print c } +localhost.cmd("command"){|c| print c } +localhost.close + +== sample 2 +checks a POP server to see if you have mail. + +pop = Telnet.new({"Host" => "your_destination_host_here", + "Port" => 110, + "Telnetmode" => FALSE, + "Prompt" => /^\+OK/}) +pop.cmd("user " + "your_username_here"){|c| print c} +pop.cmd("pass " + "your_password_here"){|c| print c} +pop.cmd("list"){|c| print c} + +=end require "socket" require "delegate" diff --git a/missing/strtod.c b/missing/strtod.c new file mode 100644 index 0000000000..e052cbc067 --- /dev/null +++ b/missing/strtod.c @@ -0,0 +1,266 @@ +/* + * strtod.c -- + * + * Source code for the "strtod" library procedure. + * + * Copyright (c) 1988-1993 The Regents of the University of California. + * Copyright (c) 1994 Sun Microsystems, Inc. + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + * RCS: @(#) $Id$ + */ + +#include "config.h" +#ifdef HAVE_STDLIB_H +# include <stdlib.h> +#endif +#include <ctype.h> +#include <errno.h> +extern int errno; + +#ifndef __STDC__ +# ifdef __GNUC__ +# define const __const__ +# else +# define const +# endif +#endif + +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif +#ifndef NULL +#define NULL 0 +#endif + +static int maxExponent = 511; /* Largest possible base 10 exponent. Any + * exponent larger than this will already + * produce underflow or overflow, so there's + * no need to worry about additional digits. + */ +static double powersOf10[] = { /* Table giving binary powers of 10. Entry */ + 10., /* is 10^2^i. Used to convert decimal */ + 100., /* exponents into floating-point numbers. */ + 1.0e4, + 1.0e8, + 1.0e16, + 1.0e32, + 1.0e64, + 1.0e128, + 1.0e256 +}; + +/* + *---------------------------------------------------------------------- + * + * strtod -- + * + * This procedure converts a floating-point number from an ASCII + * decimal representation to internal double-precision format. + * + * Results: + * The return value is the double-precision floating-point + * representation of the characters in string. If endPtr isn't + * NULL, then *endPtr is filled in with the address of the + * next character after the last one that was part of the + * floating-point number. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +double +strtod(string, endPtr) + const char *string; /* A decimal ASCII floating-point number, + * optionally preceded by white space. + * Must have form "-I.FE-X", where I is the + * integer part of the mantissa, F is the + * fractional part of the mantissa, and X + * is the exponent. Either of the signs + * may be "+", "-", or omitted. Either I + * or F may be omitted, or both. The decimal + * point isn't necessary unless F is present. + * The "E" may actually be an "e". E and X + * may both be omitted (but not just one). + */ + char **endPtr; /* If non-NULL, store terminating character's + * address here. */ +{ + int sign, expSign = FALSE; + double fraction, dblExp, *d; + register const char *p; + register int c; + int exp = 0; /* Exponent read from "EX" field. */ + int fracExp = 0; /* Exponent that derives from the fractional + * part. Under normal circumstatnces, it is + * the negative of the number of digits in F. + * However, if I is very long, the last digits + * of I get dropped (otherwise a long I with a + * large negative exponent could cause an + * unnecessary overflow on I alone). In this + * case, fracExp is incremented one for each + * dropped digit. */ + int mantSize; /* Number of digits in mantissa. */ + int decPt; /* Number of mantissa digits BEFORE decimal + * point. */ + const char *pExp; /* Temporarily holds location of exponent + * in string. */ + + /* + * Strip off leading blanks and check for a sign. + */ + + p = string; + while (isspace(*p)) { + p += 1; + } + if (*p == '-') { + sign = TRUE; + p += 1; + } else { + if (*p == '+') { + p += 1; + } + sign = FALSE; + } + + /* + * Count the number of digits in the mantissa (including the decimal + * point), and also locate the decimal point. + */ + + decPt = -1; + for (mantSize = 0; ; mantSize += 1) + { + c = *p; + if (!isdigit(c)) { + if ((c != '.') || (decPt >= 0)) { + break; + } + decPt = mantSize; + } + p += 1; + } + + /* + * Now suck up the digits in the mantissa. Use two integers to + * collect 9 digits each (this is faster than using floating-point). + * If the mantissa has more than 18 digits, ignore the extras, since + * they can't affect the value anyway. + */ + + pExp = p; + p -= mantSize; + if (decPt < 0) { + decPt = mantSize; + } else { + mantSize -= 1; /* One of the digits was the point. */ + } + if (mantSize > 18) { + fracExp = decPt - 18; + mantSize = 18; + } else { + fracExp = decPt - mantSize; + } + if (mantSize == 0) { + fraction = 0.0; + p = string; + goto done; + } else { + int frac1, frac2; + frac1 = 0; + for ( ; mantSize > 9; mantSize -= 1) + { + c = *p; + p += 1; + if (c == '.') { + c = *p; + p += 1; + } + frac1 = 10*frac1 + (c - '0'); + } + frac2 = 0; + for (; mantSize > 0; mantSize -= 1) + { + c = *p; + p += 1; + if (c == '.') { + c = *p; + p += 1; + } + frac2 = 10*frac2 + (c - '0'); + } + fraction = (1.0e9 * frac1) + frac2; + } + + /* + * Skim off the exponent. + */ + + p = pExp; + if ((*p == 'E') || (*p == 'e')) { + p += 1; + if (*p == '-') { + expSign = TRUE; + p += 1; + } else { + if (*p == '+') { + p += 1; + } + expSign = FALSE; + } + while (isdigit(*p)) { + exp = exp * 10 + (*p - '0'); + p += 1; + } + } + if (expSign) { + exp = fracExp - exp; + } else { + exp = fracExp + exp; + } + + /* + * Generate a floating-point number that represents the exponent. + * Do this by processing the exponent one bit at a time to combine + * many powers of 2 of 10. Then combine the exponent with the + * fraction. + */ + + if (exp < 0) { + expSign = TRUE; + exp = -exp; + } else { + expSign = FALSE; + } + if (exp > maxExponent) { + exp = maxExponent; + errno = ERANGE; + } + dblExp = 1.0; + for (d = powersOf10; exp != 0; exp >>= 1, d += 1) { + if (exp & 01) { + dblExp *= *d; + } + } + if (expSign) { + fraction /= dblExp; + } else { + fraction *= dblExp; + } + +done: + if (endPtr != NULL) { + *endPtr = (char *) p; + } + + if (sign) { + return -fraction; + } + return fraction; +} diff --git a/missing/vsnprintf.c b/missing/vsnprintf.c index 22feac5f15..8b190b1450 100644 --- a/missing/vsnprintf.c +++ b/missing/vsnprintf.c @@ -416,7 +416,15 @@ BSD__ultoa(val, endp, base, octzero, xdigs) #ifdef FLOATING_POINT #include <math.h> -#include "floatio.h" +/* #include "floatio.h" */ + +#ifndef MAXEXP +# define MAXEXP 1024 +#endif + +#ifndef MAXFRACT +# define MAXFRACT 64 +#endif #define BUF (MAXEXP+MAXFRACT+1) /* + decimal point */ #define DEFPREC 6 @@ -184,11 +184,14 @@ flo_to_s(flt) VALUE flt; { char buf[24]; - - snprintf(buf, 24, "%.10g", RFLOAT(flt)->value); - if (strchr(buf, '.') == 0 && - strcmp(buf, "Inf") != 0 && - strcmp(buf, "NaN") != 0) { + char *s; + + sprintf(buf, "%-.10g", RFLOAT(flt)->value); + if (s = strchr(buf, ' ')) *s = '\0'; + s = buf; if (s[0] == '-') s++; + if (strchr(s, '.') == 0 && + strcmp(s, "Inf") != 0 && + strcmp(s, "NaN") != 0) { int len = strlen(buf); char *ind = strchr(buf, 'e'); @@ -276,14 +279,11 @@ flo_div(x, y) switch (TYPE(y)) { case T_FIXNUM: f_y = FIX2LONG(y); - if (f_y == 0) rb_num_zerodiv(); return rb_float_new(RFLOAT(x)->value / (double)f_y); case T_BIGNUM: d = rb_big2dbl(y); - if (d == 0.0) rb_num_zerodiv(); return rb_float_new(RFLOAT(x)->value / d); case T_FLOAT: - if (RFLOAT(y)->value == 0.0) rb_num_zerodiv(); return rb_float_new(RFLOAT(x)->value / RFLOAT(y)->value); default: return rb_num_coerce_bin(x, y); @@ -668,8 +668,12 @@ rb_num2long(val) return (long)(RFLOAT(val)->value); } else { - rb_raise(rb_eTypeError, "float %g out of rang of integer", - RFLOAT(val)->value); + char buf[24]; + char *s; + + sprintf(buf, "%-.10g", RFLOAT(val)->value); + if (s = strchr(buf, ' ')) *s = '\0'; + rb_raise(rb_eTypeError, "float %s out of rang of integer", buf); } case T_BIGNUM: @@ -16,7 +16,7 @@ #define define_swapx(x, xtype) \ static xtype \ -TAKEN_PASTE(swap,x)(z) \ +TOKEN_PASTE(swap,x)(z) \ xtype z; \ { \ xtype r; \ @@ -64,9 +64,8 @@ define_swapx(s,short); +(((x)&0x0000000000FF0000)<<24) \ +(((x)&0x0000FF0000000000)>>24) \ +(((x)&0x00000000FF000000)<<8) \ - +(((x)&0x000000FF00000000)>>8) + +(((x)&0x000000FF00000000)>>8) ) #else - define_swapx(l,long); #endif #endif @@ -223,7 +222,7 @@ endian() #ifdef FLOAT_SWAPPER #define FLOAT_CONVWITH(y) FLOAT_SWAPPER y; #define HTONF(x,y) (memcpy(&y,&x,sizeof(float)), \ - x = htonf((FLOAT_SWAPPER)y), \ + y = htonf((FLOAT_SWAPPER)y), \ memcpy(&x,&y,sizeof(float)), \ x) #define HTOVF(x,y) (memcpy(&y,&x,sizeof(float)), \ @@ -249,7 +248,7 @@ endian() #ifdef DOUBLE_SWAPPER #define DOUBLE_CONVWITH(y) DOUBLE_SWAPPER y; #define HTOND(x,y) (memcpy(&y,&x,sizeof(double)), \ - x = htond((DOUBLE_SWAPPER)y), \ + y = htond((DOUBLE_SWAPPER)y), \ memcpy(&x,&y,sizeof(double)), \ x) #define HTOVD(x,y) (memcpy(&y,&x,sizeof(double)), \ @@ -4590,6 +4590,7 @@ yycompile(f) ruby__end__seen = 0; ruby_eval_tree = 0; newline_seen = 0; + heredoc_end = 0; ruby_sourcefile = f; ruby_in_compile = 1; n = yyparse(); @@ -5331,8 +5332,8 @@ arg_ambiguous() rb_warning("ambiguous first argument; make sure"); } -#ifndef atof -double atof(); +#ifndef strtod +double strtod (); #endif static int @@ -5777,7 +5778,8 @@ retry: if (is_float) { double d = strtod(tok(), 0); if (errno == ERANGE) { - yyerror("Float out of range"); + rb_warn("Float %s out of range", tok()); + errno = 0; } yylval.val = rb_float_new(d); return tFLOAT; @@ -1679,6 +1679,7 @@ yycompile(f) ruby__end__seen = 0; ruby_eval_tree = 0; newline_seen = 0; + heredoc_end = 0; ruby_sourcefile = f; ruby_in_compile = 1; n = yyparse(); @@ -2420,8 +2421,8 @@ arg_ambiguous() rb_warning("ambiguous first argument; make sure"); } -#ifndef atof -double atof(); +#ifndef strtod +double strtod (); #endif static int @@ -2866,7 +2867,8 @@ retry: if (is_float) { double d = strtod(tok(), 0); if (errno == ERANGE) { - yyerror("Float out of range"); + rb_warn("Float %s out of range", tok()); + errno = 0; } yylval.val = rb_float_new(d); return tFLOAT; @@ -482,6 +482,9 @@ rb_reg_search(reg, str, start, reverse) result = re_search(RREGEXP(reg)->ptr,RSTRING(str)->ptr,RSTRING(str)->len, start, range, regs); + if (FL_TEST(reg, KCODE_FIXED)) + kcode_reset_option(); + if (result == -2) { rb_reg_raise(RREGEXP(reg)->str, RREGEXP(reg)->len, "Stack overfow in regexp matcher", reg); @@ -1025,6 +1025,7 @@ re_compile_pattern(pattern, size, bufp) { register char *b = bufp->buffer; register char *p = pattern; + char *nextp; char *pend = pattern + size; register unsigned c, c1; char *p0; @@ -2018,15 +2019,16 @@ re_compile_pattern(pattern, size, bufp) normal_char: /* Expects the character in `c'. */ had_mbchar = 0; if (ismbchar(c)) { - had_mbchar = 0; + had_mbchar = 1; c1 = p - pattern; } numeric_char: + nextp = p + ismbchar(c); if (!pending_exact || pending_exact + *pending_exact + 1 != b || *pending_exact >= (c1 ? 0176 : 0177) - || *p == '+' || *p == '?' - || *p == '*' || *p == '^' - || *p == '{') { + || *nextp == '+' || *nextp == '?' + || *nextp == '*' || *nextp == '^' + || *nextp == '{') { laststart = b; BUFPUSH(exactn); pending_exact = b; @@ -2637,7 +2639,7 @@ re_compile_fastmap(bufp) { if (TRANSLATE_P()) j = translate[j]; - fastmap[j] = (j>0x7f?2:1); + fastmap[j] = (j>0x7f?(ismbchar(j)?0:2):1); } { unsigned short size; @@ -2846,15 +2848,17 @@ re_search(bufp, string, size, startpos, range, regs) int len = ismbchar(c); if (fastmap[c]) break; - c = *p++; - range -= len; + p += len; + range -= len + 1; + c = *p; if (fastmap[c] == 2) break; } - else + else { if (fastmap[MAY_TRANSLATE() ? translate[c] : c]) break; - range--; + range--; + } } startpos += irange - range; } @@ -279,6 +279,10 @@ proc_options(argcp, argvp) case 'e': forbid_setid("-e"); + if (!argv[1]) { + fprintf(stderr, "%s: no code specified for -e\n", origargv[0]); + exit(2); + } if (!e_fp) { e_tmpname = ruby_mktemp(); if (!e_tmpname) rb_fatal("Can't mktemp"); @@ -288,11 +292,9 @@ proc_options(argcp, argvp) } if (script == 0) script = e_tmpname; } - if (argv[1]) { - fputs(argv[1], e_fp); - argc--, argv++; - } + fputs(argv[1], e_fp); putc('\n', e_fp); + argc--, argv++; break; case 'r': @@ -404,8 +406,8 @@ proc_options(argcp, argvp) exit(0); } else { - printf("%s: invalid option --%s (-h will show valid options)\n", - origargv[0], s); + fprintf(stderr, "%s: invalid option --%s (-h will show valid options)\n", + origargv[0], s); exit(2); } break; @@ -416,8 +418,8 @@ proc_options(argcp, argvp) break; default: - printf("%s: invalid option -%c (-h will show valid options)\n", - origargv[0], *s); + fprintf(stderr, "%s: invalid option -%c (-h will show valid options)\n", + origargv[0], *s); exit(2); case 0: diff --git a/sample/test.rb b/sample/test.rb index f28327659e..bc136eb1d4 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -183,7 +183,7 @@ ok(i>4) check "exception"; begin - fail "this must be handled" + raise "this must be handled" ok(false) rescue ok(true) @@ -191,7 +191,7 @@ end $bad = true begin - fail "this must be handled no.2" + raise "this must be handled no.2" rescue if $bad $bad = false @@ -205,9 +205,9 @@ ok(true) $string = "this must be handled no.3" begin begin - fail "exception in rescue clause" + raise "exception in rescue clause" rescue - fail $string + raise $string end ok(false) rescue @@ -217,9 +217,9 @@ end # exception in ensure clause begin begin - fail "this must be handled no.4" + raise "this must be handled no.4" ensure - fail "exception in ensure clause" + raise "exception in ensure clause" end ok(false) rescue @@ -229,7 +229,7 @@ end $bad = true begin begin - fail "this must be handled no.5" + raise "this must be handled no.5" ensure $bad = false end @@ -240,7 +240,7 @@ ok(!$bad) $bad = true begin begin - fail "this must be handled no.6" + raise "this must be handled no.6" ensure $bad = false end @@ -355,7 +355,7 @@ ok($x[1] == 2) ok(begin for k,v in $y - fail if k*2 != v + raise if k*2 != v end true rescue @@ -746,7 +746,7 @@ if defined? Process.kill sleep 0.1 ok($x == 2) - trap "SIGINT", proc{fail "Interrupt"} + trap "SIGINT", proc{raise "Interrupt"} x = false begin @@ -1140,7 +1140,7 @@ rb_str_gsub_bang(argc, argv, str) } if (RSTRING(str)->len > offset) { len = bp - buf; - if (blen - len < RSTRING(str)->len - offset) { + if (blen - len < RSTRING(str)->len - offset + 1) { REALLOC_N(buf, char, len + RSTRING(str)->len - offset + 1); bp = buf + len; } @@ -1,2 +1,2 @@ #define RUBY_VERSION "1.3.1" -#define VERSION_DATE "99/02/03" +#define VERSION_DATE "99/02/05" |