Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
405d6b342f | ||
|
|
f1cf71eddc | ||
|
|
2d8b722d23 | ||
|
|
751eb00371 | ||
|
|
cb4c129e3d | ||
|
|
635fc6d90c | ||
|
|
57cc1e85b2 | ||
|
|
f1630f8668 | ||
|
|
a3ed3589e6 |
@@ -1,3 +1,31 @@
|
||||
2002-04-05 Daniel Steffen <das@users.sourceforge.net>
|
||||
|
||||
* mac/tclMacPkgConfig.c: Added Mac implementation of pkgconfig.
|
||||
* tests/config.test: fixed failing tests.
|
||||
|
||||
2002-02-05 Andreas Kupries <andreas_kupries@users.sourceforge.net>
|
||||
|
||||
* tests/config.test: Added a testsuite for pkgconfig.
|
||||
|
||||
* unix/mkLinks: Regenerated.
|
||||
* doc/RegConfig.3: Added documentation for the new public API
|
||||
function.
|
||||
|
||||
* This commit addresses the following topics from the comments at
|
||||
SF item 507083:
|
||||
|
||||
@ Reformatted to 72 columns per line (mostly). Some character
|
||||
strings (Panic messages) are still longer.
|
||||
|
||||
@ Better panic messages.
|
||||
|
||||
@ Allocation of wrapper uses sizeof(Tcl_Obj*) instead of sizeof
|
||||
(char*).
|
||||
|
||||
@ Terminate array with either "" or NULL.
|
||||
|
||||
@ Changed to use ckalloc/ckfree instead of Tcl_Alloc/Tcl_Free.
|
||||
|
||||
2002-01-23 Andreas Kupries <andreas_kupries@users.sourceforge.net>
|
||||
|
||||
* unix/mkLinks: Regenerated.
|
||||
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
'\"
|
||||
'\" Copyright (c) 2002 Andreas Kupries <andreas_kupries@users.sourceforge.net>
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: RegConfig.3,v 1.1.2.1 2002/02/05 22:15:23 andreas_kupries Exp $
|
||||
.so man.macros
|
||||
.TH Tcl_RegisterConfig 3 8.4 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
.SH NAME
|
||||
Tcl_RegisterConfig \- procedures to register embedded configuration information.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
void
|
||||
\fBTcl_RegisterConfig\fR(\fIinterp,pkgName,configuration,valEncoding\fR)
|
||||
.sp
|
||||
.SH ARGUMENTS
|
||||
.AP Tcl_Interp *interp in
|
||||
|
||||
Refers to the interpreter the embedded configuration information is
|
||||
registered for. Must not be NULL.
|
||||
|
||||
.AP "CONST char" *pkgName in
|
||||
|
||||
Contains the name of the package registering the embedded
|
||||
configuration as ASCII string. This means that this information is in
|
||||
UTF-8 too. Must not be NULL.
|
||||
|
||||
.AP Tcl_Config *configuration in
|
||||
|
||||
Refers to an array of Tcl_Config entries containing the information
|
||||
embedded in the binary library. Must not be NULL. The end of the array
|
||||
is signaled by either a key identical to NULL, or a key refering to
|
||||
the empty string.
|
||||
|
||||
.AP "CONST char" *valEncoding in
|
||||
|
||||
Contains the name of the encoding used to store the configuration
|
||||
values as ASCII string. This means that this information is in UTF-8
|
||||
too. Must not be NULL.
|
||||
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The function described here has its base in TIP 59 and provides
|
||||
extensions with support for the embedding of configuration
|
||||
information into their binary library and the generation of a
|
||||
tcl-level interface for querying this information.
|
||||
.PP
|
||||
To embed configuration information into their binary library an
|
||||
extension has to define a non-volatile array of Tcl_Config entries in
|
||||
one if its source files and then call \fBTcl_RegisterConfig\fR to
|
||||
register that information.
|
||||
.PP
|
||||
\fBTcl_RegisterConfig\fR takes four arguments; first, a reference to
|
||||
the interpreter we are registering the information with, second, the
|
||||
name of the package registering its configuration information, third,
|
||||
a pointer to an array of structures, and fourth a string declaring the
|
||||
encoding used by the configuration values.
|
||||
.PP
|
||||
The string \fIvalEncoding\fR contains the name of an encoding known to
|
||||
Tcl. All these names are use only characters in the ASCII subset of
|
||||
UTF-8 and are thus implicity in the UTF-8 encoding. It is expected
|
||||
that keys are legible english text and therefore using the ASCII
|
||||
subset of UTF-8. In other words, they are expected to be in UTF-8
|
||||
too. The values associated with the keys can be any string
|
||||
however. For these the contents of \fIvalEncoding\fR define which
|
||||
encoding was used to represent the characters of the strings.
|
||||
.PP
|
||||
Each element of the \fIconfiguration\fR array refers to two strings
|
||||
containing the key and the value associated with that key. The end of
|
||||
the array is signaled by either an empty key or a key identical to
|
||||
NULL. The function makes \fBno\fR copy of the \fIconfiguration\fR
|
||||
array. This means that the caller has to make sure that the memory
|
||||
holding this array is never released. This is the meaning behind the
|
||||
word \fBnon-volatile\fR used earlier. The easiest way to accomplish
|
||||
this is to define a global static array of Tcl_Config entries. See the
|
||||
file "generic/tclPkgConfig.c" in the sources of the tcl core for an
|
||||
example.
|
||||
.PP
|
||||
When called \fBTcl_RegisterConfig\fR will
|
||||
.IP (1)
|
||||
create a namespace having the provided \fIpkgName\fR, if not yet
|
||||
existing.
|
||||
.IP (2)
|
||||
create the command \fBpkgconfig\fR in that namespace and link it to
|
||||
the provided information so that the keys from _configuration_ and
|
||||
their associated values can be retrieved through calls to
|
||||
\fBpkgconfig\fR.
|
||||
.PP
|
||||
The command \fBpkgconfig\fR will provide two subcommands, \fBlist\fR
|
||||
and \fBget\fR:
|
||||
.RS
|
||||
.TP
|
||||
::\fIpkgName\fR::\fBpkgconfig\fR list
|
||||
Returns a list containing the names of all defined keys.
|
||||
.TP
|
||||
::\fIpkgName\fR::\fBpkgconfig\fR get \fIkey\fR
|
||||
Returns the configuration value associated with the specified
|
||||
\fIkey\fR.
|
||||
.RE
|
||||
|
||||
.SH TCL_CONFIG
|
||||
|
||||
The \fBTcl_Config\fR structure contains the following fields:
|
||||
.PP
|
||||
.CS
|
||||
typedef struct Tcl_Config {
|
||||
CONST char* key;
|
||||
CONST char* value;
|
||||
} Tcl_Config;
|
||||
.CE
|
||||
|
||||
'\" No cross references yet.
|
||||
'\" .SH "SEE ALSO"
|
||||
|
||||
.SH KEYWORDS
|
||||
embedding, configuration, bianry library
|
||||
+7
-1
@@ -10,7 +10,7 @@
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# RCS: @(#) $Id: tcl.decls,v 1.77 2002/01/23 20:46:01 dgp Exp $
|
||||
# RCS: @(#) $Id: tcl.decls,v 1.77.2.1 2002/01/25 01:47:01 andreas_kupries Exp $
|
||||
|
||||
library tcl
|
||||
|
||||
@@ -1698,6 +1698,12 @@ declare 482 generic {
|
||||
void Tcl_GetTime( Tcl_Time* timeBuf )
|
||||
}
|
||||
|
||||
# New export due to TIP#59
|
||||
declare 483 generic {
|
||||
void Tcl_RegisterConfig (Tcl_Interp* interp, CONST char* pkgName, Tcl_Config* configuration, \
|
||||
CONST char* valEncoding)
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
|
||||
# Define the platform specific public Tcl interface. These functions are
|
||||
|
||||
+10
-1
@@ -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: tcl.h,v 1.110 2002/01/17 04:37:33 dgp Exp $
|
||||
* RCS: @(#) $Id: tcl.h,v 1.110.2.1 2002/01/25 01:47:01 andreas_kupries Exp $
|
||||
*/
|
||||
|
||||
#ifndef _TCL
|
||||
@@ -2070,6 +2070,15 @@ typedef struct Tcl_Parse {
|
||||
|
||||
typedef unsigned short Tcl_UniChar;
|
||||
|
||||
/* The following structure is used in calls 'Tcl_RegisterConfig' to
|
||||
* provide the system with the embedded configuration data.
|
||||
*/
|
||||
|
||||
typedef struct Tcl_Config {
|
||||
CONST char* key; /* Configuration key to register. ASCII encoded, thus UTF-8 */
|
||||
CONST char* value; /* The value associated with the key. System encoding */
|
||||
} Tcl_Config;
|
||||
|
||||
/*
|
||||
* Deprecated Tcl procedures:
|
||||
*/
|
||||
|
||||
+10
-1
@@ -13,7 +13,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclBasic.c,v 1.43 2001/12/14 20:31:22 msofer Exp $
|
||||
* RCS: @(#) $Id: tclBasic.c,v 1.43.2.1 2002/01/25 01:47:01 andreas_kupries Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -558,6 +558,15 @@ Tcl_CreateInterp()
|
||||
#endif
|
||||
Tcl_InitStubs(interp, TCL_VERSION, 1);
|
||||
|
||||
/*
|
||||
* TIP #59: Make embedded configuration information
|
||||
* available. This makes use of a public API call
|
||||
* (Tcl_RegisterConfig) and thus requires that the global stub
|
||||
* table is initialized.
|
||||
*/
|
||||
|
||||
TclInitEmbeddedConfigurationInformation (interp);
|
||||
|
||||
return interp;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,327 @@
|
||||
/*
|
||||
* tclConfig.c --
|
||||
*
|
||||
* This file provides the facilities which allow Tcl and other packages
|
||||
* to embed configuration information into their binary libraries.
|
||||
*
|
||||
* Copyright (c) 2002 Andreas Kupries <andreas_kupries@users.sourceforge.net>
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclConfig.c,v 1.1.2.4 2002/02/06 12:21:43 davygrvy Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Internal structure to hold additional information about the
|
||||
* embedded configuration. Allocated on the heap during construction
|
||||
* of the configuration command. Allocated big enough to hold
|
||||
* references to as many strings as there are entries in the
|
||||
* configuration itself. These references will refer to the
|
||||
* configuration values, converted into UTF 8. This conversion is done
|
||||
* on demand.
|
||||
*/
|
||||
|
||||
typedef struct Tcl_ConfigMeta {
|
||||
Tcl_Config* configuration; /* Reference to the embedded
|
||||
* configuration. */
|
||||
Tcl_Encoding valEncoding; /* Token for the encoding used to
|
||||
* represent the values in the
|
||||
* configuration. */
|
||||
Tcl_Obj* keylist; /* List of the registered keys */
|
||||
int entries; /* Number of entries in
|
||||
* configuration. */
|
||||
Tcl_Obj* value [1]; /* Array of the values converted to
|
||||
* UTF-8. Usage of Tcl_Obj's means
|
||||
* that we remove one conversion from
|
||||
* string to object when querying the
|
||||
* data, and also share them with
|
||||
* other parts of the system as much
|
||||
* as possible. */
|
||||
} Tcl_ConfigMeta;
|
||||
|
||||
/*
|
||||
* Static functions in this file:
|
||||
*/
|
||||
|
||||
static
|
||||
int QueryConfigObjCmd _ANSI_ARGS_((ClientData clientData,
|
||||
Tcl_Interp *interp, int objc, struct Tcl_Obj * CONST * objv));
|
||||
|
||||
static
|
||||
void QueryConfigDelete _ANSI_ARGS_((ClientData clientData));
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_RegisterConfig --
|
||||
*
|
||||
* See TIP#59 for details on what this procedure does.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* Creates namespace and cfg query command in it as per TIP #59.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
void
|
||||
Tcl_RegisterConfig (interp, pkgName, configuration, valEncoding)
|
||||
Tcl_Interp* interp; /* Interpreter the configuration
|
||||
* command is registered in. */
|
||||
CONST char* pkgName; /* Name of the package registering
|
||||
* the embedded configuration. ASCII,
|
||||
* thus in UTF-8 too. */
|
||||
Tcl_Config* configuration; /* Embedded configuration */
|
||||
CONST char* valEncoding; /* Name of the encoding used to
|
||||
* store the configuration values,
|
||||
* ASCII, thus UTF-8 */
|
||||
{
|
||||
/* Actions:
|
||||
* - Count the entries in the configuration,
|
||||
* - Allocate a big enough wrapper (meta) and initialize it
|
||||
* - Create the configuration query command and use the wrapper
|
||||
* as its client data.
|
||||
*/
|
||||
|
||||
int n, i;
|
||||
Tcl_Config* cfg;
|
||||
Tcl_ConfigMeta* wrap;
|
||||
Tcl_DString cmdName;
|
||||
|
||||
/* The counting loop stops if it encounters either an empty key
|
||||
* ("") or a NULL pointer as key. This is an extension of the
|
||||
* specification, which only recognizes "" as end of array.
|
||||
*/
|
||||
|
||||
for (n = 0, cfg = configuration;
|
||||
(cfg->key != (CONST char*) NULL) && (cfg->key [0] != '\0') ;
|
||||
n++, cfg++)
|
||||
/* empty loop */
|
||||
;
|
||||
|
||||
wrap = (Tcl_ConfigMeta*) ckalloc (sizeof (Tcl_ConfigMeta) +
|
||||
(sizeof (Tcl_Obj*) * n));
|
||||
|
||||
wrap->configuration = configuration;
|
||||
wrap->entries = n;
|
||||
wrap->valEncoding = Tcl_GetEncoding (NULL, valEncoding);
|
||||
wrap->keylist = (Tcl_Obj*) NULL;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
wrap->value [i] = (Tcl_Obj*) NULL;
|
||||
}
|
||||
|
||||
Tcl_DStringInit (&cmdName);
|
||||
Tcl_DStringAppend (&cmdName, "::", -1);
|
||||
Tcl_DStringAppend (&cmdName, pkgName, -1);
|
||||
|
||||
/* The incomplete command name is the name of the namespace to
|
||||
* place it in.
|
||||
*/
|
||||
|
||||
if ((Tcl_Namespace*) NULL == Tcl_FindNamespace(interp,
|
||||
Tcl_DStringValue (&cmdName), NULL, TCL_GLOBAL_ONLY)) {
|
||||
|
||||
if ((Tcl_Namespace*) NULL == Tcl_CreateNamespace (interp,
|
||||
Tcl_DStringValue (&cmdName), (ClientData) NULL,
|
||||
(Tcl_NamespaceDeleteProc *) NULL)) {
|
||||
|
||||
Tcl_Panic ("%s.\n%s %s", Tcl_GetStringResult(interp),
|
||||
"Tcl_RegisterConfig: Unable to create namespace for",
|
||||
"package configuration.");
|
||||
}
|
||||
}
|
||||
|
||||
Tcl_DStringAppend (&cmdName, "::pkgconfig", -1);
|
||||
|
||||
if ((Tcl_Command) NULL == Tcl_CreateObjCommand (interp,
|
||||
Tcl_DStringValue (&cmdName), QueryConfigObjCmd,
|
||||
(ClientData) wrap, QueryConfigDelete)) {
|
||||
|
||||
Tcl_Panic ("%s %s", "Tcl_RegisterConfig: Unable to create query",
|
||||
"command for package configuration");
|
||||
}
|
||||
|
||||
Tcl_DStringFree (&cmdName);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* QueryConfigObjCmd --
|
||||
*
|
||||
* Implementation of "::<package>::pkgconfig", the command to
|
||||
* query configuration information embedded into a binary library.
|
||||
*
|
||||
* Results:
|
||||
* A standard tcl result.
|
||||
*
|
||||
* Side effects:
|
||||
* See the manual for what this command does.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static
|
||||
int QueryConfigObjCmd (clientData, interp, objc, objv)
|
||||
ClientData clientData;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
struct Tcl_Obj * CONST * objv;
|
||||
{
|
||||
Tcl_ConfigMeta* wrap = (Tcl_ConfigMeta*) clientData;
|
||||
int index, i;
|
||||
|
||||
static CONST char *subcmdStrings[] = {
|
||||
"get", "list", NULL
|
||||
};
|
||||
enum subcmds {
|
||||
CFG_GET, CFG_LIST
|
||||
};
|
||||
|
||||
if ((objc < 2) || (objc > 3)) {
|
||||
Tcl_WrongNumArgs (interp, 0, NULL, "list | get key");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (Tcl_GetIndexFromObj(interp, objv[1], subcmdStrings,
|
||||
"subcommand", 0, &index) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
switch ((enum subcmds) index) {
|
||||
case CFG_GET:
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs (interp, 0, NULL, "get key");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
for (i=0; i < wrap->entries; i++) {
|
||||
/* We can use 'strcmp' as we know that the keys are in
|
||||
* ASCII/UTF-8
|
||||
*/
|
||||
if (strcmp (wrap->configuration [i].key,
|
||||
Tcl_GetString (objv [2])) == 0) {
|
||||
|
||||
if (wrap->value [i] == (Tcl_Obj*) NULL) {
|
||||
/* Convert the value associated with a key to
|
||||
* UTF 8 on demand, i.e. only if requested at
|
||||
* all and cache the result as it will never
|
||||
* change.
|
||||
*/
|
||||
|
||||
Tcl_DString conv;
|
||||
|
||||
CONST char* convValue =
|
||||
Tcl_ExternalToUtfDString (wrap->valEncoding,
|
||||
wrap->configuration [i].value,
|
||||
-1, &conv);
|
||||
|
||||
Tcl_Obj* valString = Tcl_NewStringObj (convValue, -1);
|
||||
|
||||
Tcl_DStringFree (&conv);
|
||||
|
||||
if (valString == (Tcl_Obj*) NULL) {
|
||||
Tcl_SetObjResult (interp,
|
||||
Tcl_NewStringObj (
|
||||
"unable to convert value to utf-8",
|
||||
-1));
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_IncrRefCount (valString);
|
||||
wrap->value [i] = valString;
|
||||
}
|
||||
Tcl_SetObjResult (interp, wrap->value [i]);
|
||||
return TCL_OK;
|
||||
}
|
||||
}
|
||||
Tcl_SetObjResult (interp,
|
||||
Tcl_NewStringObj ("key not known", -1));
|
||||
return TCL_ERROR;
|
||||
|
||||
case CFG_LIST:
|
||||
if (objc != 2) {
|
||||
Tcl_WrongNumArgs (interp, 0, NULL, "list");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (wrap->keylist == (Tcl_Obj*) NULL) {
|
||||
/* Generate the list of know keys on demand and cache
|
||||
* it as it will never change.
|
||||
*/
|
||||
|
||||
int i;
|
||||
Tcl_Obj* listResult = Tcl_NewListObj (0, NULL);
|
||||
|
||||
if (listResult == (Tcl_Obj*) NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
for (i=0; i < wrap->entries; i++) {
|
||||
Tcl_Obj* keyString =
|
||||
Tcl_NewStringObj (wrap->configuration [i].key,
|
||||
-1);
|
||||
|
||||
if (keyString == (Tcl_Obj*) NULL) {
|
||||
Tcl_DecrRefCount (listResult);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (TCL_OK != Tcl_ListObjAppendElement (interp,
|
||||
listResult, keyString)) {
|
||||
Tcl_DecrRefCount (listResult);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
Tcl_IncrRefCount (listResult);
|
||||
wrap->keylist = listResult;
|
||||
}
|
||||
Tcl_SetObjResult (interp, wrap->keylist);
|
||||
return TCL_OK;
|
||||
default:
|
||||
Tcl_Panic ("QueryConfigObjCmd: Unknown subcommand to 'pkgconfig'. This can't happen");
|
||||
break;
|
||||
}
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
*-------------------------------------------------------------------------
|
||||
*
|
||||
* QueryConfigDelete --
|
||||
*
|
||||
* Command delete procedure. Cleans up after the configuration query
|
||||
* command when it is deleted by the user or during finalization.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* Deallocates all non-transient memory allocated by Tcl_RegisterConfig.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static
|
||||
void QueryConfigDelete (clientData)
|
||||
ClientData clientData;
|
||||
{
|
||||
Tcl_ConfigMeta* wrap = (Tcl_ConfigMeta*) clientData;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < wrap->entries; i++) {
|
||||
if (wrap->value[i] != (Tcl_Obj*) NULL) {
|
||||
Tcl_DecrRefCount (wrap->value [i]);
|
||||
}
|
||||
}
|
||||
if (wrap->keylist != (Tcl_Obj*) NULL) {
|
||||
Tcl_DecrRefCount (wrap->keylist);
|
||||
}
|
||||
Tcl_FreeEncoding (wrap->valEncoding);
|
||||
ckfree ((char*) wrap);
|
||||
}
|
||||
+11
-1
@@ -8,7 +8,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclDecls.h,v 1.77 2002/01/23 20:46:01 dgp Exp $
|
||||
* RCS: @(#) $Id: tclDecls.h,v 1.77.2.1 2002/01/25 01:47:01 andreas_kupries Exp $
|
||||
*/
|
||||
|
||||
#ifndef _TCLDECLS
|
||||
@@ -1514,6 +1514,11 @@ EXTERN int Tcl_EvalTokensStandard _ANSI_ARGS_((
|
||||
int count));
|
||||
/* 482 */
|
||||
EXTERN void Tcl_GetTime _ANSI_ARGS_((Tcl_Time* timeBuf));
|
||||
/* 483 */
|
||||
EXTERN void Tcl_RegisterConfig _ANSI_ARGS_((Tcl_Interp* interp,
|
||||
CONST char* pkgName,
|
||||
Tcl_Config* configuration,
|
||||
CONST char* valEncoding));
|
||||
|
||||
typedef struct TclStubHooks {
|
||||
struct TclPlatStubs *tclPlatStubs;
|
||||
@@ -2056,6 +2061,7 @@ typedef struct TclStubs {
|
||||
void (*tcl_FSMountsChanged) _ANSI_ARGS_((Tcl_Filesystem * fsPtr)); /* 480 */
|
||||
int (*tcl_EvalTokensStandard) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Token * tokenPtr, int count)); /* 481 */
|
||||
void (*tcl_GetTime) _ANSI_ARGS_((Tcl_Time* timeBuf)); /* 482 */
|
||||
void (*tcl_RegisterConfig) _ANSI_ARGS_((Tcl_Interp* interp, CONST char* pkgName, Tcl_Config* configuration, CONST char* valEncoding)); /* 483 */
|
||||
} TclStubs;
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -4028,6 +4034,10 @@ extern TclStubs *tclStubsPtr;
|
||||
#define Tcl_GetTime \
|
||||
(tclStubsPtr->tcl_GetTime) /* 482 */
|
||||
#endif
|
||||
#ifndef Tcl_RegisterConfig
|
||||
#define Tcl_RegisterConfig \
|
||||
(tclStubsPtr->tcl_RegisterConfig) /* 483 */
|
||||
#endif
|
||||
|
||||
#endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
|
||||
|
||||
|
||||
+3
-1
@@ -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.75 2002/01/15 21:19:07 dgp Exp $
|
||||
* RCS: @(#) $Id: tclInt.h,v 1.75.2.1 2002/01/25 01:47:01 andreas_kupries Exp $
|
||||
*/
|
||||
|
||||
#ifndef _TCLINT
|
||||
@@ -1652,6 +1652,8 @@ EXTERN int TclDoGlob _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
char *separators, Tcl_DString *headPtr,
|
||||
char *tail, Tcl_GlobTypeData *types));
|
||||
EXTERN void TclDumpMemoryInfo _ANSI_ARGS_((FILE *outFile));
|
||||
EXTERN void TclInitEmbeddedConfigurationInformation
|
||||
_ANSI_ARGS_((Tcl_Interp *interp));
|
||||
EXTERN void TclExpandTokenArray _ANSI_ARGS_((
|
||||
Tcl_Parse *parsePtr));
|
||||
EXTERN void TclExprFloatError _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* tclPkgConfig.c --
|
||||
*
|
||||
* This file contains the configuration information to
|
||||
* embed into the tcl binary library.
|
||||
*
|
||||
* Copyright (c) 2002 Andreas Kupries <andreas_kupries@users.sourceforge.net>
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclPkgConfig.c,v 1.1.2.3 2002/02/19 22:01:17 andreas_kupries Exp $
|
||||
*/
|
||||
|
||||
/* Note, the definitions in this module are influenced by the
|
||||
* following C preprocessor macros:
|
||||
*
|
||||
* OSCMa = shortcut for "old style configuration macro activates"
|
||||
* NSCMdt = shortcut for "new style configuration macro declares that"
|
||||
*
|
||||
* - TCL_THREADS OSCMa compilation as threaded core.
|
||||
* - TCL_MEM_DEBUG OSCMa memory debugging.
|
||||
* - TCL_COMPILE_DEBUG OSCMa debugging of bytecode compiler.
|
||||
* - TCL_COMPILE_STATS OSCMa bytecode compiler statistics.
|
||||
*
|
||||
* - TCL_CFG_DO64BIT NSCMdt tcl is compiled for a 64bit system.
|
||||
* - TCL_CFG_DEBUG NSCMdt tcl is compiled with symbol info on.
|
||||
* - TCL_CFG_OPTIMIZED NSCMdt tcl is compiled with cc optimizations on.
|
||||
* - TCL_CFG_PROFILED NSCMdt tcl is compiled with profiling info.
|
||||
*
|
||||
* - CFG_RUNTIME_* Paths to various stuff at runtime.
|
||||
* - CFG_INSTALL_* Paths to various stuff at installation time.
|
||||
*
|
||||
* - TCL_CFGVAL_ENCODING string containing the encoding used for the
|
||||
* configuration values.
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
|
||||
|
||||
/* Use C preprocessor statements to define the various values for the
|
||||
* embedded configuration information. */
|
||||
|
||||
#ifdef TCL_THREADS
|
||||
# define CFG_THREADED "1"
|
||||
#else
|
||||
# define CFG_THREADED "0"
|
||||
#endif
|
||||
#ifdef TCL_MEM_DEBUG
|
||||
# define CFG_MEMDEBUG "1"
|
||||
#else
|
||||
# define CFG_MEMDEBUG "0"
|
||||
#endif
|
||||
#ifdef TCL_COMPILE_DEBUG
|
||||
# define CFG_COMPILE_DEBUG "1"
|
||||
#else
|
||||
# define CFG_COMPILE_DEBUG "0"
|
||||
#endif
|
||||
#ifdef TCL_COMPILE_STATS
|
||||
# define CFG_COMPILE_STATS "1"
|
||||
#else
|
||||
# define CFG_COMPILE_STATS "0"
|
||||
#endif
|
||||
#ifdef TCL_CFG_DO64BIT
|
||||
# define CFG_64 "1"
|
||||
#else
|
||||
# define CFG_64 "0"
|
||||
#endif
|
||||
#ifdef TCL_CFG_DEBUG
|
||||
# define CFG_DEBUG "1"
|
||||
#else
|
||||
# define CFG_DEBUG "0"
|
||||
#endif
|
||||
#ifdef TCL_CFG_OPTIMIZED
|
||||
# define CFG_OPTIMIZED "1"
|
||||
#else
|
||||
# define CFG_OPTIMIZED "0"
|
||||
#endif
|
||||
#ifdef TCL_CFG_PROFILED
|
||||
# define CFG_PROFILED "1"
|
||||
#else
|
||||
# define CFG_PROFILED "0"
|
||||
#endif
|
||||
|
||||
static Tcl_Config cfg [] = {
|
||||
{"debug", CFG_DEBUG},
|
||||
{"threaded", CFG_THREADED},
|
||||
{"profiled", CFG_PROFILED},
|
||||
{"64bit", CFG_64},
|
||||
{"optimized", CFG_OPTIMIZED},
|
||||
{"mem_debug", CFG_MEMDEBUG},
|
||||
{"compile_debug", CFG_COMPILE_DEBUG},
|
||||
{"compile_stats", CFG_COMPILE_STATS},
|
||||
|
||||
/* Runtime paths to various stuff */
|
||||
|
||||
{"libdir,runtime", CFG_RUNTIME_LIBDIR},
|
||||
{"bindir,runtime", CFG_RUNTIME_BINDIR},
|
||||
{"scriptdir,runtime", CFG_RUNTIME_SCRDIR},
|
||||
{"includedir,runtime", CFG_RUNTIME_INCDIR},
|
||||
{"docdir,runtime", CFG_RUNTIME_DOCDIR},
|
||||
|
||||
/* Installation paths to various stuff */
|
||||
|
||||
{"libdir,install", CFG_INSTALL_LIBDIR},
|
||||
{"bindir,install", CFG_INSTALL_BINDIR},
|
||||
{"scriptdir,install", CFG_INSTALL_SCRDIR},
|
||||
{"includedir,install", CFG_INSTALL_INCDIR},
|
||||
{"docdir,install", CFG_INSTALL_DOCDIR},
|
||||
|
||||
/* Last entry, closes the array */
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
void
|
||||
TclInitEmbeddedConfigurationInformation (interp)
|
||||
Tcl_Interp* interp; /* Interpreter the configuration
|
||||
* command is registered in. */
|
||||
{
|
||||
Tcl_RegisterConfig (interp, "tcl", cfg, TCL_CFGVAL_ENCODING);
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclStubInit.c,v 1.66 2002/01/05 22:55:52 dgp Exp $
|
||||
* RCS: @(#) $Id: tclStubInit.c,v 1.66.2.1 2002/01/25 01:47:01 andreas_kupries Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -885,6 +885,7 @@ TclStubs tclStubs = {
|
||||
Tcl_FSMountsChanged, /* 480 */
|
||||
Tcl_EvalTokensStandard, /* 481 */
|
||||
Tcl_GetTime, /* 482 */
|
||||
Tcl_RegisterConfig, /* 483 */
|
||||
};
|
||||
|
||||
/* !END!: Do not edit above this line. */
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* tclMacPkgConfig.c --
|
||||
*
|
||||
* This file contains the Mac configuration information to
|
||||
* embed into the tcl binary library.
|
||||
*
|
||||
* Copyright (c) 2002 Daniel Steffen <das@users.sourceforge.net>
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclMacPkgConfig.c,v 1.1.2.1 2002/04/05 13:49:45 das Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
#ifdef __MWERKS__
|
||||
|
||||
/* define DEBUG/OPTIMIZED macros depending on the value of
|
||||
* Metrowerks specific precompiler functions.
|
||||
* (traceback is for PPC, macsbug for 68k) */
|
||||
# if __option(traceback) || __option(macsbug)
|
||||
# define TCL_CFG_DEBUG
|
||||
# else
|
||||
# define TCL_CFG_OPTIMIZED
|
||||
# endif
|
||||
|
||||
/* define PROFILED macros depending depending on the value of
|
||||
* Metrowerks specific precompiler functions. */
|
||||
# if __option(profile)
|
||||
# define TCL_CFG_PROFILED
|
||||
# endif
|
||||
|
||||
#else
|
||||
|
||||
# ifdef TCL_DEBUG
|
||||
# define TCL_CFG_DEBUG
|
||||
# else
|
||||
# define TCL_CFG_OPTIMIZED
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
/* the CFG_*DIR values need to be built up dynamically at runtime
|
||||
* because the name of the Macintosh Extension directory on a user's
|
||||
* system is not known at build time */
|
||||
#define CFG_RUNTIME_PREFIX "${::env(EXT_FOLDER)}Tool Command Language"
|
||||
#define CFG_RUNTIME_LIBDIR CFG_RUNTIME_PREFIX
|
||||
#define CFG_RUNTIME_BINDIR CFG_RUNTIME_PREFIX
|
||||
#define CFG_RUNTIME_SCRDIR CFG_RUNTIME_PREFIX":tcl"TCL_VERSION
|
||||
#define CFG_RUNTIME_INCDIR CFG_RUNTIME_PREFIX
|
||||
#define CFG_RUNTIME_DOCDIR CFG_RUNTIME_PREFIX
|
||||
#define CFG_INSTALL_LIBDIR CFG_RUNTIME_LIBDIR
|
||||
#define CFG_INSTALL_BINDIR CFG_RUNTIME_BINDIR
|
||||
#define CFG_INSTALL_SCRDIR CFG_RUNTIME_SCRDIR
|
||||
#define CFG_INSTALL_INCDIR CFG_RUNTIME_INCDIR
|
||||
#define CFG_INSTALL_DOCDIR CFG_RUNTIME_DOCDIR
|
||||
|
||||
/* use system encoding */
|
||||
#define TCL_CFGVAL_ENCODING NULL
|
||||
|
||||
/* We want to include tclPkgConfig.c to get the remaining CFG_* macros
|
||||
* and the cfg array declaration, but need our own definition of
|
||||
* TclInitEmbeddedConfigurationInformation, so we rename this routine
|
||||
* for the duration of the inclusion and declare it static */
|
||||
static void TclUnusedInitEmbeddedConfigurationInformation
|
||||
_ANSI_ARGS_((Tcl_Interp *interp));
|
||||
#define TclInitEmbeddedConfigurationInformation \
|
||||
TclUnusedInitEmbeddedConfigurationInformation
|
||||
#include "tclPkgConfig.c"
|
||||
#undef TclInitEmbeddedConfigurationInformation
|
||||
|
||||
|
||||
void
|
||||
TclInitEmbeddedConfigurationInformation (interp)
|
||||
Tcl_Interp* interp; /* Interpreter the configuration
|
||||
* command is registered in. */
|
||||
{
|
||||
Tcl_Config *cfgp;
|
||||
Tcl_Obj *valObj, *substObj;
|
||||
char *subst;
|
||||
int len;
|
||||
|
||||
valObj = Tcl_NewObj();
|
||||
|
||||
/* Call Tcl_SubstObj on all values in the cfg array and replace
|
||||
* the existing value by the result if any substitution has
|
||||
* occurred. This is needed because on the Mac the CFG_*DIR
|
||||
* macros contain variables that are not known until runtime */
|
||||
for (cfgp = cfg;
|
||||
(cfgp->key != (CONST char*) NULL) && (cfgp->key [0] != '\0') ;
|
||||
cfgp++)
|
||||
{
|
||||
Tcl_SetStringObj(valObj, cfgp->value, -1);
|
||||
substObj = Tcl_SubstObj(interp, valObj, TCL_SUBST_VARIABLES);
|
||||
if( substObj ) {
|
||||
subst = Tcl_GetStringFromObj(substObj, &len);
|
||||
if ( strcmp(cfgp->value, subst) )
|
||||
cfgp->value = strcpy(ckalloc((unsigned)len+1), subst);
|
||||
Tcl_DecrRefCount(substObj);
|
||||
}
|
||||
}
|
||||
|
||||
Tcl_DecrRefCount(valObj);
|
||||
|
||||
Tcl_RegisterConfig (interp, "tcl", cfg, TCL_CFGVAL_ENCODING);
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
# -*- tcl -*-
|
||||
# Commands covered: pkgconfig
|
||||
#
|
||||
# This file contains a collection of tests for one or more of the Tcl
|
||||
# built-in commands. Sourcing this file into Tcl runs the tests and
|
||||
# generates output for errors. No output means no errors were found.
|
||||
#
|
||||
# Copyright (c) 1991-1993 The Regents of the University of California.
|
||||
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
# Copyright (c) 1998-1999 by Scriptics Corporation.
|
||||
#
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# RCS: @(#) $Id: config.test,v 1.1.2.2 2002/04/05 13:49:57 das Exp $
|
||||
|
||||
if {[lsearch [namespace children] ::tcltest] == -1} {
|
||||
package require tcltest
|
||||
namespace import -force ::tcltest::*
|
||||
}
|
||||
|
||||
test pkgconfig-1.1 {query keys} {
|
||||
lsort [::tcl::pkgconfig list]
|
||||
} {64bit bindir,install bindir,runtime compile_debug compile_stats debug docdir,install docdir,runtime includedir,install includedir,runtime libdir,install libdir,runtime mem_debug optimized profiled scriptdir,install scriptdir,runtime threaded}
|
||||
|
||||
test pkgconfig-1.2 {query keys multiple times} {
|
||||
string compare [::tcl::pkgconfig list] [::tcl::pkgconfig list]
|
||||
} 0
|
||||
|
||||
test pkgconfig-1.3 {query value multiple times} {
|
||||
string compare \
|
||||
[::tcl::pkgconfig get bindir,install] \
|
||||
[::tcl::pkgconfig get bindir,install]
|
||||
} 0
|
||||
|
||||
|
||||
test pkgconfig-2.0 {error: missing subcommand} {
|
||||
catch {::tcl::pkgconfig} msg
|
||||
set msg
|
||||
} {wrong # args: should be "list | get key"}
|
||||
|
||||
test pkgconfig-2.1 {error: illegal subcommand} {
|
||||
catch {::tcl::pkgconfig foo} msg
|
||||
set msg
|
||||
} {bad subcommand "foo": must be get or list}
|
||||
|
||||
test pkgconfig-2.2 {error: list with arguments} {
|
||||
catch {::tcl::pkgconfig list foo} msg
|
||||
set msg
|
||||
} {wrong # args: should be "list"}
|
||||
|
||||
test pkgconfig-2.3 {error: get without arguments} {
|
||||
catch {::tcl::pkgconfig get} msg
|
||||
set msg
|
||||
} {wrong # args: should be "get key"}
|
||||
|
||||
test pkgconfig-2.4 {error: query unknown key} {
|
||||
catch {::tcl::pkgconfig get foo} msg
|
||||
set msg
|
||||
} {key not known}
|
||||
|
||||
test pkgconfig-2.5 {error: query with to many arguments} {
|
||||
catch {::tcl::pkgconfig get foo bar} msg
|
||||
set msg
|
||||
} {wrong # args: should be "list | get key"}
|
||||
|
||||
# cleanup
|
||||
::tcltest::cleanupTests
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+34
-3
@@ -5,7 +5,7 @@
|
||||
# "autoconf" program (constructs like "@foo@" will get replaced in the
|
||||
# actual Makefile.
|
||||
#
|
||||
# RCS: @(#) $Id: Makefile.in,v 1.93 2002/01/11 19:17:49 mdejong Exp $
|
||||
# RCS: @(#) $Id: Makefile.in,v 1.93.2.2 2002/02/19 22:01:17 andreas_kupries Exp $
|
||||
|
||||
VERSION = @TCL_VERSION@
|
||||
|
||||
@@ -274,13 +274,13 @@ XTTEST_OBJS = xtTestInit.o tclTest.o tclTestObj.o tclTestProcBodyObj.o \
|
||||
GENERIC_OBJS = regcomp.o regexec.o regfree.o regerror.o tclAlloc.o \
|
||||
tclAsync.o tclBasic.o tclBinary.o \
|
||||
tclCkalloc.o tclClock.o tclCmdAH.o tclCmdIL.o tclCmdMZ.o \
|
||||
tclCompCmds.o tclCompExpr.o tclCompile.o tclDate.o tclEncoding.o \
|
||||
tclCompCmds.o tclCompExpr.o tclCompile.o tclConfig.o tclDate.o tclEncoding.o \
|
||||
tclEnv.o tclEvent.o tclExecute.o tclFCmd.o tclFileName.o tclGet.o \
|
||||
tclHash.o tclHistory.o tclIndexObj.o tclInterp.o tclIO.o tclIOCmd.o \
|
||||
tclIOGT.o tclIOSock.o tclIOUtil.o tclLink.o tclListObj.o \
|
||||
tclLiteral.o tclLoad.o tclMain.o tclNamesp.o tclNotify.o \
|
||||
tclObj.o tclPanic.o tclParse.o tclParseExpr.o tclPipe.o \
|
||||
tclPkg.o tclPosixStr.o tclPreserve.o tclProc.o tclRegexp.o \
|
||||
tclPkg.o tclPkgConfig.o tclPosixStr.o tclPreserve.o tclProc.o tclRegexp.o \
|
||||
tclResolve.o tclResult.o tclScan.o tclStringObj.o tclThread.o \
|
||||
tclStubInit.o tclStubLib.o tclTimer.o tclUtf.o tclUtil.o tclVar.o
|
||||
|
||||
@@ -320,6 +320,7 @@ GENERIC_SRCS = \
|
||||
$(GENERIC_DIR)/tclCompCmds.c \
|
||||
$(GENERIC_DIR)/tclCompExpr.c \
|
||||
$(GENERIC_DIR)/tclCompile.c \
|
||||
$(GENERIC_DIR)/tclConfig.c \
|
||||
$(GENERIC_DIR)/tclDate.c \
|
||||
$(GENERIC_DIR)/tclEncoding.c \
|
||||
$(GENERIC_DIR)/tclEnv.c \
|
||||
@@ -349,6 +350,7 @@ GENERIC_SRCS = \
|
||||
$(GENERIC_DIR)/tclParseExpr.c \
|
||||
$(GENERIC_DIR)/tclPipe.c \
|
||||
$(GENERIC_DIR)/tclPkg.c \
|
||||
$(GENERIC_DIR)/tclPkgConfig.c \
|
||||
$(GENERIC_DIR)/tclPosixStr.c \
|
||||
$(GENERIC_DIR)/tclPreserve.c \
|
||||
$(GENERIC_DIR)/tclProc.c \
|
||||
@@ -794,6 +796,9 @@ tclCompExpr.o: $(GENERIC_DIR)/tclCompExpr.c
|
||||
tclCompile.o: $(GENERIC_DIR)/tclCompile.c
|
||||
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCompile.c
|
||||
|
||||
tclConfig.o: $(GENERIC_DIR)/tclConfig.c
|
||||
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclConfig.c
|
||||
|
||||
tclEncoding.o: $(GENERIC_DIR)/tclEncoding.c
|
||||
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclEncoding.c
|
||||
|
||||
@@ -911,6 +916,32 @@ tclPipe.o: $(GENERIC_DIR)/tclPipe.c
|
||||
tclPkg.o: $(GENERIC_DIR)/tclPkg.c
|
||||
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPkg.c
|
||||
|
||||
|
||||
# TIP #59, embedding of configuration information into the binary library.
|
||||
#
|
||||
# Part of Tcl's configuration information are the paths where it was
|
||||
# installed and where it will look for its libraries (which can be
|
||||
# different). We derive this information from the variables which can
|
||||
# be overridden by the user. As every path can be configured
|
||||
# separately we do not remember one general prefix/exec_prefix but all
|
||||
# the different paths individually.
|
||||
|
||||
tclPkgConfig.o: $(GENERIC_DIR)/tclPkgConfig.c
|
||||
$(CC) -c $(CC_SWITCHES) \
|
||||
-DCFG_INSTALL_LIBDIR=\"$(LIB_INSTALL_DIR)\" \
|
||||
-DCFG_INSTALL_BINDIR=\"$(BIN_INSTALL_DIR)\" \
|
||||
-DCFG_INSTALL_SCRDIR=\"$(SCRIPT_INSTALL_DIR)\" \
|
||||
-DCFG_INSTALL_INCDIR=\"$(INCLUDE_INSTALL_DIR)\" \
|
||||
-DCFG_INSTALL_DOCDIR=\"$(MAN_INSTALL_DIR)\" \
|
||||
\
|
||||
-DCFG_RUNTIME_LIBDIR=\"$(libdir)\" \
|
||||
-DCFG_RUNTIME_BINDIR=\"$(bindir)\" \
|
||||
-DCFG_RUNTIME_SCRDIR=\"$(TCL_LIBRARY)\" \
|
||||
-DCFG_RUNTIME_INCDIR=\"$(includedir)\" \
|
||||
-DCFG_RUNTIME_DOCDIR=\"$(mandir)\" \
|
||||
\
|
||||
$(GENERIC_DIR)/tclPkgConfig.c
|
||||
|
||||
tclPosixStr.o: $(GENERIC_DIR)/tclPosixStr.c
|
||||
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPosixStr.c
|
||||
|
||||
|
||||
Vendored
+355
-313
File diff suppressed because it is too large
Load Diff
+7
-1
@@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to
|
||||
dnl generate the file "configure", which is run during Tcl installation
|
||||
dnl to configure the system for the local environment.
|
||||
#
|
||||
# RCS: @(#) $Id: configure.in,v 1.78 2002/01/11 20:46:34 mdejong Exp $
|
||||
# RCS: @(#) $Id: configure.in,v 1.78.2.1 2002/01/25 01:47:02 andreas_kupries Exp $
|
||||
|
||||
AC_INIT(../generic/tcl.h)
|
||||
|
||||
@@ -47,6 +47,12 @@ AC_HAVE_HEADERS(unistd.h limits.h)
|
||||
|
||||
SC_ENABLE_THREADS
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Embedded configuration information, encoding to use for the values, TIP #59
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
SC_TCL_CFG_ENCODING
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# If we're using GCC, see if the compiler understands -pipe. If so, use it.
|
||||
# It makes compiling go faster. (This is only a performance feature.)
|
||||
|
||||
@@ -869,6 +869,10 @@ if test -r RecordEval.3; then
|
||||
rm -f Tcl_RecordAndEval.3
|
||||
ln RecordEval.3 Tcl_RecordAndEval.3
|
||||
fi
|
||||
if test -r RegConfig.3; then
|
||||
rm -f Tcl_RegisterConfig.3
|
||||
ln RegConfig.3 Tcl_RegisterConfig.3
|
||||
fi
|
||||
if test -r RegExp.3; then
|
||||
rm -f Tcl_RegExpMatch.3
|
||||
rm -f Tcl_RegExpCompile.3
|
||||
|
||||
+34
-1
@@ -422,11 +422,13 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [
|
||||
LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)'
|
||||
DBGX=g
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(TCL_CFG_DEBUG)
|
||||
else
|
||||
CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
|
||||
LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
|
||||
DBGX=""
|
||||
AC_MSG_RESULT([no])
|
||||
AC_DEFINE(TCL_CFG_OPTIMIZED)
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -1238,7 +1240,11 @@ dnl AC_CHECK_TOOL(AR, ar, :)
|
||||
esac
|
||||
|
||||
if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then
|
||||
AC_MSG_WARN("64bit support being disabled -- don\'t know magic for this platform")
|
||||
AC_MSG_WARN("64bit support being disabled -- don\'t know magic for this platform")
|
||||
fi
|
||||
|
||||
if test "$do64bit" = "yes" -a "$do64bit_ok" = "yes" ; then
|
||||
AC_DEFINE(TCL_CFG_DO64BIT)
|
||||
fi
|
||||
|
||||
# Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic
|
||||
@@ -1969,3 +1975,30 @@ AC_DEFUN(SC_TCL_LINK_LIBS, [
|
||||
AC_SUBST(TCL_LIBS)
|
||||
AC_SUBST(MATH_LIBS)
|
||||
])
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# SC_TCL_CFG_ENCODING TIP #59
|
||||
#
|
||||
# Declare the encoding to use for embedded configuration information.
|
||||
#
|
||||
# Arguments:
|
||||
# None.
|
||||
#
|
||||
# Results:
|
||||
# Might append to the following vars:
|
||||
# DEFS (implicit)
|
||||
#
|
||||
# Will define the following vars:
|
||||
# TCL_CFGVAL_ENCODING
|
||||
#
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_DEFUN(SC_TCL_CFG_ENCODING, [
|
||||
AC_ARG_WITH(encoding, [ --with-encoding encoding for configuration values], with_tcencoding=${withval})
|
||||
|
||||
if test x"${with_tcencoding}" != x ; then
|
||||
AC_DEFINE_UNQUOTED(TCL_CFGVAL_ENCODING,"${with_tcencoding}")
|
||||
else
|
||||
AC_DEFINE(TCL_CFGVAL_ENCODING,"iso8859-1")
|
||||
fi
|
||||
])
|
||||
|
||||
+29
-1
@@ -5,7 +5,7 @@
|
||||
# "autoconf" program (constructs like "@foo@" will get replaced in the
|
||||
# actual Makefile.
|
||||
#
|
||||
# RCS: @(#) $Id: Makefile.in,v 1.58 2001/11/25 05:22:19 mdejong Exp $
|
||||
# RCS: @(#) $Id: Makefile.in,v 1.58.2.2 2002/02/19 22:01:17 andreas_kupries Exp $
|
||||
|
||||
VERSION = @TCL_VERSION@
|
||||
|
||||
@@ -70,6 +70,7 @@ MAN3_INSTALL_DIR = $(MAN_INSTALL_DIR)/man3
|
||||
# Tcl commands:
|
||||
MANN_INSTALL_DIR = $(MAN_INSTALL_DIR)/mann
|
||||
|
||||
|
||||
# Libraries built with optimization switches have this additional extension
|
||||
TCL_DBGX = @TCL_DBGX@
|
||||
|
||||
@@ -217,6 +218,7 @@ GENERIC_OBJS = \
|
||||
tclCompCmds.$(OBJEXT) \
|
||||
tclCompExpr.$(OBJEXT) \
|
||||
tclCompile.$(OBJEXT) \
|
||||
tclConfig.$(OBJEXT) \
|
||||
tclDate.$(OBJEXT) \
|
||||
tclEncoding.$(OBJEXT) \
|
||||
tclEnv.$(OBJEXT) \
|
||||
@@ -247,6 +249,7 @@ GENERIC_OBJS = \
|
||||
tclParseExpr.$(OBJEXT) \
|
||||
tclPipe.$(OBJEXT) \
|
||||
tclPkg.$(OBJEXT) \
|
||||
tclPkgConfig.$(OBJEXT) \
|
||||
tclPosixStr.$(OBJEXT) \
|
||||
tclPreserve.$(OBJEXT) \
|
||||
tclProc.$(OBJEXT) \
|
||||
@@ -405,6 +408,31 @@ tclWinReg.${OBJEXT} : tclWinReg.c
|
||||
tclWinDde.${OBJEXT} : tclWinDde.c
|
||||
$(CC) -c $(CC_SWITCHES) -DUSE_TCL_STUBS @DEPARG@ $(CC_OBJNAME)
|
||||
|
||||
# TIP #59, embedding of configuration information into the binary library.
|
||||
#
|
||||
# Part of Tcl's configuration information are the paths where it was
|
||||
# installed and where it will look for its libraries (which can be
|
||||
# different). We derive this information from the variables which can
|
||||
# be overridden by the user. As every path can be configured
|
||||
# separately we do not remember one general prefix/exec_prefix but all
|
||||
# the different paths individually.
|
||||
|
||||
tclPkgConfig.${OBJEXT}: tclPkgConfig.c
|
||||
$(CC) -c $(CC_SWITCHES) \
|
||||
-DCFG_INSTALL_LIBDIR=\"$(LIB_INSTALL_DIR)\" \
|
||||
-DCFG_INSTALL_BINDIR=\"$(BIN_INSTALL_DIR)\" \
|
||||
-DCFG_INSTALL_SCRDIR=\"$(SCRIPT_INSTALL_DIR)\" \
|
||||
-DCFG_INSTALL_INCDIR=\"$(INCLUDE_INSTALL_DIR)\" \
|
||||
-DCFG_INSTALL_DOCDIR=\"$(MAN_INSTALL_DIR)\" \
|
||||
\
|
||||
-DCFG_RUNTIME_LIBDIR=\"$(libdir)\" \
|
||||
-DCFG_RUNTIME_BINDIR=\"$(bindir)\" \
|
||||
-DCFG_RUNTIME_SCRDIR=\"$(TCL_LIBRARY)\" \
|
||||
-DCFG_RUNTIME_INCDIR=\"$(includedir)\" \
|
||||
-DCFG_RUNTIME_DOCDIR=\"$(mandir)\" \
|
||||
\
|
||||
-DUSE_TCL_STUBS @DEPARG@ $(CC_OBJNAME)
|
||||
|
||||
# The following objects are part of the stub library and should not
|
||||
# be built as DLL objects but none of the symbols should be exported
|
||||
|
||||
|
||||
Vendored
+82
-40
@@ -13,6 +13,8 @@ ac_default_prefix=/usr/local
|
||||
# Any additions from configure.in:
|
||||
ac_help="$ac_help
|
||||
--enable-threads build with threads"
|
||||
ac_help="$ac_help
|
||||
--with-encoding encoding for configuration values"
|
||||
ac_help="$ac_help
|
||||
--enable-shared build and link with shared libraries [--enable-shared]"
|
||||
ac_help="$ac_help
|
||||
@@ -574,7 +576,7 @@ fi
|
||||
# Extract the first word of "gcc", so it can be a program name with args.
|
||||
set dummy gcc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:578: checking for $ac_word" >&5
|
||||
echo "configure:580: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -604,7 +606,7 @@ if test -z "$CC"; then
|
||||
# Extract the first word of "cc", so it can be a program name with args.
|
||||
set dummy cc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:608: checking for $ac_word" >&5
|
||||
echo "configure:610: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -655,7 +657,7 @@ fi
|
||||
# Extract the first word of "cl", so it can be a program name with args.
|
||||
set dummy cl; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:659: checking for $ac_word" >&5
|
||||
echo "configure:661: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -687,7 +689,7 @@ fi
|
||||
fi
|
||||
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:691: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
echo "configure:693: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
|
||||
ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
@@ -698,12 +700,12 @@ cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
|
||||
#line 702 "configure"
|
||||
#line 704 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
main(){return(0);}
|
||||
EOF
|
||||
if { (eval echo configure:707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
ac_cv_prog_cc_works=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
@@ -729,12 +731,12 @@ if test $ac_cv_prog_cc_works = no; then
|
||||
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
|
||||
fi
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
|
||||
echo "configure:733: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "configure:735: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
|
||||
echo "configure:738: checking whether we are using GNU C" >&5
|
||||
echo "configure:740: checking whether we are using GNU C" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -743,7 +745,7 @@ else
|
||||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:749: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
ac_cv_prog_gcc=yes
|
||||
else
|
||||
ac_cv_prog_gcc=no
|
||||
@@ -762,7 +764,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS=
|
||||
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
|
||||
echo "configure:766: checking whether ${CC-cc} accepts -g" >&5
|
||||
echo "configure:768: checking whether ${CC-cc} accepts -g" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -805,7 +807,7 @@ if test "${GCC}" = "yes" ; then
|
||||
# Extract the first word of "ar", so it can be a program name with args.
|
||||
set dummy ar; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:809: checking for $ac_word" >&5
|
||||
echo "configure:811: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -834,7 +836,7 @@ fi
|
||||
# Extract the first word of "ranlib", so it can be a program name with args.
|
||||
set dummy ranlib; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:838: checking for $ac_word" >&5
|
||||
echo "configure:840: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -863,7 +865,7 @@ fi
|
||||
# Extract the first word of "windres", so it can be a program name with args.
|
||||
set dummy windres; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:867: checking for $ac_word" >&5
|
||||
echo "configure:869: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -896,7 +898,7 @@ fi
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
|
||||
echo "configure:900: checking whether ${MAKE-make} sets \${MAKE}" >&5
|
||||
echo "configure:902: checking whether ${MAKE-make} sets \${MAKE}" >&5
|
||||
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@@ -928,12 +930,12 @@ fi
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
|
||||
echo "configure:932: checking for Cygwin environment" >&5
|
||||
echo "configure:934: checking for Cygwin environment" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 937 "configure"
|
||||
#line 939 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
@@ -944,7 +946,7 @@ int main() {
|
||||
return __CYGWIN__;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:950: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_cygwin=yes
|
||||
else
|
||||
@@ -971,13 +973,13 @@ fi
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
echo $ac_n "checking for object suffix""... $ac_c" 1>&6
|
||||
echo "configure:975: checking for object suffix" >&5
|
||||
echo "configure:977: checking for object suffix" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
rm -f conftest*
|
||||
echo 'int i = 1;' > conftest.$ac_ext
|
||||
if { (eval echo configure:981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
for ac_file in conftest.*; do
|
||||
case $ac_file in
|
||||
*.c) ;;
|
||||
@@ -995,19 +997,19 @@ OBJEXT=$ac_cv_objext
|
||||
ac_objext=$ac_cv_objext
|
||||
|
||||
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
|
||||
echo "configure:999: checking for mingw32 environment" >&5
|
||||
echo "configure:1001: checking for mingw32 environment" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1004 "configure"
|
||||
#line 1006 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
return __MINGW32__;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_mingw32=yes
|
||||
else
|
||||
@@ -1026,7 +1028,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
|
||||
|
||||
|
||||
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
|
||||
echo "configure:1030: checking for executable suffix" >&5
|
||||
echo "configure:1032: checking for executable suffix" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1036,7 +1038,7 @@ else
|
||||
rm -f conftest*
|
||||
echo 'int main () { return 0; }' > conftest.$ac_ext
|
||||
ac_cv_exeext=
|
||||
if { (eval echo configure:1040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
if { (eval echo configure:1042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
for file in conftest.*; do
|
||||
case $file in
|
||||
*.c | *.o | *.obj) ;;
|
||||
@@ -1063,7 +1065,7 @@ ac_exeext=$EXEEXT
|
||||
|
||||
|
||||
echo $ac_n "checking for building with threads""... $ac_c" 1>&6
|
||||
echo "configure:1067: checking for building with threads" >&5
|
||||
echo "configure:1069: checking for building with threads" >&5
|
||||
# Check whether --enable-threads or --disable-threads was given.
|
||||
if test "${enable_threads+set}" = set; then
|
||||
enableval="$enable_threads"
|
||||
@@ -1087,6 +1089,31 @@ EOF
|
||||
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Embedded configuration information, encoding to use for the values, TIP #59
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
|
||||
# Check whether --with-encoding or --without-encoding was given.
|
||||
if test "${with_encoding+set}" = set; then
|
||||
withval="$with_encoding"
|
||||
with_tcencoding=${withval}
|
||||
fi
|
||||
|
||||
|
||||
if test x"${with_tcencoding}" != x ; then
|
||||
cat >> confdefs.h <<EOF
|
||||
#define TCL_CFGVAL_ENCODING "${with_tcencoding}"
|
||||
EOF
|
||||
|
||||
else
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define TCL_CFGVAL_ENCODING "iso8859-1"
|
||||
EOF
|
||||
|
||||
fi
|
||||
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# The statements below define a collection of symbols related to
|
||||
# building libtcl as a shared library instead of a static library.
|
||||
@@ -1094,7 +1121,7 @@ EOF
|
||||
|
||||
|
||||
echo $ac_n "checking how to build libraries""... $ac_c" 1>&6
|
||||
echo "configure:1098: checking how to build libraries" >&5
|
||||
echo "configure:1125: checking how to build libraries" >&5
|
||||
# Check whether --enable-shared or --disable-shared was given.
|
||||
if test "${enable_shared+set}" = set; then
|
||||
enableval="$enable_shared"
|
||||
@@ -1135,7 +1162,7 @@ EOF
|
||||
# Step 0: Enable 64 bit support?
|
||||
|
||||
echo $ac_n "checking if 64bit support is requested""... $ac_c" 1>&6
|
||||
echo "configure:1139: checking if 64bit support is requested" >&5
|
||||
echo "configure:1166: checking if 64bit support is requested" >&5
|
||||
# Check whether --enable-64bit or --disable-64bit was given.
|
||||
if test "${enable_64bit+set}" = set; then
|
||||
enableval="$enable_64bit"
|
||||
@@ -1152,7 +1179,7 @@ fi
|
||||
# Extract the first word of "cygpath", so it can be a program name with args.
|
||||
set dummy cygpath; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1156: checking for $ac_word" >&5
|
||||
echo "configure:1183: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CYGPATH'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1189,7 +1216,7 @@ fi
|
||||
# set various compiler flags depending on whether we are using gcc or cl
|
||||
|
||||
echo $ac_n "checking compiler flags""... $ac_c" 1>&6
|
||||
echo "configure:1193: checking compiler flags" >&5
|
||||
echo "configure:1220: checking compiler flags" >&5
|
||||
if test "${GCC}" = "yes" ; then
|
||||
if test "$do64bit" = "yes" ; then
|
||||
echo "configure: warning: "64bit mode not supported with GCC on Windows"" 1>&2
|
||||
@@ -1364,6 +1391,13 @@ echo "configure:1193: checking compiler flags" >&5
|
||||
LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
|
||||
fi
|
||||
|
||||
if test "$do64bit" = "yes" ; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define TCL_CFG_DO64BIT 1
|
||||
EOF
|
||||
|
||||
fi
|
||||
|
||||
# DL_LIBS is empty, but then we match the Unix version
|
||||
|
||||
|
||||
@@ -1379,7 +1413,7 @@ echo "configure:1193: checking compiler flags" >&5
|
||||
|
||||
|
||||
echo $ac_n "checking for build with symbols""... $ac_c" 1>&6
|
||||
echo "configure:1383: checking for build with symbols" >&5
|
||||
echo "configure:1417: checking for build with symbols" >&5
|
||||
# Check whether --enable-symbols or --disable-symbols was given.
|
||||
if test "${enable_symbols+set}" = set; then
|
||||
enableval="$enable_symbols"
|
||||
@@ -1394,11 +1428,19 @@ fi
|
||||
LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)'
|
||||
DBGX=d
|
||||
echo "$ac_t""yes" 1>&6
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define TCL_CFG_DEBUG 1
|
||||
EOF
|
||||
|
||||
else
|
||||
CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
|
||||
LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
|
||||
DBGX=""
|
||||
echo "$ac_t""no" 1>&6
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define TCL_CFG_OPTIMIZED 1
|
||||
EOF
|
||||
|
||||
fi
|
||||
|
||||
|
||||
@@ -1409,7 +1451,7 @@ TCL_DBGX=${DBGX}
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
|
||||
echo "configure:1413: checking how to run the C preprocessor" >&5
|
||||
echo "configure:1455: checking how to run the C preprocessor" >&5
|
||||
# On Suns, sometimes $CPP names a directory.
|
||||
if test -n "$CPP" && test -d "$CPP"; then
|
||||
CPP=
|
||||
@@ -1424,13 +1466,13 @@ else
|
||||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||
# not just through cpp.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1428 "configure"
|
||||
#line 1470 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@@ -1441,13 +1483,13 @@ else
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1445 "configure"
|
||||
#line 1487 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1451: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1493: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@@ -1458,13 +1500,13 @@ else
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -nologo -E"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1462 "configure"
|
||||
#line 1504 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@@ -1490,17 +1532,17 @@ echo "$ac_t""$CPP" 1>&6
|
||||
|
||||
ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for errno.h""... $ac_c" 1>&6
|
||||
echo "configure:1494: checking for errno.h" >&5
|
||||
echo "configure:1536: checking for errno.h" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1499 "configure"
|
||||
#line 1541 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <errno.h>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1504: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1546: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
|
||||
+7
-1
@@ -3,7 +3,7 @@
|
||||
# generate the file "configure", which is run during Tcl installation
|
||||
# to configure the system for the local environment.
|
||||
#
|
||||
# RCS: @(#) $Id: configure.in,v 1.46 2002/01/11 20:46:34 mdejong Exp $
|
||||
# RCS: @(#) $Id: configure.in,v 1.46.2.1 2002/01/25 01:47:02 andreas_kupries Exp $
|
||||
|
||||
AC_INIT(../generic/tcl.h)
|
||||
|
||||
@@ -96,6 +96,12 @@ AC_EXEEXT
|
||||
|
||||
SC_ENABLE_THREADS
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Embedded configuration information, encoding to use for the values, TIP #59
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
SC_TCL_CFG_ENCODING
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# The statements below define a collection of symbols related to
|
||||
# building libtcl as a shared library instead of a static library.
|
||||
|
||||
+32
-1
@@ -7,7 +7,17 @@
|
||||
#
|
||||
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
|
||||
# Copyright (c) 1998-1999 by Scriptics Corporation.
|
||||
|
||||
# TIP #59 information.
|
||||
#
|
||||
# This makefile does not set the following configuration cpp
|
||||
# defines. Behind the defines are the makefile variables listed to set
|
||||
# to -D... when that feature is enabled.
|
||||
#
|
||||
# - TCL_CFG_PROFILED PROFDEFINES
|
||||
# - TCL_CFG_OPTIMIZED OPTDEFINES
|
||||
# - TCL_CFG_DO64BIT SIXFOURDEFINES
|
||||
|
||||
# Have a look at the complete description on how to build and test Tcl with
|
||||
# the current Borland compilers at www.ratiosoft.com/tcl/borland.
|
||||
#
|
||||
@@ -88,6 +98,13 @@ libpath32 = -L"$(TOOLS32)\lib"
|
||||
NODEBUG = 1
|
||||
!endif
|
||||
|
||||
# CFG_ENCODING=encoding
|
||||
# name of encoding for configuration information. Defaults
|
||||
# to cp1252
|
||||
!if !defined(CFG_ENCODING)
|
||||
CFG_ENCODING = \"cp1252\"
|
||||
!endif
|
||||
|
||||
# The following defines can be used to control the amount of debugging
|
||||
# code that is added to the compilation.
|
||||
#
|
||||
@@ -120,10 +137,12 @@ BINROOT = ..
|
||||
!IF "$(NODEBUG)" == "1"
|
||||
TMPDIRNAME = Release
|
||||
DBGX =
|
||||
SYMDEFINES =
|
||||
!ELSE
|
||||
TMPDIRNAME = Debug
|
||||
#DBGX = d
|
||||
DBGX =
|
||||
SYMDEFINES = -DTCL_CFG_DEBUG
|
||||
!ENDIF
|
||||
TMPDIR = $(BINROOT)\$(TMPDIRNAME)
|
||||
OUTDIRNAME = $(TMPDIRNAME)
|
||||
@@ -187,6 +206,7 @@ TCLOBJS = \
|
||||
$(TMPDIR)\tclCompCmds.obj \
|
||||
$(TMPDIR)\tclCompExpr.obj \
|
||||
$(TMPDIR)\tclCompile.obj \
|
||||
$(TMPDIR)\tclConfig.obj \
|
||||
$(TMPDIR)\tclDate.obj \
|
||||
$(TMPDIR)\tclEncoding.obj \
|
||||
$(TMPDIR)\tclEnv.obj \
|
||||
@@ -217,6 +237,7 @@ TCLOBJS = \
|
||||
$(TMPDIR)\tclParseExpr.obj \
|
||||
$(TMPDIR)\tclPipe.obj \
|
||||
$(TMPDIR)\tclPkg.obj \
|
||||
$(TMPDIR)\tclPkgConfig.obj \
|
||||
$(TMPDIR)\tclPosixStr.obj \
|
||||
$(TMPDIR)\tclPreserve.obj \
|
||||
$(TMPDIR)\tclProc.obj \
|
||||
@@ -255,7 +276,9 @@ WINDIR = $(ROOT)\win
|
||||
GENERICDIR = $(ROOT)\generic
|
||||
|
||||
TCL_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)"
|
||||
TCL_DEFINES = $(DEBUGDEFINES) $(THREADDEFINES)
|
||||
TCL_DEFINES = $(DEBUGDEFINES) $(THREADDEFINES) $(SYMDEFINES) \
|
||||
$(PROFDEFINES) $(OPTDEFINES) $(SIXFOURDEFINES) \
|
||||
-DTCL_CFGVAL_ENCODING=${CFG_ENCODING}
|
||||
|
||||
######################################################################
|
||||
# Compiler flags
|
||||
@@ -482,6 +505,14 @@ $(TMPDIR)\tclTestObj.obj: $(GENERICDIR)\tclTestObj.c
|
||||
$(TMPDIR)\tclWinTest.obj: $(WINDIR)\tclWinTest.c
|
||||
$(cc32) $(TCL_CFLAGS) -o$(TMPDIR)\$@ $?
|
||||
|
||||
$(TMP_DIR)\tclPkgConfig.obj: $(GENERICDIR)\tclPkgConfig.c
|
||||
$(cc32) $(TCL_CFLAGS) \
|
||||
-DCFG_INSTALL_EXEC_PREFIX=\"$(INSTALL_EXEC_PREFIX)\" \
|
||||
-DCFG_INSTALL_PREFIX=\"$(INSTALL_PREFIX)\" \
|
||||
-DCFG_RUNTIME_EXEC_PREFIX=\"$(RUNTIME_EXEC_PREFIX)\" \
|
||||
-DCFG_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
|
||||
-o$(TMPDIR)\$@ $?
|
||||
|
||||
$(TMPDIR)\tclAppInit.obj : $(WINDIR)\tclAppInit.c
|
||||
$(cc32) $(TCL_CFLAGS) -o$(TMPDIR)\$@ $?
|
||||
|
||||
|
||||
+50
-29
@@ -12,7 +12,7 @@
|
||||
# Copyright (c) 2001 Tomasoft Engineering.
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
# RCS: @(#) $Id: makefile.vc,v 1.77 2002/01/11 20:07:23 davygrvy Exp $
|
||||
# RCS: @(#) $Id: makefile.vc,v 1.77.2.4 2002/02/19 22:01:17 andreas_kupries Exp $
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
!if "$(MSVCDIR)" == ""
|
||||
@@ -104,6 +104,10 @@ the environment. Jump to this line to read the new instructions.
|
||||
# TESTPAT=<file>
|
||||
# Reads the tests requested to be run from this file.
|
||||
#
|
||||
# CFG_ENCODING=encoding
|
||||
# name of encoding for configuration information. Defaults
|
||||
# to cp1252
|
||||
#
|
||||
# 5) Examples:
|
||||
#
|
||||
# Basic syntax of calling nmake looks like this:
|
||||
@@ -210,6 +214,10 @@ TCLTESTOBJS = \
|
||||
$(TMP_DIR)\tclTestProcBodyObj.obj \
|
||||
$(TMP_DIR)\tclThreadTest.obj \
|
||||
$(TMP_DIR)\tclWinTest.obj \
|
||||
!if $(TCL_LINKWITHEXTENSIONS)
|
||||
$(TMP_DIR)\tclWinReg.obj \
|
||||
$(TMP_DIR)\tclWinDde.obj \
|
||||
!endif
|
||||
$(TMP_DIR)\testMain.obj
|
||||
|
||||
TCLOBJS = \
|
||||
@@ -230,6 +238,7 @@ TCLOBJS = \
|
||||
$(TMP_DIR)\tclCompCmds.obj \
|
||||
$(TMP_DIR)\tclCompExpr.obj \
|
||||
$(TMP_DIR)\tclCompile.obj \
|
||||
$(TMP_DIR)\tclConfig.obj \
|
||||
$(TMP_DIR)\tclDate.obj \
|
||||
$(TMP_DIR)\tclEncoding.obj \
|
||||
$(TMP_DIR)\tclEnv.obj \
|
||||
@@ -260,6 +269,7 @@ TCLOBJS = \
|
||||
$(TMP_DIR)\tclParseExpr.obj \
|
||||
$(TMP_DIR)\tclPipe.obj \
|
||||
$(TMP_DIR)\tclPkg.obj \
|
||||
$(TMP_DIR)\tclPkgConfig.obj \
|
||||
$(TMP_DIR)\tclPosixStr.obj \
|
||||
$(TMP_DIR)\tclPreserve.obj \
|
||||
$(TMP_DIR)\tclProc.obj \
|
||||
@@ -309,17 +319,19 @@ TCL_DEFINES = $(OPTDEFINES)
|
||||
# Compile flags
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
!if !$(DEBUG)
|
||||
# This cranks the optimization level to maximize speed
|
||||
cdebug = -O2 -Gs
|
||||
!else if "$(MACHINE)" == "IA64"
|
||||
cdebug = -Od -Zi
|
||||
!if $(DEBUG)
|
||||
cdebug = -Z7 -WX -Od
|
||||
!else
|
||||
cdebug = -Z7 -Od -WX
|
||||
!if $(OPTIMIZING)
|
||||
# This cranks the optimization level to maximize speed
|
||||
cdebug = -O2 -Op -Gs
|
||||
!else
|
||||
cdebug =
|
||||
!endif
|
||||
!endif
|
||||
|
||||
# declarations common to all compiler options
|
||||
cflags = -c -W3 -nologo -Fp$(TMP_DIR)\ -YX
|
||||
cflags = -nologo -c -W3 -YX -QI0f -QIfdiv -Fp$(TMP_DIR)^\
|
||||
|
||||
!if $(MSVCRT)
|
||||
crt = -MD$(DBGX)
|
||||
@@ -327,9 +339,9 @@ crt = -MD$(DBGX)
|
||||
crt = -MT$(DBGX)
|
||||
!endif
|
||||
|
||||
BASE_CLFAGS = $(cdebug) $(cflags) $(crt) $(TCL_INCLUDES)
|
||||
BASE_CLFAGS = $(cflags) $(cdebug) $(crt) $(TCL_INCLUDES)
|
||||
TCL_CFLAGS = $(BASE_CLFAGS) $(TCL_DEFINES)
|
||||
CON_CFLAGS = $(cdebug) $(cflags) $(crt) -DCONSOLE
|
||||
CON_CFLAGS = $(cflags) $(cdebug) $(crt) -DCONSOLE
|
||||
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
@@ -345,19 +357,9 @@ ldebug = -release
|
||||
# declarations common to all linker options
|
||||
lflags = -nologo -machine:$(MACHINE)
|
||||
|
||||
# declarations for use on Intel i386, i486, and Pentium systems
|
||||
!IF "$(MACHINE)" == "IX86"
|
||||
DLLENTRY = @12
|
||||
dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
|
||||
!ELSE IF "$(MACHINE)" == "IA64"
|
||||
DLLENTRY = @12
|
||||
dlllflags = $(lflags) -dll
|
||||
!ELSE
|
||||
dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
|
||||
!ENDIF
|
||||
|
||||
conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
|
||||
guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup
|
||||
conlflags = $(lflags) -subsystem:console
|
||||
guilflags = $(lflags) -subsystem:windows
|
||||
|
||||
baselibs = kernel32.lib advapi32.lib user32.lib
|
||||
winlibs = $(baselibs) gdi32.lib
|
||||
@@ -391,6 +393,7 @@ test: setup $(TCLTEST) dlls $(CAT32)
|
||||
!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE"
|
||||
$(TCLTEST) $(ROOT)/tests/all.tcl $(TESTFLAGS)
|
||||
!else
|
||||
@echo Please wait while the tests are collected...
|
||||
$(TCLTEST) $(ROOT)/tests/all.tcl $(TESTFLAGS) > tests.log
|
||||
type tests.log | more
|
||||
!endif
|
||||
@@ -409,7 +412,7 @@ $(TCLLIB): $(TCLOBJS)
|
||||
$**
|
||||
<<
|
||||
!else
|
||||
$(link32) $(ldebug) $(dlllflags) -out:$@ $(winlibs) @<<
|
||||
$(link32) $(dlllflags) $(ldebug) -out:$@ $(winlibs) @<<
|
||||
$**
|
||||
<<
|
||||
-@del $*.exp
|
||||
@@ -420,40 +423,44 @@ $(TCLSTUBLIB): $(TCLSTUBOBJS)
|
||||
$(lib32) -nologo -out:$@ $(TCLSTUBOBJS)
|
||||
|
||||
$(TCLSH): $(TCLSHOBJS) $(TCLIMPLIB)
|
||||
$(link32) $(ldebug) $(conlflags) -stack:2300000 -out:$@ $(baselibs) @<<
|
||||
$(link32) $(conlflags) $(ldebug) -stack:2300000 -out:$@ $(baselibs) @<<
|
||||
$**
|
||||
<<
|
||||
|
||||
|
||||
$(TCLTEST): $(TCLTESTOBJS) $(TCLIMPLIB)
|
||||
$(link32) $(ldebug) $(conlflags) -stack:2300000 -out:$@ $(baselibs) @<<
|
||||
$(link32) $(conlflags) $(ldebug) -stack:2300000 -out:$@ $(baselibs) @<<
|
||||
$**
|
||||
<<
|
||||
|
||||
|
||||
$(TCLPIPEDLL): $(WINDIR)\stub16.c
|
||||
$(cc32) $(CON_CFLAGS) -Fo$(TMP_DIR)\ $(WINDIR)\stub16.c
|
||||
$(link32) $(ldebug) $(conlflags) -out:$@ $(TMP_DIR)\stub16.obj \
|
||||
$(link32) $(conlflags) $(ldebug) -out:$@ $(TMP_DIR)\stub16.obj \
|
||||
$(baselibs)
|
||||
|
||||
|
||||
!if $(STATIC_BUILD)
|
||||
!if !$(TCL_LINKWITHEXTENSIONS)
|
||||
$(TCLDDEDLL): $(TMP_DIR)\tclWinDde.obj
|
||||
$(lib32) -nologo -out:$@ $(TMP_DIR)\tclWinDde.obj
|
||||
!endif
|
||||
!else
|
||||
$(TCLDDEDLL): $(TMP_DIR)\tclWinDde.obj $(TCLSTUBLIB)
|
||||
$(link32) $(ldebug) $(dlllflags) -out:$@ $** $(baselibs)
|
||||
$(link32) $(dlllflags) $(ldebug) -out:$@ $** $(baselibs)
|
||||
-@del $*.exp
|
||||
-@del $*.lib
|
||||
!endif
|
||||
|
||||
|
||||
!if $(STATIC_BUILD)
|
||||
!if !$(TCL_LINKWITHEXTENSIONS)
|
||||
$(TCLREGDLL): $(TMP_DIR)\tclWinReg.obj
|
||||
$(lib32) -nologo -out:$@ $(TMP_DIR)\tclWinReg.obj
|
||||
!endif
|
||||
!else
|
||||
$(TCLREGDLL): $(TMP_DIR)\tclWinReg.obj $(TCLSTUBLIB)
|
||||
$(link32) $(ldebug) $(dlllflags) -out:$@ $** $(baselibs)
|
||||
$(link32) $(dlllflags) $(ldebug) -out:$@ $** $(baselibs)
|
||||
-@del $*.exp
|
||||
-@del $*.lib
|
||||
!endif
|
||||
@@ -596,6 +603,20 @@ $(TMP_DIR)\tclTestObj.obj: $(GENERICDIR)\tclTestObj.c
|
||||
$(TMP_DIR)\tclWinTest.obj: $(WINDIR)\tclWinTest.c
|
||||
$(cc32) $(TCL_CFLAGS) -Fo$@ $?
|
||||
|
||||
$(TMP_DIR)\tclPkgConfig.obj: $(GENERICDIR)\tclPkgConfig.c
|
||||
$(cc32) -DBUILD_tcl $(TCL_CFLAGS) \
|
||||
-DCFG_INSTALL_LIBDIR=\"$(LIB_INSTALL_DIR)\" \
|
||||
-DCFG_INSTALL_BINDIR=\"$(BIN_INSTALL_DIR)\" \
|
||||
-DCFG_INSTALL_SCRDIR=\"$(SCRIPT_INSTALL_DIR)\" \
|
||||
-DCFG_INSTALL_INCDIR=\"$(INCLUDE_INSTALL_DIR)\" \
|
||||
-DCFG_INSTALL_DOCDIR=\"$(DOC_INSTALL_DIR)\" \
|
||||
-DCFG_RUNTIME_LIBDIR=\"$(LIB_INSTALL_DIR)\" \
|
||||
-DCFG_RUNTIME_BINDIR=\"$(BIN_INSTALL_DIR)\" \
|
||||
-DCFG_RUNTIME_SCRDIR=\"$(SCRIPT_INSTALL_DIR)\" \
|
||||
-DCFG_RUNTIME_INCDIR=\"$(INCLUDE_INSTALL_DIR)\" \
|
||||
-DCFG_RUNTIME_DOCDIR=\"$(DOC_INSTALL_DIR)\" \
|
||||
-Fo$@ $?
|
||||
|
||||
$(TMP_DIR)\tclAppInit.obj: $(WINDIR)\tclAppInit.c
|
||||
!if $(TCL_LINKWITHEXTENSIONS)
|
||||
$(cc32) $(TCL_CFLAGS) -DTCL_LINKWITHEXTENSIONS -Fo$@ $?
|
||||
@@ -625,7 +646,7 @@ $(TMP_DIR)\tclWinDde.obj: $(WINDIR)\tclWinDde.c
|
||||
# be built as DLL objects but none of the symbols should be exported
|
||||
|
||||
$(TMP_DIR)\tclStubLib.obj: $(GENERICDIR)\tclStubLib.c
|
||||
$(cc32) $(cdebug) $(cflags) -Zl -DSTATIC_BUILD $(TCL_INCLUDES) -Fo$@ $?
|
||||
$(cc32) $(cflags) $(cdebug) -Zl -DSTATIC_BUILD $(TCL_INCLUDES) -Fo$@ $?
|
||||
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
+38
-2
@@ -10,7 +10,7 @@
|
||||
# Copyright (c) 2001 Tomasoft Engineering.
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
# RCS: @(#) $Id: rules.vc,v 1.4 2001/11/15 00:19:41 davygrvy Exp $
|
||||
# RCS: @(#) $Id: rules.vc,v 1.4.2.3 2002/02/06 12:20:26 davygrvy Exp $
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
!ifndef _RULES_VC
|
||||
@@ -29,6 +29,9 @@ INSTALLDIR = C:\Progra~1\Tcl
|
||||
MACHINE = IX86
|
||||
!endif
|
||||
|
||||
!ifndef CFG_ENCODING
|
||||
CFG_ENCODING = \"cp1252\"
|
||||
!endif
|
||||
|
||||
#----------------------------------------------------------
|
||||
# Decode the options requested.
|
||||
@@ -166,7 +169,28 @@ TCL_COMPILE_DEBUG = 0
|
||||
!endif
|
||||
!endif
|
||||
|
||||
OPTDEFINES =
|
||||
#----------------------------------------------------------
|
||||
# Test for compiler features
|
||||
#----------------------------------------------------------
|
||||
|
||||
!if !$(DEBUG)
|
||||
### test for optimizations
|
||||
!if [ $(cc32) -nologo -Ox -c -Zs -TC -Fdtemp nul 2>&1 | find "D4002" ]
|
||||
!message *** Compiler has 'optimizations'
|
||||
OPTIMIZING = 1
|
||||
!else
|
||||
!message *** Compiler doesn't have 'optimizations'
|
||||
OPTIMIZING = 0
|
||||
!endif
|
||||
|
||||
### Clean-up temp files after tests.
|
||||
!if [ @for %d in (temp.idb temp.pdb) do @if exist %d erase %d ]
|
||||
!else
|
||||
OPTIMIZING = 0
|
||||
!endif
|
||||
|
||||
|
||||
OPTDEFINES = -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING)
|
||||
!if $(TCL_MEM_DEBUG)
|
||||
OPTDEFINES = -DTCL_MEM_DEBUG
|
||||
!endif
|
||||
@@ -179,7 +203,19 @@ OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1
|
||||
!if $(STATIC_BUILD)
|
||||
OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD
|
||||
!endif
|
||||
!if $(DEBUG)
|
||||
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DEBUG
|
||||
!elseif $(OPTIMIZING)
|
||||
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED
|
||||
!endif
|
||||
!if $(PROFILE)
|
||||
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED
|
||||
!endif
|
||||
!if "$(MACHINE)" == "IA64"
|
||||
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT
|
||||
!endif
|
||||
|
||||
!message *** Optional defines are '$(OPTDEFINES)'
|
||||
!message
|
||||
|
||||
!endif
|
||||
|
||||
+58
@@ -265,11 +265,19 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [
|
||||
LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)'
|
||||
DBGX=d
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(TCL_CFG_DEBUG)
|
||||
else
|
||||
CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
|
||||
LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
|
||||
DBGX=""
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
# Use result from SC_CONFIG_CFLAGS to determine if
|
||||
# optimization is truly active.
|
||||
|
||||
if [ $OPTIMIZING -eq 1 ]; then
|
||||
AC_DEFINE(TCL_CFG_OPTIMIZED)
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -486,6 +494,24 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
|
||||
CFLAGS_OPTIMIZE="-nologo -Oti -Gs -GD ${runtime}"
|
||||
STLIB_LD="lib -nologo"
|
||||
LINKBIN="link -link50compat"
|
||||
|
||||
# A check borrowed from 'rules.vc' to determine if the
|
||||
# compiler actually supports optimization. If not we do
|
||||
# not try to use this feature.
|
||||
|
||||
lines=`$(CC) -nologo -Ox -c -Zs -TC -Fdtemp nul 2>&1 | grep "D4002" | wc -l`
|
||||
|
||||
for f in temp.idb temp.pdb ; do
|
||||
if [ -f $f ]; then
|
||||
rm -f $f
|
||||
fi
|
||||
done
|
||||
if [ $lines -gt 0 ]; then
|
||||
OPTIMIZING=1
|
||||
else
|
||||
OPTIMIZING=0
|
||||
CFLAGS_OPTIMIZE="-nologo -Oti -Gs -GD ${runtime}"
|
||||
fi
|
||||
fi
|
||||
|
||||
SHLIB_LD="${LINKBIN} -dll -nologo -incremental:no"
|
||||
@@ -517,6 +543,10 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
|
||||
LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
|
||||
fi
|
||||
|
||||
if test "$do64bit" = "yes" ; then
|
||||
AC_DEFINE(TCL_CFG_DO64BIT)
|
||||
fi
|
||||
|
||||
# DL_LIBS is empty, but then we match the Unix version
|
||||
AC_SUBST(DL_LIBS)
|
||||
AC_SUBST(CFLAGS_DEBUG)
|
||||
@@ -608,3 +638,31 @@ AC_DEFUN(SC_PROG_TCLSH, [
|
||||
fi
|
||||
AC_SUBST(TCLSH_PROG)
|
||||
])
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# SC_TCL_CFG_ENCODING TIP #59
|
||||
#
|
||||
# Declare the encoding to use for embedded configuration information.
|
||||
#
|
||||
# Arguments:
|
||||
# None.
|
||||
#
|
||||
# Results:
|
||||
# Might append to the following vars:
|
||||
# DEFS (implicit)
|
||||
#
|
||||
# Will define the following vars:
|
||||
# TCL_CFGVAL_ENCODING
|
||||
#
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_DEFUN(SC_TCL_CFG_ENCODING, [
|
||||
AC_ARG_WITH(encoding, [ --with-encoding encoding for configuration values], with_tcencoding=${withval})
|
||||
|
||||
if test x"${with_tcencoding}" != x ; then
|
||||
AC_DEFINE_UNQUOTED(TCL_CFGVAL_ENCODING,"${with_tcencoding}")
|
||||
else
|
||||
# Default encoding on windows is not "iso8859-1"
|
||||
AC_DEFINE(TCL_CFGVAL_ENCODING,"cp1252")
|
||||
fi
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user