Re: Linuxthreads patch for STk-3.1.1 (plus all other known patches)

From: David Fox <fox_at_hoopla.mrl.nyu.edu>
Date: 25 Nov 1996 12:05:01 -0500

Erick wrote:

] > David Fox writes
] > This patch is an addendum to my profiling patch, it causes STk to
] > leave SIGUSR1 and SIGUSR2 alone so that linuxthreads can function
] > properly. For your convenience I'll include all my patches to 3.1.1
] > below, not just the signal patch.
]
] Does it mean that you have implemented threads in STk?

Well, no. But you could run a C procedure in a thread while STk is
executing. To load an image maybe. I guess it would be a fair bit of
work to make STk thread safe. You'd need to protect global variables
like the free list. It would be worthwhile, though.

(I lost a bunch of messages too, because we changed our domain.
I'll post my patch file again just in case.)

diff -ru STk-3.1/Tk/configure~ STk-3.1/Tk/configure
--- STk-3.1/Tk/configure~ Mon Jul 22 08:20:53 1996
+++ STk-3.1/Tk/configure Tue Aug 13 16:31:21 1996
_at_@ -1,5 +1,5 @@
 #! /bin/sh
 
-cd unix; configure
+cd unix; ./configure
 
 # Simple no?
diff -ru STk-3.1/Tk/Makefile~ STk-3.1/Tk/Makefile
--- STk-3.1/Tk/Makefile~ Wed Jul 24 09:00:50 1996
+++ STk-3.1/Tk/Makefile Tue Aug 13 16:30:31 1996
_at_@ -15,7 +15,7 @@
         (cd $(FLAVOR); $(MAKE) install)
 
 install.libs:
- (cd $(FLAVOR); $(MAKE) install.libs)
+ (cd $(FLAVOR); $(MAKE) install-libraries)
 
 clean:
         (cd $(FLAVOR); $(MAKE) clean)
diff -ru STk-3.1/Lib/posix.stk~ STk-3.1/Lib/posix.stk
--- STk-3.1/Lib/posix.stk~ Tue Jul 23 03:15:52 1996
+++ STk-3.1/Lib/posix.stk Tue Aug 13 16:41:07 1996
_at_@ -37,6 +37,6 @@
 ;;;;
 ;;;; Backward compatibility
 ;;;;
-(define posix-access? posix-access)
+(define posix-access posix-access?)
 
 (provide "posix")
diff -ru STk-3.1/Tcl/Makefile.in~ STk-3.1/Tcl/Makefile.in~
--- STk-3.1/Tcl/Makefile.in~ Mon Jul 22 09:03:20 1996
+++ STk-3.1/Tcl/Makefile.in Tue Aug 13 16:43:04 1996
_at_@ -30,6 +30,8 @@
         -if [ ! -d $(execdir) ] ; then mkdir -p $(execdir); fi
         $(CP) libtcl.a $(execdir)
         $(RANLIB) $(execdir)/libtcl.a
+ $(CP) libevtcl.a $(execdir)
+ $(RANLIB) $(execdir)/libevtcl.a
         -if [ ! -d $(incdir) ] ; then mkdir -p $(incdir); fi
         $(CP) tcl.h tclInt.h tclRegexp.h $(incdir)
  
diff -ru STk-3.1/Lib/Makefile~ STk-3.1/Lib/Makefile
--- STk-3.1/Lib/Makefile~ Mon Jul 22 09:50:06 1996
+++ STk-3.1/Lib/Makefile Tue Aug 13 17:09:29 1996
_at_@ -18,7 +18,7 @@
         -if [ ! -d $(SITE_SCHEME) ] ; then mkdir -p $(SITE_SCHEME); fi
         -if [ ! -d $(STK_IMAGES) ] ; then mkdir -p $(STK_IMAGES); fi
         -if [ ! -d $(STK_STK) ] ; then mkdir -p $(STK_STK); fi
- for i in *.stk *.stklos prolog.ps STk.init; \
+ for i in *.stk prolog.ps STk.init; \
         do \
           sed -e 's=/usr/local/lib/stk=$(libdir)=' \
               -e 's=/usr/local/bin=$(bindir)=' $$i > $(STK_STK)/$$i ;\
diff -ru STk-3.1/configure.in~ STk-3.1/configure.in
--- STk-3.1/configure.in~ Sun Jul 21 16:35:38 1996
+++ STk-3.1/configure.in Wed Aug 14 05:45:08 1996
_at_@ -16,6 +16,7 @@
   Linux*)
           case $version in
             1.*) version=1.X;;
