
TCLX_PATCHES -   02/13/2000

These patches to TclX8.2.0 form the beginning of Stubs-support
for TclX. Implemented are:
- Some fixes in the use of Tcl_InitStubs().
- libtclx8.2.so is now compiled with -DUSE_TCL_STUBS
  and linked with the stub library.
- A few other fixes, such as header-file ordering in tclXfilescan.c
  and a (char *) cast. Those two fixes are necessary only in
  combination with the 8.2.x plus-patch, and have no
  other side-effects.

Still missing:
- TclX should export its own stub-table, and provide its
  own stub-library (libtclxstub8.2.a) to be picked up by
  libtkx8.2.so
- libtkx8.2.so should be linked with libtclstub8.2.a,
  libtclxstub8.2.a and libtkstub8.2.a

This partial implementation is sufficient for me at this
moment. Later it will be implemented further.

If you are using Solaris, don't be surprised if the patch utility does not
work. This is a known problem. Better install GNU patch version 2.1 or later.

*** pluspatch.orig	Sun Feb 13 21:07:12 2000
--- pluspatch	Sun Feb 13 21:06:53 2000
***************
*** 0 ****
--- 1,55 ----
+ #!/bin/sh
+ # The next line restarts using tclsh8.2 \
+ exec tclsh8.2 $0 ${1+"$@"}
+ 
+ set dirs [list . ./unix ./tcl/unix ./tcl/generic ./tk/unix ./tk/generic]
+ set package "+"
+ set version "8.2.0"
+ set date [clock format [clock seconds] -format "%m/%d/%Y"]
+ 
+ #
+ # This is a tcl-script that will search a list of directories
+ # for ".orig"-files. For all of these it will make a "diff",
+ # and create a patch-file.
+ #
+ #	Written by:	Jan Nijtmans
+ #			CMG (Computer Management Group) Arnhem B.V.
+ #			email: j.nijtmans@chello.nl (private)
+ #			       jan.nijtmans@cmg.nl (work)
+ #			url:   http://purl.oclc.org/net/nijtmans/
+ 
+ set patchlevel ""
+ set dfiles ""
+ 
+ set file [open pluspatch.orig w]
+ close $file
+ 
+ foreach dir $dirs {
+     set files [eval exec ls $dir]
+     foreach file $files {
+ 	if {[regexp ".*\.orig" $file]} {
+ 	    set file [file join $dir [string range $file 0 [expr [string length $file]-6]]]
+ 	    lappend dfiles $file.diff
+ 	    set file [string range $file 2 [string length $file]]
+ 	    puts stdout "creating $file.diff"
+ 	    catch "exec diff -c $file.orig $file >$file.diff"
+ 	}
+     }
+ }
+ 
+ puts stdout "creating TCLX_PATCHES"
+ set file [open TCLX_PATCHES w]
+ puts $file ""
+ puts $file "TCLX_PATCHES -   $date"
+ puts $file ""
+ puts $file "This patch file updates from TclX ${version} to TclX ${version}${package}. It should be applied"
+ puts $file "by running the \"patch\" program in the top-level directory of a clean"
+ puts $file "TclX ${version} release, using the command \"patch -p0 <TCLX_PATCHES\""
+ puts $file ""
+ puts $file "If you are using Solaris, don't be surprised if the patch utility does not"
+ puts $file "work. This is a known problem. Better install GNU patch version 2.1 or later."
+ puts $file ""
+ eval exec cat $dfiles >@$file
+ close $file
+ 
+ file delete pluspatch.diff pluspatch.orig
*** unix/Common.mk.in.orig	Mon Feb  7 01:54:02 2000
--- unix/Common.mk.in	Sun Feb 13 20:04:29 2000
***************
*** 122,128 ****
  TCL_DEFS             = @TCL_DEFS@
  TCL_LIBS             = @TCL_LIBS@
  TCL_EXEC_PREFIX      = @TCL_EXEC_PREFIX@
! TCL_SHLIB_CFLAGS     = @TCL_SHLIB_CFLAGS@
  TCL_LD_FLAGS         = @TCL_LD_FLAGS@
  TCL_DL_LIBS          = @TCL_DL_LIBS@
  TCL_SHLIB_LD         = @TCL_SHLIB_LD@
--- 122,128 ----
  TCL_DEFS             = @TCL_DEFS@
  TCL_LIBS             = @TCL_LIBS@
  TCL_EXEC_PREFIX      = @TCL_EXEC_PREFIX@
! TCL_SHLIB_CFLAGS     = @TCL_SHLIB_CFLAGS@ -DUSE_TCL_STUBS
  TCL_LD_FLAGS         = @TCL_LD_FLAGS@
  TCL_DL_LIBS          = @TCL_DL_LIBS@
  TCL_SHLIB_LD         = @TCL_SHLIB_LD@
*** unix/configure.in.orig	Mon Feb  7 01:54:02 2000
--- unix/configure.in	Sun Feb 13 20:04:35 2000
***************
*** 461,510 ****
  AC_SUBST(SHARED_LIBS)
  
  #------------------------------------------------------------------------------
