Tcl Source Code

Artifact [a8b6972efc]
Login

Artifact a8b6972efc3bee9611de30781410d1f045834625:

Attachment "tcl8.4.1.patch.3.txt" to ticket [701232ffff] added by nobody 2003-03-11 06:32:29.
diff -urN ../tcl8.4.1/generic/tclPosixStr.c tcl8.4.1/generic/tclPosixStr.c
--- ../tcl8.4.1/generic/tclPosixStr.c	Wed May 29 02:14:21 2002
+++ tcl8.4.1/generic/tclPosixStr.c	Sun Dec 22 16:02:41 2002
@@ -945,7 +945,9 @@
 	case SIGALRM: return "SIGALRM";
 #endif
 #ifdef SIGBUS
+#  if !defined(SIGSEGV) || (SIGBUS != SIGSEGV)
 	case SIGBUS: return "SIGBUS";
+#  endif
 #endif
 #ifdef SIGCHLD
 	case SIGCHLD: return "SIGCHLD";
@@ -1077,7 +1079,9 @@
 	case SIGALRM: return "alarm clock";
 #endif
 #ifdef SIGBUS
+#  if !defined(SIGSEGV) || (SIGBUS != SIGSEGV)
 	case SIGBUS: return "bus error";
+#  endif
 #endif
 #ifdef SIGCHLD
 	case SIGCHLD: return "child status changed";
diff -urN ../tcl8.4.1/unix/tcl.m4 tcl8.4.1/unix/tcl.m4
--- ../tcl8.4.1/unix/tcl.m4	Tue Oct 22 21:18:39 2002
+++ tcl8.4.1/unix/tcl.m4	Sun Dec 22 16:44:51 2002
@@ -914,6 +914,15 @@
 		fi
 	    fi
 	    ;;
+	BeOS*)
+	    SHLIB_CFLAGS="-fPIC"
+	    SHLIB_LD="cc -nostart"
+	    SHLIB_LD_LIBS='${LIBS}'
+	    SHLIB_SUFFIX=".so"
+	    DL_OBJS="tclLoadDl.o"
+	    DL_LIBS="-ldl"
+	    LDFLAGS="-lsocket -lbind"
+	    ;;
 	BSD/OS-2.1*|BSD/OS-3*)
 	    SHLIB_CFLAGS=""
 	    SHLIB_LD="shlicc -r"
@@ -2314,6 +2323,13 @@
     AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname,
 	    [LIBS="$LIBS -lnsl"])])
     
+    #--------------------------------------------------------------------
+    # Check for inet_ntoa in -lbind, for BeOS (which also needs -lsocket,
+    # even if the network functions are in -lnet which is always linked 
+    # to, for compatibility.
+    #--------------------------------------------------------------------
+    AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"])
+
     # Don't perform the eval of the libraries here because DL_LIBS
     # won't be set until we call SC_CONFIG_CFLAGS
 
diff -urN ../tcl8.4.1/unix/tclUnixChan.c tcl8.4.1/unix/tclUnixChan.c
--- ../tcl8.4.1/unix/tclUnixChan.c	Tue Sep  3 04:01:25 2002
+++ tcl8.4.1/unix/tclUnixChan.c	Sun Dec 22 16:02:41 2002
@@ -54,8 +54,15 @@
 #   define IOSTATE			struct termios
 #   define GETIOSTATE(fd, statePtr)	tcgetattr((fd), (statePtr))
 #   define SETIOSTATE(fd, statePtr)	tcsetattr((fd), TCSADRAIN, (statePtr))
-#   define GETCONTROL(fd, intPtr)	ioctl((fd), TIOCMGET, (intPtr))
-#   define SETCONTROL(fd, intPtr)	ioctl((fd), TIOCMSET, (intPtr))
+#   ifdef TIOCMGET
+#       define GETCONTROL(fd, intPtr)	ioctl((fd), TIOCMGET, (intPtr))
+#       define SETCONTROL(fd, intPtr)	ioctl((fd), TIOCMSET, (intPtr))
+#   else
+#       if defined(TCSETDTR) && defined(TCSETRTS)
+#           define SETCONTROLDTR(fd, intPtr)	ioctl((fd), TCSETDTR, (intPtr))
+#           define SETCONTROLRTS(fd, intPtr)	ioctl((fd), TCSETRTS, (intPtr))
+#       endif
+#   endif /* TIOCMGET */
     /*
      * TIP #35 introduced a different on exit flush/close behavior that
      * doesn't work correctly with standard channels on all systems.
@@ -1011,7 +1018,9 @@
 	    return TCL_ERROR;
 	}
 
+#ifdef GETCONTROL
 	GETCONTROL(fsPtr->fd, &control);
+#endif
 	while (argc > 1) {
 	    if (Tcl_GetBoolean(interp, argv[1], &flag) == TCL_ERROR) {
 		return TCL_ERROR;
@@ -1024,8 +1033,13 @@
 		    control &= ~TIOCM_DTR;
 		}
 #else /* !TIOCM_DTR */
+#    if defined(TCSETDTR) && defined(TCSETRTS)
+		control = flag;
+		SETCONTROLDTR(fsPtr->fd, &control);
+#    else
 		UNSUPPORTED_OPTION("-ttycontrol DTR");
 		return TCL_ERROR;
+#    endif /* TCSETDTR && TCSETRTS */
 #endif /* TIOCM_DTR */
 	    } else if (strncasecmp(argv[0], "RTS", strlen(argv[0])) == 0) {
 #ifdef TIOCM_RTS
@@ -1035,8 +1049,13 @@
 		    control &= ~TIOCM_RTS;
 		}
 #else /* !TIOCM_RTS*/
+#    if defined(TCSETDTR) && defined(TCSETRTS)
+		control = flag;
+		SETCONTROLRTS(fsPtr->fd, &control);
+#    else
 		UNSUPPORTED_OPTION("-ttycontrol RTS");
 		return TCL_ERROR;
+#    endif /* TCSETDTR && TCSETRTS */
 #endif /* TIOCM_RTS*/
 	    } else if (strncasecmp(argv[0], "BREAK", strlen(argv[0])) == 0) {
 #ifdef SETBREAK
@@ -1055,8 +1074,9 @@
 	    }
 	    argc -= 2, argv += 2;
 	} /* while (argc > 1) */
-
+#ifdef GETCONTROL
 	SETCONTROL(fsPtr->fd, &control);
+#endif
 	return TCL_OK;
     }
 
@@ -1170,10 +1190,15 @@
      * but not returned by unnamed [fconfigure chan]
      */
     if ((len > 4) && (strncmp(optionName, "-ttystatus", len) == 0)) {
+#ifdef GETCONTROL
 	int status;
 	valid = 1;
 	GETCONTROL(fsPtr->fd, &status);
 	TtyModemStatusStr(status, dsPtr);
+#else
+	UNSUPPORTED_OPTION("-ttystatus");
+	valid = 0;
+#endif /* GETCONTROL */
     }
 #endif /* USE_TERMIOS */
 
diff -urN ../tcl8.4.1/unix/tclUnixPort.h tcl8.4.1/unix/tclUnixPort.h
--- ../tcl8.4.1/unix/tclUnixPort.h	Tue Jul  2 19:10:33 2002
+++ tcl8.4.1/unix/tclUnixPort.h	Sun Dec 22 16:02:41 2002
@@ -406,6 +406,15 @@
 #endif
 
 /*
+ * Make sure that P_tmpdir is defined.
+ * (BeOS needs this)
+ */
+
+#ifndef P_tmpdir
+#   define P_tmpdir "/tmp"
+#endif
+
+/*
  * The following macro defines the type of the mask arguments to
  * select:
  */