Check-in [13d81a254d]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:add selected tcl upstream changes
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 13d81a254d9617b7891474aea086d5bd30ac34c3
User & Date: chw 2019-09-13 04:06:32
Context
2019-09-13
04:09
more selected tcl upstream changes check-in: b83f715fa7 user: chw tags: trunk
04:06
add selected tcl upstream changes check-in: 13d81a254d user: chw tags: trunk
04:05
add tk upstream changes check-in: d39c4fd1ed user: chw tags: trunk
Changes

Changes to jni/tcl/generic/tclCompile.c.

  2122   2122       const char *p = script;	/* Where we are in our compile. */
  2123   2123       int depth = TclGetStackDepth(envPtr);
  2124   2124       Interp *iPtr = (Interp *) interp;
  2125   2125   
  2126   2126       if (envPtr->iPtr == NULL) {
  2127   2127   	Tcl_Panic("TclCompileScript() called on uninitialized CompileEnv");
  2128   2128       }
  2129         -    /* 
         2129  +    /*
  2130   2130        * Check depth to avoid overflow of the C execution stack by too many
  2131   2131        * nested calls of TclCompileScript (considering interp recursionlimit).
  2132   2132        * Factor 5/4 (1.25) is used to avoid too mistaken limit recognition
  2133   2133        * during "mixed" evaluation and compilation process (nested eval+compile)
  2134   2134        * and is good enough for default recursionlimit (1000).
  2135   2135        */
  2136   2136       if (iPtr->numLevels / 5 > iPtr->maxNestingDepth / 4) {
................................................................................
  2214   2214   	     * The advantage of this shortcut is that CompileCommandTokens()
  2215   2215   	     * can be written with an assumption that parsePtr->numWords > 0, with
  2216   2216   	     * the implication the CCT() always generates bytecode.
  2217   2217   	     */
  2218   2218   	    continue;
  2219   2219   	}
  2220   2220   
  2221         -	/* 
         2221  +	/*
  2222   2222   	 * Avoid stack exhaustion by too many nested calls of TclCompileScript
  2223   2223   	 * (considering interp recursionlimit).
  2224   2224   	 */
  2225   2225   	iPtr->numLevels++;
  2226   2226   
  2227   2227   	lastCmdIdx = CompileCommandTokens(interp, parsePtr, envPtr);
  2228   2228   

Changes to jni/tcl/generic/tclEncoding.c.

  1770   1770         0,  0,  0,  0,  0,  0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 192 ... 207 */
  1771   1771         0,  0,  0,  0,  0,  0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 208 ... 223 */
  1772   1772         0,  0,  0,  0,  0,  0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 224 ... 239 */
  1773   1773         0,  0,  0,  0,  0,  0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 240 ... 255 */
  1774   1774       };
  1775   1775   
  1776   1776       Tcl_DStringInit(&lineString);
  1777         -    if (Tcl_Gets(chan, &lineString) < 0) {
         1777  +    if (Tcl_Gets(chan, &lineString) == -1) {
  1778   1778   	return NULL;
  1779   1779       }
  1780   1780       line = Tcl_DStringValue(&lineString);
  1781   1781   
  1782   1782       fallback = (int) strtol(line, &line, 16);
  1783   1783       symbol = (int) strtol(line, &line, 10);
  1784   1784       numPages = (int) strtol(line, &line, 10);
................................................................................
  2104   2104   	Tcl_DStringFree(&lineString);
  2105   2105       }
  2106   2106   
  2107   2107       size = sizeof(EscapeEncodingData) - sizeof(EscapeSubTable)
  2108   2108   	    + Tcl_DStringLength(&escapeData);
  2109   2109       dataPtr = ckalloc(size);
  2110   2110       dataPtr->initLen = strlen(init);
  2111         -    memcpy(dataPtr->init, init, (unsigned) dataPtr->initLen + 1);
         2111  +    memcpy(dataPtr->init, init, dataPtr->initLen + 1);
  2112   2112       dataPtr->finalLen = strlen(final);
  2113         -    memcpy(dataPtr->final, final, (unsigned) dataPtr->finalLen + 1);
         2113  +    memcpy(dataPtr->final, final, dataPtr->finalLen + 1);
  2114   2114       dataPtr->numSubTables =
  2115   2115   	    Tcl_DStringLength(&escapeData) / sizeof(EscapeSubTable);
  2116   2116       memcpy(dataPtr->subTables, Tcl_DStringValue(&escapeData),
  2117         -	    (size_t) Tcl_DStringLength(&escapeData));
         2117  +	    Tcl_DStringLength(&escapeData));
  2118   2118       Tcl_DStringFree(&escapeData);
  2119   2119   
  2120   2120       memset(dataPtr->prefixBytes, 0, sizeof(dataPtr->prefixBytes));
  2121   2121       for (i = 0; i < dataPtr->numSubTables; i++) {
  2122   2122   	dataPtr->prefixBytes[UCHAR(dataPtr->subTables[i].sequence[0])] = 1;
  2123   2123       }
  2124   2124       if (dataPtr->init[0] != '\0') {
................................................................................
  2198   2198   	srcLen = dstLen;
  2199   2199   	result = TCL_CONVERT_NOSPACE;
  2200   2200       }
  2201   2201   
  2202   2202       *srcReadPtr = srcLen;
  2203   2203       *dstWrotePtr = srcLen;
  2204   2204       *dstCharsPtr = srcLen;
  2205         -    memcpy(dst, src, (size_t) srcLen);
         2205  +    memcpy(dst, src, srcLen);
  2206   2206       return result;
  2207   2207   }
  2208   2208   
  2209   2209   /*
  2210   2210    *-------------------------------------------------------------------------
  2211   2211    *
  2212   2212    * UtfExtToUtfIntProc --
................................................................................
  3602   3602       if (flags & TCL_ENCODING_START) {
  3603   3603   	state = 0;
  3604   3604   	if ((dst + dataPtr->initLen) > dstEnd) {
  3605   3605   	    *srcReadPtr = 0;
  3606   3606   	    *dstWrotePtr = 0;
  3607   3607   	    return TCL_CONVERT_NOSPACE;
  3608   3608   	}
  3609         -	memcpy(dst, dataPtr->init, (size_t)dataPtr->initLen);
         3609  +	memcpy(dst, dataPtr->init, dataPtr->initLen);
  3610   3610   	dst += dataPtr->initLen;
  3611   3611       } else {
  3612   3612   	state = PTR2INT(*statePtr);
  3613   3613       }
  3614   3614   
  3615   3615       encodingPtr = GetTableEncoding(dataPtr, state);
  3616   3616       tableDataPtr = encodingPtr->clientData;
................................................................................
  3681   3681   		     */
  3682   3682   
  3683   3683   		    state = oldState;
  3684   3684   		    result = TCL_CONVERT_NOSPACE;
  3685   3685   		    break;
  3686   3686   		}
  3687   3687   		memcpy(dst, subTablePtr->sequence,
  3688         -			(size_t) subTablePtr->sequenceLen);
         3688  +			subTablePtr->sequenceLen);
  3689   3689   		dst += subTablePtr->sequenceLen;
  3690   3690   	    }
  3691   3691   	}
  3692   3692   
  3693   3693   	if (tablePrefixBytes[(word >> 8)] != 0) {
  3694   3694   	    if (dst + 1 > dstEnd) {
  3695   3695   		result = TCL_CONVERT_NOSPACE;
................................................................................
  3724   3724   	if ((dst + dataPtr->finalLen + (state?len:0)) > dstEnd) {
  3725   3725   	    result = TCL_CONVERT_NOSPACE;
  3726   3726   	} else {
  3727   3727   	    if (state) {
  3728   3728   		memcpy(dst, dataPtr->subTables[0].sequence, len);
  3729   3729   		dst += len;
  3730   3730   	    }
  3731         -	    memcpy(dst, dataPtr->final, (size_t) dataPtr->finalLen);
         3731  +	    memcpy(dst, dataPtr->final, dataPtr->finalLen);
  3732   3732   	    dst += dataPtr->finalLen;
  3733   3733   	    state &= ~TCL_ENCODING_END;
  3734   3734   	}
  3735   3735       }
  3736   3736   
  3737   3737       *statePtr = (Tcl_EncodingState) INT2PTR(state);
  3738   3738       *srcReadPtr = src - srcStart;

Changes to jni/tcl/generic/tclUtil.c.

   897    897   		Tcl_SetErrorCode(interp, "TCL", "INTERNAL", "Tcl_SplitList",
   898    898   			NULL);
   899    899   	    }
   900    900   	    return TCL_ERROR;
   901    901   	}
   902    902   	argv[i] = p;
   903    903   	if (literal) {
   904         -	    memcpy(p, element, (size_t) elSize);
          904  +	    memcpy(p, element, elSize);
   905    905   	    p += elSize;
   906    906   	    *p = 0;
   907    907   	    p++;
   908    908   	} else {
   909    909   	    p += 1 + TclCopyAndCollapse(elSize, element, p);
   910    910   	}
   911    911       }