- # Check for Plus patch being installed. Does libtcl.a contains a definition of
- # Tcl_InitStandAlone() and does Tk contain Tk_InitStandAlone.
- #------------------------------------------------------------------------------
- AC_MSG_CHECKING([standalone support of Tcl (Plus patch)])
- if test -f "${TCL_BUILD}/unix/${TCL_STLIB_NAME}"; then
-     x=`nm -p "${TCL_BUILD}/unix/${TCL_STLIB_NAME}" |grep 'Tcl_InitStandAlone'`
-     if test "x$x" != "x"; then
-         # Build variables already set
- 	AC_MSG_RESULT([yes])
-         AC_DEFINE(HAVE_TCL_STANDALONE)
-     else
- 	AC_MSG_RESULT([no])
- 	TCLX_BUILD_STANDALONE=""
- 	TCLX_BUILD_DUMMY_STANDALONE=""
-     fi
- else
-     AC_MSG_RESULT([no])
-     TCLX_BUILD_STANDALONE=""
-     TCLX_BUILD_DUMMY_STANDALONE=""
- fi
- AC_SUBST(TCLX_BUILD_STANDALONE)
- AC_SUBST(TCLX_BUILD_DUMMY_STANDALONE)
- 
- AC_MSG_CHECKING([standalone support of Tk (Plus patch)])
- if test "${TKX_BUILD}" = "YES" -a -f "${TK_BUILD}/unix/${TK_STLIB_NAME}"; then
-     x=`nm -p "${TK_BUILD}/unix/${TK_STLIB_NAME}" |grep 'Tk_InitStandAlone'`
-     if test "x$x" != "x"; then
-         # Build variables already set
- 	AC_MSG_RESULT([yes])
-         AC_DEFINE(HAVE_TK_STANDALONE)
-     else
- 	AC_MSG_RESULT([no])
- 	TKX_BUILD_STANDALONE=""
- 	TKX_BUILD_DUMMY_STANDALONE=""
-     fi
- else
-     AC_MSG_RESULT([no])
-     TKX_BUILD_STANDALONE=""
-     TKX_BUILD_DUMMY_STANDALONE=""
- fi
- AC_SUBST(TKX_BUILD_STANDALONE)
- AC_SUBST(TKX_BUILD_DUMMY_STANDALONE)
- 
- #------------------------------------------------------------------------------
  # Determine if Tcl was built with threading support.
  #------------------------------------------------------------------------------
  SC_ENABLE_THREADS
--- 461,466 ----
*** tcl/unix/Makefile.in.orig	Mon Feb  7 01:53:59 2000
--- tcl/unix/Makefile.in	Sat Apr 29 18:35:37 2000
***************
*** 37,43 ****
  LD_SWITCHES = ${LDFLAGS} ${TCL_LD_FLAGS} ${TCL_LD_SEARCH_FLAGS} \
  	      ${XLDFLAGS} ${XCFLAGS} ${CFLAGS}
  
! LIBS = @SHARED_LIBS@
  
  ALL_LIBS = ${TCLX_BUILD_LIB_SPEC} ${TCL_BUILD_LIB_SPEC} \
  	   ${XLDLIBS} ${TCLX_LIBS} ${TCL_LIBS}
--- 37,43 ----
  LD_SWITCHES = ${LDFLAGS} ${TCL_LD_FLAGS} ${TCL_LD_SEARCH_FLAGS} \
  	      ${XLDFLAGS} ${XCFLAGS} ${CFLAGS}
  
! LIBS = ${TCLX_LD_SEARCH_FLAGS} ${TCL_BUILD_STUB_LIB_SPEC} @SHARED_LIBS@
  
  ALL_LIBS = ${TCLX_BUILD_LIB_SPEC} ${TCL_BUILD_LIB_SPEC} \
  	   ${XLDLIBS} ${TCLX_LIBS} ${TCL_LIBS}
***************
*** 45,55 ****
  STATIC_LIBS = ${TCLX_STLIB_NAME} ${TCL_UNIX_DIR}/${TCL_STLIB_NAME} \
  	      ${XLDLIBS} ${TCLX_LIBS} ${TCL_LIBS}
  
  #------------------------------------------------------------------------------
  # Source and target macros.
  #
  GENERIC_OBJS = \
-     @TCLX_BUILD_STANDALONE@ \
      tclXbsearch.o    tclXchmod.o      tclXcmdInit.o    tclXcmdloop.o  \
      tclXdebug.o      tclXdup.o        tclXfcntl.o      tclXfilecmds.o \
      tclXfilescan.o   tclXflock.o      tclXfstat.o      tclXgeneral.o  \
--- 45,56 ----
  STATIC_LIBS = ${TCLX_STLIB_NAME} ${TCL_UNIX_DIR}/${TCL_STLIB_NAME} \
  	      ${XLDLIBS} ${TCLX_LIBS} ${TCL_LIBS}
  
+ LIB_RUNTIME_DIR = ${TCLX_INST_LIB}
+ 
  #------------------------------------------------------------------------------
  # Source and target macros.
  #
  GENERIC_OBJS = \
      tclXbsearch.o    tclXchmod.o      tclXcmdInit.o    tclXcmdloop.o  \
      tclXdebug.o      tclXdup.o        tclXfcntl.o      tclXfilecmds.o \
      tclXfilescan.o   tclXflock.o      tclXfstat.o      tclXgeneral.o  \
***************
*** 61,67 ****
      tclXunixOS.o     tclXoscmds.o     tclXunixDup.o    tclXlgets.o
  
  GENERIC_SOBJS = \
-     @TCLX_BUILD_DUMMY_STANDALONE@ \
      tclXbsearch@SHOBJ_SUFFIX@    tclXchmod@SHOBJ_SUFFIX@    \
      tclXcmdInit@SHOBJ_SUFFIX@    tclXcmdloop@SHOBJ_SUFFIX@  \
      tclXdebug@SHOBJ_SUFFIX@      tclXdup@SHOBJ_SUFFIX@      \
--- 62,67 ----
***************
*** 119,128 ****
  HELP_DIR = ${srcbasedir}/tcl/help
  
  TEST_OBJS = tclTest.o tclTestObj.o tclUnixTest.o tclXtest.o \
