summaryrefslogtreecommitdiffstats
path: root/generic/tclZipfs.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2021-02-16 16:31:14 (GMT)
committerdgp <dgp@users.sourceforge.net>2021-02-16 16:31:14 (GMT)
commitb33613724bccac4b5eaf90f55904948d39d34407 (patch)
tree25604b65b1573fc2bb18d82c59c8dec005db7abd /generic/tclZipfs.c
parent7808b4eb65eec56f5ce3bb91d677c40606f8de77 (diff)
parent7432856ed97d9c0afb90d4ce8f08be8a247567e6 (diff)
downloadtcl-b33613724bccac4b5eaf90f55904948d39d34407.zip
tcl-b33613724bccac4b5eaf90f55904948d39d34407.tar.gz
tcl-b33613724bccac4b5eaf90f55904948d39d34407.tar.bz2
merge trunk
Diffstat (limited to 'generic/tclZipfs.c')
-rw-r--r--generic/tclZipfs.c50
1 files changed, 14 insertions, 36 deletions
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index 058c203..de03c28 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -38,8 +38,6 @@
#include "zutil.h"
#include "crc32.h"
-#ifdef CFG_RUNTIME_DLLFILE
-
/*
** We are compiling as part of the core.
** TIP430 style zipfs prefix
@@ -50,22 +48,6 @@
#define ZIPFS_APP_MOUNT "//zipfs:/app"
#define ZIPFS_ZIP_MOUNT "//zipfs:/lib/tcl"
-#else /* !CFG_RUNTIME_DLLFILE */
-
-/*
-** We are compiling from the /compat folder of tclconfig
-** Pre TIP430 style zipfs prefix
-** //zipfs:/ doesn't work straight out of the box on either windows or Unix
-** without other changes made to tip 430
-*/
-
-#define ZIPFS_VOLUME "zipfs:/"
-#define ZIPFS_VOLUME_LEN 7
-#define ZIPFS_APP_MOUNT "zipfs:/app"
-#define ZIPFS_ZIP_MOUNT "zipfs:/lib/tcl"
-
-#endif /* CFG_RUNTIME_DLLFILE */
-
/*
* Various constants and offsets found in ZIP archive files
*/
@@ -303,7 +285,9 @@ static const char *zipfs_literal_tcl_library = NULL;
static inline int DescribeMounted(Tcl_Interp *interp,
const char *mountPoint);
static inline int ListMountPoints(Tcl_Interp *interp);
+#if !defined(STATIC_BUILD)
static int ZipfsAppHookFindTclInit(const char *archive);
+#endif
static int ZipFSPathInFilesystemProc(Tcl_Obj *pathPtr,
void **clientDataPtr);
static Tcl_Obj * ZipFSFilesystemPathTypeProc(Tcl_Obj *pathPtr);
@@ -3115,7 +3099,7 @@ TclZipfs_TclLibrary(void)
{
Tcl_Obj *vfsInitScript;
int found;
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(STATIC_BUILD)
HMODULE hModule;
WCHAR wName[MAX_PATH + LIBRARY_SIZE];
char dllName[(MAX_PATH + LIBRARY_SIZE) * 3];
@@ -3149,6 +3133,7 @@ TclZipfs_TclLibrary(void)
* that we must mount the zip file and dll before releasing to search.
*/
+#if !defined(STATIC_BUILD)
#if defined(_WIN32)
hModule = (HMODULE)TclWinGetTclInstance();
GetModuleFileNameW(hModule, wName, MAX_PATH);
@@ -3157,30 +3142,21 @@ TclZipfs_TclLibrary(void)
if (ZipfsAppHookFindTclInit(dllName) == TCL_OK) {
return Tcl_NewStringObj(zipfs_literal_tcl_library, -1);
}
-#elif /* !_WIN32 && */ defined(CFG_RUNTIME_DLLFILE)
+#else
+# if defined(CFG_RUNTIME_LIBDIR)
if (ZipfsAppHookFindTclInit(
CFG_RUNTIME_LIBDIR "/" CFG_RUNTIME_DLLFILE) == TCL_OK) {
return Tcl_NewStringObj(zipfs_literal_tcl_library, -1);
}
-#endif /* _WIN32 || CFG_RUNTIME_DLLFILE */
-
- /*
- * If we're configured to know about a ZIP archive we should use, do that.
- */
-
-#ifdef CFG_RUNTIME_ZIPFILE
- if (ZipfsAppHookFindTclInit(
- CFG_RUNTIME_LIBDIR "/" CFG_RUNTIME_ZIPFILE) == TCL_OK) {
- return Tcl_NewStringObj(zipfs_literal_tcl_library, -1);
- }
+# endif
+# if defined(CFG_RUNTIME_BINDIR)
if (ZipfsAppHookFindTclInit(
- CFG_RUNTIME_SCRDIR "/" CFG_RUNTIME_ZIPFILE) == TCL_OK) {
- return Tcl_NewStringObj(zipfs_literal_tcl_library, -1);
- }
- if (ZipfsAppHookFindTclInit(CFG_RUNTIME_ZIPFILE) == TCL_OK) {
+ CFG_RUNTIME_BINDIR "/" CFG_RUNTIME_DLLFILE) == TCL_OK) {
return Tcl_NewStringObj(zipfs_literal_tcl_library, -1);
}
-#endif /* CFG_RUNTIME_ZIPFILE */
+# endif
+#endif /* _WIN32 */
+#endif /* !defined(STATIC_BUILD) */
/*
* If anything set the cache (but subsequently failed) go with that
@@ -4747,6 +4723,7 @@ TclZipfs_Init(
#endif /* HAVE_ZLIB */
}
+#if !defined(STATIC_BUILD)
static int
ZipfsAppHookFindTclInit(
const char *archive)
@@ -4783,6 +4760,7 @@ ZipfsAppHookFindTclInit(
return TCL_ERROR;
}
+#endif
static void
ZipfsExitHandler(