diff options
-rw-r--r-- | generic/tclZipfs.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 35b6712..303ea03 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -16,6 +16,7 @@ * projects. */ +#define _GNU_SOURCE #include "tclInt.h" #include "tclFileSystem.h" @@ -32,6 +33,10 @@ #define TBLS 1 #endif +#if 1 /* HAVE_DLADDR */ +#include <dlfcn.h> +#endif + #ifdef HAVE_ZLIB #include "zlib.h" #include "crypt.h" @@ -3907,6 +3912,12 @@ TclZipfs_TclLibrary(void) if (ZipfsAppHookFindTclInit(dllName) == TCL_OK) { return Tcl_NewStringObj(zipfs_literal_tcl_library, -1); } +#elif 1 + Dl_info dlinfo; + if (dladdr(TclZipfs_TclLibrary, &dlinfo) && (dlinfo.dli_fname != NULL) + && (ZipfsAppHookFindTclInit(dlinfo.dli_fname) == TCL_OK)) { + return Tcl_NewStringObj(zipfs_literal_tcl_library, -1); + } #else if (ZipfsAppHookFindTclInit(CFG_RUNTIME_LIBDIR "/" CFG_RUNTIME_DLLFILE) == TCL_OK) { return Tcl_NewStringObj(zipfs_literal_tcl_library, -1); |