! 	tclThreadTest.o tclXunixTest.o
  
  TEST_SAOBJS = tclTest.o tclTestObj.o tclUnixTest.o tclXtest.o \
! 	tclThreadTest.o tclXunixTestSA.o
  
  #------------------------------------------------------------------------------
  # Dependencies for generating the libraries and linking the executable.
--- 119,128 ----
  HELP_DIR = ${srcbasedir}/tcl/help
  
  TEST_OBJS = tclTest.o tclTestObj.o tclUnixTest.o tclXtest.o \
! 	tclThreadTest.o tclXunixTest.o tclTestProcBodyObj.o
  
  TEST_SAOBJS = tclTest.o tclTestObj.o tclUnixTest.o tclXtest.o \
! 	tclThreadTest.o tclXunixTestSA.o tclTestProcBodyObj.o
  
  #------------------------------------------------------------------------------
  # Dependencies for generating the libraries and linking the executable.
***************
*** 255,260 ****
--- 255,263 ----
  
  tclThreadTest.o: ${TCL_SRC_DIR}/generic/tclThreadTest.c
  	${CC} -c ${CC_SWITCHES} ${TCL_SRC_DIR}/generic/tclThreadTest.c
+ 
+ tclTestProcBodyObj.o: ${TCL_SRC_DIR}/generic/tclTestProcBodyObj.c
+ 	${CC} -c ${CC_SWITCHES} ${TCL_SRC_DIR}/generic/tclTestProcBodyObj.c
  
  dltest.tmp: dltest
  	touch dltest.tmp
*** tcl/generic/tclExtend.h.orig	Mon Feb  7 01:53:54 2000
--- tcl/generic/tclExtend.h	Sun Feb 13 20:04:35 2000
***************
*** 128,136 ****
  			       int         exact));
  
  EXTERN int
- Tclx_InitStandAlone _ANSI_ARGS_((Tcl_Interp *interp));
- 
- EXTERN int
  Tclxcmd_Init _ANSI_ARGS_((Tcl_Interp *interp));
  
  EXTERN int
--- 128,133 ----
***************
*** 305,313 ****
  
  EXTERN int
  Tkx_Init _ANSI_ARGS_((Tcl_Interp  *interp));
- 
- EXTERN int
- Tkx_InitStandAlone _ANSI_ARGS_((Tcl_Interp *interp));
  
  EXTERN int
  Tkx_SafeInit _ANSI_ARGS_((Tcl_Interp *interp));
--- 302,307 ----
*** tcl/generic/tclXfilescan.c.orig	Mon Feb  7 01:53:54 2000
--- tcl/generic/tclXfilescan.c	Sun Feb 13 20:04:35 2000
***************
*** 17,24 ****
   *-----------------------------------------------------------------------------
   */
  
! #include "tclExtdInt.h"
  #include "tclRegexp.h"
  
  /*
   * A scan context describes a collection of match patterns and commands,
--- 17,25 ----
   *-----------------------------------------------------------------------------
   */
  
! #include "tcl.h"
  #include "tclRegexp.h"
+ #include "tclExtdInt.h"
  
  /*
   * A scan context describes a collection of match patterns and commands,
*** tcl/generic/tclXinit.c.orig	Mon Feb  7 01:53:54 2000
--- tcl/generic/tclXinit.c	Sun Feb 13 20:44:06 2000
***************
*** 28,34 ****
   *      default directory does not work.
   *    o [info nameofexectutable]/../../tclX$version/$w/$platform, for
   *      running before installation.  Platform is either "unix" or "win".
!  * The source -rsrc commands are used when TclX has standalone support built
   * in.
   *
   * Parameters:
--- 28,34 ----
   *      default directory does not work.
   *    o [info nameofexectutable]/../../tclX$version/$w/$platform, for
   *      running before installation.  Platform is either "unix" or "win".
!  * The ::wrap::source commands are used when TclX has standalone support built
   * in.
   *
   * Parameters:
***************
*** 58,65 ****
  	}\n\
          set libDir {}\n",
  #ifdef HAVE_TCL_STANDALONE
!        "if ![catch {uplevel #0 source -rsrc ${w}x}] {\n\
! 	    uplevel #0 source -rsrc ${w}x:tclIndex\n\
  	    return\n\
          }\n",
  #endif    
--- 58,65 ----
  	}\n\
          set libDir {}\n",
  #ifdef HAVE_TCL_STANDALONE
!        "if ![catch {uplevel #0 ::wrap::source lib/${w}X$version/${w}x.tcl}] {\n\
! 	    uplevel #0 ::wrap::source lib/${w}X$version/tclIndex\n\
  	    return\n\
          }\n",
  #endif    
***************
*** 362,368 ****
  InitSetup (interp)
      Tcl_Interp *interp;
  {
!     if (Tcl_PkgRequire (interp, "Tcl", TCL_VERSION, 1) == NULL) {
  	return TCL_ERROR;
      }
      if (Tcl_PkgProvide (interp, "Tclx", TCLX_VERSION) != TCL_OK) {
--- 362,368 ----
  InitSetup (interp)
      Tcl_Interp *interp;
  {
!     if (Tcl_PkgRequire (interp, "Tcl", TCLX_VERSION, 0) == NULL) {
  	return TCL_ERROR;
      }
      if (Tcl_PkgProvide (interp, "Tclx", TCLX_VERSION) != TCL_OK) {
***************
*** 394,401 ****
  Tclx_Init (interp)
      Tcl_Interp *interp;
  {
!     if (Tcl_InitStubs(interp, "8.0", 0) == NULL) {
! 	abort();
      }
  
      if (InitSetup (interp) == TCL_ERROR)
--- 394,401 ----
  Tclx_Init (interp)
      Tcl_Interp *interp;
  {
!     if (Tcl_InitStubs(interp, TCLX_VERSION, 0) == NULL) {
! 	return TCL_ERROR;
      }
  
      if (InitSetup (interp) == TCL_ERROR)
*** tcl/generic/tclXlib.c.orig	Mon Feb  7 01:53:54 2000
--- tcl/generic/tclXlib.c	Sun Feb 13 20:49:34 2000
***************
*** 45,56 ****
   */
  #ifdef HAVE_TCL_STANDALONE
  static char autoloadCmd [] =