................................................................................
   935    935    *	None.
   936    936    *
   937    937    *----------------------------------------------------------------------
   938    938    */
   939    939   
   940    940   int
   941    941   Tcl_ScanElement(
   942         -    register const char *src,	/* String to convert to list element. */
   943         -    register int *flagPtr)	/* Where to store information to guide
   944         -				 * Tcl_ConvertCountedElement. */
          942  +    const char *src,	/* String to convert to list element. */
          943  +    int *flagPtr)	/* Where to store information to guide
          944  +			 * Tcl_ConvertCountedElement. */
   945    945   {
   946    946       return Tcl_ScanCountedElement(src, -1, flagPtr);
   947    947   }
   948    948   
   949    949   /*
   950    950    *----------------------------------------------------------------------
   951    951    *
................................................................................
  1315   1315    *	None.
  1316   1316    *
  1317   1317    *----------------------------------------------------------------------
  1318   1318    */
  1319   1319   
  1320   1320   int
  1321   1321   Tcl_ConvertElement(
  1322         -    register const char *src,	/* Source information for list element. */
  1323         -    register char *dst,		/* Place to put list-ified element. */
  1324         -    register int flags)		/* Flags produced by Tcl_ScanElement. */
         1322  +    const char *src,	/* Source information for list element. */
         1323  +    char *dst,		/* Place to put list-ified element. */
         1324  +    int flags)		/* Flags produced by Tcl_ScanElement. */
  1325   1325   {
  1326   1326       return Tcl_ConvertCountedElement(src, -1, dst, flags);
  1327   1327   }
  1328   1328   
  1329   1329   /*
  1330   1330    *----------------------------------------------------------------------
  1331   1331    *
................................................................................
  1345   1345    *	None.
  1346   1346    *
  1347   1347    *----------------------------------------------------------------------
  1348   1348    */
  1349   1349   
  1350   1350   int
  1351   1351   Tcl_ConvertCountedElement(
  1352         -    register const char *src,	/* Source information for list element. */
  1353         -    int length,			/* Number of bytes in src, or -1. */
  1354         -    char *dst,			/* Place to put list-ified element. */
  1355         -    int flags)			/* Flags produced by Tcl_ScanElement. */
         1352  +    const char *src,	/* Source information for list element. */
         1353  +    int length,		/* Number of bytes in src, or -1. */
         1354  +    char *dst,		/* Place to put list-ified element. */
         1355  +    int flags)		/* Flags produced by Tcl_ScanElement. */
  1356   1356   {
  1357   1357       int numBytes = TclConvertElement(src, length, dst, flags);
  1358   1358       dst[numBytes] = '\0';
  1359   1359       return numBytes;
  1360   1360   }
  1361   1361   
  1362   1362   /*
................................................................................
  1378   1378    *	None.
  1379   1379    *
  1380   1380    *----------------------------------------------------------------------
  1381   1381    */
  1382   1382   
  1383   1383   int
  1384   1384   TclConvertElement(
  1385         -    register const char *src,	/* Source information for list element. */
  1386         -    int length,			/* Number of bytes in src, or -1. */
  1387         -    char *dst,			/* Place to put list-ified element. */
  1388         -    int flags)			/* Flags produced by Tcl_ScanElement. */
         1385  +    const char *src,	/* Source information for list element. */
         1386  +    int length,		/* Number of bytes in src, or -1. */
         1387  +    char *dst,		/* Place to put list-ified element. */
         1388  +    int flags)		/* Flags produced by Tcl_ScanElement. */
  1389   1389   {
  1390   1390       int conversion = flags & CONVERT_MASK;
  1391   1391       char *p = dst;
  1392   1392   
  1393   1393       /*
  1394   1394        * Let the caller demand we use escape sequences rather than braces.
  1395   1395        */
................................................................................
  2008   2008   	Tcl_Panic("Tcl_Concat: max size of Tcl value exceeded");
  2009   2009       }
  2010   2010   
  2011   2011       /*
  2012   2012        * All element bytes + (argc - 1) spaces + 1 terminating NULL.
  2013   2013        */
  2014   2014   
  2015         -    result = ckalloc((unsigned) (bytesNeeded + argc));
         2015  +    result = ckalloc(bytesNeeded + argc);
  2016   2016   
  2017   2017       for (p = result, i = 0;  i < argc;  i++) {
  2018   2018   	int triml, trimr, elemLength;
  2019   2019   	const char *element;
  2020   2020   
  2021   2021   	element = argv[i];
  2022   2022   	elemLength = strlen(argv[i]);
................................................................................
  2041   2041   	/*
  2042   2042   	 * Append to the result with space if needed.
  2043   2043   	 */
  2044   2044   
  2045   2045   	if (needSpace) {
  2046   2046   	    *p++ = ' ';
  2047   2047   	}
  2048         -	memcpy(p, element, (size_t) elemLength);
         2048  +	memcpy(p, element, elemLength);
  2049   2049   	p += elemLength;
  2050   2050   	needSpace = 1;
  2051   2051       }
  2052   2052       *p = '\0';
  2053   2053       return result;
  2054   2054   }
  2055   2055   
