summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--unix/Makefile.in2
-rwxr-xr-xunix/configure6
-rw-r--r--unix/configure.in6
-rw-r--r--unix/tclUnixInit.c68
-rwxr-xr-xwin/configure4
-rw-r--r--win/configure.in14
-rw-r--r--win/makefile.vc1
-rw-r--r--win/tclConfig.sh.in2
8 files changed, 40 insertions, 63 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 7619afc..17057e4 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -979,7 +979,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 87dc84d..d890135 100755
--- a/unix/configure
+++ b/unix/configure
@@ -19243,13 +19243,13 @@ VERSION=${TCL_VERSION}
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.in b/unix/configure.in
index 4f62510..ca4145a 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -864,13 +864,13 @@ VERSION=${TCL_VERSION}
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 2d17027..5a27359 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -4,7 +4,7 @@
* Contains the Unix-specific interpreter initialization functions.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright (c) 1999 by Scriptics Corporation.
+ * Copyright (c) 1999 Scriptics Corporation.
* All rights reserved.
*/
@@ -371,13 +371,13 @@ TclpInitPlatform(void)
* Make sure, that the standard FDs exist. [Bug 772288]
*/
- if (TclOSseek(0, (Tcl_SeekOffset) 0, SEEK_CUR) == -1 && errno == EBADF) {
+ if (TclOSseek(0, 0, SEEK_CUR) == -1 && errno == EBADF) {
open("/dev/null", O_RDONLY);
}
- if (TclOSseek(1, (Tcl_SeekOffset) 0, SEEK_CUR) == -1 && errno == EBADF) {
+ if (TclOSseek(1, 0, SEEK_CUR) == -1 && errno == EBADF) {
open("/dev/null", O_WRONLY);
}
- if (TclOSseek(2, (Tcl_SeekOffset) 0, SEEK_CUR) == -1 && errno == EBADF) {
+ if (TclOSseek(2, 0, SEEK_CUR) == -1 && errno == EBADF) {
open("/dev/null", O_WRONLY);
}
@@ -792,7 +792,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];
@@ -808,29 +809,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();
@@ -844,10 +836,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);
}
@@ -857,21 +846,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);
}
+#endif /* HAVE_COREFOUNDATION */
+ 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);
#ifdef DJGPP
Tcl_SetVar2(interp, "tcl_platform", "platform", "dos", TCL_GLOBAL_ONLY);
@@ -910,6 +900,7 @@ TclpSetVariables(
#elif !defined NO_UNAME
if (uname(&name) >= 0) {
const char *native;
+ Tcl_DString ds;
unameOK = 1;
@@ -971,6 +962,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 1382854..3fc4815 100755
--- a/win/configure
+++ b/win/configure
@@ -5296,9 +5296,9 @@ fi
#--------------------------------------------------------------------
if test "$prefix/lib" != "$libdir"; then
- TCL_PACKAGE_PATH="{${libdir}} {${prefix}/lib}"
+ TCL_PACKAGE_PATH="${libdir}:${prefix}/lib"
else
- TCL_PACKAGE_PATH="{${prefix}/lib}"
+ TCL_PACKAGE_PATH="${prefix}/lib"
fi
# The tclsh.exe.manifest requires these
diff --git a/win/configure.in b/win/configure.in
index 737f046..80c1f15 100644
--- a/win/configure.in
+++ b/win/configure.in
@@ -364,19 +364,6 @@ else
fi
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
@@ -464,7 +451,6 @@ AC_SUBST(TCL_LD_SEARCH_FLAGS)
AC_SUBST(TCL_BUILD_EXP_FILE)
AC_SUBST(TCL_EXP_FILE)
AC_SUBST(DL_LIBS)
-AC_SUBST(TCL_PACKAGE_PATH)
# win only
AC_SUBST(TCL_DDE_VERSION)
diff --git a/win/makefile.vc b/win/makefile.vc
index ef67c66..e94e3db 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -717,7 +717,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 aba0532..d69a9da 100644
--- a/win/tclConfig.sh.in
+++ b/win/tclConfig.sh.in
@@ -148,7 +148,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