! "if [catch {source -rsrc autoload}] {\n\
!     source [file join $tclx_library autoload.tcl]\n\
  }";
  #else
  static char autoloadCmd [] =
!     "source [file join $tclx_library autoload.tcl]";
  #endif
  
  /*
--- 45,56 ----
   */
  #ifdef HAVE_TCL_STANDALONE
  static char autoloadCmd [] =
! "if [catch {::wrap::source lib/tclX8.2/autoload.tcl}] {\n\
!     source [list [file join $tclx_library autoload.tcl]];
  }";
  #else
  static char autoloadCmd [] =
!     "source [list [file join $tclx_library autoload.tcl]]";
  #endif
  
  /*
***************
*** 207,213 ****
          goto posixError;
      channel = NULL;
  
!     oldScriptFile = iPtr->scriptFile;
      iPtr->scriptFile = fileName;
      result = Tcl_GlobalEval (interp, cmdBuf.string);
      iPtr->scriptFile = oldScriptFile;
--- 207,213 ----
          goto posixError;
      channel = NULL;
  
!     oldScriptFile = (char *) iPtr->scriptFile;
      iPtr->scriptFile = fileName;
      result = Tcl_GlobalEval (interp, cmdBuf.string);
      iPtr->scriptFile = oldScriptFile;
***************
*** 638,644 ****
      Tcl_DStringInit (&command);
  
      Tcl_DStringAppend (&command, 
! 		       "if [catch {source -rsrc buildidx}] {source [file join $tclx_library buildidx.tcl]};", -1);
      Tcl_DStringAppend (&command, "buildpackageindex ", -1);
      Tcl_DStringAppend (&command, tlibFilePath, -1);
  
--- 638,644 ----
      Tcl_DStringInit (&command);
  
      Tcl_DStringAppend (&command, 
! 		       "if [catch {::wrap::source /lib/tclX8.2/buildidx.tcl}] {source [file join $tclx_library buildidx.tcl]};", -1);
      Tcl_DStringAppend (&command, "buildpackageindex ", -1);
      Tcl_DStringAppend (&command, tlibFilePath, -1);
  
*** tk/generic/tkXinit.c.orig	Mon Feb  7 01:54:00 2000
--- tk/generic/tkXinit.c	Sun Feb 13 20:04:36 2000
***************
*** 36,42 ****
  InitSetup (interp)
      Tcl_Interp  *interp;
  {
!     if (Tcl_PkgRequire (interp, "Tk", TK_VERSION, 1) == NULL) {
   	return TCL_ERROR;
      }
      if (Tcl_PkgRequire (interp, "Tclx", TCLX_VERSION, 1) == NULL) {
--- 36,45 ----
  InitSetup (interp)
      Tcl_Interp  *interp;
  {
!     if (Tcl_InitStubs (interp, TCLX_VERSION, 0) == NULL) {
!       return TCL_ERROR;
!     }
!     if (Tk_InitStubs (interp, TCLX_VERSION, 0) == NULL) {
   	return TCL_ERROR;
      }
      if (Tcl_PkgRequire (interp, "Tclx", TCLX_VERSION, 1) == NULL) {
***************
*** 60,76 ****
  int Tkx_Init (interp)
      Tcl_Interp *interp;
  {
-     /* 
-      * Initialize the stubs before making any calls to Tcl or Tk APIs.
-      */
- 
-     if (Tcl_InitStubs(interp, "8.0", 0) == NULL) {
- 	abort();
-     }
-     if (Tk_InitStubs(interp, "8.0", 0) == NULL) {
- 	abort();
-     }
- 
      if (InitSetup(interp) != TCL_OK) {
  	goto errorExit;
      }
--- 63,68 ----
*** tk/generic/tkXshell.c.orig	Sun Feb 13 20:58:13 2000
--- tk/generic/tkXshell.c	Sun Feb 13 20:59:05 2000
***************
*** 84,91 ****
  extern int		isatty _ANSI_ARGS_((int fd));
  extern char *		strrchr _ANSI_ARGS_((CONST char *string, int c));
  #endif
- extern void		TkpDisplayWarning _ANSI_ARGS_((char *msg,
- 			    char *title));
  
  #ifndef TKX_SHELL
  /*
--- 84,89 ----
*** unix/configure.orig	Sat Apr 29 18:04:36 2000
--- unix/configure	Sat Apr 29 18:07:11 2000
***************
*** 22,28 ****
  ac_help="$ac_help
    --enable-gcc            allow use of gcc if available [--disable-gcc]"
  ac_help="$ac_help
!   --enable-64bit          enable 64bit support"
  ac_help="$ac_help
    --disable-load          disallow dynamic loading and "load" command"
  ac_help="$ac_help
--- 22,30 ----
  ac_help="$ac_help
    --enable-gcc            allow use of gcc if available [--disable-gcc]"
  ac_help="$ac_help
!   --enable-64bit          enable 64bit support (where applicable)"
! ac_help="$ac_help
!   --enable-64bit-vis      enable 64bit Sparc VIS support"
  ac_help="$ac_help
    --disable-load          disallow dynamic loading and "load" command"
  ac_help="$ac_help
***************
*** 1615,1627 ****
  
  
      if test "$enableval" = "yes"; then
- 	echo "$ac_t""Will compile with 64bit support" 1>&6
  	do64bit=yes
      else
  	do64bit=no
      fi
      echo "$ac_t""$do64bit" 1>&6
   
      # Step 1: set the variable "system" to hold the name and version number
      # for the system.  This can usually be done via the "uname" command, but
      # there are a few systems, like Next, where this doesn't work.
--- 1617,1650 ----
  
  
      if test "$enableval" = "yes"; then
  	do64bit=yes
      else
  	do64bit=no
      fi
      echo "$ac_t""$do64bit" 1>&6
   
+     # Step 0.b: Enable Solaris 64 bit VIS support?
+ 
+     echo $ac_n "checking if 64bit Sparc VIS support is requested""... $ac_c" 1>&6
+ echo "configure:1630: checking if 64bit Sparc VIS support is requested" >&5
+     # Check whether --enable-64bit-vis or --disable-64bit-vis was given.
+ if test "${enable_64bit_vis+set}" = set; then
+   enableval="$enable_64bit_vis"
+   :
+ else
+   enableval="no"
+ fi
+ 
+ 
+     if test "$enableval" = "yes"; then
+ 	# Force 64bit on with VIS
+ 	do64bit=yes
+ 	do64bitVIS=yes
+     else
+ 	do64bitVIS=no
+     fi
+     echo "$ac_t""$do64bitVIS" 1>&6
+ 
      # Step 1: set the variable "system" to hold the name and version number
      # for the system.  This can usually be done via the "uname" command, but
      # there are a few systems, like Next, where this doesn't work.
***************
*** 1649,1654 ****
  	fi
      fi
  
      # Step 2: check for existence of -ldl library.  This is needed because
      # Linux can use either -ldl or -ldld for dynamic loading.
  
--- 1672,1683 ----
  	fi
      fi
  
+     if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
+ 	using_gcc="yes"
+     else
+ 	using_gcc="no"
+     fi
+ 
      # Step 2: check for existence of -ldl library.  This is needed because
      # Linux can use either -ldl or -ldld for dynamic loading.
  
***************
*** 1706,1723 ****
      TCL_LIB_VERSIONS_OK=ok
      CFLAGS_DEBUG=-g
      CFLAGS_OPTIMIZE=-O
      TCL_NEEDS_EXP_FILE=0
      TCL_BUILD_EXP_FILE=""
      TCL_EXP_FILE=""
-     STLIB_LD="ar cr"
      case $system in
  	AIX-4.[2-9])
  	    SHLIB_CFLAGS=""
! 	    SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
  	    DL_OBJS="tclLoadDl.o"
! 	    DL_LIBS="-ldl"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
  	    TCL_NEEDS_EXP_FILE=1
--- 1735,1761 ----
      TCL_LIB_VERSIONS_OK=ok
      CFLAGS_DEBUG=-g
      CFLAGS_OPTIMIZE=-O
+     if test "$using_gcc" = "yes" ; then
+ 	CFLAGS_WARNING="-Wall -Wno-implicit-int"
+     else
+ 	CFLAGS_WARNING=""
+     fi
      TCL_NEEDS_EXP_FILE=0
      TCL_BUILD_EXP_FILE=""
      TCL_EXP_FILE=""
      case $system in
  	AIX-4.[2-9])
+ 	    if test "$using_gcc" = "no" ; then
+ 		# The IBM compiler has a bug with -O when compiling the
+ 		# text widget code (TkTextPixelIndex segv)
+ 		CFLAGS_OPTIMIZE=""
+ 	    fi
  	    SHLIB_CFLAGS=""
! 	    SHLIB_LD=$TCL_SHLIB_LD
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
  	    DL_OBJS="tclLoadDl.o"
! 	    DL_LIBS="-ldl ${TCL_BUILD_LIB_SPEC}"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
  	    TCL_NEEDS_EXP_FILE=1
***************
*** 1725,1736 ****
  	    ;;
  	AIX-*)
  	    SHLIB_CFLAGS=""
! 	    SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
  	    DL_OBJS="tclLoadDl.o"
  	    LIBOBJS="$LIBOBJS tclLoadAix.o"
! 	    DL_LIBS="-lld"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
  	    TCL_NEEDS_EXP_FILE=1
--- 1763,1774 ----
  	    ;;
  	AIX-*)
  	    SHLIB_CFLAGS=""
! 	    SHLIB_LD=$TCL_SHLIB_LD
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
  	    DL_OBJS="tclLoadDl.o"
  	    LIBOBJS="$LIBOBJS tclLoadAix.o"
! 	    DL_LIBS="-lld ${TCL_BUILD_LIB_SPEC}"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
  	    TCL_NEEDS_EXP_FILE=1
***************
*** 1838,1844 ****
  	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS=""
  	    LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
! 	    if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
  		EXTRA_CFLAGS="-mabi=n32"
  		LDFLAGS="-mabi=n32"
  	    else
--- 1876,1882 ----
  	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS=""
  	    LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
! 	    if test "$using_gcc" = "yes" ; then
  		EXTRA_CFLAGS="-mabi=n32"
  		LDFLAGS="-mabi=n32"
  	    else
***************
*** 1976,1982 ****
  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    
! 		SHLIB_CFLAGS="-fpic"
  		SHLIB_LD="ld -Bshareable -x"
  		SHLIB_LD_LIBS=""
  		SHLIB_SUFFIX=".so"
--- 2014,2021 ----
  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    
! 		# NetBSD/SPARC needs -fPIC, -fpic will not do.
! 		SHLIB_CFLAGS="-fPIC"
  		SHLIB_LD="ld -Bshareable -x"
  		SHLIB_LD_LIBS=""
  		SHLIB_SUFFIX=".so"
***************
*** 1984,1990 ****
  		DL_LIBS=""
  		LDFLAGS=""
  		LD_SEARCH_FLAGS=""
! 		SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
  	    
  else
    echo "$ac_t""no" 1>&6
--- 2023,2052 ----
  		DL_LIBS=""
  		LDFLAGS=""
  		LD_SEARCH_FLAGS=""
! 		echo $ac_n "checking for ELF""... $ac_c" 1>&6
! echo "configure:2028: checking for ELF" >&5
! 		cat > conftest.$ac_ext <<EOF
! #line 2030 "configure"
! #include "confdefs.h"
! 
! #ifdef __ELF__
! 	yes
! #endif
! 		
! EOF
! if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
!   egrep "yes" >/dev/null 2>&1; then
!   rm -rf conftest*
!   echo "$ac_t""yes" 1>&6
! 		    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so'
! else
!   rm -rf conftest*
!   echo "$ac_t""no" 1>&6
! 		    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
! 		
! fi
! rm -f conftest*
! 
  	    
  else
    echo "$ac_t""no" 1>&6
***************
*** 2009,2021 ****
  	    ;;
  	FreeBSD-*)
  	    # FreeBSD 3.* and greater have ELF.
! 	    SHLIB_CFLAGS="-fpic"
  	    SHLIB_LD="ld -Bshareable -x"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
  	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS=""
! 	    LDFLAGS=""
  	    LD_SEARCH_FLAGS=""
  	    ;;
  	NEXTSTEP-*)
--- 2071,2083 ----
  	    ;;
  	FreeBSD-*)
  	    # FreeBSD 3.* and greater have ELF.
! 	    SHLIB_CFLAGS="-fPIC"
  	    SHLIB_LD="ld -Bshareable -x"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
  	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS=""
! 	    LDFLAGS="-export-dynamic"
  	    LD_SEARCH_FLAGS=""
  	    ;;
  	NEXTSTEP-*)
***************
*** 2049,2055 ****
  	    ;;
  	OSF1-1.*)
  	    # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
! 	    SHLIB_CFLAGS="-fpic"
  	    SHLIB_LD="ld -shared"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
--- 2111,2117 ----
  	    ;;
  	OSF1-1.*)
  	    # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
! 	    SHLIB_CFLAGS="-fPIC"
  	    SHLIB_LD="ld -shared"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
***************
*** 2080,2095 ****
  	    LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
  	    ;;
  	SCO_SV-3.2*)
! 	    # Note, dlopen is available only on SCO 3.2.5 and greater.  However,
  	    # this test works, since "uname -s" was non-standard in 3.2.4 and
  	    # below.
! 	    SHLIB_CFLAGS="-Kpic -belf"
  	    SHLIB_LD="ld -G"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
  	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS=""
- 	    LDFLAGS="-belf -Wl,-Bexport"
  	    LD_SEARCH_FLAGS=""
  	    ;;
  	SINIX*5.4*)
--- 2142,2162 ----
  	    LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
  	    ;;
  	SCO_SV-3.2*)
! 	    # Note, dlopen is available only on SCO 3.2.5 and greater. However,
  	    # this test works, since "uname -s" was non-standard in 3.2.4 and
  	    # below.
! 	    if test "$using_gcc" = "yes" ; then
! 	    	SHLIB_CFLAGS="-fPIC -melf"
! 	    	LDFLAGS="-melf -Wl,-Bexport"
! 	    else
! 	    	SHLIB_CFLAGS="-Kpic -belf"
! 	    	LDFLAGS="-belf -Wl,-Bexport"
! 	    fi
  	    SHLIB_LD="ld -G"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
  	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS=""
  	    LD_SEARCH_FLAGS=""
  	    ;;
  	SINIX*5.4*)
***************
*** 2142,2161 ****
      
  	    do64bit_ok=no
  	    if test "$do64bit" = "yes" ; then
! 	    arch=`isainfo`
! 	    if test "$arch" = "sparcv9 sparc" ; then
! 		if test "$CC" != "gcc" -a `$CC -v 2>&1 | grep -c gcc` = "0" ; then
! 		do64bit_ok=yes
! 		EXTRA_CFLAGS="-xarch=v9"
! 		LDFLAGS="-xarch=v9"
! 		else 
! 		echo "configure: warning: "64bit mode not supported using GCC on $system"" 1>&2
  		fi
- 	    else
- 		echo "configure: warning: "64bit mode only supported sparcv9 system"" 1>&2
  	    fi
! 	    fi
! 	    
  	    # Note: need the LIBS below, otherwise Tk won't find Tcl's
  	    # symbols when dynamically loaded into tclsh.
  
--- 2209,2233 ----
      
  	    do64bit_ok=no
  	    if test "$do64bit" = "yes" ; then
! 		arch=`isainfo`
! 		if test "$arch" = "sparcv9 sparc" ; then
! 			if test "$using_gcc" = "no" ; then
! 			    do64bit_ok=yes
! 			    if test "$do64bitVIS" = "yes" ; then
! 				EXTRA_CFLAGS="-xarch=v9a"
! 			    	LDFLAGS="-xarch=v9a"
! 			    else
! 				EXTRA_CFLAGS="-xarch=v9"
! 			    	LDFLAGS="-xarch=v9"
! 			    fi
! 			else 
! 			    echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2
! 			fi
! 		else
! 		    echo "configure: warning: "64bit mode only supported sparcv9 system"" 1>&2
  		fi
  	    fi
! 
  	    # Note: need the LIBS below, otherwise Tk won't find Tcl's
  	    # symbols when dynamically loaded into tclsh.
  
***************
*** 2163,2169 ****
  	    SHLIB_SUFFIX=".so"
  	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS="-ldl"
! 	    if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
  		LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
  	    else
  		LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
--- 2235,2241 ----
  	    SHLIB_SUFFIX=".so"
  	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS="-ldl"
! 	    if test "$using_gcc" = "yes" ; then
  		LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
  	    else
  		LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
***************
*** 2399,2405 ****
      # standard manufacturer compiler.
  
      if test "$DL_OBJS" != "tclLoadNone.o" ; then
! 	if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
  	    case $system in
  		AIX-*)
  		    ;;
--- 2471,2477 ----
      # standard manufacturer compiler.
  
      if test "$DL_OBJS" != "tclLoadNone.o" ; then
! 	if test "$using_gcc" = "yes" ; then
  	    case $system in
  		AIX-*)
  		    ;;
***************
*** 2674,2731 ****
  
  
  #------------------------------------------------------------------------------
- # Check for Plus patch being installed. Does libtcl.a contains a definition of
- # Tcl_InitStandAlone() and does Tk contain Tk_InitStandAlone.
- #------------------------------------------------------------------------------
- echo $ac_n "checking standalone support of Tcl (Plus patch)""... $ac_c" 1>&6
- echo "configure:2682: checking standalone support of Tcl (Plus patch)" >&5
- if test -f "${TCL_BUILD}/unix/${TCL_STLIB_NAME}"; then
-     x=`nm -p "${TCL_BUILD}/unix/${TCL_STLIB_NAME}" |grep 'Tcl_InitStandAlone'`
-     if test "x$x" != "x"; then
-         # Build variables already set
- 	echo "$ac_t""yes" 1>&6
-         cat >> confdefs.h <<\EOF
- #define HAVE_TCL_STANDALONE 1
- EOF
- 
-     else
- 	echo "$ac_t""no" 1>&6
- 	TCLX_BUILD_STANDALONE=""
- 	TCLX_BUILD_DUMMY_STANDALONE=""
-     fi
- else
-     echo "$ac_t""no" 1>&6
-     TCLX_BUILD_STANDALONE=""
-     TCLX_BUILD_DUMMY_STANDALONE=""
- fi
- 
- 
- 
- echo $ac_n "checking standalone support of Tk (Plus patch)""... $ac_c" 1>&6
- echo "configure:2706: checking standalone support of Tk (Plus patch)" >&5
- if test "${TKX_BUILD}" = "YES" -a -f "${TK_BUILD}/unix/${TK_STLIB_NAME}"; then
-     x=`nm -p "${TK_BUILD}/unix/${TK_STLIB_NAME}" |grep 'Tk_InitStandAlone'`
-     if test "x$x" != "x"; then
-         # Build variables already set
- 	echo "$ac_t""yes" 1>&6
-         cat >> confdefs.h <<\EOF
- #define HAVE_TK_STANDALONE 1
- EOF
- 
-     else
- 	echo "$ac_t""no" 1>&6
- 	TKX_BUILD_STANDALONE=""
- 	TKX_BUILD_DUMMY_STANDALONE=""
-     fi
- else
-     echo "$ac_t""no" 1>&6
-     TKX_BUILD_STANDALONE=""
-     TKX_BUILD_DUMMY_STANDALONE=""
- fi
- 
- 
- 
- #------------------------------------------------------------------------------
  # Determine if Tcl was built with threading support.
  #------------------------------------------------------------------------------
  
--- 2747,2752 ----
  
  
  #------------------------------------------------------------------------------
  # Determine if Tcl was built with threading support.
  #------------------------------------------------------------------------------
  
***************
*** 2793,2823 ****
  tcl_ok=no
  fi
  
! 	if test "$tcl_ok" = "yes"; then
! 	    # The space is needed
! 	    THREADS_LIBS=" -lpthread"
! 	else
!             echo $ac_n "checking for pthread_mutex_init in -lc_r""... $ac_c" 1>&6
! echo "configure:2802: checking for pthread_mutex_init in -lc_r" >&5
! ac_lib_var=`echo c_r'_'pthread_mutex_init | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    ac_save_LIBS="$LIBS"
! LIBS="-lc_r  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2810 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
      builtin and then its argument prototype would still apply.  */