+ 2.*) version=1.X;;
           esac
           case $machine in
             i*86) machine=ix86;;
diff -ru STk-3.1/configure~ STk-3.1/configure
--- STk-3.1/configure~ Sun Jul 21 16:41:46 1996
+++ STk-3.1/configure Wed Aug 14 05:45:00 1996
_at_@ -554,6 +554,7 @@
   Linux*)
           case $version in
             1.*) version=1.X;;
+ 2.*) version=1.X;;
           esac
           case $machine in
             i*86) machine=ix86;;
diff -ru STk-3.1/Tk/unix/Makefile.in~ STk-3.1/Tk/unix/Makefile.in
--- STk-3.1/Tk/unix/Makefile.in~ Wed Jul 24 12:47:12 1996
+++ STk-3.1/Tk/unix/Makefile.in Wed Aug 14 06:27:40 1996
_at_@ -46,16 +46,16 @@
 SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TK_LIBRARY)
 
 # Directory in which to install the archive libtk.a:
-LIB_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/lib
+LIB_INSTALL_DIR = $(INSTALL_ROOT)$(execdir)
 
 # Directory in which to install the program wish:
-BIN_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/bin
+BIN_INSTALL_DIR = $(INSTALL_ROOT)$(execdir)
 
 # Directory from which the program wish should be referenced by scripts:
 BIN_DIR = $(exec_prefix)/bin
 
 # Directory in which to install the include file tk.h:
-INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/include
+INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(incdir)
 
 # Top-level directory for manual entries:
 MAN_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/man
_at_@ -299,7 +299,7 @@
 
 install: all
 
-install-binaries: libtk.a wish
+install-binaries: wish
         _at_for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
             do \
             if [ ! -d $$i ] ; then \
_at_@ -309,15 +309,16 @@
                 else true; \
                 fi; \
             done;
- _at_echo "Installing libtk.a"
- _at_$(INSTALL_DATA) libtk.a $(LIB_INSTALL_DIR)/libtk$(VERSION).a
- _at_$(RANLIB) $(LIB_INSTALL_DIR)/libtk$(VERSION).a
         _at_echo "Installing wish"
         _at_$(INSTALL_PROGRAM) wish $(BIN_INSTALL_DIR)/wish$(VERSION)
+ for i in $(SRC_DIR)/library/*.tcl $(SRC_DIR)/library/tclIndex $(SRC_DIR)/library/prolog.ps $(UNIX_DIR)/tkAppInit.c; \
+ do \
+ echo "Installing $$i"; \
+ $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
+ done;
 
-install-libraries:
- _at_for i in $(INSTALL_ROOT)$(prefix)/lib $(INCLUDE_INSTALL_DIR) \
- $(SCRIPT_INSTALL_DIR) ; \
+install-libraries: libtk.a
+ _at_for i in $(LIB_INSTALL_DIR) $(INCLUDE_INSTALL_DIR) ; \
             do \
             if [ ! -d $$i ] ; then \
                 echo "Making directory $$i"; \
_at_@ -328,11 +329,9 @@
             done;
         _at_echo "Installing tk.h"
         _at_$(INSTALL_DATA) $(GENERIC_DIR)/tk.h $(INCLUDE_INSTALL_DIR)
- for i in $(SRC_DIR)/library/*.tcl $(SRC_DIR)/library/tclIndex $(SRC_DIR)/library/prolog.ps $(UNIX_DIR)/tkAppInit.c; \
- do \
- echo "Installing $$i"; \
- $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
- done;
+ _at_echo "Installing libtk.a"
+ _at_$(INSTALL_DATA) libtk.a $(LIB_INSTALL_DIR)/libtk$(VERSION).a
+ _at_$(RANLIB) $(LIB_INSTALL_DIR)/libtk$(VERSION).a
 
 install-demos:
         _at_for i in $(INSTALL_ROOT)$(prefix)/lib $(SCRIPT_INSTALL_DIR) \
diff -ru STk-3.1/Src/error.c~ STk-3.1/Src/error.c
--- STk-3.1/Src/error.c~ Sun Jun 2 15:49:53 1996
+++ STk-3.1/Src/error.c Sun Sep 22 05:57:47 1996
_at_@ -68,7 +68,12 @@
                          STk_uncode(x)));
       else {
         if (err_counter>1)
+#if 0
           fprintf(STk_stderr, "WARNING: %s is buggy!!\n", REPORT_ERROR);
+#else
+ {fprintf(STk_stderr, "WARNING: %s is buggy!!\n", REPORT_ERROR);
+ abort();}
+#endif
         fprintf(STk_stderr, "\n%s %s", head, message);
         if (NNULLP(x)) {
           fprintf(STk_stderr, ": ");
diff -ru STk-3.1/Src/unix.c~ STk-3.1/Src/unix.c
--- STk-3.1/Src/unix.c~ Sun Jul 21 11:22:37 1996
+++ STk-3.1/Src/unix.c Thu Oct 17 12:39:59 1996
_at_@ -445,6 +445,13 @@
     return;
   }
 
+ if (exec[0] == '.' || index(exec, '/')) {
+ getcwd(path, MAX_PATH_LENGTH);
+ strcat(path, "/");
+ strcat(path, exec);
+ return;
+ }
+
 #ifdef FREEBSD
   /* I don't understand why this is needed */
   if (access(path, X_OK) == 0) {
diff -ru STk-3.1/Src/signal.c.orig STk-3.1/Src/signal.c
--- STk-3.1/Src/signal.c.orig Sun Jul 14 06:34:09 1996
+++ STk-3.1/Src/signal.c Tue Nov 19 13:30:22 1996
_at_@ -185,6 +185,24 @@
       0) ? Ntruth : NIL;
     /* Treat specially SIGINT (^C) */
     signals[SIGINT] = NIL;
