Tcl Source Code

Artifact [3218071bde]
Login

Artifact 3218071bdef77fcf0afff68bcc103b97503d73c3:

Attachment "patch" to ticket [942954ffff] added by aotto1968 2004-04-28 13:02:04.
diff -C 2 -r -x configure ./ChangeLog new/ChangeLog
*** ./ChangeLog	2004-04-27 12:43:49.000000000 +0200
--- new/ChangeLog	2004-03-01 21:18:43.000000000 +0100
***************
*** 1,16 ****
- 2004-04-27  Andreas Otto <[email protected]>
- 
- 	* adding support for Interix to build as native unix appli-
-           cation in the Interix - Windows (XP) subsystem
- 	* tests/fileName.test
- 	* tests/http.test
- 	* tests/socket.test
- 	* unix/configure.in
- 	* unix/Makefile.in
- 	* unix/tcl.m4
- 	* unix/tclUnixChan.c
- 	* unix/tclUnixInit.c
- 	* unix/tclUnixTime.c
- 
  2004-03-01  Don Porter	<[email protected]>
  
--- 1,2 ----
diff -C 2 -r -x configure ./tests/fileName.test new/tests/fileName.test
*** ./tests/fileName.test	2004-04-27 09:44:26.000000000 +0200
--- new/tests/fileName.test	2003-10-06 11:49:20.000000000 +0200
***************
*** 21,29 ****
  tcltest::testConstraint testtranslatefilename [string equal testtranslatefilename [info commands testtranslatefilename]]
  
- # Interix is unix but has the NTFS filesytem.
- if {$tcl_platform(os) ne "Interix"} {
-     configure -constraints notInterix
- }
- 
  global env
  if {[tcltest::testConstraint testsetplatform]} {
--- 21,24 ----
***************
*** 1871,1879 ****
      glob ~ouster/.csh*
  } "/home/ouster/.cshrc"
- 
- # Interx has NTFS as filesystem and is not been able to create 
- # a file like "odd\\\[\]*?\{\}name"
  catch {close [open globTest/odd\\\[\]*?\{\}name w]}
! test filename-15.6 {unix specific globbing} {unixOnly notInterix} {
      global env
      set temp $env(HOME)
--- 1866,1871 ----
      glob ~ouster/.csh*
  } "/home/ouster/.cshrc"
  catch {close [open globTest/odd\\\[\]*?\{\}name w]}
! test filename-15.6 {unix specific globbing} {unixOnly} {
      global env
      set temp $env(HOME)
Nur in new/tests: fileName.test.orig.
diff -C 2 -r -x configure ./tests/http.test new/tests/http.test
*** ./tests/http.test	2004-04-27 09:36:12.000000000 +0200
--- new/tests/http.test	2003-07-18 21:41:17.000000000 +0200
***************
*** 20,28 ****
  }
  
- # Interix is unix with some windows-limitations
- if {$tcl_platform(os) ne "Interix"} {
-     configure -constraints notInterix
- }
- 
  if {[catch {package require http 2} version]} {
      if {[info exists http2]} {
--- 20,23 ----
***************
*** 440,446 ****
  #	after the connection "completes" but the socket is bad
  
! # Interix (WinSocket) does not create an error-msg on async sockets
! 
! test http-4.14 {http::Event} {notInterix} {
      set code [catch {
  	set token [http::geturl $badurl/?timeout=10 -timeout 10000 -command {#}]
--- 435,439 ----
  #	after the connection "completes" but the socket is bad
  
! test http-4.14 {http::Event} {
      set code [catch {
  	set token [http::geturl $badurl/?timeout=10 -timeout 10000 -command {#}]
Nur in new/tests: http.test.orig.
diff -C 2 -r -x configure ./tests/socket.test new/tests/socket.test
*** ./tests/socket.test	2004-04-27 09:43:35.000000000 +0200
--- new/tests/socket.test	2004-02-26 00:38:17.000000000 +0100
***************
*** 66,74 ****
  namespace import -force ::tcltest::*
  
- # Interix is unix with some windows-limitations
- if {$tcl_platform(os) ne "Interix"} {
-     configure -constraints notInterix
- }
- 
  # Some tests require the testthread and exec commands
  testConstraint testthread [llength [info commands testthread]]
--- 66,69 ----
***************
*** 522,527 ****
  } -result {done 50}
  set path(script) [makeFile {} script]
! #Interix (WinSocket) allows two server-connections on the same port
! test socket-2.9 {socket conflict} {socket stdio notInterix} {
      set s [socket -server accept 0]
      file delete $path(script)
--- 517,521 ----
  } -result {done 50}
  set path(script) [makeFile {} script]
! test socket-2.9 {socket conflict} {socket stdio} {
      set s [socket -server accept 0]
      file delete $path(script)
***************
*** 590,595 ****
  
  
! #Interix (WinSocket) allows two server-connections on the same port
! test socket-3.1 {socket conflict} {socket stdio notInterix} {
      file delete $path(script)
      set f [open $path(script) w]
--- 584,588 ----
  
  
! test socket-3.1 {socket conflict} {socket stdio} {
      file delete $path(script)
      set f [open $path(script) w]
***************
*** 744,750 ****
  } ok
  
- #Interix (WinSocket) allows connections to low-ports
  test socket-5.1 {byte order problems, socket numbers, htons} \
! 	{socket unixOnly notRoot notInterix} {
      set x {couldn't open socket: not owner}
      if {![catch {socket -server dodo 0x1} msg]} {
--- 737,742 ----
  } ok
  
  test socket-5.1 {byte order problems, socket numbers, htons} \
! 	{socket unixOnly notRoot} {
      set x {couldn't open socket: not owner}
      if {![catch {socket -server dodo 0x1} msg]} {
***************
*** 762,768 ****
      set x
  } {couldn't open socket: port number too high}
- #Interix (WinSocket) allows connections to low-ports
  test socket-5.3 {byte order problems, socket numbers, htons} \
! 	{socket unixOnly notRoot notInterix} {
      set x {couldn't open socket: not owner}
      if {![catch {socket -server dodo 21} msg]} {
--- 754,759 ----
      set x
  } {couldn't open socket: port number too high}
  test socket-5.3 {byte order problems, socket numbers, htons} \
! 	{socket unixOnly notRoot} {
      set x {couldn't open socket: not owner}
      if {![catch {socket -server dodo 21} msg]} {
***************
*** 1159,1165 ****
      set cnt
  } 50
! # Macintosh (and Interix) sockets can have more than one server per port
! if {$tcl_platform(platform) == "macintosh" || 
!     $tcl_platform(os)       == "Interix" } {
      set conflictResult {0 2836}
  } else {
--- 1150,1155 ----
      set cnt
  } 50
! # Macintosh sockets can have more than one server per port
! if {$tcl_platform(platform) == "macintosh"} {
      set conflictResult {0 2836}
  } else {
Nur in new/tests: socket.test.orig.
diff -C 2 -r -x configure ./unix/configure.in new/unix/configure.in
*** ./unix/configure.in	2004-04-22 10:57:52.000000000 +0200
--- new/unix/configure.in	2004-03-02 00:58:59.000000000 +0100
***************
*** 131,135 ****
  #	pernicious.  If "fd_set" isn't defined anywhere then set a
  #	special flag.
- #       Interix defines fd_set in sys/times.h included by sys/select.h
  #--------------------------------------------------------------------
  
--- 131,134 ----
***************
*** 141,155 ****
  tk_ok=$tcl_cv_type_fd_set
  if test $tcl_cv_type_fd_set = no; then
-     AC_MSG_CHECKING([for fd_set in sys/select])
-     AC_CACHE_VAL(tcl_cv_type_fd_set_in_select,
- 	AC_TRY_COMPILE([#include <sys/select.h>],[fd_set readMask, writeMask;],
- 	    tcl_cv_type_fd_set_in_select=yes, tcl_cv_type_fd_set_in_select=no))
-     AC_MSG_RESULT($tcl_cv_type_fd_set_in_select)
-     if test $tcl_cv_type_fd_set_in_select = yes; then
- 	AC_DEFINE(HAVE_SYS_SELECT_H)
- 	tk_ok=yes
-     fi
- fi
- if test $tcl_cv_type_fd_set = no && test $tcl_cv_type_fd_set_in_select = no ; then
      AC_MSG_CHECKING([for fd_mask in sys/select])
      AC_CACHE_VAL(tcl_cv_grep_fd_mask,
--- 140,143 ----
***************
*** 209,215 ****
  else
      AC_MSG_RESULT([broken, using substitute])
!     ## new with 2.58
!     ## LIBOBJS="$LIBOBJS strstr.o"
!     AC_LIBOBJ([strstr])
  fi
  
--- 197,201 ----
  else
      AC_MSG_RESULT([broken, using substitute])
!     LIBOBJS="$LIBOBJS strstr.o"
  fi
  
***************
*** 236,240 ****
  if test "$tcl_ok" = 0; then
      test -n "$verbose" && echo "	Adding strtoul.o."
!     AC_LIBOBJ([strtoul])
  fi
  
--- 222,226 ----
  if test "$tcl_ok" = 0; then
      test -n "$verbose" && echo "	Adding strtoul.o."
!     LIBOBJS="$LIBOBJS strtoul.o"
  fi
  
***************
*** 260,264 ****
  if test "$tcl_ok" = 0; then
      test -n "$verbose" && echo "	Adding strtod.o."
!     AC_LIBOBJ([strtod])
  fi
  
--- 246,250 ----
  if test "$tcl_ok" = 0; then
      test -n "$verbose" && echo "	Adding strtod.o."
!     LIBOBJS="$LIBOBJS strtod.o"
  fi
  
***************
*** 295,299 ****
  AC_MSG_RESULT($ac_cv_type_socklen_t)
  if test $ac_cv_type_socklen_t = no; then
!     SC_SOCKLEN_TYPE
  fi
  
--- 281,285 ----
  AC_MSG_RESULT($ac_cv_type_socklen_t)
  if test $ac_cv_type_socklen_t = no; then
!     AC_DEFINE(socklen_t, unsigned)
  fi
  
***************
*** 342,346 ****
  fi
  if test "$tcl_ok" = 0; then
!     AC_LIBOBJ([strncasecmp])
  fi
  
--- 328,332 ----
  fi
  if test "$tcl_ok" = 0; then
!     LIBOBJS="$LIBOBJS strncasecmp.o"
  fi
  
Nur in new/unix: configure.in.orig.
diff -C 2 -r -x configure ./unix/Makefile.in new/unix/Makefile.in
*** ./unix/Makefile.in	2004-04-27 10:28:23.000000000 +0200
--- new/unix/Makefile.in	2004-03-02 00:58:59.000000000 +0100
***************
*** 730,739 ****
  	rm -f *.a *.o libtcl* core errs *~ \#* TAGS *.E a.out \
  		errors tclsh tcltest lib.exp
! 	-cd dltest ; $(MAKE) clean
  
  distclean: clean
  	rm -rf Makefile config.status config.cache config.log tclConfig.sh \
  		$(PACKAGE).* prototype
! 	-cd dltest ; $(MAKE) distclean
  
  depend:
--- 730,739 ----
  	rm -f *.a *.o libtcl* core errs *~ \#* TAGS *.E a.out \
  		errors tclsh tcltest lib.exp
! 	cd dltest ; $(MAKE) clean
  
  distclean: clean
  	rm -rf Makefile config.status config.cache config.log tclConfig.sh \
  		$(PACKAGE).* prototype
! 	cd dltest ; $(MAKE) distclean
  
  depend:
Nur in new/unix: Makefile.in.orig.
diff -C 2 -r -x configure ./unix/tcl.m4 new/unix/tcl.m4
*** ./unix/tcl.m4	2004-04-22 11:07:35.000000000 +0200
--- new/unix/tcl.m4	2004-03-02 00:58:59.000000000 +0100
***************
*** 901,905 ****
  	    # AIX v<=4.1 has some different flags than 4.2+
  	    if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
! 		AC_LIBOBJ([tclLoadAix])
  		DL_LIBS="-lld"
  	    fi
--- 901,905 ----
  	    # AIX v<=4.1 has some different flags than 4.2+
  	    if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
! 		LIBOBJS="$LIBOBJS tclLoadAix.o"
  		DL_LIBS="-lld"
  	    fi
***************
*** 1155,1159 ****
  	    # Disable inlining only when one of the
  	    # files in compat/*.c is being linked in.
! 	    if test x"${LIB@&t@OBJS}" != x ; then
  	        EXTRA_CFLAGS="${EXTRA_CFLAGS} -fno-inline"
  	    fi
--- 1155,1159 ----
  	    # Disable inlining only when one of the
  	    # files in compat/*.c is being linked in.
! 	    if test x"${LIBOBJS}" != x ; then
  	        EXTRA_CFLAGS="${EXTRA_CFLAGS} -fno-inline"
  	    fi
***************
*** 1565,1582 ****
  	    LD_SEARCH_FLAGS=""
  	    ;;
- 	Interix*)
- 	    AC_CHECK_HEADER(dlfcn.h,, [AC_MSG_ERROR([cannot find dlfcn.h, bailing out])])
- 	    CFLAGS="${CFLAGS} -D_ALL_SOURCE -D_INTERIX"
- 	    CPPFLAGS="${CPPFLAGS} -D_ALL_SOURCE"
- 	    SHLIB_CFLAGS=""
- 	    SHLIB_LD="gcc -shared"
- 	    SHLIB_LD_LIBS='${LIBS}'
- 	    SHLIB_SUFFIX=".so"
- 	    DL_OBJS="tclLoadDl.o"
- 	    DL_LIBS="-ldl"
- 	    LDFLAGS=""
- 	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR} -Wl,--export-dynamic'
- 	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
- 	    ;;
      esac
  
--- 1565,1568 ----
***************
*** 1709,1714 ****
  		ULTRIX-4.*)
  		    ;;
- 		Interix*)
- 		    ;;
  		*)
  		    SHLIB_CFLAGS="-fPIC"
--- 1695,1698 ----
***************
*** 2093,2137 ****
      fi
  ])
- 
- #--------------------------------------------------------------------
- # SC_SOCKLEN_TYPE
- #
- #	Interix uses "int" as type for socklen_t 
- #
- # Arguments:
- #	none
- #	
- # Results:
- #
- #	Defines the following var:
- #		socklen_t
- #
- #--------------------------------------------------------------------
- 
- AC_DEFUN(SC_SOCKLEN_TYPE, [
-     if test -f /usr/lib/NextStep/software_version; then
- 	system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
-     else
- 	system=`uname -s`-`uname -r`
- 	if test "$?" -ne 0 ; then
- 	    system=unknown
- 	else
- 	    # Special check for weird MP-RAS system (uname returns weird
- 	    # results, and the version is kept in special file).
- 	
- 	    if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
- 		system=MP-RAS-`awk '{print $3}' /etc/.relid'`
- 	    fi
- 	    if test "`uname -s`" = "AIX" ; then
- 		system=AIX-`uname -v`.`uname -r`
- 	    fi
- 	fi
-     fi
-     case $system in
-         Interix)    AC_DEFINE(socklen_t, int)  ;;
-         *)          AC_DEFINE(socklen_t, unsigned)  ;;
-     esac
- ])
- 
  #--------------------------------------------------------------------
  # SC_BLOCKING_STYLE
--- 2077,2080 ----
***************
*** 2326,2330 ****
  	else
  	    AC_MSG_RESULT(buggy)
! 	    AC_LIBOBJ([fixstrtod])
  	    AC_DEFINE(strtod, fixstrtod)
  	fi
--- 2269,2273 ----
  	else
  	    AC_MSG_RESULT(buggy)
! 	    LIBOBJS="$LIBOBJS fixstrtod.o"
  	    AC_DEFINE(strtod, fixstrtod)
  	fi
Nur in new/unix: tcl.m4.orig.
diff -C 2 -r -x configure ./unix/tclUnixChan.c new/unix/tclUnixChan.c
*** ./unix/tclUnixChan.c	2004-04-27 10:00:45.000000000 +0200
--- new/unix/tclUnixChan.c	2004-02-25 15:54:52.000000000 +0100
***************
*** 57,61 ****
  #   define SETIOSTATE(fd, statePtr)	tcsetattr((fd), TCSADRAIN, (statePtr))
  #   define GETCONTROL(fd, intPtr)	ioctl((fd), TIOCMGET, (intPtr))
! #   define SETCONTROL(fd, intPtr)	ioctl((fd), (int)TIOCMSET, (intPtr))
      /*
       * TIP #35 introduced a different on exit flush/close behavior that
--- 57,61 ----
  #   define SETIOSTATE(fd, statePtr)	tcsetattr((fd), TCSADRAIN, (statePtr))
  #   define GETCONTROL(fd, intPtr)	ioctl((fd), TIOCMGET, (intPtr))
! #   define SETCONTROL(fd, intPtr)	ioctl((fd), TIOCMSET, (intPtr))
      /*
       * TIP #35 introduced a different on exit flush/close behavior that
***************
*** 1128,1134 ****
  
  	GETIOSTATE(fsPtr->fd, &iostate);
! 	sprintf(buf, "%c", (int) iostate.c_cc[VSTART]);
  	Tcl_DStringAppendElement(dsPtr, buf);
! 	sprintf(buf, "%c", (int) iostate.c_cc[VSTOP]);
  	Tcl_DStringAppendElement(dsPtr, buf);
      }
--- 1128,1134 ----
  
  	GETIOSTATE(fsPtr->fd, &iostate);
! 	sprintf(buf, "%c", iostate.c_cc[VSTART]);
  	Tcl_DStringAppendElement(dsPtr, buf);
! 	sprintf(buf, "%c", iostate.c_cc[VSTOP]);
  	Tcl_DStringAppendElement(dsPtr, buf);
      }
Nur in new/unix: tclUnixChan.c.orig.
diff -C 2 -r -x configure ./unix/tclUnixInit.c new/unix/tclUnixInit.c
*** ./unix/tclUnixInit.c	2004-04-26 13:01:02.000000000 +0200
--- new/unix/tclUnixInit.c	2004-02-18 00:46:54.000000000 +0100
***************
*** 493,497 ****
  	 * but this does not work on some systems (e.g. Linux/i386 RH 5.0).
  	 */
- 
  #ifdef HAVE_LANGINFO
  	if (setlocale(LC_CTYPE, "") != NULL) {
--- 493,496 ----
***************
*** 525,534 ****
  		for(q = p+1; *p ; *p++ = *q++);
  	    } else if ((*encoding == '\0')
! 		    || !strcmp(encoding, "ansi_x3.4-1968")
! #		    ifdef _INTERIX
! 		    || !strcmp(encoding, "ascii")
! #		    endif
! 		    ) {
! 		/* Use iso8859-1 for empty or 'ansi_x3.4-1968' or 'Interix:ascii' encoding */
  		encoding = "iso8859-1";
  	    }
--- 524,529 ----
  		for(q = p+1; *p ; *p++ = *q++);
  	    } else if ((*encoding == '\0')
! 		    || !strcmp(encoding, "ansi_x3.4-1968")) {
! 		/* Use iso8859-1 for empty or 'ansi_x3.4-1968' encoding */
  		encoding = "iso8859-1";
  	    }
Nur in new/unix: tclUnixInit.c.orig.
diff -C 2 -r -x configure ./unix/tclUnixTime.c new/unix/tclUnixTime.c
*** ./unix/tclUnixTime.c	2004-04-20 14:25:35.000000000 +0200
--- new/unix/tclUnixTime.c	2002-07-19 14:31:10.000000000 +0200
***************
*** 42,55 ****
  static struct tm *ThreadSafeGMTime _ANSI_ARGS_(( CONST time_t* ));
  static struct tm *ThreadSafeLocalTime _ANSI_ARGS_(( CONST time_t* ));
- 
- #ifdef _INTERIX
- /*
-  * Interix defines gmtime_r and localtime_r only with _REENTRANT defined.
-  * to avoid global defining _REENTRANT, I shadow the prototype from
-  * /usr/include/time.h
-  */
- extern struct tm* __cdecl gmtime_r(const time_t *, struct tm*);
- extern struct tm* __cdecl localtime_r(const time_t *, struct tm*);
- #endif
  
  /*
--- 42,45 ----
Nur in new/unix: tclUnixTime.c.orig.