! char pthread_mutex_init();
  
  int main() {
! pthread_mutex_init()
  ; return 0; }
  EOF
! if { (eval echo configure:2821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 2815,2847 ----
  tcl_ok=no
  fi
  
! 	if test "$tcl_ok" = "no"; then
! 	    # Check a little harder for __pthread_mutex_init in the same
! 	    # library, as some systems hide it there until pthread.h is
! 	    # defined.  We could alternatively do an AC_TRY_COMPILE with
! 	    # pthread.h, but that will work with libpthread really doesn't
! 	    # exist, like AIX 4.2.  [Bug: 4359]
! 	    echo $ac_n "checking for __pthread_mutex_init in -lpthread""... $ac_c" 1>&6
! echo "configure:2826: checking for __pthread_mutex_init in -lpthread" >&5
! ac_lib_var=`echo pthread'_'__pthread_mutex_init | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    ac_save_LIBS="$LIBS"
! LIBS="-lpthread  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2834 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
      builtin and then its argument prototype would still apply.  */
! char __pthread_mutex_init();
  
  int main() {
! __pthread_mutex_init()
  ; return 0; }
  EOF
! if { (eval echo configure:2845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 2838,2850 ****
  tcl_ok=no
  fi
  
!             if test "$tcl_ok" = "yes"; then
!                 # The space is needed
!                 THREADS_LIBS=" -lc_r"
!             else
!                 TCL_THREADS=0
!                 echo "configure: warning: "Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..."" 1>&2
!             fi
  	fi
      else
  	TCL_THREADS=0
--- 2862,2875 ----
  tcl_ok=no
  fi
  
! 	fi
! 
! 	if test "$tcl_ok" = "yes"; then
! 	    # The space is needed
! 	    THREADS_LIBS=" -lpthread"
! 	else
! 	    TCL_THREADS=0
! 	    echo "configure: warning: "Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..."" 1>&2
  	fi
      else
  	TCL_THREADS=0
***************
*** 4876,4881 ****
--- 4901,4907 ----
  s%@DL_LIBS@%$DL_LIBS%g
  s%@CFLAGS_DEBUG@%$CFLAGS_DEBUG%g
  s%@CFLAGS_OPTIMIZE@%$CFLAGS_OPTIMIZE%g
+ s%@CFLAGS_WARNING@%$CFLAGS_WARNING%g
  s%@TCLX_DBGX@%$TCLX_DBGX%g
  s%@TKX_DBGX@%$TKX_DBGX%g
  s%@TCL_DBGX@%$TCL_DBGX%g
***************
*** 4909,4918 ****
  s%@OBJ_RESTORE@%$OBJ_RESTORE%g
  s%@CC_SHOBJ_FLAG@%$CC_SHOBJ_FLAG%g
  s%@SHARED_LIBS@%$SHARED_LIBS%g
- s%@TCLX_BUILD_STANDALONE@%$TCLX_BUILD_STANDALONE%g
- s%@TCLX_BUILD_DUMMY_STANDALONE@%$TCLX_BUILD_DUMMY_STANDALONE%g
- s%@TKX_BUILD_STANDALONE@%$TKX_BUILD_STANDALONE%g
- s%@TKX_BUILD_DUMMY_STANDALONE@%$TKX_BUILD_DUMMY_STANDALONE%g
  s%@LN_S@%$LN_S%g
  s%@HAVE_SYML@%$HAVE_SYML%g
  s%@MAKEINCLUDE@%$MAKEINCLUDE%g
--- 4935,4940 ----
*** tk/unix/Makefile.in.orig	Sat Apr 29 18:39:24 2000
--- tk/unix/Makefile.in	Sat Apr 29 18:41:04 2000
***************
*** 49,57 ****
  #------------------------------------------------------------------------------
  # Source and target macros.
  #
! GENERIC_OBJS = @TKX_BUILD_STANDALONE@ tkXinit.o tkXshell.o
  
! GENERIC_SOBJS = @TKX_BUILD_DUMMY_STANDALONE@ tkXinit@SHOBJ_SUFFIX@ \
  		tkXshell@SHOBJ_SUFFIX@
  
  OBJS = ${GENERIC_OBJS}
--- 49,57 ----
  #------------------------------------------------------------------------------
  # Source and target macros.
  #
! GENERIC_OBJS = tkXinit.o tkXshell.o
  
! GENERIC_SOBJS = tkXinit@SHOBJ_SUFFIX@ \
  		tkXshell@SHOBJ_SUFFIX@
  
  OBJS = ${GENERIC_OBJS}
***************
*** 133,139 ****
  	@echo "# The next line restarts using wishx \\"	>>tclhelp
  	@echo 'exec wishx $$0 $${1+"$$@"}'		>>tclhelp
  	@echo ""					>>tclhelp
! 	@echo "package require Tk ${TK_VERSION}"	>>tclhelp
  	@echo "package require Tclx ${TCLX_VERSION}"	>>tclhelp
  	@echo ""					>>tclhelp
  	@cat ${RUNTIME_DIR}/tclhelp.tcl 		>>tclhelp
--- 133,139 ----
  	@echo "# The next line restarts using wishx \\"	>>tclhelp
  	@echo 'exec wishx $$0 $${1+"$$@"}'		>>tclhelp
  	@echo ""					>>tclhelp
! 	@echo "package require Tk"			>>tclhelp
  	@echo "package require Tclx ${TCLX_VERSION}"	>>tclhelp
  	@echo ""					>>tclhelp
  	@cat ${RUNTIME_DIR}/tclhelp.tcl 		>>tclhelp
*** tk/runtime/tclhelp.tcl.orig	Sat Apr 29 19:50:15 2000
--- tk/runtime/tclhelp.tcl	Sat Apr 29 19:52:05 2000
***************
*** 220,228 ****
  	}
      }
      if {$direction} {
! 	set index [$w search -forwards -nocase $string "$index + 1 char"]
      } else {
! 	set index [$w search -backwards -nocase $string "$index - 1 char"]
      }
      if {$index==""} {
  	tk_dialog .searcherror "Error in Search" "String \"$string\" not found" error 0 "O.K."
--- 220,228 ----
  	}
      }
      if {$direction} {
! 	set index [$w search -forwards -nocase -- $string "$index + 1 char"]
      } else {
! 	set index [$w search -backwards -nocase -- $string "$index - 1 char"]
      }
      if {$index==""} {
  	tk_dialog .searcherror "Error in Search" "String \"$string\" not found" error 0 "O.K."