+#ifdef SIGPROF
+ if (i == SIGPROF) {
+ signals[SIGPROF] = NIL;
+ continue; /* Don't interfere with the profiler */
+ }
+#endif
+#ifdef SIGUSR1
+ if (i == SIGUSR1) {
+ signals[SIGUSR1] = NIL;
+ continue; /* Don't interfere with linuxthreads */
+ }
+#endif
+#ifdef SIGUSR1
+ if (i == SIGUSR1) {
+ signals[SIGUSR1] = NIL;
+ continue; /* Don't interfere with linuxthreads */
+ }
+#endif
 #ifdef HAVE_SIGACTION
     {
       /* Use the secure Posix.1 way */
diff -ru STk-3.1/Src/primitives.c~ STk-3.1/Src/primitives.c
--- STk-3.1/Src/primitives.c~ Sun Jun 16 17:00:58 1996
+++ STk-3.1/Src/primitives.c Tue Nov 12 05:53:55 1996
_at_@ -410,10 +410,8 @@
   {"uncode", tc_subr_1, STk_uncode}, /* + */
   {"exit", tc_subr_0_or_1, STk_quit_interpreter}, /* + */
 
-#ifdef USE_TK
   {"trace-var", tc_subr_2, STk_trace_var}, /* + */
   {"untrace-var", tc_subr_1, STk_untrace_var}, /* + */
-#endif
 
   /**** Undocumented primitives */
   {"%get-eval-stack", tc_subr_0, STk_get_eval_stack},
diff -ru STk-3.1/VERSION~ STk-3.1/VERSION
--- STk-3.1/VERSION~ Sun Jul 21 16:48:41 1996
+++ STk-3.1/VERSION Tue Nov 12 06:43:07 1996
_at_@ -1 +1 @@
-VERSION=3.1
+VERSION=3.1.1
diff -ru STk-3.1/Lib/process.stk~ STk-3.1/Lib/process.stk
--- STk-3.1/Lib/process.stk~ Sun Jul 21 12:41:57 1996
+++ STk-3.1/Lib/process.stk Tue Nov 12 09:54:35 1996
_at_@ -22,6 +22,6 @@
     ;; Process module is in the core interpreter
     (%init-process)
     ;; Try to load it dynamically
- (load (sting-append "process." *shared-suffix*)))
+ (load (string-append "process." *shared-suffix*)))
 
 (provide "process")

-- 
David Fox	   http://found.cs.nyu.edu/fox		xoF divaD
NYU Media Research Lab   fox_at_cs.nyu.edu    baL hcraeseR aideM UYN
Received on Mon Nov 25 1996 - 17:59:51 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST