Skip to content

Commit

Permalink
version 1.0-971015
Browse files Browse the repository at this point in the history
https://cache.ruby-lang.org/pub/ruby/1.0/ruby-1.0-971015.tar.gz

Wed Oct 15 18:08:37 1997  Yukihiro Matsumoto  <matz@netlab.co.jp>

	* version 1.0-971015
  • Loading branch information
matz authored and k0kubun committed Aug 17, 2019
1 parent 7ad1988 commit 2a4ba10
Show file tree
Hide file tree
Showing 20 changed files with 222 additions and 58 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,3 +1,7 @@
Wed Oct 15 18:08:37 1997 Yukihiro Matsumoto <matz@netlab.co.jp>

* version 1.0-971015

Fri Oct 3 10:51:10 1997 Yukihiro Matsumoto <matz@netlab.co.jp>

* version 1.0-971003
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion config.guess
Expand Up @@ -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 ;;
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion config.sub
Expand Up @@ -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* \
Expand Down
58 changes: 53 additions & 5 deletions configure.in
Expand Up @@ -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.
Expand Down Expand Up @@ -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\
Expand Down Expand Up @@ -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 ;;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion error.c
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion eval.c
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions ext/extmk.rb.in
Expand Up @@ -287,6 +287,11 @@ $(TARGET): $(OBJS)
mfile.printf "\
$(TARGET): $(OBJS)
ar cru $(TARGET) $(OBJS)
"
elsif PLATFORM =~ "-nextstep"
mfile.printf "\
$(TARGET): $(OBJS)
cc -r $(CFLAGS) -o $(TARGET) $(OBJS)
"
else
mfile.printf "\
Expand Down
9 changes: 5 additions & 4 deletions io.c
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion main.c
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion 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
Expand All @@ -14,6 +14,7 @@
*/

#include <sys/stat.h>
#include <errno.h>
/*
* Make a directory.
*/
Expand Down
105 changes: 104 additions & 1 deletion missing/nt.c
Expand Up @@ -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 *);

Expand Down Expand Up @@ -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)
);
}
Expand Down
9 changes: 9 additions & 0 deletions missing/nt.h
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions 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

0 comments on commit 2a4ba10

Please sign in to comment.