summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog16
-rw-r--r--generic/tclEvent.c28
-rw-r--r--generic/tclInt.h21
-rw-r--r--generic/tclThread.c134
-rw-r--r--generic/tclThreadStorage.c860
-rw-r--r--unix/tcl.m44
-rw-r--r--unix/tclConfig.h.in3
-rw-r--r--unix/tclUnixThrd.c168
-rw-r--r--win/Makefile.in4
-rwxr-xr-xwin/configure673
-rw-r--r--win/rules.vc11
-rw-r--r--win/tcl.m43
-rw-r--r--win/tclWinThrd.c202
13 files changed, 694 insertions, 1433 deletions
diff --git a/ChangeLog b/ChangeLog
index 500808f..822da12 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2004-08-11 Kevin Kenny <kennykb@acm.org>
+
+ * generic/tclEvent.c: Eliminated the USE_THREAD_STORAGE
+ * generic/tclInt.h: option (which is on in every build
+ * generic/tclThread.c: generated by the standard configurator).
+ * generic/tclThreadStorage.c: Eliminated the code for thread
+ * unix/configure: specific data without USE_THREAD_STORAGE
+ * unix/tcl.m4: and radically refactored the code
+ * unix/tclConfig.h.in: for USE_THREAD_STORAGE so that it
+ * unix/tclUnixThrd.c: has fewer dependencies on the order
+ * win/configure: of finalization. (Also, made
+ * win/Makefile.in: 'make distclean' on Windows clean
+ * win/rules.vc: just a little bit cleaner.)
+ * win/tcl.m4:
+ * win/tclWinThrd.c:
+
2005-08-10 Kevin Kenny <kennykb@acm.org>
* generic/tclEvent.c (Tcl_Finalize): Pushed Tcl_FinalizeLoad and
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index 713ef30..270e11b 100644
--- a/generic/tclEvent.c
+++ b/generic/tclEvent.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclEvent.c,v 1.62 2005/08/10 16:28:02 kennykb Exp $
+ * RCS: @(#) $Id: tclEvent.c,v 1.63 2005/08/11 22:06:47 kennykb Exp $
*/
#include "tclInt.h"
@@ -782,6 +782,8 @@ TclInitSubsystems()
* implementation of self-initializing locks.
*/
+ TclInitThreadStorage(); /* Creates master hash table for
+ * thread local storage */
#if USE_TCLALLOC
TclInitAlloc(); /* Process wide mutex init */
#endif
@@ -952,6 +954,23 @@ Tcl_Finalize()
#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC)
TclFinalizeThreadAlloc();
#endif
+ /*
+ * We defer unloading of packages until very late to avoid memory
+ * access issues. Both exit callbacks and synchronization variables
+ * may be stored in packages.
+ *
+ * Note that TclFinalizeLoad unloads packages in the reverse of the
+ * order they were loaded in (i.e. last to be loaded is the first to
+ * be unloaded). This can be important for correct unloading when
+ * dependencies exist.
+ *
+ * Once load has been finalized, we will have deleted any temporary
+ * copies of shared libraries and can therefore reset the filesystem
+ * to its original state.
+ */
+
+ TclFinalizeLoad();
+ TclResetFilesystem();
/*
* We defer unloading of packages until very late to avoid memory
@@ -1002,6 +1021,13 @@ void
Tcl_FinalizeThread()
{
ExitHandler *exitPtr;
+
+ /*
+ * We use TclThreadDataKeyGet here, rather than Tcl_GetThreadData,
+ * because we don't want to initialize the data block if it hasn't
+ * been initialized already.
+ */
+
ThreadSpecificData *tsdPtr =
(ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 82bf45e..8ba85b6 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclInt.h,v 1.244 2005/08/05 23:56:29 dkf Exp $
+ * RCS: @(#) $Id: tclInt.h,v 1.245 2005/08/11 22:06:47 kennykb Exp $
*/
#ifndef _TCLINT
@@ -2061,15 +2061,11 @@ MODULE_SCOPE void TclpFinalizeCondition _ANSI_ARGS_((
Tcl_Condition *condPtr));
MODULE_SCOPE void TclpFinalizeMutex _ANSI_ARGS_((Tcl_Mutex *mutexPtr));
MODULE_SCOPE void TclpFinalizePipes _ANSI_ARGS_((void));
-MODULE_SCOPE void TclpFinalizeThreadData _ANSI_ARGS_((
- Tcl_ThreadDataKey *keyPtr));
MODULE_SCOPE int TclpThreadCreate _ANSI_ARGS_((
Tcl_ThreadId *idPtr,
Tcl_ThreadCreateProc proc,
ClientData clientData,
int stackSize, int flags));
-MODULE_SCOPE void TclpFinalizeThreadDataKey _ANSI_ARGS_((
- Tcl_ThreadDataKey *keyPtr));
MODULE_SCOPE int TclpFindVariable _ANSI_ARGS_((CONST char *name,
int *lengthPtr));
MODULE_SCOPE void TclpInitLibraryPath _ANSI_ARGS_((char **valuePtr,
@@ -2121,16 +2117,12 @@ MODULE_SCOPE void TclpUnloadFile _ANSI_ARGS_((
Tcl_LoadHandle loadHandle));
MODULE_SCOPE VOID * TclpThreadDataKeyGet _ANSI_ARGS_((
Tcl_ThreadDataKey *keyPtr));
-MODULE_SCOPE void TclpThreadDataKeyInit _ANSI_ARGS_((
- Tcl_ThreadDataKey *keyPtr));
MODULE_SCOPE void TclpThreadDataKeySet _ANSI_ARGS_((
Tcl_ThreadDataKey *keyPtr, VOID *data));
MODULE_SCOPE void TclpThreadExit _ANSI_ARGS_((int status));
MODULE_SCOPE int TclpThreadGetStackSize _ANSI_ARGS_((void));
MODULE_SCOPE void TclRememberCondition _ANSI_ARGS_((
Tcl_Condition *mutex));
-MODULE_SCOPE void TclRememberDataKey _ANSI_ARGS_((
- Tcl_ThreadDataKey *mutex));
MODULE_SCOPE VOID TclRememberJoinableThread _ANSI_ARGS_((
Tcl_ThreadId id));
MODULE_SCOPE void TclRememberMutex _ANSI_ARGS_((Tcl_Mutex *mutex));
@@ -2171,16 +2163,9 @@ MODULE_SCOPE int TclpLoadMemory _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_LoadHandle *loadHandle,
Tcl_FSUnloadFileProc **unloadProcPtr));
#endif
-MODULE_SCOPE void TclThreadStorageDataKeyInit(
- Tcl_ThreadDataKey *keyPtr);
-MODULE_SCOPE void * TclThreadStorageDataKeyGet(Tcl_ThreadDataKey *keyPtr);
-MODULE_SCOPE void TclThreadStorageDataKeySet(Tcl_ThreadDataKey *keyPtr,
- void *data);
+MODULE_SCOPE void TclInitThreadStorage(void);
+MODULE_SCOPE void TclpFinalizeThreadDataThread(void);
MODULE_SCOPE void TclFinalizeThreadStorage(void);
-MODULE_SCOPE void TclFinalizeThreadStorageData(
- Tcl_ThreadDataKey *keyPtr);
-MODULE_SCOPE void TclFinalizeThreadStorageDataKey(
- Tcl_ThreadDataKey *keyPtr);
/*
*----------------------------------------------------------------
diff --git a/generic/tclThread.c b/generic/tclThread.c
index 766e984..17dd0ad 100644
--- a/generic/tclThread.c
+++ b/generic/tclThread.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclThread.c,v 1.12 2005/07/21 14:38:51 dkf Exp $
+ * RCS: @(#) $Id: tclThread.c,v 1.13 2005/08/11 22:06:47 kennykb Exp $
*/
#include "tclInt.h"
@@ -83,43 +83,22 @@ Tcl_GetThreadData(keyPtr, size)
{
VOID *result;
#ifdef TCL_THREADS
-
- /*
- * See if this is the first thread to init this key.
- */
-
- if (*keyPtr == NULL) {
-#ifdef USE_THREAD_STORAGE
- TclThreadStorageDataKeyInit(keyPtr);
-#else
- TclpThreadDataKeyInit(keyPtr);
-#endif /* USE_THREAD_STORAGE */
- }
-
/*
* Initialize the key for this thread.
*/
-#ifdef USE_THREAD_STORAGE
- result = TclThreadStorageDataKeyGet(keyPtr);
-#else
result = TclpThreadDataKeyGet(keyPtr);
-#endif /* USE_THREAD_STORAGE */
if (result == NULL) {
result = (VOID *)ckalloc((size_t)size);
memset(result, 0, (size_t)size);
-#ifdef USE_THREAD_STORAGE
- TclThreadStorageDataKeySet(keyPtr, result);
-#else
TclpThreadDataKeySet(keyPtr, result);
-#endif /* USE_THREAD_STORAGE */
}
#else /* TCL_THREADS */
if (*keyPtr == NULL) {
result = (VOID *)ckalloc((size_t)size);
memset((char *)result, 0, (size_t)size);
*keyPtr = (Tcl_ThreadDataKey)result;
- TclRememberDataKey(keyPtr);
+ RememberSyncObject((char *)keyPtr, &keyRecord);
}
result = *(VOID **)keyPtr;
#endif /* TCL_THREADS */
@@ -149,11 +128,7 @@ TclThreadDataKeyGet(keyPtr)
* (pthread_key_t **) */
{
#ifdef TCL_THREADS
-#ifdef USE_THREAD_STORAGE
- return (VOID *)TclThreadStorageDataKeyGet(keyPtr);
-#else
return (VOID *)TclpThreadDataKeyGet(keyPtr);
-#endif /* USE_THREAD_STORAGE */
#else /* TCL_THREADS */
char *result = *(char **)keyPtr;
return (VOID *)result;
@@ -164,49 +139,6 @@ TclThreadDataKeyGet(keyPtr)
/*
*----------------------------------------------------------------------
*
- * TclThreadDataKeySet --
- *
- * This function sets a thread local storage pointer.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The assigned value will be returned by TclpThreadDataKeyGet.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclThreadDataKeySet(keyPtr, data)
- Tcl_ThreadDataKey *keyPtr; /* Identifier for the data chunk, really
- * (pthread_key_t **) */
- VOID *data; /* Thread local storage */
-{
-#ifdef TCL_THREADS
-
- if (*keyPtr == NULL) {
-#ifdef USE_THREAD_STORAGE
- TclThreadStorageDataKeyInit(keyPtr);
-#else
- TclpThreadDataKeyInit(keyPtr);
-#endif /* USE_THREAD_STORAGE */
- }
-
-#ifdef USE_THREAD_STORAGE
- TclThreadStorageDataKeySet(keyPtr, data);
-#else
- TclpThreadDataKeySet(keyPtr, data);
-#endif /* USE_THREAD_STORAGE */
-
-#else /* TCL_THREADS */
- *keyPtr = (Tcl_ThreadDataKey) data;
-#endif /* TCL_THREADS */
-}
-
-/*
- *----------------------------------------------------------------------
- *
* RememberSyncObject
*
* Keep a list of (mutexes/condition variable/data key) used during
@@ -337,29 +269,6 @@ Tcl_MutexFinalize(mutexPtr)
/*
*----------------------------------------------------------------------
*
- * TclRememberDataKey
- *
- * Keep a list of thread data keys used during finalization.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Add to the key list.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclRememberDataKey(keyPtr)
- Tcl_ThreadDataKey *keyPtr;
-{
- RememberSyncObject((char *)keyPtr, &keyRecord);
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TclRememberCondition
*
* Keep a list of condition variables used during finalization.
@@ -427,26 +336,7 @@ Tcl_ConditionFinalize(condPtr)
void
TclFinalizeThreadData()
{
- int i;
-
- TclpMasterLock();
- for (i=0 ; i<keyRecord.num ; i++) {
- Tcl_ThreadDataKey *keyPtr = (Tcl_ThreadDataKey *) keyRecord.list[i];
-
-#ifdef TCL_THREADS
-#ifdef USE_THREAD_STORAGE
- TclFinalizeThreadStorageData(keyPtr);
-#else
- TclpFinalizeThreadData(keyPtr);
-#endif /* USE_THREAD_STORAGE */
-#else /* TCL_THREADS */
- if (*keyPtr != NULL) {
- ckfree((char *)*keyPtr);
- *keyPtr = NULL;
- }
-#endif /* TCL_THREADS */
- }
- TclpMasterUnlock();
+ TclpFinalizeThreadDataThread();
}
/*
@@ -470,19 +360,23 @@ void
TclFinalizeSynchronization()
{
#ifdef TCL_THREADS
+ void* blockPtr;
Tcl_ThreadDataKey *keyPtr;
Tcl_Mutex *mutexPtr;
Tcl_Condition *condPtr;
int i;
TclpMasterLock();
+
+ /*
+ * If we're running unthreaded, the TSD blocks are simply stored
+ * inside their thread data keys. Free them here.
+ */
+
for (i=0 ; i<keyRecord.num ; i++) {
keyPtr = (Tcl_ThreadDataKey *)keyRecord.list[i];
-#ifdef USE_THREAD_STORAGE
- TclFinalizeThreadStorageDataKey(keyPtr);
-#else
- TclpFinalizeThreadDataKey(keyPtr);
-#endif /* USE_THREAD_STORAGE */
+ blockPtr = (void*) *keyPtr;
+ ckfree(blockPtr);
}
if (keyRecord.list != NULL) {
ckfree((char *)keyRecord.list);
@@ -492,12 +386,10 @@ TclFinalizeSynchronization()
keyRecord.num = 0;
/*
- * Call platform specific thread storage master cleanup.
+ * Call thread storage master cleanup.
*/
-#ifdef USE_THREAD_STORAGE
TclFinalizeThreadStorage();
-#endif /* USE_THREAD_STORAGE */
for (i=0 ; i<mutexRecord.num ; i++) {
mutexPtr = (Tcl_Mutex *)mutexRecord.list[i];
diff --git a/generic/tclThreadStorage.c b/generic/tclThreadStorage.c
index cd49457..10093e4 100644
--- a/generic/tclThreadStorage.c
+++ b/generic/tclThreadStorage.c
@@ -8,12 +8,12 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclThreadStorage.c,v 1.6 2005/08/05 23:56:29 dkf Exp $
+ * RCS: @(#) $Id: tclThreadStorage.c,v 1.7 2005/08/11 22:06:47 kennykb Exp $
*/
#include "tclInt.h"
-#if defined(TCL_THREADS) && defined(USE_THREAD_STORAGE)
+#if defined(TCL_THREADS)
/*
* This is the thread storage cache array and it's accompanying mutex. The
@@ -43,13 +43,7 @@ typedef struct ThreadStorage {
static Tcl_HashEntry * AllocThreadStorageEntry(Tcl_HashTable *tablePtr,
void *keyPtr);
static void FreeThreadStorageEntry(Tcl_HashEntry *hPtr);
-static void ThreadStorageLockInit(void);
-static void ThreadStorageLock(void);
-static void ThreadStorageUnlock(void);
static Tcl_HashTable * ThreadStorageGetHashTable(Tcl_ThreadId id);
-static Tcl_HashTable * ThreadStorageInit(Tcl_ThreadId id, void *reserved);
-static void FinalizeThreadStorageThreadMushroomMushroom(
- Tcl_ThreadId id);
/*
* This is the hash key type for thread storage. We MUST use this in
@@ -59,7 +53,8 @@ static void FinalizeThreadStorageThreadMushroomMushroom(
Tcl_HashKeyType tclThreadStorageHashKeyType = {
TCL_HASH_KEY_TYPE_VERSION, /* version */
- TCL_HASH_KEY_SYSTEM_HASH, /* flags */
+ TCL_HASH_KEY_SYSTEM_HASH | TCL_HASH_KEY_RANDOMIZE_HASH,
+ /* flags */
NULL, /* hashKeyProc */
NULL, /* compareKeysProc */
AllocThreadStorageEntry, /* allocEntryProc */
@@ -83,7 +78,7 @@ Tcl_HashKeyType tclThreadStorageHashKeyType = {
* below this are RESERVED for future use.
*/
-#define STORAGE_FIRST_KEY 101
+#define STORAGE_FIRST_KEY 1
/*
* This is the default number of thread storage cache slots. This define may
@@ -98,22 +93,16 @@ Tcl_HashKeyType tclThreadStorageHashKeyType = {
* hash tables contain the actual thread storage.
*/
-static Tcl_HashTable *threadStorageHashTablePtr = NULL;
+static Tcl_HashTable threadStorageHashTable;
/*
* This is the next thread data key value to use. We increment this everytime
- * we "allocate" one. It is initially set to 1 in ThreadStorageInit.
+ * we "allocate" one. It is initially set to 1 in TclInitThreadStorage.
*/
static int nextThreadStorageKey = STORAGE_INVALID_KEY;
/*
- * Have we initialized the thread storage mutex yet?
- */
-
-static int initThreadStorage = 0;
-
-/*
* This is the master thread storage cache. Per Kevin Kenny's idea, this
* prevents unnecessary lookups for threads that use a lot of thread storage.
*/
@@ -123,88 +112,6 @@ static volatile ThreadStorage threadStorageCache[STORAGE_CACHE_SLOTS];
/*
*----------------------------------------------------------------------
*
- * ThreadStorageLockInit
- *
- * This procedure is used to initialize the lock that serializes creation
- * of thread storage.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The master lock is acquired and possibly initialized for the first
- * time.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-ThreadStorageLockInit()
-{
- if (!initThreadStorage) {
- /*
- * Mutexes in Tcl are self initializing, and we are taking advantage
- * of that fact since this file cannot contain platform specific
- * calls.
- */
-
- initThreadStorage = 1;
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * ThreadStorageLock
- *
- * This procedure is used to grab a lock that serializes creation of
- * thread storage.
- *
- * This lock must be different than the initLock because the initLock is
- * held during creation of syncronization objects.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Acquire the thread storage mutex.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-ThreadStorageLock()
-{
- ThreadStorageLockInit();
- Tcl_MutexLock(&threadStorageLock);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * ThreadStorageUnlock
- *
- * This procedure is used to release a lock that serializes creation of
- * thread storage.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Release the thread storage mutex.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-ThreadStorageUnlock()
-{
- Tcl_MutexUnlock(&threadStorageLock);
-}
-
-/*
- *----------------------------------------------------------------------
- *
* AllocThreadStorageEntry --
*
* Allocate space for a Tcl_HashEntry using TclpSysAlloc (not ckalloc).
@@ -258,109 +165,6 @@ FreeThreadStorageEntry(hPtr)
TclpSysFree((char *)hPtr);
}
-#ifdef TCL_THREAD_STORAGE_DEBUG
-/*
- *----------------------------------------------------------------------
- *
- * ThreadStoragePrint --
- *
- * This procedure prints out the contents of the master thread storage
- * hash table, the thread storage cache, and the next key value to the
- * specified file.
- *
- * This assumes that thread storage lock is held.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The thread storage lock is acquired and released.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-ThreadStoragePrint(outFile, flags)
- FILE *outFile; /* The file to print the information to. */
- int flags; /* Reserved for future use. */
-{
- Tcl_HashEntry *hPtr;
- Tcl_HashSearch search;
- int header, index;
-
- if (threadStorageHashTablePtr != NULL) {
- hPtr = Tcl_FirstHashEntry(threadStorageHashTablePtr, &search);
-
- if (hPtr != NULL) {
- fprintf(outFile, "master thread storage hash table:\n");
- for (; hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- fprintf(outFile,
- "master entry ptr %p, thread %p, thread table ptr %p\n",
- hPtr, Tcl_GetHashKey(threadStorageHashTablePtr, hPtr),
- Tcl_GetHashValue(hPtr));
- }
- } else {
- fprintf(outFile,
- "master thread storage hash table has no entries\n");
- }
- } else {
- fprintf(outFile,
- "master thread storage hash table not initialized\n");
- }
-
- header = 0; /* we have not output the header yet. */
- for (index=0 ; index<STORAGE_CACHE_SLOTS ; index++) {
- if (threadStorageCache[index].id != STORAGE_INVALID_THREAD) {
- if (!header) {
- fprintf(outFile, "thread storage cache (%d total slots):\n",
- STORAGE_CACHE_SLOTS);
- header = 1;
- }
-
- fprintf(outFile, "slot %d, thread %p, thread table ptr %p\n",
- index, threadStorageCache[index].id,
- threadStorageCache[index].hashTablePtr);
-
-#ifdef VERBOSE_THREAD_STORAGE_DEBUGGING
- /*
- * Currently not enabled by default due to Tcl_HashStats use of
- * ckalloc and ckfree. Please note that this can produce a LOT of
- * output.
- */
-
- if (threadStorageCache[index].hashTablePtr != NULL) {
- CONST char *stats =
- Tcl_HashStats(threadStorageCache[index].hashTablePtr);
- if (stats != NULL) {
- fprintf(outFile, "%s\n", stats);
- ckfree((void *)stats);
- } else {
- fprintf(outFile,
- "could not get table statistics for slot %d\n",
- index);
- }
- }
-#endif
-
- } else {
- /* fprintf(outFile, "cache slot %d not used\n", index); */
- }
- }
-
- if (!header) {
- fprintf(outFile, "thread storage cache is empty (%d total slots)\n",
- STORAGE_CACHE_SLOTS);
- header = 1;
- }
-
- /*
- * Show the next data key value.
- */
-
- fprintf(outFile, "next data key value is: %d\n", nextThreadStorageKey);
-}
-#endif /* TCL_THREAD_STORAGE_DEBUG */
-
/*
*----------------------------------------------------------------------
*
@@ -399,217 +203,120 @@ ThreadStorageGetHashTable(id)
Tcl_HashTable *hashTablePtr = threadStorageCache[index].hashTablePtr;
if (threadStorageCache[index].id != id) {
- ThreadStorageLock();
+ Tcl_MutexLock(&threadStorageLock);
/*
- * Make sure the master hash table is initialized.
+ * It's not in the cache, so we look it up...
*/
-
- ThreadStorageInit(STORAGE_INVALID_THREAD, NULL);
-
- if (threadStorageHashTablePtr != NULL) {
- /*
- * It's not in the cache, so we look it up...
- */
-
- hPtr = Tcl_FindHashEntry(threadStorageHashTablePtr, (char *)id);
-
- if (hPtr != NULL) {
- /*
- * We found it, extract the hash table pointer.
- */
-
- hashTablePtr = Tcl_GetHashValue(hPtr);
- } else {
- /*
- * The thread specific hash table is not found.
- */
-
- hashTablePtr = NULL;
- }
-
- if (hashTablePtr == NULL) {
- hashTablePtr = (Tcl_HashTable *)
- TclpSysAlloc(sizeof(Tcl_HashTable), 0);
-
- if (hashTablePtr == NULL) {
- Tcl_Panic("could not allocate thread specific hash "
- "table, TclpSysAlloc failed from "
- "ThreadStorageGetHashTable!");
- }
- Tcl_InitCustomHashTable(hashTablePtr, TCL_CUSTOM_TYPE_KEYS,
- &tclThreadStorageHashKeyType);
-
- /*
- * Add new thread storage hash table to the master hash table.
- */
-
- hPtr = Tcl_CreateHashEntry(threadStorageHashTablePtr,
- (char *)id, &new);
-
- if (hPtr == NULL) {
- Tcl_Panic("Tcl_CreateHashEntry failed from "
- "ThreadStorageInit!");
- }
- Tcl_SetHashValue(hPtr, hashTablePtr);
- }
-
+
+ hPtr = Tcl_FindHashEntry(&threadStorageHashTable, (char *)id);
+
+ if (hPtr != NULL) {
/*
- * Now, we put it in the cache since it is highly likely it will
- * be needed again shortly.
+ * We found it, extract the hash table pointer.
*/
-
- threadStorageCache[index].id = id;
- threadStorageCache[index].hashTablePtr = hashTablePtr;
+
+ hashTablePtr = Tcl_GetHashValue(hPtr);
} else {
/*
- * We cannot look it up, the master hash table has not been
- * initialized.
+ * The thread specific hash table is not found.
*/
-
+
hashTablePtr = NULL;
}
- ThreadStorageUnlock();
- }
-
- return hashTablePtr;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * ThreadStorageInit --
- *
- * This procedure initializes a thread specific hash table for the
- * current thread. It may also initialize the master hash table which
- * stores all the thread specific hash tables.
- *
- * This assumes that thread storage lock is held.
- *
- * Results:
- * A hash table pointer for the specified thread, or NULL if we are be
- * called to initialize the master hash table only.
- *
- * Side effects:
- * The thread specific hash table may be initialized and added to the
- * master hash table.
- *
- *----------------------------------------------------------------------
- */
-
-static Tcl_HashTable *
-ThreadStorageInit(id, reserved)
- Tcl_ThreadId id; /* Id of thread to get hash table for */
- void *reserved; /* reserved for future use */
-{
-#ifdef TCL_THREAD_STORAGE_DEBUG
- ThreadStoragePrint(stderr, 0);
-#endif
-
- if (threadStorageHashTablePtr == NULL) {
- /*
- * Looks like we haven't created the outer hash table yet we can just
- * do that now.
- */
- threadStorageHashTablePtr = (Tcl_HashTable *)
+ if (hashTablePtr == NULL) {
+ hashTablePtr = (Tcl_HashTable *)
TclpSysAlloc(sizeof(Tcl_HashTable), 0);
- if (threadStorageHashTablePtr == NULL) {
- Tcl_Panic("could not allocate master thread storage hash table, "
- "TclpSysAlloc failed from ThreadStorageInit!");
+
+ if (hashTablePtr == NULL) {
+ Tcl_Panic("could not allocate thread specific hash "
+ "table, TclpSysAlloc failed from "
+ "ThreadStorageGetHashTable!");
+ }
+ Tcl_InitCustomHashTable(hashTablePtr, TCL_CUSTOM_TYPE_KEYS,
+ &tclThreadStorageHashKeyType);
+
+ /*
+ * Add new thread storage hash table to the master hash table.
+ */
+
+ hPtr = Tcl_CreateHashEntry(&threadStorageHashTable,
+ (char *)id, &new);
+
+ if (hPtr == NULL) {
+ Tcl_Panic("Tcl_CreateHashEntry failed from "
+ "ThreadStorageGetHashTable!");
+ }
+ Tcl_SetHashValue(hPtr, hashTablePtr);
}
- Tcl_InitCustomHashTable(threadStorageHashTablePtr,
- TCL_CUSTOM_TYPE_KEYS, &tclThreadStorageHashKeyType);
-
- /*
- * We also initialize the cache.
- */
-
- memset((ThreadStorage *)&threadStorageCache, 0,
- sizeof(ThreadStorage) * STORAGE_CACHE_SLOTS);
/*
- * Now, we set the first value to be used for a thread data key.
+ * Now, we put it in the cache since it is highly likely it will
+ * be needed again shortly.
*/
+
+ threadStorageCache[index].id = id;
+ threadStorageCache[index].hashTablePtr = hashTablePtr;
- nextThreadStorageKey = STORAGE_FIRST_KEY;
+ Tcl_MutexUnlock(&threadStorageLock);
}
- return NULL;
+ return hashTablePtr;
}
/*
*----------------------------------------------------------------------
*
- * TclThreadStorageDataKeyInit --
+ * TclInitThreadStorage --
*
- * This procedure initializes a thread specific data block key. Each
- * thread has table of pointers to thread specific data. all threads
- * agree on which table entry is used by each module. this is remembered
- * in a "data key", that is just an index into this table. To allow self
- * initialization, the interface passes a pointer to this key and the
- * first thread to use the key fills in the pointer to the key. The key
- * should be a process-wide static.
+ * Initializes the thread storage allocator.
*
* Results:
* None.
*
* Side effects:
- * Will allocate memory the first time this process calls for this key.
- * In this case it modifies its argument to hold the pointer to
- * information about the key.
+ * This procedure initializes the master hash table that maps
+ * thread ID onto the individual index tables that map thread data
+ * key to thread data. It also creates a cache that enables
+ * fast lookup of the thread data block array for a recently
+ * executing thread without using spinlocks.
+ *
+ * This procedure is called from an extremely early point in Tcl's
+ * initialization. In particular, it may not use ckalloc/ckfree
+ * because they may depend on thread-local storage (it uses TclpSysAlloc
+ * and TclpSysFree instead). It may not depend on synchronization
+ * primitives - but no threads other than the master thread have yet
+ * been launched.
*
*----------------------------------------------------------------------
*/
void
-TclThreadStorageDataKeyInit(keyPtr)
- Tcl_ThreadDataKey *keyPtr; /* Identifier for the data chunk, really
- * (int**) */
+TclInitThreadStorage()
{
- int *indexPtr;
- int newKey;
-
- if (*keyPtr == NULL) {
- indexPtr = (int *)TclpSysAlloc(sizeof(int), 0);
- if (indexPtr == NULL) {
- Tcl_Panic("TclpSysAlloc failed from TclThreadStorageDataKeyInit!");
- }
-
- /*
- * We must call this now to make sure that nextThreadStorageKey has a
- * well defined value.
- */
-
- ThreadStorageLock();
-
- /*
- * Make sure the master hash table is initialized.
- */
-
- ThreadStorageInit(STORAGE_INVALID_THREAD, NULL);
- /*
- * These data key values are sequentially assigned and we must use the
- * storage lock to prevent serious problems here. Also note that the
- * caller should NOT make any assumptions about the provided
- * values. In particular, we may need to reserve some values in the
- * future.
- */
-
- newKey = nextThreadStorageKey++;
- ThreadStorageUnlock();
-
- *indexPtr = newKey;
- *keyPtr = (Tcl_ThreadDataKey)indexPtr;
- TclRememberDataKey(keyPtr);
- }
+ Tcl_InitCustomHashTable(&threadStorageHashTable,
+ TCL_CUSTOM_TYPE_KEYS, &tclThreadStorageHashKeyType);
+
+ /*
+ * We also initialize the cache.
+ */
+
+ memset((ThreadStorage *)&threadStorageCache, 0,
+ sizeof(ThreadStorage) * STORAGE_CACHE_SLOTS);
+
+ /*
+ * Now, we set the first value to be used for a thread data key.
+ */
+
+ nextThreadStorageKey = STORAGE_FIRST_KEY;
}
/*
*----------------------------------------------------------------------
*
- * TclThreadStorageDataKeyGet --
+ * TclpThreadDataKeyGet --
*
* This procedure returns a pointer to a block of thread local storage.
*
@@ -624,37 +331,24 @@ TclThreadStorageDataKeyInit(keyPtr)
*/
void *
-TclThreadStorageDataKeyGet(keyPtr)
+TclpThreadDataKeyGet(keyPtr)
Tcl_ThreadDataKey *keyPtr; /* Identifier for the data chunk, really
* (int**) */
{
- int *indexPtr = *(int **)keyPtr;
-
- if (indexPtr == NULL) {
+ Tcl_HashTable *hashTablePtr =
+ ThreadStorageGetHashTable(Tcl_GetCurrentThread());
+ Tcl_HashEntry *hPtr =
+ Tcl_FindHashEntry(hashTablePtr, (char *) keyPtr);
+ if (hPtr == NULL) {
return NULL;
- } else {
- Tcl_HashTable *hashTablePtr =
- ThreadStorageGetHashTable(Tcl_GetCurrentThread());
- Tcl_HashEntry *hPtr;
-
- if (hashTablePtr == NULL) {
- Tcl_Panic("ThreadStorageGetHashTable failed from "
- "ThreadStorageDataKeyGet!");
- }
-
- hPtr = Tcl_FindHashEntry(hashTablePtr, (char *) *indexPtr);
-
- if (hPtr == NULL) {
- return NULL;
- }
- return (void *) Tcl_GetHashValue(hPtr);
}
+ return (void *) Tcl_GetHashValue(hPtr);
}
/*
*----------------------------------------------------------------------
*
- * TclThreadStorageDataKeySet --
+ * TclpThreadDataKeySet --
*
* This procedure sets the pointer to a block of thread local storage.
*
@@ -662,29 +356,23 @@ TclThreadStorageDataKeyGet(keyPtr)
* None.
*
* Side effects:
- * Sets up the thread so future calls to TclThreadStorageDataKeyGet with
+ * Sets up the thread so future calls to TclpThreadDataKeyGet with
* this key will return the data pointer.
*
*----------------------------------------------------------------------
*/
void
-TclThreadStorageDataKeySet(keyPtr, data)
+TclpThreadDataKeySet(keyPtr, data)
Tcl_ThreadDataKey *keyPtr; /* Identifier for the data chunk, really
* (pthread_key_t **) */
void *data; /* Thread local storage */
{
- int *indexPtr = *(int **)keyPtr;
Tcl_HashTable *hashTablePtr;
Tcl_HashEntry *hPtr;
hashTablePtr = ThreadStorageGetHashTable(Tcl_GetCurrentThread());
- if (hashTablePtr == NULL) {
- Tcl_Panic("ThreadStorageGetHashTable failed from "
- "TclThreadStorageDataKeySet!");
- }
-
- hPtr = Tcl_FindHashEntry(hashTablePtr, (char *)*indexPtr);
+ hPtr = Tcl_FindHashEntry(hashTablePtr, (char *)keyPtr);
/*
* Does the item need to be created?
@@ -692,12 +380,7 @@ TclThreadStorageDataKeySet(keyPtr, data)
if (hPtr == NULL) {
int new;
-
- hPtr = Tcl_CreateHashEntry(hashTablePtr, (char *)*indexPtr, &new);
- if (hPtr == NULL) {
- Tcl_Panic("could not create hash entry value from "
- "TclThreadStorageDataKeySet");
- }
+ hPtr = Tcl_CreateHashEntry(hashTablePtr, (char *)keyPtr, &new);
}
Tcl_SetHashValue(hPtr, data);
@@ -706,73 +389,94 @@ TclThreadStorageDataKeySet(keyPtr, data)
/*
*----------------------------------------------------------------------
*
- * FinalizeThreadStorageThreadMushroomMushroom --
+ * TclpFinalizeThreadDataThread --
*
* This procedure cleans up the thread storage hash table for the
- * specified thread.
+ * current thread.
*
* Results:
* None.
*
* Side effects:
- * None.
+ * Frees all associated thread storage, all hash table entries for
+ * the thread's thread storage, and the hash table itself.
*
*----------------------------------------------------------------------
*/
-static void
-FinalizeThreadStorageThreadMushroomMushroom(id)
- Tcl_ThreadId id; /* Id of the thread to finalize. */
+void
+TclpFinalizeThreadDataThread()
{
+ Tcl_ThreadId id = Tcl_GetCurrentThread();
+ /* Id of the thread to finalize. */
int index = (unsigned int)id % STORAGE_CACHE_SLOTS;
- Tcl_HashTable *hashTablePtr;/* Hash table for current thread. */
Tcl_HashEntry *hPtr; /* Hash entry for current thread in master
* table. */
+ Tcl_HashTable* hashTablePtr;
+ /* Pointer to the hash table holding
+ * TSD blocks for the current thread*/
+ Tcl_HashSearch search; /* Search object to walk the TSD blocks
+ * in the designated thread */
+ Tcl_HashEntry *hPtr2; /* Hash entry for a TSD block in the
+ * designated thread. */
- ThreadStorageLock();
-
- if (threadStorageHashTablePtr != NULL) {
- hPtr = Tcl_FindHashEntry(threadStorageHashTablePtr, (char *)id);
-
- if (hPtr != NULL) {
- /*
- * We found it, extract the hash table pointer.
- */
-
- hashTablePtr = Tcl_GetHashValue(hPtr);
-
- if (hashTablePtr != NULL) {
- /*
- * Delete thread specific hash table and free the struct.
- */
-
- Tcl_DeleteHashTable(hashTablePtr);
- TclpSysFree((char *)hashTablePtr);
- }
+ Tcl_MutexLock(&threadStorageLock);
+ hPtr = Tcl_FindHashEntry(&threadStorageHashTable, (char*)id);
+ if (hPtr == NULL) {
+ hashTablePtr = NULL;
+ } else {
+ /*
+ * We found it, extract the hash table pointer.
+ */
+
+ hashTablePtr = Tcl_GetHashValue(hPtr);
+ Tcl_DeleteHashEntry(hPtr);
+ /*
+ * Make sure cache entry for this thread is NULL.
+ */
+
+ if (threadStorageCache[index].id == id) {
/*
- * Delete thread specific entry from master hash table.
+ * We do not step on another thread's cache entry. This is
+ * especially important if we are creating and exiting a lot
+ * of threads.
*/
-
- Tcl_DeleteHashEntry(hPtr);
+ threadStorageCache[index].id = STORAGE_INVALID_THREAD;
+ threadStorageCache[index].hashTablePtr = NULL;
}
}
+ Tcl_MutexUnlock(&threadStorageLock);
- /*
- * Make sure cache entry for this thread is NULL.
+ /*
+ * The thread's hash table has been extracted and removed from the master
+ * hash table. Now clean up the thread.
*/
- if (threadStorageCache[index].id == id) {
+ if (hashTablePtr != NULL) {
+
+ /* Free all TSD */
+
+ for (hPtr2 = Tcl_FirstHashEntry(hashTablePtr, &search);
+ hPtr2 != NULL;
+ hPtr2 = Tcl_NextHashEntry(&search)) {
+ void* blockPtr = Tcl_GetHashValue(hPtr2);
+ if (blockPtr != NULL) {
+ /*
+ * The block itself was allocated in Tcl_GetThreadData
+ * using ckalloc; use ckfree to dispose of it.
+ */
+ ckfree(blockPtr);
+ }
+ }
+
/*
- * We do not step on another thread's cache entry. This is especially
- * important if we are creating and exiting a lot of threads.
+ * Delete thread specific hash table and free the struct.
*/
-
- threadStorageCache[index].id = STORAGE_INVALID_THREAD;
- threadStorageCache[index].hashTablePtr = NULL;
+
+ Tcl_DeleteHashTable(hashTablePtr);
+ TclpSysFree((char *)hashTablePtr);
}
-
- ThreadStorageUnlock();
}
/*
@@ -796,51 +500,41 @@ FinalizeThreadStorageThreadMushroomMushroom(id)
void
TclFinalizeThreadStorage()
{
- ThreadStorageLock();
-
- if (threadStorageHashTablePtr != NULL) {
- Tcl_HashSearch search; /* We need to hit every thread with
+ Tcl_HashSearch search; /* We need to hit every thread with
* this search. */
- Tcl_HashEntry *hPtr; /* Hash entry for current thread in
+ Tcl_HashEntry *hPtr; /* Hash entry for current thread in
* master table. */
+ Tcl_MutexLock(&threadStorageLock);
- /*
- * We are going to delete the hash table for every thread now. This
- * hash table should be empty at this point, except for one entry for
- * the current thread.
- */
-
- for (hPtr = Tcl_FirstHashEntry(threadStorageHashTablePtr, &search);
- hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- Tcl_HashTable *hashTablePtr = Tcl_GetHashValue(hPtr);
-
- if (hashTablePtr != NULL) {
- /*
- * Delete thread specific hash table for the thread in
- * question and free the struct.
- */
-
- Tcl_DeleteHashTable(hashTablePtr);
- TclpSysFree((char *)hashTablePtr);
- }
-
+ /*
+ * We are going to delete the hash table for every thread now. This
+ * hash table should be empty at this point, except for one entry for
+ * the current thread.
+ */
+
+ for (hPtr = Tcl_FirstHashEntry(&threadStorageHashTable, &search);
+ hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
+ Tcl_HashTable *hashTablePtr = Tcl_GetHashValue(hPtr);
+
+ if (hashTablePtr != NULL) {
/*
- * Delete thread specific entry from master hash table.
+ * Delete thread specific hash table for the thread in
+ * question and free the struct.
*/
-
- Tcl_SetHashValue(hPtr, NULL);
+
+ Tcl_DeleteHashTable(hashTablePtr);
+ TclpSysFree((char *)hashTablePtr);
}
-
- Tcl_DeleteHashTable(threadStorageHashTablePtr);
- TclpSysFree((char *)threadStorageHashTablePtr);
-
+
/*
- * Reset this so that next time around we know it's not valid.
+ * Delete thread specific entry from master hash table.
*/
-
- threadStorageHashTablePtr = NULL;
+
+ Tcl_SetHashValue(hPtr, NULL);
}
-
+
+ Tcl_DeleteHashTable(&threadStorageHashTable);
+
/*
* Clear out the thread storage cache as well.
*/
@@ -855,216 +549,28 @@ TclFinalizeThreadStorage()
nextThreadStorageKey = STORAGE_INVALID_KEY;
- ThreadStorageUnlock();
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclFinalizeThreadStorageData --
- *
- * This procedure cleans up the thread-local storage. This is called
- * once for each thread.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Frees up the memory.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclFinalizeThreadStorageData(keyPtr)
- Tcl_ThreadDataKey *keyPtr;
-{
- if (*keyPtr != NULL) {
- Tcl_ThreadId id = Tcl_GetCurrentThread();
- Tcl_HashTable *hashTablePtr; /* Hash table for current thread. */
- Tcl_HashEntry *hPtr; /* Hash entry for data key in current
- * thread. */
- int *indexPtr = *(int **)keyPtr;
-
- hashTablePtr = ThreadStorageGetHashTable(id);
- if (hashTablePtr == NULL) {
- Tcl_Panic("ThreadStorageGetHashTable failed from "
- "TclFinalizeThreadStorageData!");
- }
-
- hPtr = Tcl_FindHashEntry(hashTablePtr, (char *)*indexPtr);
- if (hPtr != NULL) {
- void *result = Tcl_GetHashValue(hPtr);
-
- if (result != NULL) {
- /*
- * This must be ckfree because tclThread.c allocates these
- * using ckalloc.
- */
-
- ckfree((char *)result);
- }
-
- Tcl_SetHashValue(hPtr, NULL);
- }
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclFinalizeThreadStorageDataKey --
- *
- * This procedure is invoked to clean up one key. This is a process-wide
- * storage identifier. The thread finalization code cleans up the thread
- * local storage itself.
- *
- * This assumes the master lock is held.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The key is deallocated.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclFinalizeThreadStorageDataKey(keyPtr)
- Tcl_ThreadDataKey *keyPtr;
-{
- int *indexPtr;
- Tcl_HashTable *hashTablePtr;/* Hash table for current thread. */
- Tcl_HashSearch search; /* Need to hit every thread with this search */
- Tcl_HashEntry *hPtr; /* Hash entry for current thread in master
- * table. */
- Tcl_HashEntry *hDataPtr; /* Hash entry for data key in current thread */
-
- if (*keyPtr != NULL) {
- indexPtr = *(int **)keyPtr;
-
- ThreadStorageLock();
-
- if (threadStorageHashTablePtr != NULL) {
- /*
- * We are going to delete the specified data key entry from every
- * thread.
- */
-
- for (hPtr = Tcl_FirstHashEntry(threadStorageHashTablePtr, &search);
- hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- /*
- * Get the hash table corresponding to the thread in question.
- */
-
- hashTablePtr = Tcl_GetHashValue(hPtr);
-
- if (hashTablePtr != NULL) {
- /*
- * Now find the entry for the specified data key.
- */
-
- hDataPtr = Tcl_FindHashEntry(hashTablePtr,
- (char *)*indexPtr);
-
- if (hDataPtr != NULL) {
- /*
- * Delete the data key for this thread.
- */
-
- Tcl_DeleteHashEntry(hDataPtr);
- }
- }
- }
- }
-
- ThreadStorageUnlock();
-
- TclpSysFree((char *)indexPtr);
- *keyPtr = NULL;
- }
+ Tcl_MutexUnlock(&threadStorageLock);
}
-#else /* !defined(TCL_THREADS) || !defined(USE_THREAD_STORAGE) */
-
-static void ThreadStoragePanic(CONST char *message);
-
-/*
- *----------------------------------------------------------------------
- *
- * ThreadStoragePanic --
- *
- * Panic if Tcl was compiled without TCL_THREADS or without
- * USE_THREAD_STORAGE and a thread storage function has been called.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
+#else /* !defined(TCL_THREADS) */
-static void
-ThreadStoragePanic(
- CONST char *message) /* currently ignored */
-{
-#ifdef TCL_THREADS
-# ifdef USE_THREAD_STORAGE
- /*
- * Do nothing, everything is OK. However, this should never happen because
- * this function only gets called by the dummy thread storage functions
- * (used when one or both of these DEFINES are not present).
- */
-# else
- Tcl_Panic("Tcl was not compiled with thread storage enabled.");
-# endif /* USE_THREAD_STORAGE */
-#else
- Tcl_Panic("Tcl was not compiled with threads enabled.");
-#endif /* TCL_THREADS */
-}
-
/*
- * Stub functions that just call ThreadStoragePanic.
+ * Stub functions for non-threaded builds
*/
void
-TclThreadStorageDataKeyInit(Tcl_ThreadDataKey *keyPtr)
-{
- ThreadStoragePanic(NULL);
-}
-
-void *
-TclThreadStorageDataKeyGet(Tcl_ThreadDataKey *keyPtr)
+TclInitThreadStorage()
{
- ThreadStoragePanic(NULL);
- return NULL;
}
void
-TclThreadStorageDataKeySet(Tcl_ThreadDataKey *keyPtr, void *data)
+TclpFinalizeThreadDataThread()
{
- ThreadStoragePanic(NULL);
}
void
TclFinalizeThreadStorage()
{
- ThreadStoragePanic(NULL);
-}
-
-void
-TclFinalizeThreadStorageData(Tcl_ThreadDataKey *keyPtr)
-{
- ThreadStoragePanic(NULL);
-}
-
-void
-TclFinalizeThreadStorageDataKey(Tcl_ThreadDataKey *keyPtr)
-{
- ThreadStoragePanic(NULL);
}
#endif /* defined(TCL_THREADS) && defined(USE_THREAD_STORAGE) */
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 32e5a4c..cc5f284 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -535,10 +535,6 @@ AC_DEFUN(SC_ENABLE_THREADS, [
# allocator that significantly reduces lock contention
AC_DEFINE(USE_THREAD_ALLOC, 1,
[Do we want to use the threaded memory allocator?])
- # USE_THREAD_STORAGE tells us to use the new generic thread
- # storage subsystem.
- AC_DEFINE(USE_THREAD_STORAGE, 1,
- [Use the generic thread storage subsystem?])
AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
if test "`uname -s`" = "SunOS" ; then
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in
index 0926138..9a7fe25 100644
--- a/unix/tclConfig.h.in
+++ b/unix/tclConfig.h.in
@@ -342,9 +342,6 @@
/* Do we want to use the threaded memory allocator? */
#undef USE_THREAD_ALLOC
-/* Use the generic thread storage subsystem? */
-#undef USE_THREAD_STORAGE
-
/* Should we use vfork() instead of fork()? */
#undef USE_VFORK
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index bb07c24..3d068e5 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -543,174 +543,6 @@ TclpFinalizeMutex(mutexPtr)
*mutexPtr = NULL;
}
}
-
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpThreadDataKeyInit --
- *
- * This procedure initializes a thread specific data block key. Each
- * thread has table of pointers to thread specific data. All threads
- * agree on which table entry is used by each module. This is remembered
- * in a "data key", that is just an index into this table. To allow self
- * initialization, the interface passes a pointer to this key and the
- * first thread to use the key fills in the pointer to the key. The key
- * should be a process-wide static.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Will allocate memory the first time this process calls for this key.
- * In this case it modifies its argument to hold the pointer to
- * information about the key.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpThreadDataKeyInit(keyPtr)
- Tcl_ThreadDataKey *keyPtr; /* Identifier for the data chunk,
- * really (pthread_key_t **) */
-{
- pthread_key_t *pkeyPtr;
-
- MASTER_LOCK;
- if (*keyPtr == NULL) {
- pkeyPtr = (pthread_key_t *) ckalloc(sizeof(pthread_key_t));
- pthread_key_create(pkeyPtr, NULL);
- *keyPtr = (Tcl_ThreadDataKey)pkeyPtr;
- TclRememberDataKey(keyPtr);
- }
- MASTER_UNLOCK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpThreadDataKeyGet --
- *
- * This procedure returns a pointer to a block of thread local storage.
- *
- * Results:
- * A thread-specific pointer to the data structure, or NULL if the memory
- * has not been assigned to this key for this thread.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-VOID *
-TclpThreadDataKeyGet(keyPtr)
- Tcl_ThreadDataKey *keyPtr; /* Identifier for the data chunk, really
- * (pthread_key_t **) */
-{
- pthread_key_t *pkeyPtr = *(pthread_key_t **)keyPtr;
- if (pkeyPtr == NULL) {
- return NULL;
- } else {
- return (VOID *)pthread_getspecific(*pkeyPtr);
- }
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpThreadDataKeySet --
- *
- * This procedure sets the pointer to a block of thread local storage.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Sets up the thread so future calls to TclpThreadDataKeyGet with this
- * key will return the data pointer.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpThreadDataKeySet(keyPtr, data)
- Tcl_ThreadDataKey *keyPtr; /* Identifier for the data chunk, really
- * (pthread_key_t **) */
- VOID *data; /* Thread local storage */
-{
- pthread_key_t *pkeyPtr = *(pthread_key_t **)keyPtr;
- pthread_setspecific(*pkeyPtr, data);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpFinalizeThreadData --
- *
- * This procedure cleans up the thread-local storage. This is called once
- * for each thread.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Frees up all thread local storage.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpFinalizeThreadData(keyPtr)
- Tcl_ThreadDataKey *keyPtr;
-{
- VOID *result;
- pthread_key_t *pkeyPtr;
-
- if (*keyPtr != NULL) {
- pkeyPtr = *(pthread_key_t **)keyPtr;
- result = (VOID *)pthread_getspecific(*pkeyPtr);
- if (result != NULL) {
- ckfree((char *)result);
- pthread_setspecific(*pkeyPtr, (void *)NULL);
- }
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpFinalizeThreadDataKey --
- *
- * This procedure is invoked to clean up one key. This is a process-wide
- * storage identifier. The thread finalization code cleans up the thread
- * local storage itself.
- *
- * This assumes the master lock is held.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The key is deallocated.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpFinalizeThreadDataKey(keyPtr)
- Tcl_ThreadDataKey *keyPtr;
-{
- pthread_key_t *pkeyPtr;
- if (*keyPtr != NULL) {
- pkeyPtr = *(pthread_key_t **)keyPtr;
- pthread_key_delete(*pkeyPtr);
- ckfree((char *)pkeyPtr);
- *keyPtr = NULL;
- }
-}
-
/*
*----------------------------------------------------------------------
diff --git a/win/Makefile.in b/win/Makefile.in
index 753681b..c2beb4b 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -5,7 +5,7 @@
# "autoconf" program (constructs like "@foo@" will get replaced in the
# actual Makefile.
#
-# RCS: @(#) $Id: Makefile.in,v 1.89 2005/05/10 18:35:29 kennykb Exp $
+# RCS: @(#) $Id: Makefile.in,v 1.90 2005/08/11 22:06:47 kennykb Exp $
VERSION = @TCL_VERSION@
@@ -719,7 +719,7 @@ clean: cleanhelp
distclean: clean
$(RM) Makefile config.status config.cache config.log tclConfig.sh \
- tcl.hpj
+ tcl.hpj config.status.lineno
#
# Regenerate the stubs files.
diff --git a/win/configure b/win/configure
index 9bf3fbb..cadddbe 100755
--- a/win/configure
+++ b/win/configure
@@ -1,9 +1,8 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.57.
+# Generated by GNU Autoconf 2.59.
#
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
@@ -20,9 +19,10 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
+DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
@@ -41,7 +41,7 @@ for as_var in \
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
$as_unset $as_var
@@ -218,16 +218,17 @@ rm -f conf$$ conf$$.exe conf$$.file
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
+ test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
# IFS
@@ -667,7 +668,7 @@ done
# Be sure to have absolute paths.
for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
+ localstatedir libdir includedir oldincludedir infodir mandir
do
eval ac_val=$`echo $ac_var`
case $ac_val in
@@ -707,10 +708,10 @@ if test -z "$srcdir"; then
# Try the directory containing this script, then its parent.
ac_confdir=`(dirname "$0") 2>/dev/null ||
$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$0" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -802,9 +803,9 @@ _ACEOF
cat <<_ACEOF
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
+ [$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
+ [PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
@@ -894,12 +895,45 @@ case $srcdir in
ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
cd $ac_dir
# Check for guested configure; otherwise get Cygnus style configure.
@@ -910,7 +944,7 @@ ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
echo
$SHELL $ac_srcdir/configure --help=recursive
elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
+ test -f $ac_srcdir/configure.in; then
echo
$ac_configure --help
else
@@ -924,8 +958,7 @@ test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -937,7 +970,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.57. Invocation command line was
+generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1014,19 +1047,19 @@ do
2)
ac_configure_args1="$ac_configure_args1 '$ac_arg'"
if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
+ ac_must_keep_next=false # Got value, back to normal.
else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
fi
ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
# Get rid of the leading space.
@@ -1060,12 +1093,12 @@ _ASBOX
case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
*ac_space=\ *)
sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
;;
*)
sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
esac;
}
@@ -1094,7 +1127,7 @@ _ASBOX
for ac_var in $ac_subst_files
do
eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
+ echo "$ac_var='"'"'$ac_val'"'"'"
done | sort
echo
fi
@@ -1113,7 +1146,7 @@ _ASBOX
echo "$as_me: caught signal $ac_signal"
echo "$as_me: exit $exit_status"
} >&5
- rm -f core core.* *.core &&
+ rm -f core *.core &&
rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
@@ -1193,7 +1226,7 @@ fi
# value.
ac_cache_corrupted=false
for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
eval ac_old_val="\$ac_cv_env_${ac_var}_value"
@@ -1210,13 +1243,13 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
+ ac_cache_corrupted=:
fi;;
esac
# Pass precious variables to config.status.
@@ -1648,7 +1681,6 @@ ac_compiler=`set X $ac_compile; echo $2`
(exit $ac_status); }
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -1668,8 +1700,8 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output" >&5
-echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
(eval $ac_link_default) 2>&5
@@ -1689,23 +1721,23 @@ do
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
- ;;
+ ;;
conftest.$ac_ext )
- # This is the source file.
- ;;
+ # This is the source file.
+ ;;
[ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
*.* )
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- # FIXME: I believe we export ac_cv_exeext for Libtool,
- # but it would be cool to find out if it's true. Does anybody
- # maintain Libtool? --akim.
- export ac_cv_exeext
- break;;
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
* )
- break;;
+ break;;
esac
done
else
@@ -1779,8 +1811,8 @@ for ac_file in conftest.exe conftest conftest.*; do
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- export ac_cv_exeext
- break;;
+ export ac_cv_exeext
+ break;;
* ) break;;
esac
done
@@ -1805,7 +1837,6 @@ if test "${ac_cv_objext+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -1856,7 +1887,6 @@ if test "${ac_cv_c_compiler_gnu+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -1876,11 +1906,21 @@ main ()
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -1893,7 +1933,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_compiler_gnu=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
@@ -1909,7 +1949,6 @@ if test "${ac_cv_prog_cc_g+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -1926,11 +1965,21 @@ main ()
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -1943,7 +1992,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_prog_cc_g=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
@@ -1970,7 +2019,6 @@ else
ac_cv_prog_cc_stdc=no
ac_save_CC=$CC
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -1998,6 +2046,16 @@ static char *f (char * (*g) (char **, int), char **p, ...)
va_end (v);
return s;
}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
@@ -2024,11 +2082,21 @@ do
CC="$ac_save_CC $ac_arg"
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2041,7 +2109,7 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext
+rm -f conftest.err conftest.$ac_objext
done
rm -f conftest.$ac_ext conftest.$ac_objext
CC=$ac_save_CC
@@ -2069,19 +2137,28 @@ cat >conftest.$ac_ext <<_ACEOF
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
for ac_declaration in \
- ''\
- '#include <stdlib.h>' \
+ '' \
'extern "C" void std::exit (int) throw (); using std::exit;' \
'extern "C" void std::exit (int); using std::exit;' \
'extern "C" void exit (int) throw ();' \
@@ -2089,14 +2166,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
'void exit (int);'
do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <stdlib.h>
$ac_declaration
+#include <stdlib.h>
int
main ()
{
@@ -2107,11 +2183,21 @@ exit (42);
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2124,9 +2210,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
continue
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2143,11 +2228,21 @@ exit (42);
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2159,7 +2254,7 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
rm -f conftest*
if test -n "$ac_declaration"; then
@@ -2173,7 +2268,7 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2318,7 +2413,7 @@ fi
echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -2358,7 +2453,6 @@ if test "${ac_cv_cygwin+set}" = set; then
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2379,11 +2473,21 @@ main ()
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2396,7 +2500,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_cygwin=yes
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_cygwin" >&5
@@ -2421,7 +2525,6 @@ else
tcl_cv_seh=no
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2464,7 +2567,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
tcl_cv_seh=no
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
@@ -2490,7 +2593,6 @@ if test "${tcl_cv_eh_disposition+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2513,11 +2615,21 @@ main ()
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2530,7 +2642,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_eh_disposition=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $tcl_cv_eh_disposition" >&5
@@ -2553,7 +2665,6 @@ if test "${tcl_cv_lpfn_decls+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2577,11 +2688,21 @@ main ()
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2594,7 +2715,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_lpfn_decls=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $tcl_cv_lpfn_decls" >&5
@@ -2617,7 +2738,6 @@ if test "${tcl_cv_winnt_ignore_void+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2643,11 +2763,21 @@ main ()
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2660,7 +2790,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_winnt_ignore_void=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $tcl_cv_winnt_ignore_void" >&5
@@ -2689,7 +2819,6 @@ if test "${tcl_cv_malloc_decl_alloca+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2713,11 +2842,21 @@ main ()
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2730,7 +2869,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_malloc_decl_alloca=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $tcl_cv_malloc_decl_alloca" >&5
@@ -2754,7 +2893,6 @@ if test "${tcl_cv_cast_to_union+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2774,11 +2912,21 @@ main ()
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2791,7 +2939,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_cast_to_union=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $tcl_cv_cast_to_union" >&5
@@ -2815,7 +2963,6 @@ if test "${tcl_cv_findex_enums+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2839,11 +2986,21 @@ main ()
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2856,7 +3013,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_findex_enums=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $tcl_cv_findex_enums" >&5
@@ -2878,7 +3035,6 @@ if test "${tcl_cv_mwmo_alertable+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2901,11 +3057,21 @@ main ()
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2918,7 +3084,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_mwmo_alertable=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $tcl_cv_mwmo_alertable" >&5
@@ -3492,7 +3658,6 @@ do
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3503,7 +3668,7 @@ cat >>conftest.$ac_ext <<_ACEOF
#else
# include <assert.h>
#endif
- Syntax error
+ Syntax error
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -3515,6 +3680,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
@@ -3535,7 +3701,6 @@ rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3553,6 +3718,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
@@ -3599,7 +3765,6 @@ do
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3610,7 +3775,7 @@ cat >>conftest.$ac_ext <<_ACEOF
#else
# include <assert.h>
#endif
- Syntax error
+ Syntax error
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -3622,6 +3787,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
@@ -3642,7 +3808,6 @@ rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3660,6 +3825,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
@@ -3720,7 +3886,6 @@ if test "${ac_cv_header_stdc+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3741,11 +3906,21 @@ main ()
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3758,12 +3933,11 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_header_stdc=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3785,7 +3959,6 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3810,7 +3983,6 @@ if test $ac_cv_header_stdc = yes; then
:
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3822,9 +3994,9 @@ cat >>conftest.$ac_ext <<_ACEOF
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif
@@ -3835,7 +4007,7 @@ main ()
int i;
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
+ || toupper (i) != TOUPPER (i))
exit(2);
exit (0);
}
@@ -3860,7 +4032,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_header_stdc=no
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
fi
@@ -3885,7 +4057,7 @@ fi
for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
+ inttypes.h stdint.h unistd.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_header" >&5
@@ -3894,7 +4066,6 @@ if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3906,11 +4077,21 @@ $ac_includes_default
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3923,7 +4104,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_Header=no"
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -3950,7 +4131,6 @@ else
echo "$as_me:$LINENO: checking errno.h usability" >&5
echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3961,11 +4141,21 @@ $ac_includes_default
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3978,7 +4168,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6
@@ -3986,7 +4176,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6
echo "$as_me:$LINENO: checking errno.h presence" >&5
echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -4004,6 +4193,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
@@ -4023,33 +4213,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
{ echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
+ { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- no:yes )
+ no:yes:* )
{ echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
@@ -4269,13 +4458,13 @@ _ACEOF
# `set' does not quote correctly, so add quotes (double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \).
sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
;;
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
esac;
} |
@@ -4305,13 +4494,13 @@ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
s/:*\$(srcdir):*/:/;
s/:*\${srcdir}:*/:/;
s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
+s/^\([^=]*=[ ]*\):*/\1/;
s/:*$//;
-s/^[^=]*=[ ]*$//;
+s/^[^=]*=[ ]*$//;
}'
fi
@@ -4325,13 +4514,13 @@ fi
cat >confdef2opt.sed <<\_ACEOF
t clear
: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
t quote
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
t quote
d
: quote
-s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
+s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
s,\[,\\&,g
s,\],\\&,g
s,\$,$$,g
@@ -4353,7 +4542,7 @@ ac_ltlibobjs=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
# 2. Add them.
ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
@@ -4397,9 +4586,10 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
+DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
@@ -4418,7 +4608,7 @@ for as_var in \
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
$as_unset $as_var
@@ -4597,16 +4787,17 @@ rm -f conf$$ conf$$.exe conf$$.file
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
+ test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
# IFS
@@ -4633,7 +4824,7 @@ _ASBOX
cat >&5 <<_CSEOF
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.57. Invocation command line was
+generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -4677,7 +4868,7 @@ Usage: $0 [OPTIONS] [FILE]...
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
+ instantiate the configuration file FILE
Configuration files:
$config_files
@@ -4688,11 +4879,10 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.57,
+configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
srcdir=$srcdir
@@ -4995,9 +5185,9 @@ _ACEOF
(echo ':t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
fi
ac_sed_frag=`expr $ac_sed_frag + 1`
ac_beg=$ac_end
@@ -5015,21 +5205,21 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case $ac_file in
- | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
*:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
* ) ac_file_in=$ac_file.in ;;
esac
# Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -5045,10 +5235,10 @@ echo X"$ac_file" |
as_dirs="$as_dir $as_dirs"
as_dir=`(dirname "$as_dir") 2>/dev/null ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -5086,12 +5276,45 @@ case $srcdir in
ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
@@ -5109,7 +5332,7 @@ echo "$as_me: creating $ac_file" >&6;}
configure_input="$ac_file. "
fi
configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
+ sed 's,.*/,,'` by configure."
# First look for the input files in the build tree, otherwise in the
# src tree.
@@ -5118,24 +5341,24 @@ echo "$as_me: creating $ac_file" >&6;}
case $f in
-) echo $tmp/stdin ;;
[\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
- echo $f;;
+ echo "$f";;
*) # Relative
- if test -f "$f"; then
- # Build tree
- echo $f
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo $srcdir/$f
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
- fi;;
+ fi;;
esac
done` || { (exit 1); exit 1; }
_ACEOF
diff --git a/win/rules.vc b/win/rules.vc
index d9b498f..cfa4baa 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -10,7 +10,7 @@
# Copyright (c) 2001-2003 David Gravereaux.
#
#------------------------------------------------------------------------------
-# RCS: @(#) $Id: rules.vc,v 1.20 2005/05/10 18:35:36 kennykb Exp $
+# RCS: @(#) $Id: rules.vc,v 1.21 2005/08/11 22:06:47 kennykb Exp $
#------------------------------------------------------------------------------
!ifndef _RULES_VC
@@ -179,12 +179,6 @@ USE_THREAD_ALLOC = 1
!else
USE_THREAD_ALLOC = 0
!endif
-!if [nmakehlp -f $(OPTS) "thrdstorage"]
-!message *** Doing thrdstorage
-USE_THREAD_STORAGE = 1
-!else
-USE_THREAD_STORAGE = 0
-!endif
!if [nmakehlp -f $(OPTS) "unchecked"]
!message *** Doing unchecked
UNCHECKED = 1
@@ -329,9 +323,6 @@ OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1
!if $(USE_THREAD_ALLOC)
OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1
!endif
-!if $(USE_THREAD_STORAGE)
-OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_STORAGE=1
-!endif
!endif
!if $(STATIC_BUILD)
OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD
diff --git a/win/tcl.m4 b/win/tcl.m4
index 7b0f5a6..5b9f8c0 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -257,9 +257,6 @@ AC_DEFUN(SC_ENABLE_THREADS, [
# USE_THREAD_ALLOC tells us to try the special thread-based
# allocator that significantly reduces lock contention
AC_DEFINE(USE_THREAD_ALLOC)
- # USE_THREAD_STORAGE tells us to use the new generic thread
- # storage subsystem.
- AC_DEFINE(USE_THREAD_STORAGE)
else
TCL_THREADS=0
AC_MSG_RESULT([no (default)])
diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c
index 11d3870..a54ff36 100644
--- a/win/tclWinThrd.c
+++ b/win/tclWinThrd.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinThrd.c,v 1.39 2005/07/24 22:56:50 dkf Exp $
+ * RCS: @(#) $Id: tclWinThrd.c,v 1.40 2005/08/11 22:06:47 kennykb Exp $
*/
#include "tclWinInt.h"
@@ -568,206 +568,6 @@ TclpFinalizeMutex(mutexPtr)
/*
*----------------------------------------------------------------------
*
- * TclpThreadDataKeyInit --
- *
- * This procedure initializes a thread specific data block key. Each
- * thread has table of pointers to thread specific data. All threads
- * agree on which table entry is used by each module. This is remembered
- * in a "data key", that is just an index into this table. To allow self
- * initialization, the interface passes a pointer to this key and the
- * first thread to use the key fills in the pointer to the key. The key
- * should be a process-wide static.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Will allocate memory the first time this process calls for this key.
- * In this case it modifies its argument to hold the pointer to
- * information about the key.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpThreadDataKeyInit(keyPtr)
- Tcl_ThreadDataKey *keyPtr; /* Identifier for the data chunk, really
- * (DWORD **) */
-{
- DWORD *indexPtr;
- DWORD newKey;
-
- MASTER_LOCK;
- if (*keyPtr == NULL) {
- indexPtr = (DWORD *)ckalloc(sizeof(DWORD));
- newKey = TlsAlloc();
- if (newKey == TLS_OUT_OF_INDEXES) {
- Tcl_Panic("TlsAlloc failed from TclpThreadDataKeyInit!");
- /* This should have been a fatal error. */
- }
-
- *indexPtr = newKey;
- *keyPtr = (Tcl_ThreadDataKey)indexPtr;
- TclRememberDataKey(keyPtr);
- }
- MASTER_UNLOCK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpThreadDataKeyGet --
- *
- * This procedure returns a pointer to a block of thread local storage.
- *
- * Results:
- * A thread-specific pointer to the data structure, or NULL if the memory
- * has not been assigned to this key for this thread.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-VOID *
-TclpThreadDataKeyGet(keyPtr)
- Tcl_ThreadDataKey *keyPtr; /* Identifier for the data chunk, really
- * (DWORD **) */
-{
- DWORD *indexPtr = *(DWORD **)keyPtr;
- LPVOID result;
-
- if (indexPtr == NULL) {
- return NULL;
- }
- result = TlsGetValue(*indexPtr);
- if ((result == NULL) && (GetLastError() != NO_ERROR)) {
- Tcl_Panic("TlsGetValue failed from TclpThreadDataKeyGet!");
- }
- return result;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpThreadDataKeySet --
- *
- * This procedure sets the pointer to a block of thread local storage.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Sets up the thread so future calls to TclpThreadDataKeyGet with this
- * key will return the data pointer.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpThreadDataKeySet(keyPtr, data)
- Tcl_ThreadDataKey *keyPtr; /* Identifier for the data chunk, really
- * (pthread_key_t **) */
- VOID *data; /* Thread local storage. */
-{
- DWORD *indexPtr = *(DWORD **)keyPtr;
- BOOL success;
-
- success = TlsSetValue(*indexPtr, (void *)data);
- if (!success) {
- Tcl_Panic("TlsSetValue failed from TclpThreadDataKeySet!");
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpFinalizeThreadData --
- *
- * This procedure cleans up the thread-local storage. This is called once
- * for each thread.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Frees up the memory.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpFinalizeThreadData(keyPtr)
- Tcl_ThreadDataKey *keyPtr;
-{
- VOID *result;
- DWORD *indexPtr;
- BOOL success;
-
- if (*keyPtr != NULL) {
- indexPtr = *(DWORD **)keyPtr;
- result = (VOID *) TlsGetValue(*indexPtr);
-
- if (result != NULL) {
-#if defined(USE_THREAD_ALLOC) && !defined(TCL_MEM_DEBUG)
- if (indexPtr == &tlsKey) {
- TclpFreeAllocCache(result);
- return;
- }
-#endif /* USE_THREAD_ALLOC && !TCL_MEM_DEBUG */
-
- ckfree((char *)result);
- success = TlsSetValue(*indexPtr, (void *)NULL);
- if (!success) {
- Tcl_Panic("TlsSetValue failed from TclpFinalizeThreadData!");
- }
- } else if (GetLastError() != NO_ERROR) {
- Tcl_Panic("TlsGetValue failed from TclpFinalizeThreadData!");
- }
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpFinalizeThreadDataKey --
- *
- * This procedure is invoked to clean up one key. This is a process-wide
- * storage identifier. The thread finalization code cleans up the thread
- * local storage itself.
- *
- * This assumes the master lock is held.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The key is deallocated.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpFinalizeThreadDataKey(keyPtr)
- Tcl_ThreadDataKey *keyPtr;
-{
- DWORD *indexPtr;
- BOOL success;
- if (*keyPtr != NULL) {
- indexPtr = *(DWORD **)keyPtr;
- success = TlsFree(*indexPtr);
- if (!success) {
- Tcl_Panic("TlsFree failed from TclpFinalizeThreadDataKey!");
- }
- ckfree((char *)indexPtr);
- *keyPtr = NULL;
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
* Tcl_ConditionWait --
*
* This procedure is invoked to wait on a condition variable. The mutex