diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-03-04 20:58:25 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-03-04 20:58:25 (GMT) |
commit | 096f3c3d71040b2812626cd557aa49e7916530bd (patch) | |
tree | 63c61bb02ae39c09afe718843e7d7644807453f9 | |
parent | a5c99ff3f843051aa22bdb762ebfb2eae6044bb5 (diff) | |
parent | acf8badcb65fff9369ce44e9991d54a96c807187 (diff) | |
download | tcl-096f3c3d71040b2812626cd557aa49e7916530bd.zip tcl-096f3c3d71040b2812626cd557aa49e7916530bd.tar.gz tcl-096f3c3d71040b2812626cd557aa49e7916530bd.tar.bz2 |
Merge 8.7
-rw-r--r-- | library/clock.tcl | 4 | ||||
-rw-r--r-- | unix/Makefile.in | 2 | ||||
-rwxr-xr-x | unix/configure | 6 | ||||
-rw-r--r-- | unix/configure.ac | 6 | ||||
-rw-r--r-- | unix/tclUnixInit.c | 66 | ||||
-rwxr-xr-x | win/configure | 15 | ||||
-rw-r--r-- | win/configure.ac | 14 | ||||
-rw-r--r-- | win/makefile.vc | 1 | ||||
-rw-r--r-- | win/tclConfig.sh.in | 2 |
9 files changed, 39 insertions, 77 deletions
diff --git a/library/clock.tcl b/library/clock.tcl index ee84b83..b468fea 100644 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -31,7 +31,7 @@ uplevel \#0 { # library code can find message catalogs and time zone definition files. namespace eval ::tcl::clock \ - [list variable LibDir [file dirname [info script]]] + [list variable LibDir [info library]] #---------------------------------------------------------------------- # @@ -554,6 +554,8 @@ proc ::tcl::clock::Initialize {} { pdt -0700 \ yst -0900 \ ydt -0800 \ + akst -0900 \ + akdt -0800 \ hst -1000 \ hdt -0900 \ cat -1000 \ diff --git a/unix/Makefile.in b/unix/Makefile.in index 0dd9dda..a4bb907 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -1101,7 +1101,7 @@ install-libraries: libraries done @if [ -n "$(TCL_MODULE_PATH)" -a -f $(TOP_DIR)/library/tm.tcl ] ; then \ echo "Customizing tcl module path"; \ - echo "if {![interp issafe]} { ::tcl::tm::roots {$(TCL_MODULE_PATH)} }" >> \ + echo "if {![interp issafe]} { ::tcl::tm::roots [list $(TCL_MODULE_PATH)] }" >> \ "$(SCRIPT_INSTALL_DIR)/tm.tcl"; \ fi diff --git a/unix/configure b/unix/configure index 10e947a..946e512 100755 --- a/unix/configure +++ b/unix/configure @@ -11400,13 +11400,13 @@ fi if test "$FRAMEWORK_BUILD" = "1" ; then test -z "$TCL_PACKAGE_PATH" && \ - TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl ~/Library/Frameworks /Library/Frameworks" + TCL_PACKAGE_PATH="~/Library/Tcl:/Library/Tcl:~/Library/Frameworks:/Library/Frameworks" test -z "$TCL_MODULE_PATH" && \ TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl" elif test "$prefix/lib" != "$libdir"; then - test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="{${libdir}} {${prefix}/lib} ${TCL_PACKAGE_PATH}" + test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="${libdir}:${prefix}/lib" else - test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="{${prefix}/lib} ${TCL_PACKAGE_PATH}" + test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="${prefix}/lib" fi #-------------------------------------------------------------------- diff --git a/unix/configure.ac b/unix/configure.ac index cf1eb87..03d7e5a 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -889,13 +889,13 @@ AC_SUBST(TCL_BUILDTIME_LIBRARY) if test "$FRAMEWORK_BUILD" = "1" ; then test -z "$TCL_PACKAGE_PATH" && \ - TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl ~/Library/Frameworks /Library/Frameworks" + TCL_PACKAGE_PATH="~/Library/Tcl:/Library/Tcl:~/Library/Frameworks:/Library/Frameworks" test -z "$TCL_MODULE_PATH" && \ TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl" elif test "$prefix/lib" != "$libdir"; then - test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="{${libdir}} {${prefix}/lib} ${TCL_PACKAGE_PATH}" + test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="${libdir}:${prefix}/lib" else - test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="{${prefix}/lib} ${TCL_PACKAGE_PATH}" + test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="${prefix}/lib" fi #-------------------------------------------------------------------- diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 982c36b..c7bc463 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -100,7 +100,7 @@ typedef struct { * defined by Makefile. */ -static char defaultLibraryDir[sizeof(TCL_LIBRARY)+200] = TCL_LIBRARY; +static const char defaultLibraryDir[] = TCL_LIBRARY; /* * Directory in which to look for packages (each package is typically @@ -108,7 +108,7 @@ static char defaultLibraryDir[sizeof(TCL_LIBRARY)+200] = TCL_LIBRARY; * Makefile. */ -static char pkgPath[sizeof(TCL_PACKAGE_PATH)+200] = TCL_PACKAGE_PATH; +static const char pkgPath[] = TCL_PACKAGE_PATH; /* * The following table is used to map from Unix locale strings to encoding @@ -790,7 +790,8 @@ TclpSetVariables( struct utsname name; #endif int unameOK; - Tcl_DString ds; + const char *p, *q; + Tcl_Obj *pkgListObj = Tcl_NewObj(); #ifdef HAVE_COREFOUNDATION char tclLibPath[MAXPATHLEN + 1]; @@ -806,29 +807,20 @@ TclpSetVariables( if (MacOSXGetLibraryPath(interp, MAXPATHLEN, tclLibPath) == TCL_OK) { const char *str; CFBundleRef bundleRef; + Tcl_DString ds; Tcl_SetVar2(interp, "tclDefaultLibrary", NULL, tclLibPath, TCL_GLOBAL_ONLY); - Tcl_SetVar2(interp, "tcl_pkgPath", NULL, tclLibPath, TCL_GLOBAL_ONLY); - Tcl_SetVar2(interp, "tcl_pkgPath", NULL, " ", - TCL_GLOBAL_ONLY | TCL_APPEND_VALUE); - + Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(tclLibPath, -1)); str = TclGetEnv("DYLD_FRAMEWORK_PATH", &ds); if ((str != NULL) && (str[0] != '\0')) { - char *p = Tcl_DStringValue(&ds); - - /* - * Convert DYLD_FRAMEWORK_PATH from colon to space separated. - */ - - do { - if (*p == ':') { - *p = ' '; - } - } while (*p++); - Tcl_SetVar2(interp, "tcl_pkgPath", NULL, Tcl_DStringValue(&ds), - TCL_GLOBAL_ONLY | TCL_APPEND_VALUE); - Tcl_SetVar2(interp, "tcl_pkgPath", NULL, " ", - TCL_GLOBAL_ONLY | TCL_APPEND_VALUE); + p = Tcl_DStringValue(&ds); + while ((q = strchr(p, ':')) != NULL) { + Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(p, q-p)); + p = q+1; + } + if (*p) { + Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(p, -1)); + } Tcl_DStringFree(&ds); } bundleRef = CFBundleGetMainBundle(); @@ -842,10 +834,7 @@ TclpSetVariables( (unsigned char*) tclLibPath, MAXPATHLEN) && ! TclOSstat(tclLibPath, &statBuf) && S_ISDIR(statBuf.st_mode)) { - Tcl_SetVar2(interp, "tcl_pkgPath", NULL, tclLibPath, - TCL_GLOBAL_ONLY | TCL_APPEND_VALUE); - Tcl_SetVar2(interp, "tcl_pkgPath", NULL, " ", - TCL_GLOBAL_ONLY | TCL_APPEND_VALUE); + Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(tclLibPath, -1)); } CFRelease(frameworksURL); } @@ -855,22 +844,22 @@ TclpSetVariables( (unsigned char*) tclLibPath, MAXPATHLEN) && ! TclOSstat(tclLibPath, &statBuf) && S_ISDIR(statBuf.st_mode)) { - Tcl_SetVar2(interp, "tcl_pkgPath", NULL, tclLibPath, - TCL_GLOBAL_ONLY | TCL_APPEND_VALUE); - Tcl_SetVar2(interp, "tcl_pkgPath", NULL, " ", - TCL_GLOBAL_ONLY | TCL_APPEND_VALUE); + Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(tclLibPath, -1)); } CFRelease(frameworksURL); } } - Tcl_SetVar2(interp, "tcl_pkgPath", NULL, pkgPath, - TCL_GLOBAL_ONLY | TCL_APPEND_VALUE); - } else + } #endif /* HAVE_COREFOUNDATION */ - { - Tcl_SetVar2(interp, "tcl_pkgPath", NULL, pkgPath, TCL_GLOBAL_ONLY); + p = pkgPath; + while ((q = strchr(p, ':')) != NULL) { + Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(p, q-p)); + p = q+1; } - + if (*p) { + Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(p, -1)); + } + Tcl_ObjSetVar2(interp, Tcl_NewStringObj("tcl_pkgPath", -1), NULL, pkgListObj, TCL_GLOBAL_ONLY); { /* Some platforms build configure scripts expect ~ expansion so do that */ Tcl_Obj *origPaths; @@ -878,8 +867,7 @@ TclpSetVariables( origPaths = Tcl_GetVar2Ex(interp, "tcl_pkgPath", NULL, TCL_GLOBAL_ONLY); resolvedPaths = TclResolveTildePathList(origPaths); if (resolvedPaths != origPaths && resolvedPaths != NULL) { - Tcl_SetVar2Ex(interp, "tcl_pkgPath", NULL, - resolvedPaths, TCL_GLOBAL_ONLY); + Tcl_SetVar2Ex(interp, "tcl_pkgPath", NULL, resolvedPaths, TCL_GLOBAL_ONLY); } } @@ -920,6 +908,7 @@ TclpSetVariables( #elif !defined NO_UNAME if (uname(&name) >= 0) { const char *native; + Tcl_DString ds; unameOK = 1; @@ -981,6 +970,7 @@ TclpSetVariables( { struct passwd *pwEnt = TclpGetPwUid(getuid()); const char *user; + Tcl_DString ds; if (pwEnt == NULL) { user = ""; diff --git a/win/configure b/win/configure index e689ad4..2f0fb9f 100755 --- a/win/configure +++ b/win/configure @@ -653,7 +653,6 @@ TCL_REG_VERSION TCL_DDE_MINOR_VERSION TCL_DDE_MAJOR_VERSION TCL_DDE_VERSION -TCL_PACKAGE_PATH TCL_BUILD_LIB_SPEC MAKE_EXE MAKE_DLL @@ -5895,19 +5894,6 @@ else RC_DEFINES="" fi -#-------------------------------------------------------------------- -# The statements below define the symbol TCL_PACKAGE_PATH, which -# gives a list of directories that may contain packages. The list -# consists of one directory for machine-dependent binaries and -# another for platform-independent scripts. -#-------------------------------------------------------------------- - -if test "$prefix/lib" != "$libdir"; then - TCL_PACKAGE_PATH="{${libdir}} {${prefix}/lib}" -else - TCL_PACKAGE_PATH="{${prefix}/lib}" -fi - # The tclsh.exe.manifest requires these # TCL_WIN_VERSION is the 4 dotted pair Windows version format which needs # the release level, and must account for interim release versioning @@ -5989,7 +5975,6 @@ TCL_WIN_VERSION="$TCL_VERSION.$TCL_RELEASE_LEVEL.`echo $TCL_PATCH_LEVEL | tr -d - # win only diff --git a/win/configure.ac b/win/configure.ac index 8eb748e..3bfff53 100644 --- a/win/configure.ac +++ b/win/configure.ac @@ -357,19 +357,6 @@ else RC_DEFINES="" fi -#-------------------------------------------------------------------- -# The statements below define the symbol TCL_PACKAGE_PATH, which -# gives a list of directories that may contain packages. The list -# consists of one directory for machine-dependent binaries and -# another for platform-independent scripts. -#-------------------------------------------------------------------- - -if test "$prefix/lib" != "$libdir"; then - TCL_PACKAGE_PATH="{${libdir}} {${prefix}/lib}" -else - TCL_PACKAGE_PATH="{${prefix}/lib}" -fi - # The tclsh.exe.manifest requires these # TCL_WIN_VERSION is the 4 dotted pair Windows version format which needs # the release level, and must account for interim release versioning @@ -450,7 +437,6 @@ AC_SUBST(MAKE_DLL) AC_SUBST(MAKE_EXE) AC_SUBST(TCL_BUILD_LIB_SPEC) -AC_SUBST(TCL_PACKAGE_PATH) # win only AC_SUBST(TCL_DDE_VERSION) diff --git a/win/makefile.vc b/win/makefile.vc index 6e059e8..b433635 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -819,7 +819,6 @@ $(OUT_DIR)\tclConfig.sh: $(WIN_DIR)\tclConfig.sh.in @TCL_LIB_SPEC@ $(LIB_INSTALL_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib
@TCL_INCLUDE_SPEC@ -I$(INCLUDE_INSTALL_DIR)
@TCL_SRC_DIR@ $(ROOT)
-@TCL_PACKAGE_PATH@
@TCL_STUB_LIB_FILE@ $(TCLSTUBLIBNAME)
@TCL_STUB_LIB_FLAG@ $(TCLSTUBLIBNAME)
@TCL_STUB_LIB_SPEC@ -L$(LIB_INSTALL_DIR) $(TCLSTUBLIBNAME)
diff --git a/win/tclConfig.sh.in b/win/tclConfig.sh.in index c980af6..8085d67 100644 --- a/win/tclConfig.sh.in +++ b/win/tclConfig.sh.in @@ -144,7 +144,7 @@ TCL_SRC_DIR='@TCL_SRC_DIR@' # List of standard directories in which to look for packages during # "package require" commands. Contains the "prefix" directory plus also # the "exec_prefix" directory, if it is different. -TCL_PACKAGE_PATH='@TCL_PACKAGE_PATH@' +TCL_PACKAGE_PATH='' # Tcl supports stub. TCL_SUPPORTS_STUBS=1 |