................................................................................
  2743   2743        */
  2744   2744   
  2745   2745       if (newSize >= dsPtr->spaceAvl) {
  2746   2746   	dsPtr->spaceAvl = newSize * 2;
  2747   2747   	if (dsPtr->string == dsPtr->staticSpace) {
  2748   2748   	    char *newString = ckalloc(dsPtr->spaceAvl);
  2749   2749   
  2750         -	    memcpy(newString, dsPtr->string, (size_t) dsPtr->length);
         2750  +	    memcpy(newString, dsPtr->string, dsPtr->length);
  2751   2751   	    dsPtr->string = newString;
  2752   2752   	} else {
  2753   2753   	    int offset = -1;
  2754   2754   
  2755   2755   	    /* See [16896d49fd] */
  2756   2756   	    if (bytes >= dsPtr->string
  2757   2757   		    && bytes <= dsPtr->string + dsPtr->length) {
................................................................................
  2846   2846        */
  2847   2847   
  2848   2848       if (newSize >= dsPtr->spaceAvl) {
  2849   2849   	dsPtr->spaceAvl = newSize * 2;
  2850   2850   	if (dsPtr->string == dsPtr->staticSpace) {
  2851   2851   	    char *newString = ckalloc(dsPtr->spaceAvl);
  2852   2852   
  2853         -	    memcpy(newString, dsPtr->string, (size_t) dsPtr->length);
         2853  +	    memcpy(newString, dsPtr->string, dsPtr->length);
  2854   2854   	    dsPtr->string = newString;
  2855   2855   	} else {
  2856   2856   	    int offset = -1;
  2857   2857   
  2858   2858   	    /* See [16896d49fd] */
  2859   2859   	    if (element >= dsPtr->string
  2860   2860   		    && element <= dsPtr->string + dsPtr->length) {
................................................................................
  2940   2940   	    dsPtr->spaceAvl = newsize;
  2941   2941   	} else {
  2942   2942   	    dsPtr->spaceAvl = length + 1;
  2943   2943   	}
  2944   2944   	if (dsPtr->string == dsPtr->staticSpace) {
  2945   2945   	    char *newString = ckalloc(dsPtr->spaceAvl);
  2946   2946   
  2947         -	    memcpy(newString, dsPtr->string, (size_t) dsPtr->length);
         2947  +	    memcpy(newString, dsPtr->string, dsPtr->length);
  2948   2948   	    dsPtr->string = newString;
  2949   2949   	} else {
  2950   2950   	    dsPtr->string = ckrealloc(dsPtr->string, dsPtr->spaceAvl);
  2951   2951   	}
  2952   2952       }
  2953   2953       dsPtr->length = length;
  2954   2954       dsPtr->string[length] = 0;
................................................................................
  3044   3044   
  3045   3045       if (dsPtr->string != dsPtr->staticSpace) {
  3046   3046   	ckfree(dsPtr->string);
  3047   3047       }
  3048   3048   
  3049   3049       /*
  3050   3050        * Do more efficient transfer when we know the result is a Tcl_Obj. When
  3051         -     * there's no st`ring result, we only have to deal with two cases:
         3051  +     * there's no string result, we only have to deal with two cases:
  3052   3052        *
  3053   3053        *  1. When the string rep is the empty string, when we don't copy but
  3054   3054        *     instead use the staticSpace in the DString to hold an empty string.
  3055   3055   
  3056   3056        *  2. When the string rep is not there or there's a real string rep, when
  3057   3057        *     we use Tcl_GetString to fetch (or generate) the string rep - which
  3058   3058        *     we know to have been allocated with ckalloc() - and use it to
................................................................................
  3089   3089       dsPtr->length = strlen(iPtr->result);
  3090   3090       if (iPtr->freeProc != NULL) {
  3091   3091   	if (iPtr->freeProc == TCL_DYNAMIC) {
  3092   3092   	    dsPtr->string = iPtr->result;
  3093   3093   	    dsPtr->spaceAvl = dsPtr->length+1;
  3094   3094   	} else {
  3095   3095   	    dsPtr->string = ckalloc(dsPtr->length+1);
  3096         -	    memcpy(dsPtr->string, iPtr->result, (unsigned) dsPtr->length+1);
         3096  +	    memcpy(dsPtr->string, iPtr->result, dsPtr->length+1);
  3097   3097   	    iPtr->freeProc(iPtr->result);
  3098   3098   	}
  3099   3099   	dsPtr->spaceAvl = dsPtr->length+1;
  3100   3100   	iPtr->freeProc = NULL;
  3101   3101       } else {
  3102   3102   	if (dsPtr->length < TCL_DSTRING_STATIC_SIZE) {
  3103   3103   	    dsPtr->string = dsPtr->staticSpace;
  3104   3104   	    dsPtr->spaceAvl = TCL_DSTRING_STATIC_SIZE;
  3105   3105   	} else {
  3106   3106   	    dsPtr->string = ckalloc(dsPtr->length+1);
  3107   3107   	    dsPtr->spaceAvl = dsPtr->length + 1;
  3108   3108   	}
  3109         -	memcpy(dsPtr->string, iPtr->result, (unsigned) dsPtr->length+1);
         3109  +	memcpy(dsPtr->string, iPtr->result, dsPtr->length+1);
  3110   3110       }
  3111   3111   
  3112   3112       iPtr->result = iPtr->resultSpace;
  3113   3113       iPtr->resultSpace[0] = 0;
  3114   3114   }
  3115   3115   
  3116   3116   /*
................................................................................
  3257   3257   				 * at least TCL_DOUBLE_SPACE characters. */
  3258   3258   {
  3259   3259       char *p, c;
  3260   3260       int exponent;
  3261   3261       int signum;
  3262   3262       char *digits;
  3263   3263       char *end;
  3264         -    int *precisionPtr = Tcl_GetThreadData(&precisionKey, (int) sizeof(int));
         3264  +    int *precisionPtr = Tcl_GetThreadData(&precisionKey, sizeof(int));
  3265   3265   
  3266   3266       /*
  3267   3267        * Handle NaN.
  3268   3268        */
  3269   3269   
  3270   3270       if (TclIsNaN(value)) {
  3271   3271   	TclFormatNaN(value, dst);
................................................................................
  4096   4096   int
  4097   4097   TclCheckBadOctal(
  4098   4098       Tcl_Interp *interp,		/* Interpreter to use for error reporting. If
  4099   4099   				 * NULL, then no error message is left after
  4100   4100   				 * errors. */
  4101   4101       const char *value)		/* String to check. */
  4102   4102   {
  4103         -    register const char *p = value;
         4103  +    const char *p = value;
  4104   4104   
  4105   4105       /*
  4106   4106        * A frequent mistake is invalid octal values due to an unwanted leading
  4107   4107        * zero. Try to generate a meaningful error message.
  4108   4108        */
  4109   4109   
  4110   4110       while (TclIsSpaceProc(*p)) {
................................................................................
  4287   4287       if (NULL != pgvPtr->value) {
  4288   4288   	ckfree(pgvPtr->value);
  4289   4289       } else {
  4290   4290   	Tcl_CreateExitHandler(FreeProcessGlobalValue, pgvPtr);
  4291   4291       }
  4292   4292       bytes = Tcl_GetStringFromObj(newValue, &pgvPtr->numBytes);
  4293   4293       pgvPtr->value = ckalloc(pgvPtr->numBytes + 1);
  4294         -    memcpy(pgvPtr->value, bytes, (unsigned) pgvPtr->numBytes + 1);
         4294  +    memcpy(pgvPtr->value, bytes, pgvPtr->numBytes + 1);
  4295   4295       if (pgvPtr->encoding) {
  4296   4296   	Tcl_FreeEncoding(pgvPtr->encoding);
  4297   4297       }
  4298   4298       pgvPtr->encoding = encoding;
  4299   4299   
  4300   4300       /*
  4301   4301        * Fill the local thread copy directly with the Tcl_Obj value to avoid
................................................................................
  4353   4353   		    pgvPtr->numBytes, &native);
  4354   4354   	    Tcl_ExternalToUtfDString(current, Tcl_DStringValue(&native),
  4355   4355   	    Tcl_DStringLength(&native), &newValue);
  4356   4356   	    Tcl_DStringFree(&native);
  4357   4357   	    ckfree(pgvPtr->value);
  4358   4358   	    pgvPtr->value = ckalloc(Tcl_DStringLength(&newValue) + 1);
  4359   4359   	    memcpy(pgvPtr->value, Tcl_DStringValue(&newValue),
  4360         -		    (size_t) Tcl_DStringLength(&newValue) + 1);
         4360  +		    Tcl_DStringLength(&newValue) + 1);
  4361   4361   	    Tcl_DStringFree(&newValue);
  4362   4362   	    Tcl_FreeEncoding(pgvPtr->encoding);
  4363   4363   	    pgvPtr->encoding = current;
  4364   4364   	    Tcl_MutexUnlock(&pgvPtr->mutex);
  4365   4365   	} else {
  4366   4366   	    Tcl_FreeEncoding(current);
  4367   4367   	}
  4368   4368       }
  4369   4369       cacheMap = GetThreadHash(&pgvPtr->key);
  4370         -    hPtr = Tcl_FindHashEntry(cacheMap, (char *) INT2PTR(epoch));
         4370  +    hPtr = Tcl_FindHashEntry(cacheMap, INT2PTR(epoch));
  4371   4371       if (NULL == hPtr) {
  4372   4372   	int dummy;
  4373   4373   
  4374   4374   	/*
  4375   4375   	 * No cache for the current epoch - must be a new one.
  4376   4376   	 *
  4377   4377   	 * First, clear the cacheMap, as anything in it must refer to some

Changes to jni/tcl/library/init.tcl.

   643    643   		return [set auto_execs($name) [list $file]]
   644    644   	    }
   645    645   	}
   646    646   	return ""
   647    647       }
   648    648   
   649    649       set path "[file dirname [info nameof]];.;"
   650         -    if {[info exists env(WINDIR)]} {
          650  +    if {[info exists env(SystemRoot)]} {
          651  +	set windir $env(SystemRoot)
          652  +    } elseif {[info exists env(WINDIR)]} {
   651    653   	set windir $env(WINDIR)
   652    654       }
   653    655       if {[info exists windir]} {
   654    656   	if {$tcl_platform(os) eq "Windows NT"} {
   655    657   	    append path "$windir/system32;"
   656    658   	}
   657    659   	append path "$windir/system;$windir;"

jni/tcl/library/tzdata/America/Indiana/Tell_City became a regular file.


Changes to jni/tcl/tests/cmdAH.test.

  1345   1345   } -cleanup {
  1346   1346       removeFile touch.me /tmp
  1347   1347   } -result 1
  1348   1348   test cmdAH-25.3 {Tcl_FileObjCmd: owned} {unix notRoot} {
  1349   1349       file owned /
  1350   1350   } 0
  1351   1351   test cmdAH-25.3.1 {Tcl_FileObjCmd: owned} -constraints win -body {
  1352         -    file owned $env(windir)
         1352  +    if {[info exists env(SystemRoot)]} {
         1353  +	file owned $env(SystemRoot)
         1354  +    } else {
         1355  +	file owned $env(windir)
         1356  +    }
  1353   1357   } -result 0
  1354   1358   test cmdAH-25.4 {Tcl_FileObjCmd: owned} -body {
  1355   1359       file owned nosuchfile
  1356   1360   } -result 0
  1357   1361   
  1358   1362   # readlink
  1359   1363   test cmdAH-26.1 {Tcl_FileObjCmd: readlink} -returnCodes error -body {

Changes to jni/tcl/win/makefile.vc.

    47     47   # Visual Studio/Windows SDK for the appropriate target architecture.
    48     48   #
    49     49   # NOTE: For older (Visual C++ 6 or the 2003 SDK), to use the Platform
    50     50   # SDK (not expressly needed), run setenv.bat after
    51     51   # vcvars32.bat according to the instructions for it.  This can also
    52     52   # turn on the 64-bit compiler, if your SDK has it.
    53     53   #
           54  +# Basic macros and options usable on the commandline (see rules.vc for more info):
           55  +#	OPTS=msvcrt,static,staticpkg,symbols,nothreads,profile,unchecked,time64bit,none
           56  +#		Sets special options for the core.  The default is for none.
           57  +#		Any combination of the above may be used (comma separated).
           58  +#		'none' will over-ride everything to nothing.
           59  +#
           60  +#		msvcrt   = Affects the static option only to switch it from
           61  +#			   using libcmt(d) as the C runtime [by default] to
           62  +#			   msvcrt(d). This is useful for static embedding
           63  +#			   support.
           64  +#		static   = Builds a static library of the core instead of a
           65  +#			   dll.  The shell will be static (and large), as well.
           66  +#		staticpkg= Affects the static option only to switch
           67  +#			   tclshXX.exe to have the dde and reg extension linked
           68  +#			   inside it.
           69  +#		nothreads  = Turns off full multithreading support (default on).
           70  +#		thrdalloc = Use the thread allocator (shared global free pool).
           71  +#		symbols =  Adds symbols for step debugging.
           72  +#		profile =  Adds profiling hooks.  Map file is assumed.
           73  +#		unchecked = Allows a symbols build to not use the debug
           74  +#			   enabled runtime (msvcrt.dll not msvcrtd.dll
           75  +#			   or libcmt.lib not libcmtd.lib).
           76  +#		time64bit = Forces a build using 64-bit time_t for 32-bit build
           77  +#			   (CRT library should support this).
           78  +#
           79  +#	STATS=compdbg,memdbg,none
           80  +#		Sets optional memory and bytecode compiler debugging code added
           81  +#		to the core.  The default is for none.  Any combination of the
           82  +#		above may be used (comma separated).  'none' will over-ride
           83  +#		everything to nothing.
           84  +#
           85  +#		compdbg  = Enables byte compilation logging.
           86  +#		memdbg   = Enables the debugging memory allocator.
           87  +#
           88  +#	CHECKS=64bit,fullwarn,nodep,none
           89  +#		Sets special macros for checking compatibility.
           90  +#
           91  +#		64bit    = Enable 64bit portability warnings (if available)
           92  +#		fullwarn = Builds with full compiler and link warnings enabled.
           93  +#			    Very verbose.
           94  +#		nodep	 = Turns off compatibility macros to ensure the core
           95  +#			    isn't being built with deprecated functions.
           96  +#
           97  +#	MACHINE=(ALPHA|AMD64|IA64|IX86)
           98  +#		Set the machine type used for the compiler, linker, and
           99  +#		resource compiler.  This hook is needed to tell the tools
          100  +#		when alternate platforms are requested.  IX86 is the default
          101  +#		when not specified. If the CPU environment variable has been
          102  +#		set (ie: recent Platform SDK) then MACHINE is set from CPU.
          103  +#
          104  +#	TMP_DIR=<path>
          105  +#	OUT_DIR=<path>
          106  +#		Hooks to allow the intermediate and output directories to be
          107  +#		changed.  $(OUT_DIR) is assumed to be
          108  +#		$(BINROOT)\(Release|Debug) based on if symbols are requested.
          109  +#		$(TMP_DIR) will de $(OUT_DIR)\<buildtype> by default.
          110  +#
          111  +#	TESTPAT=<file>
          112  +#		Reads the tests requested to be run from this file.
          113  +#
          114  +#	CFG_ENCODING=encoding
          115  +#		name of encoding for configuration information. Defaults
          116  +#		to cp1252
          117  +#
    54    118   # Examples:
    55    119   #       c:\tcl_src\win\>nmake -f makefile.vc release
    56    120   #       c:\tcl_src\win\>nmake -f makefile.vc test
    57    121   #       c:\tcl_src\win\>nmake -f makefile.vc install INSTALLDIR=c:\progra~1\tcl
    58    122   #       c:\tcl_src\win\>nmake -f makefile.vc release OPTS=pdbs
    59    123   #       c:\tcl_src\win\>nmake -f makefile.vc release OPTS=symbols
    60    124   #
................................................................................
   478    542   	@for /d %d in ($(PKGSDIR)\*) do \
   479    543   	  @if exist "%~fd\win\makefile.vc" ( \
   480    544   	    pushd "%~fd\win" & \
   481    545   	    $(MAKE) -$(MAKEFLAGS) -f makefile.vc TCLDIR=$(ROOT) clean &\
   482    546   	    popd \
   483    547   	  )
   484    548   
   485         -$(CAT32): $(WINDIR)\cat.c
          549  +$(CAT32): $(WIN_DIR)\cat.c
   486    550   	$(cc32) $(cflags) $(crt) -D_CRT_NONSTDC_NO_DEPRECATE -DCONSOLE -Fo$(TMP_DIR)\ $?
   487    551   	$(CONEXECMD) -stack:16384 $(TMP_DIR)\cat.obj
   488    552   	$(_VC_MANIFEST_EMBED_EXE)
   489    553   
   490    554   #---------------------------------------------------------------------
   491    555   # Regenerate the stubs files.  [Development use only]
   492    556   #---------------------------------------------------------------------
................................................................................
   588    652   #---------------------------------------------------------------------
   589    653   # Build tclConfig.sh for the TEA build system.
   590    654   #---------------------------------------------------------------------
   591    655   
   592    656   tclConfig: $(OUT_DIR)\tclConfig.sh
   593    657   
   594    658   # TBD - is this tclConfig.sh file ever used? The values are incorrect!
   595         -$(OUT_DIR)\tclConfig.sh: $(WINDIR)\tclConfig.sh.in
          659  +$(OUT_DIR)\tclConfig.sh: $(WIN_DIR)\tclConfig.sh.in
   596    660   	@echo Creating tclConfig.sh
   597    661           @nmakehlp -s << $** >$@
   598    662   @TCL_DLL_FILE@       $(TCLLIBNAME)
   599    663   @TCL_VERSION@        $(DOTVERSION)
   600    664   @TCL_MAJOR_VERSION@  $(TCL_MAJOR_VERSION)
   601    665   @TCL_MINOR_VERSION@  $(TCL_MINOR_VERSION)
   602    666   @TCL_PATCH_LEVEL@    $(TCL_PATCH_LEVEL)
................................................................................
   664    728   	--name-prefix=TclDate \
   665    729   	$(GENERICDIR)/tclGetDate.y
   666    730   
   667    731   #---------------------------------------------------------------------
   668    732   # Special case object file targets
   669    733   #---------------------------------------------------------------------
   670    734   
   671         -$(TMP_DIR)\testMain.obj: $(WINDIR)\tclAppInit.c
          735  +$(TMP_DIR)\testMain.obj: $(WIN_DIR)\tclAppInit.c
   672    736   	$(cc32) $(appcflags) -DTCL_TEST \
   673    737   	    -DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
   674    738   	    -Fo$@ $?
   675    739   
   676    740   $(TMP_DIR)\tclMain2.obj: $(GENERICDIR)\tclMain.c
   677    741   	$(cc32) $(pkgcflags) -DTCL_ASCII_MAIN \
   678    742   	    -Fo$@ $?
................................................................................
   679    743   
   680    744   $(TMP_DIR)\tclTest.obj: $(GENERICDIR)\tclTest.c
   681    745   	$(cc32) $(appcflags) -Fo$@ $?
   682    746   
   683    747   $(TMP_DIR)\tclTestObj.obj: $(GENERICDIR)\tclTestObj.c
   684    748   	$(cc32) $(appcflags) -Fo$@ $?
   685    749   
   686         -$(TMP_DIR)\tclWinTest.obj: $(WINDIR)\tclWinTest.c
          750  +$(TMP_DIR)\tclWinTest.obj: $(WIN_DIR)\tclWinTest.c
   687    751   	$(CCAPPCMD) $?
   688    752   
   689    753   $(TMP_DIR)\tclZlib.obj: $(GENERICDIR)\tclZlib.c
   690    754   	$(cc32) $(pkgcflags) -I$(COMPATDIR)\zlib -Fo$@ $?
   691    755   
   692    756   $(TMP_DIR)\tclPkgConfig.obj: $(GENERICDIR)\tclPkgConfig.c
   693    757   	$(cc32) $(pkgcflags) \
................................................................................
   699    763   	-DCFG_RUNTIME_LIBDIR="\"$(LIB_INSTALL_DIR:\=\\)\"" \
   700    764   	-DCFG_RUNTIME_BINDIR="\"$(BIN_INSTALL_DIR:\=\\)\"" \
   701    765   	-DCFG_RUNTIME_SCRDIR="\"$(SCRIPT_INSTALL_DIR:\=\\)\"" \
   702    766   	-DCFG_RUNTIME_INCDIR="\"$(INCLUDE_INSTALL_DIR:\=\\)\"" \
   703    767   	-DCFG_RUNTIME_DOCDIR="\"$(DOC_INSTALL_DIR:\=\\)\""     \
   704    768   	-Fo$@ $?
   705    769   
   706         -$(TMP_DIR)\tclAppInit.obj: $(WINDIR)\tclAppInit.c
          770  +$(TMP_DIR)\tclAppInit.obj: $(WIN_DIR)\tclAppInit.c
   707    771   	$(cc32) $(appcflags) \
   708    772   	    -DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
   709    773   	    -Fo$@ $?
   710    774   
   711    775   ### The following objects should be built using the stub interfaces
   712    776   ### *ALL* extensions need to built with -DTCL_THREADS=1
   713    777   
   714         -$(TMP_DIR)\tclWinReg.obj: $(WINDIR)\tclWinReg.c
          778  +$(TMP_DIR)\tclWinReg.obj: $(WIN_DIR)\tclWinReg.c
   715    779   !if $(STATIC_BUILD)
   716    780   	$(cc32) $(appcflags) -DSTATIC_BUILD -Fo$@ $?
   717    781   !else
   718    782   	$(cc32) $(appcflags) -DUSE_TCL_STUBS -Fo$@ $?
   719    783   !endif
   720    784   
   721    785   
   722         -$(TMP_DIR)\tclWinDde.obj: $(WINDIR)\tclWinDde.c
          786  +$(TMP_DIR)\tclWinDde.obj: $(WIN_DIR)\tclWinDde.c
   723    787   !if $(STATIC_BUILD)
   724    788   	$(cc32) $(appcflags) -DSTATIC_BUILD -Fo$@ $?
   725    789   !else
   726    790   	$(cc32) $(appcflags) -DUSE_TCL_STUBS -Fo$@ $?
   727    791   !endif
   728    792   
   729    793   
................................................................................
   736    800   
   737    801   $(TMP_DIR)\tclTomMathStubLib.obj: $(GENERICDIR)\tclTomMathStubLib.c
   738    802   	$(cc32) $(stubscflags) -Fo$@ $?
   739    803   
   740    804   $(TMP_DIR)\tclOOStubLib.obj: $(GENERICDIR)\tclOOStubLib.c
   741    805   	$(cc32) $(stubscflags) -Fo$@ $?
   742    806   
   743         -$(TMP_DIR)\tclsh.exe.manifest: $(WINDIR)\tclsh.exe.manifest.in
          807  +$(TMP_DIR)\tclsh.exe.manifest: $(WIN_DIR)\tclsh.exe.manifest.in
   744    808   	@nmakehlp -s << $** >$@
   745    809   @MACHINE@	  $(MACHINE:IX86=X86)
   746    810   @TCL_WIN_VERSION@  $(DOTVERSION).0.0
   747    811   <<
   748    812   
   749    813   #---------------------------------------------------------------------
   750    814   # Generate the source dependencies.  Having dependency rules will
................................................................................
   756    820   
   757    821   depend:
   758    822   !if !exist($(TCLSH))
   759    823   	@echo Build tclsh first!
   760    824   !else
   761    825   	$(TCLSH) $(TOOLSDIR:\=/)/mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \
   762    826   		-passthru:"-DBUILD_tcl $(TCL_INCLUDES) $(PRJ_INCLUDES)" $(GENERICDIR),$$(GENERICDIR) \
   763         -		$(COMPATDIR),$$(COMPATDIR) $(TOMMATHDIR),$$(TOMMATHDIR) $(WINDIR),$$(WINDIR) @<<
          827  +		$(COMPATDIR),$$(COMPATDIR) $(TOMMATHDIR),$$(TOMMATHDIR) $(WIN_DIR),$$(WIN_DIR) @<<
   764    828   $(TCLOBJS)
   765    829   <<
   766    830   !endif
   767    831   
   768    832   #---------------------------------------------------------------------
   769    833   # Dependency rules
   770    834   #---------------------------------------------------------------------
................................................................................
   793    857   <<
   794    858   
   795    859   {$(COMPATDIR)\zlib}.c{$(TMP_DIR)}.obj::
   796    860   	$(cc32) $(pkgcflags) -Fo$(TMP_DIR)\ @<<
   797    861   $<
   798    862   <<
   799    863   
   800         -$(TMP_DIR)\tclsh.res: $(TMP_DIR)\tclsh.exe.manifest $(WINDIR)\tclsh.rc
          864  +$(TMP_DIR)\tclsh.res: $(TMP_DIR)\tclsh.exe.manifest $(WIN_DIR)\tclsh.rc
   801    865   
   802    866   
   803    867   #---------------------------------------------------------------------
   804    868   # Installation.
   805    869   #---------------------------------------------------------------------
   806    870   
   807    871   install-binaries:
................................................................................
   851    915   	@$(CPY) "$(ROOT)\library\parray.tcl"      "$(SCRIPT_INSTALL_DIR)\"
   852    916   	@$(CPY) "$(ROOT)\library\safe.tcl"        "$(SCRIPT_INSTALL_DIR)\"
   853    917   	@$(CPY) "$(ROOT)\library\tclIndex"        "$(SCRIPT_INSTALL_DIR)\"
   854    918   	@$(CPY) "$(ROOT)\library\package.tcl"     "$(SCRIPT_INSTALL_DIR)\"
   855    919   	@$(CPY) "$(ROOT)\library\word.tcl"        "$(SCRIPT_INSTALL_DIR)\"
   856    920   	@$(CPY) "$(ROOT)\library\auto.tcl"        "$(SCRIPT_INSTALL_DIR)\"
   857    921   	@$(CPY) "$(OUT_DIR)\tclConfig.sh"         "$(LIB_INSTALL_DIR)\"
   858         -	@$(CPY) "$(WINDIR)\tclooConfig.sh"        "$(LIB_INSTALL_DIR)\"
   859         -	@$(CPY) "$(WINDIR)\rules.vc"              "$(LIB_INSTALL_DIR)\nmake\"
   860         -	@$(CPY) "$(WINDIR)\targets.vc"              "$(LIB_INSTALL_DIR)\nmake\"
   861         -	@$(CPY) "$(WINDIR)\nmakehlp.c"            "$(LIB_INSTALL_DIR)\nmake\"
          922  +	@$(CPY) "$(WIN_DIR)\tclooConfig.sh"        "$(LIB_INSTALL_DIR)\"
          923  +	@$(CPY) "$(WIN_DIR)\rules.vc"              "$(LIB_INSTALL_DIR)\nmake\"
          924  +	@$(CPY) "$(WIN_DIR)\targets.vc"              "$(LIB_INSTALL_DIR)\nmake\"
          925  +	@$(CPY) "$(WIN_DIR)\nmakehlp.c"            "$(LIB_INSTALL_DIR)\nmake\"
   862    926   	@$(CPY) "$(OUT_DIR)\tcl.nmake"            "$(LIB_INSTALL_DIR)\nmake\"
   863    927   	@echo Installing library http1.0 directory
   864    928   	@$(CPY) "$(ROOT)\library\http1.0\*.tcl" \
   865    929   	    "$(SCRIPT_INSTALL_DIR)\http1.0\"
   866    930   	@echo Installing library opt0.4 directory
   867    931   	@$(CPY) "$(ROOT)\library\opt\*.tcl" \
   868    932   	    "$(SCRIPT_INSTALL_DIR)\opt0.4\"

Changes to jni/tcl/win/rules.vc.

    20     20   !ifndef _RULES_VC
    21     21   _RULES_VC = 1
    22     22   
    23     23   # The following macros define the version of the rules.vc nmake build system
    24     24   # For modifications that are not backward-compatible, you *must* change
    25     25   # the major version.
    26     26   RULES_VERSION_MAJOR = 1
    27         -RULES_VERSION_MINOR = 3
           27  +RULES_VERSION_MINOR = 4
    28     28   
    29     29   # The PROJECT macro must be defined by parent makefile.
    30     30   !if "$(PROJECT)" == ""
    31     31   !error *** Error: Macro PROJECT not defined! Please define it before including rules.vc
    32     32   !endif
    33     33   
    34     34   !if "$(PRJ_PACKAGE_TCLNAME)" == ""
................................................................................
   158    158   # some Tcl interfaces that are not publicly exposed.
   159    159   #
   160    160   # The fragment will set the following macros:
   161    161   # ROOT - root of this module sources
   162    162   # COMPATDIR - source directory that holds compatibility sources
   163    163   # DOCDIR - source directory containing documentation files
   164    164   # GENERICDIR - platform-independent source directory
   165         -# WINDIR - Windows-specific source directory
          165  +# WIN_DIR - Windows-specific source directory
   166    166   # TESTDIR - directory containing test files
   167    167   # TOOLSDIR - directory containing build tools
   168    168   # _TCLDIR - root of the Tcl installation OR the Tcl sources. Not set
   169    169   #    when building Tcl itself.
   170    170   # _INSTALLDIR - native form of the installation path. For Tcl
   171    171   #    this will be the root of the Tcl installation. For extensions
   172    172   #    this will be the lib directory under the root.
................................................................................
   211    211   !ifndef DEMODIR
   212    212   !if exist("$(LIBDIR)\demos")
   213    213   DEMODIR		= $(LIBDIR)\demos
   214    214   !else
   215    215   DEMODIR		= $(ROOT)\demos
   216    216   !endif
   217    217   !endif # ifndef DEMODIR
   218         -# Do NOT enclose WINDIR in a !ifndef because Windows always defines
   219         -# WINDIR env var to point to c:\windows!
   220         -# TBD - This is a potentially dangerous conflict, rename WINDIR to
   221         -# something else
   222         -WINDIR		= $(ROOT)\win
          218  +# Do NOT use WINDIR because it is Windows internal environment
          219  +# variable to point to c:\windows!
          220  +WIN_DIR		= $(ROOT)\win
   223    221   
   224    222   !ifndef RCDIR
   225         -!if exist("$(WINDIR)\rc")
   226         -RCDIR           = $(WINDIR)\rc
          223  +!if exist("$(WIN_DIR)\rc")
          224  +RCDIR           = $(WIN_DIR)\rc
   227    225   !else
   228         -RCDIR           = $(WINDIR)
          226  +RCDIR           = $(WIN_DIR)
   229    227   !endif
   230    228   !endif
   231    229   RCDIR = $(RCDIR:/=\)
   232    230   
   233    231   # The target directory where the built packages and binaries will be installed.
   234    232   # INSTALLDIR is the (optional) path specified by the user.
   235    233   # _INSTALLDIR is INSTALLDIR using the backslash separator syntax
................................................................................
   743    741   TCL_USE_STATIC_PACKAGES	= 1
   744    742   !else
   745    743   TCL_USE_STATIC_PACKAGES	= 0
   746    744   !endif
   747    745   
   748    746   !if [nmakehlp -f $(OPTS) "nothreads"]
   749    747   !message *** Compile explicitly for non-threaded tcl
   750         -TCL_THREADS	= 0
          748  +TCL_THREADS = 0
   751    749   USE_THREAD_ALLOC= 0
   752    750   !else
   753    751   TCL_THREADS	= 1
   754    752   USE_THREAD_ALLOC= 1
   755    753   !endif
   756    754   
   757    755   # Yes, it's weird that the "symbols" option controls DEBUG and
................................................................................
  1074   1072   
  1075   1073   # The name of the stubs library for the project being built
  1076   1074   STUBPREFIX      = $(PROJECT)stub
  1077   1075   
  1078   1076   # Set up paths to various Tcl executables and libraries needed by extensions
  1079   1077   !if $(DOING_TCL)
  1080   1078   
  1081         -TCLSHNAME       = $(PROJECT)sh$(TCL_VERSION)$(SUFX).exe
         1079  +TCLSHNAME       = $(PROJECT)sh$(VERSION)$(SUFX).exe
  1082   1080   TCLSH		= $(OUT_DIR)\$(TCLSHNAME)
  1083   1081   TCLIMPLIB	= $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib
  1084   1082   TCLLIBNAME	= $(PROJECT)$(VERSION)$(SUFX).$(EXT)
  1085   1083   TCLLIB		= $(OUT_DIR)\$(TCLLIBNAME)
  1086   1084   
  1087   1085   TCLSTUBLIBNAME	= $(STUBPREFIX)$(VERSION).lib
  1088   1086   TCLSTUBLIB	= $(OUT_DIR)\$(TCLSTUBLIBNAME)
  1089         -TCL_INCLUDES    = -I"$(WINDIR)" -I"$(GENERICDIR)"
         1087  +TCL_INCLUDES    = -I"$(WIN_DIR)" -I"$(GENERICDIR)"
  1090   1088   
  1091   1089   !else # ! $(DOING_TCL)
  1092   1090   
  1093   1091   !if $(TCLINSTALL) # Building against an installed Tcl
  1094   1092   
  1095   1093   # When building extensions, we need to locate tclsh. Depending on version
  1096   1094   # of Tcl we are building against, this may or may not have a "t" suffix.
  1097   1095   # Try various possibilities in turn.
  1098         -TCLSH		= $(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe
  1099         -!if !exist("$(TCLSH)") && $(TCL_THREADS)
  1100         -TCLSH           = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX).exe
  1101         -!endif
         1096  +TCLSH		= $(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX:t=).exe
  1102   1097   !if !exist("$(TCLSH)")
  1103         -TCLSH           = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX:t=).exe
         1098  +TCLSH           = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX:t=).exe
  1104   1099   !endif
  1105   1100   
  1106   1101   TCLSTUBLIB	= $(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib
  1107         -TCLIMPLIB	= $(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib
         1102  +TCLIMPLIB	= $(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX:t=).lib
  1108   1103   # When building extensions, may be linking against Tcl that does not add
  1109   1104   # "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility.
  1110   1105   !if !exist("$(TCLIMPLIB)")
  1111         -TCLIMPLIB	= $(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX:t=).lib
         1106  +TCLIMPLIB	= $(_TCLDIR)\lib\tcl$(TCL_VERSION)t$(SUFX:t=).lib
  1112   1107   !endif
  1113   1108   TCL_LIBRARY	= $(_TCLDIR)\lib
  1114   1109   TCLREGLIB	= $(_TCLDIR)\lib\tclreg13$(SUFX:t=).lib
  1115   1110   TCLDDELIB	= $(_TCLDIR)\lib\tcldde14$(SUFX:t=).lib
  1116   1111   TCLTOOLSDIR	= \must\have\tcl\sources\to\build\this\target
  1117   1112   TCL_INCLUDES    = -I"$(_TCLDIR)\include"
  1118   1113   
  1119   1114   !else # Building against Tcl sources
  1120   1115   
  1121         -TCLSH		= $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe
  1122         -!if !exist($(TCLSH)) && $(TCL_THREADS)
  1123         -TCLSH		= $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX).exe
  1124         -!endif
         1116  +TCLSH		= $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX:t=).exe
  1125   1117   !if !exist($(TCLSH))
  1126         -TCLSH		= $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX:t=).exe
         1118  +TCLSH		= $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX:t=).exe
  1127   1119   !endif
  1128   1120   TCLSTUBLIB	= $(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib
  1129         -TCLIMPLIB	= $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib
         1121  +TCLIMPLIB	= $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX:t=).lib
  1130   1122   # When building extensions, may be linking against Tcl that does not add
  1131   1123   # "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility.
  1132   1124   !if !exist("$(TCLIMPLIB)")
  1133         -TCLIMPLIB	= $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX:t=).lib
         1125  +TCLIMPLIB	= $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)t$(SUFX:t=).lib
  1134   1126   !endif
  1135   1127   TCL_LIBRARY	= $(_TCLDIR)\library
  1136   1128   TCLREGLIB	= $(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg13$(SUFX:t=).lib
  1137   1129   TCLDDELIB	= $(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde14$(SUFX:t=).lib
  1138   1130   TCLTOOLSDIR	= $(_TCLDIR)\tools
  1139   1131   TCL_INCLUDES	= -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win"
  1140   1132   
................................................................................
  1163   1155   TKIMPLIBNAME	= tk$(TK_VERSION)$(SUFX).lib
  1164   1156   
  1165   1157   !if $(DOING_TK)
  1166   1158   WISH 		= $(OUT_DIR)\$(WISHNAME)
  1167   1159   TKSTUBLIB	= $(OUT_DIR)\$(TKSTUBLIBNAME)
  1168   1160   TKIMPLIB	= $(OUT_DIR)\$(TKIMPLIBNAME)
  1169   1161   TKLIB		= $(OUT_DIR)\$(TKLIBNAME)
  1170         -TK_INCLUDES    = -I"$(WINDIR)" -I"$(GENERICDIR)"
         1162  +TK_INCLUDES    = -I"$(WIN_DIR)" -I"$(GENERICDIR)"
  1171   1163   
  1172   1164   !else # effectively NEED_TK
  1173   1165   
  1174   1166   !if $(TKINSTALL) # Building against installed Tk
  1175   1167   WISH		= $(_TKDIR)\bin\$(WISHNAME)
  1176   1168   TKSTUBLIB	= $(_TKDIR)\lib\$(TKSTUBLIBNAME)
  1177   1169   TKIMPLIB	= $(_TKDIR)\lib\$(TKIMPLIBNAME)
................................................................................
  1282   1274   
  1283   1275   !if $(TCL_MEM_DEBUG)
  1284   1276   OPTDEFINES	= $(OPTDEFINES) -DTCL_MEM_DEBUG
  1285   1277   !endif
  1286   1278   !if $(TCL_COMPILE_DEBUG)
  1287   1279   OPTDEFINES	= $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS
  1288   1280   !endif
  1289         -!if $(TCL_THREADS) && $(TCL_VERSION) <= 86
         1281  +!if $(TCL_THREADS) && $(TCL_VERSION) < 87
  1290   1282   OPTDEFINES	= $(OPTDEFINES) -DTCL_THREADS=1
  1291         -!if $(USE_THREAD_ALLOC)
         1283  +!if $(USE_THREAD_ALLOC) && $(TCL_VERSION) < 87
  1292   1284   OPTDEFINES	= $(OPTDEFINES) -DUSE_THREAD_ALLOC=1
  1293   1285   !endif
  1294   1286   !endif
  1295   1287   !if $(STATIC_BUILD)
  1296   1288   OPTDEFINES	= $(OPTDEFINES) -DSTATIC_BUILD
  1297   1289   !endif
  1298   1290   !if $(TCL_NO_DEPRECATED)
................................................................................
  1408   1400   !if $(DEBUG)
  1409   1401   # Turn warnings into errors
  1410   1402   cwarn = $(cwarn) -WX
  1411   1403   !endif
  1412   1404   
  1413   1405   INCLUDES = $(TCL_INCLUDES) $(TK_INCLUDES) $(PRJ_INCLUDES)
  1414   1406   !if !$(DOING_TCL) && !$(DOING_TK)
  1415         -INCLUDES = $(INCLUDES) -I"$(GENERICDIR)" -I"$(WINDIR)" -I"$(COMPATDIR)"
         1407  +INCLUDES = $(INCLUDES) -I"$(GENERICDIR)" -I"$(WIN_DIR)" -I"$(COMPATDIR)"
  1416   1408   !endif
  1417   1409   
  1418   1410   # These flags are defined roughly in the order of the pre-reform
  1419   1411   # rules.vc/makefile.vc to help visually compare that the pre- and
  1420   1412   # post-reform build logs
  1421   1413   
  1422   1414   # cflags contains generic flags used for building practically all object files
................................................................................
  1602   1594   	@echo Installing demos to '$(DEMO_INSTALL_DIR)'
  1603   1595   	@if not exist "$(DEMO_INSTALL_DIR)" mkdir "$(DEMO_INSTALL_DIR)"
  1604   1596   	@if exist $(DEMODIR) $(CPYDIR) "$(DEMODIR)" "$(DEMO_INSTALL_DIR)"
  1605   1597   
  1606   1598   default-clean:
  1607   1599   	@echo Cleaning $(TMP_DIR)\* ...
  1608   1600   	@if exist $(TMP_DIR)\nul $(RMDIR) $(TMP_DIR)
  1609         -	@echo Cleaning $(WINDIR)\nmakehlp.obj, nmakehlp.exe ...
  1610         -	@if exist $(WINDIR)\nmakehlp.obj del $(WINDIR)\nmakehlp.obj
  1611         -	@if exist $(WINDIR)\nmakehlp.exe del $(WINDIR)\nmakehlp.exe
  1612         -	@if exist $(WINDIR)\nmakehlp.out del $(WINDIR)\nmakehlp.out
  1613         -	@echo Cleaning $(WINDIR)\nmhlp-out.txt ...
  1614         -	@if exist $(WINDIR)\nmhlp-out.txt del $(WINDIR)\nmhlp-out.txt
  1615         -	@echo Cleaning $(WINDIR)\_junk.pch ...
  1616         -	@if exist $(WINDIR)\_junk.pch del $(WINDIR)\_junk.pch
  1617         -	@echo Cleaning $(WINDIR)\vercl.x, vercl.i ...
  1618         -	@if exist $(WINDIR)\vercl.x del $(WINDIR)\vercl.x
  1619         -	@if exist $(WINDIR)\vercl.i del $(WINDIR)\vercl.i
  1620         -	@echo Cleaning $(WINDIR)\versions.vc, version.vc ...
  1621         -	@if exist $(WINDIR)\versions.vc del $(WINDIR)\versions.vc
  1622         -	@if exist $(WINDIR)\version.vc del $(WINDIR)\version.vc
         1601  +	@echo Cleaning $(WIN_DIR)\nmakehlp.obj, nmakehlp.exe ...
         1602  +	@if exist $(WIN_DIR)\nmakehlp.obj del $(WIN_DIR)\nmakehlp.obj
         1603  +	@if exist $(WIN_DIR)\nmakehlp.exe del $(WIN_DIR)\nmakehlp.exe
         1604  +	@if exist $(WIN_DIR)\nmakehlp.out del $(WIN_DIR)\nmakehlp.out
         1605  +	@echo Cleaning $(WIN_DIR)\nmhlp-out.txt ...
         1606  +	@if exist $(WIN_DIR)\nmhlp-out.txt del $(WIN_DIR)\nmhlp-out.txt
         1607  +	@echo Cleaning $(WIN_DIR)\_junk.pch ...
         1608  +	@if exist $(WIN_DIR)\_junk.pch del $(WIN_DIR)\_junk.pch
         1609  +	@echo Cleaning $(WIN_DIR)\vercl.x, vercl.i ...
         1610  +	@if exist $(WIN_DIR)\vercl.x del $(WIN_DIR)\vercl.x
         1611  +	@if exist $(WIN_DIR)\vercl.i del $(WIN_DIR)\vercl.i
         1612  +	@echo Cleaning $(WIN_DIR)\versions.vc, version.vc ...
         1613  +	@if exist $(WIN_DIR)\versions.vc del $(WIN_DIR)\versions.vc
         1614  +	@if exist $(WIN_DIR)\version.vc del $(WIN_DIR)\version.vc
  1623   1615   
  1624   1616   default-hose: default-clean
  1625   1617   	@echo Hosing $(OUT_DIR)\* ...
  1626   1618   	@if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR)
  1627   1619   
  1628   1620   # Only for backward compatibility
  1629   1621   default-distclean: default-hose
................................................................................
  1707   1699   # main application, the master makefile should define explicit rules.
  1708   1700   
  1709   1701   {$(ROOT)}.c{$(TMP_DIR)}.obj::
  1710   1702   	$(CCPKGCMD) @<<
  1711   1703   $<
  1712   1704   <<
  1713   1705   
  1714         -{$(WINDIR)}.c{$(TMP_DIR)}.obj::
         1706  +{$(WIN_DIR)}.c{$(TMP_DIR)}.obj::
  1715   1707   	$(CCPKGCMD) @<<
  1716   1708   $<
  1717   1709   <<
  1718   1710   
  1719   1711   {$(GENERICDIR)}.c{$(TMP_DIR)}.obj::
  1720   1712   	$(CCPKGCMD) @<<
  1721   1713   $<
................................................................................
  1725   1717   	$(CCPKGCMD) @<<
  1726   1718   $<
  1727   1719   <<
  1728   1720   
  1729   1721   {$(RCDIR)}.rc{$(TMP_DIR)}.res:
  1730   1722   	$(RESCMD) $<
  1731   1723   
  1732         -{$(WINDIR)}.rc{$(TMP_DIR)}.res:
         1724  +{$(WIN_DIR)}.rc{$(TMP_DIR)}.res:
  1733   1725   	$(RESCMD) $<
  1734   1726   
  1735   1727   {$(TMP_DIR)}.rc{$(TMP_DIR)}.res:
  1736   1728   	$(RESCMD) $<
  1737   1729   
  1738   1730   .SUFFIXES:
  1739   1731   .SUFFIXES:.c .rc
................................................................................
  1760   1752   !if $(CONFIG_CHECK)
  1761   1753   !ifdef TCLNMAKECONFIG
  1762   1754   !include $(TCLNMAKECONFIG)
  1763   1755   
  1764   1756   !if defined(CORE_MACHINE) && "$(CORE_MACHINE)" != "$(MACHINE)"
  1765   1757   !error ERROR: Build target ($(MACHINE)) does not match the Tcl library architecture ($(CORE_MACHINE)).
  1766   1758   !endif
  1767         -!if defined(CORE_USE_THREAD_ALLOC) && $(CORE_USE_THREAD_ALLOC) != $(USE_THREAD_ALLOC)
         1759  +!if $(TCL_VERSION) < 87 && defined(CORE_USE_THREAD_ALLOC) && $(CORE_USE_THREAD_ALLOC) != $(USE_THREAD_ALLOC)
  1768   1760   !message WARNING: Value of USE_THREAD_ALLOC ($(USE_THREAD_ALLOC)) does not match its Tcl core value ($(CORE_USE_THREAD_ALLOC)).
  1769   1761   !endif
  1770   1762   !if defined(CORE_DEBUG) && $(CORE_DEBUG) != $(DEBUG)
  1771   1763   !message WARNING: Value of DEBUG ($(DEBUG)) does not match its Tcl library configuration ($(DEBUG)).
  1772   1764   !endif
  1773   1765   !endif
  1774   1766