diff options
author | Yukihiro Matsumoto <[email protected]> | 1997-10-15 18:08:37 +0900 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2019-08-17 22:09:33 +0900 |
commit | 2a4ba10e2d68c09ddb2e3f5751f5161c00a13bf5 (patch) | |
tree | 13190036ce10900901e1ff5b559ececbdc05a167 | |
parent | 7ad198827b6029d5338c6a2dfe68248da25e9db5 (diff) |
version 1.0-971015v1_0_971015
https://cache.ruby-lang.org/pub/ruby/1.0/ruby-1.0-971015.tar.gz
Wed Oct 15 18:08:37 1997 Yukihiro Matsumoto <[email protected]>
* version 1.0-971015
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | MANIFEST | 2 | ||||
-rwxr-xr-x | config.guess | 5 | ||||
-rwxr-xr-x | config.sub | 2 | ||||
-rw-r--r-- | configure.in | 58 | ||||
-rw-r--r-- | error.c | 2 | ||||
-rw-r--r-- | eval.c | 5 | ||||
-rw-r--r-- | ext/extmk.rb.in | 5 | ||||
-rw-r--r-- | io.c | 9 | ||||
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | missing/mkdir.c | 3 | ||||
-rw-r--r-- | missing/nt.c | 105 | ||||
-rw-r--r-- | missing/nt.h | 9 | ||||
-rw-r--r-- | missing/x68.c | 12 | ||||
-rw-r--r-- | ruby.1 | 8 | ||||
-rw-r--r-- | ruby.c | 5 | ||||
-rw-r--r-- | sample/cbreak.rb | 36 | ||||
-rw-r--r-- | version.h | 4 | ||||
-rw-r--r-- | win32/Makefile | 2 | ||||
-rw-r--r-- | win32/config.h | 2 |
20 files changed, 222 insertions, 58 deletions
@@ -1,3 +1,7 @@ +Wed Oct 15 18:08:37 1997 Yukihiro Matsumoto <[email protected]> + + * version 1.0-971015 + Fri Oct 3 10:51:10 1997 Yukihiro Matsumoto <[email protected]> * version 1.0-971003 @@ -124,8 +124,8 @@ missing/strftime.c missing/strstr.c missing/strtol.c missing/strtoul.c +missing/x68.c sample/biorhythm.rb -sample/cbreak.rb sample/clnt.rb sample/dbmtest.rb sample/dir.rb diff --git a/config.guess b/config.guess index ea28434e58..91dad5ee6a 100755 --- a/config.guess +++ b/config.guess @@ -333,6 +333,9 @@ EOF *:NetBSD:*:*) echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; *:*:*BOW*:*) echo i386-pc-bow exit 0 ;; @@ -572,7 +575,7 @@ main () } EOF -${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy.x dummy && exit 0 +${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm -f dummy.c dummy.x dummy && exit 0 rm -f dummy.c dummy.x dummy # Apollos put the system type in the environment. diff --git a/config.sub b/config.sub index 9dec8e3c13..002d408812 100755 --- a/config.sub +++ b/config.sub @@ -686,7 +686,7 @@ case $os in | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \ | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \ | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ diff --git a/configure.in b/configure.in index 699ca1eed3..9a59f42e0f 100644 --- a/configure.in +++ b/configure.in @@ -28,6 +28,35 @@ if test $rb_thread = yes; then fi AC_CANONICAL_HOST + + +dnl checks for fat-binary +fat_binary=no +AC_ARG_ENABLE( fat-binary, + [--enable-fat-binary build a NeXT Multi Architecture Binary. ], + [ fat_binary=$enableval ] ) +if test "$fat_binary" = yes ; then + + AC_MSG_CHECKING( target architecture ) + + if test "$TARGET_ARCHS" = "" ; then + if test `/usr/bin/arch` = "m68k" ; then + TARGET_ARCHS="m68k i486" + else + TARGET_ARCHS="m68k `/usr/bin/arch`" + fi + fi + # /usr/lib/arch_tool -archify_list $TARGET_ARCHS + for archs in $TARGET_ARCHS + do + ARCH_FLAG="$ARCH_FLAG -arch $archs " + echo -n " $archs" + done + AC_DEFINE( NEXT_FAT_BINARY ) + echo "." +fi + + AC_ARG_PROGRAM dnl Checks for programs. @@ -75,7 +104,7 @@ AC_TYPE_SIGNAL AC_FUNC_ALLOCA AC_FUNC_VFORK AC_REPLACE_FUNCS(dup2 setenv memmove mkdir strcasecmp strerror strftime\ - strstr strtoul strdup strcasecmp crypt flock) + strstr strtoul strdup crypt flock) AC_CHECK_FUNCS(fmod killpg random wait4 waitpid syscall getcwd\ truncate chsize times utimes fcntl lockf setitimer\ setruid seteuid setreuid setrgid setegid setregid\ @@ -269,8 +298,11 @@ if test "$with_dln_a_out" != yes; then rb_cv_dlopen=yes ;; netbsd*) LDSHARED="ld -Bshareable" rb_cv_dlopen=yes ;; - nextstep*) LDSHARED='ld' + openbsd*) LDSHARED="ld -Bshareable" + rb_cv_dlopen=yes ;; + nextstep*) LDSHARED='cc -r' LDFLAGS="-u libsys_s" + DLDFLAGS="$ARCH_FLAG" rb_cv_dlopen=yes ;; aix*) LDSHARED='../../miniruby ../aix_ld.rb $(TARGET)' rb_cv_dlopen=yes ;; @@ -407,11 +439,27 @@ AC_SUBST(setup) if test "$prefix" = NONE; then prefix=$ac_default_prefix fi + +if test "$fat_binary" = yes ; then + CFLAGS="$CFLAGS -pipe $ARCH_FLAG" +fi + AC_DEFINE_UNQUOTED(RUBY_LIB, "${prefix}/lib/ruby") AC_SUBST(arch)dnl -arch="${host_cpu}-${host_os}" -AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${prefix}/lib/ruby/${host_cpu}-${host_os}") -AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "$arch") + +if test "$fat_binary" = yes ; then + arch="fat-${host_os}" + + AC_DEFINE_UNQUOTED(RUBY_THIN_ARCHLIB, + "${prefix}/lib/ruby/" __ARCHITECTURE__ "-${host_os}" ) + + AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${prefix}/lib/ruby/${arch}") + AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${host_os}" ) +else + arch="${host_cpu}-${host_os}" + AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${prefix}/lib/ruby/${arch}") + AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}") +fi echo "creating config.h" cat confdefs.h > config.h @@ -313,7 +313,7 @@ void Init_Exception() { eGlobalExit = rb_define_class("GlobalExit", cString); - rb_define_method(eGlobalExit, "new", exc_s_new, -1); + rb_define_singleton_method(eGlobalExit, "new", exc_s_new, -1); rb_define_method(eGlobalExit, "inspect", exc_inspect, 0); eSystemExit = rb_define_class("SystemExit", eGlobalExit); @@ -685,7 +685,10 @@ ruby_options(argc, argv) eval_tree = save; } POP_TAG(); - if (state) error_print(); + if (state) { + error_print(); + exit(1); + } } static VALUE diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in index 80e2a3c9d1..c6405aa6f7 100644 --- a/ext/extmk.rb.in +++ b/ext/extmk.rb.in @@ -288,6 +288,11 @@ $(TARGET): $(OBJS) $(TARGET): $(OBJS) ar cru $(TARGET) $(OBJS) " + elsif PLATFORM =~ "-nextstep" + mfile.printf "\ +$(TARGET): $(OBJS) + cc -r $(CFLAGS) -o $(TARGET) $(OBJS) +" else mfile.printf "\ $(TARGET): $(OBJS) @@ -1760,11 +1760,12 @@ io_ctl(io, req, arg, io_p) #endif str_modify(arg); - if (arg->len < len) { - str_resize(arg, len+1); - arg->ptr[len] = 17; /* a little sanity check here */ - narg = (long)arg->ptr; + if (len < arg->len) { + len = arg->len; } + str_resize(arg, len+1); + arg->ptr[len] = 17; /* a little sanity check here */ + narg = (long)arg->ptr; } fd = fileno(fptr->f); #ifdef HAVE_FCNTL @@ -23,7 +23,7 @@ __declspec(dllexport) void __stdcall ruby_run(void); __declspec(dllexport) void __stdcall NtInitialize(int *, char ***); #endif -void +int main(argc, argv, envp) int argc; char **argv, **envp; diff --git a/missing/mkdir.c b/missing/mkdir.c index b581a5e467..ed1476db9a 100644 --- a/missing/mkdir.c +++ b/missing/mkdir.c @@ -1,4 +1,4 @@ -* +/* * Written by Robert Rother, Mariah Corporation, August 1985. * * If you want it, it's yours. All I ask in return is that if you @@ -14,6 +14,7 @@ */ #include <sys/stat.h> +#include <errno.h> /* * Make a directory. */ diff --git a/missing/nt.c b/missing/nt.c index 6674f09207..58736ae241 100644 --- a/missing/nt.c +++ b/missing/nt.c @@ -46,6 +46,109 @@ static char *str_grow(struct RString *str, size_t new_size); char *NTLoginName;
+DWORD Win32System = (DWORD)-1;
+
+static DWORD
+IdOS(void)
+{
+ static OSVERSIONINFO osver;
+
+ if (osver.dwPlatformId != Win32System) {
+ memset(&osver, 0, sizeof(OSVERSIONINFO));
+ osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&osver);
+ Win32System = osver.dwPlatformId;
+ }
+ return (Win32System);
+}
+
+static int
+IsWin95(void) {
+ return (IdOS() == VER_PLATFORM_WIN32_WINDOWS);
+}
+
+static int
+IsWinNT(void) {
+ return (IdOS() == VER_PLATFORM_WIN32_NT);
+}
+
+
+/* simulate flock by locking a range on the file */
+
+
+#define LK_ERR(f,i) ((f) ? (i = 0) : (errno = GetLastError()))
+#define LK_LEN 0xffff0000
+
+int
+flock(int fd, int oper)
+{
+ OVERLAPPED o;
+ int i = -1;
+ HANDLE fh;
+
+ fh = (HANDLE)_get_osfhandle(fd);
+ memset(&o, 0, sizeof(o));
+
+ if(IsWinNT()) {
+ switch(oper) {
+ case LOCK_SH: /* shared lock */
+ LK_ERR(LockFileEx(fh, 0, 0, LK_LEN, 0, &o),i);
+ break;
+ case LOCK_EX: /* exclusive lock */
+ LK_ERR(LockFileEx(fh, LOCKFILE_EXCLUSIVE_LOCK, 0, LK_LEN, 0, &o),i);
+ break;
+ case LOCK_SH|LOCK_NB: /* non-blocking shared lock */
+ LK_ERR(LockFileEx(fh, LOCKFILE_FAIL_IMMEDIATELY, 0, LK_LEN, 0, &o),i);
+ break;
+ case LOCK_EX|LOCK_NB: /* non-blocking exclusive lock */
+ LK_ERR(LockFileEx(fh,
+ LOCKFILE_EXCLUSIVE_LOCK|LOCKFILE_FAIL_IMMEDIATELY,
+ 0, LK_LEN, 0, &o),i);
+ if(errno == EDOM) errno = EWOULDBLOCK;
+ break;
+ case LOCK_UN: /* unlock lock */
+ if (UnlockFileEx(fh, 0, LK_LEN, 0, &o)) {
+ i = 0;
+ }
+ else {
+ /* GetLastError() must returns `ERROR_NOT_LOCKED' */
+ errno = EWOULDBLOCK;
+ }
+ if(errno == EDOM) errno = EWOULDBLOCK;
+ break;
+ default: /* unknown */
+ errno = EINVAL;
+ break;
+ }
+ }
+ else if(IsWin95()) {
+ switch(oper) {
+ case LOCK_EX:
+ while(i == -1) {
+ LK_ERR(LockFile(fh, 0, 0, LK_LEN, 0), i);
+ if(errno != EDOM && i == -1) break;
+ }
+ break;
+ case LOCK_EX | LOCK_NB:
+ LK_ERR(LockFile(fh, 0, 0, LK_LEN, 0), i);
+ if(errno == EDOM) errno = EWOULDBLOCK;
+ break;
+ case LOCK_UN:
+ LK_ERR(UnlockFile(fh, 0, 0, LK_LEN, 0), i);
+ if(errno == EDOM) errno = EWOULDBLOCK;
+ break;
+ default:
+ errno = EINVAL;
+ break;
+ }
+ }
+ return i;
+}
+
+#undef LK_ERR
+#undef LK_LEN
+
+
#undef const
FILE *fdopen(int, const char *);
@@ -467,7 +570,7 @@ mypopen (char *cmd, char *mode) fd = _open_osfhandle((long)hOutFile, (_O_WRONLY | pipemode));
CloseHandle(hInFile);
DuplicateHandle(GetCurrentProcess(), hStdin,
- GetCurrentProcess(), &hDummy,
+ GetCurrentProcess(), &hDummy,
0, TRUE, (DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE)
);
}
diff --git a/missing/nt.h b/missing/nt.h index cf9f4cb00a..70132b4577 100644 --- a/missing/nt.h +++ b/missing/nt.h @@ -147,6 +147,7 @@ extern int NtMakeCmdVector(char *, char ***, int); extern char *NtGetLib(void); extern char *NtGetBin(void); extern FILE *mypopen(char *, char *); +extern int flock(int fd, int oper); // // define this so we can do inplace editing @@ -190,6 +191,14 @@ extern char *mystrerror(int); #define HAVE_WAITPID 1 #define HAVE_GETCWD 1 +#define LOCK_SH 1 +#define LOCK_EX 2 +#define LOCK_NB 4 +#define LOCK_UN 8 +#ifndef EWOULDBLOCK +#define EWOULDBLOCK 10035 /* EBASEERR + 35 (winsock.h) */ +#endif + #ifdef popen #undef popen #define popen mypopen diff --git a/missing/x68.c b/missing/x68.c new file mode 100644 index 0000000000..8fd9c3e879 --- /dev/null +++ b/missing/x68.c @@ -0,0 +1,12 @@ +#include "config.h" + +#if !HAVE_SELECT +#include "x68/select.c" +#endif +#if MISSING__DTOS18 +#include "x68/_dtos18.c" +#endif +#if MISSING_FCONVERT +#include "x68/_round.c" +#include "x68/fconvert.c" +#endif @@ -191,6 +191,7 @@ mode, ruby executes .ne 1 \& $F = $_.split at beginning of each loop. +.fi .TP .B -c causes ruby to check the syntax of the script and exit without @@ -225,6 +226,7 @@ example: \& MATZ \& % cat /tmp/junk.bak \& matz +.fi .TP .B -I directory used to tell ruby where to load the library scripts. Directory @@ -244,6 +246,7 @@ sed -n or awk. \& while gets \& ... \& end +.fi .TP .B -p acts mostly same as -n switch, but print the value of variable @@ -253,6 +256,7 @@ example: .ne 2 \& % echo matz | ruby -p -e '$_.tr! "a-z", "A-Z"' \& MATZ +.fi .TP .B -r filename causes ruby to load the file using [4]require. It is useful @@ -269,6 +273,7 @@ example: \& #! /usr/local/bin/ruby -s \& # prints "true" if invoked with `-xyz' switch. \& print "true\n" if $xyz +.fi .TP .B -S makes ruby uses the PATH environment variable to search for @@ -278,8 +283,9 @@ manner: .nf .ne 2 \& #! /usr/local/bin/ruby -\& # This line makes the next one a comment in ruby \ +\& # This line makes the next one a comment in ruby \\ \& exec /usr/local/bin/ruby -S $0 $* +.fi On some systems $0 does not always contain the full pathname, so you need -S switch to tell ruby to search for the script if necessary. @@ -595,6 +595,11 @@ ruby_prog_init() if (rb_safe_level() == 0) { addpath(getenv("RUBYLIB")); } + +#ifdef RUBY_THIN_ARCHLIB + addpath(RUBY_THIN_ARCHLIB); +#endif + #ifdef RUBY_ARCHLIB addpath(RUBY_ARCHLIB); #endif diff --git a/sample/cbreak.rb b/sample/cbreak.rb deleted file mode 100644 index cbb15d2f41..0000000000 --- a/sample/cbreak.rb +++ /dev/null @@ -1,36 +0,0 @@ -# ioctl example works on Sun - -CBREAK = 0x00000002 -ECHO = 0x00000008 -TIOCGETP = 0x40067408 -TIOCSETP = 0x80067409 - -def cbreak () - set_cbreak(TRUE) -end - -def cooked () - set_cbreak(FALSE) -end - -def set_cbreak (on) - tty = "\0" * 256 - STDIN.ioctl(TIOCGETP, tty) - ttys = tty.unpack("C4 S") - if on - ttys[4] |= CBREAK - ttys[4] &= ~ECHO - else - ttys[4] &= ~CBREAK - ttys[4] |= ECHO - end - tty = ttys.pack("C4 S") - STDIN.ioctl(TIOCSETP, tty) -end -cbreak(); - -print("this is no-echo line: "); -readline().print -cooked(); -print("this is echo line: "); -readline() @@ -1,2 +1,2 @@ -#define RUBY_VERSION "1.0-971003" -#define VERSION_DATE "97/10/03" +#define RUBY_VERSION "1.0-971015" +#define VERSION_DATE "97/10/15" diff --git a/win32/Makefile b/win32/Makefile index 4927e05631..b5a9d140cf 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -20,7 +20,7 @@ PURIFY = CFLAGS = -nologo -DNT=1 -Zi -MD
LDFLAGS = $(CFLAGS) -Fm -MD
LIBS = $(EXTLIBS) advapi32.lib wsock32.lib
-MISSING = crypt.obj flock.obj setenv.obj alloca.obj nt.obj
+MISSING = crypt.obj setenv.obj alloca.obj nt.obj
prefix =
binprefix =
diff --git a/win32/config.h b/win32/config.h index d43cfdb535..cf5cb332bf 100644 --- a/win32/config.h +++ b/win32/config.h @@ -51,7 +51,7 @@ #define S_IREAD _S_IREAD #define S_IWRITE _S_IWRITE #define S_IEXEC _S_IEXEC -#define S_ISFIFO _S_ISFIFO +#define S_IFIFO _S_IFIFO #define UIDTYPE int #define GIDTYPE int |