summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-06-18 19:39:39 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-06-18 19:39:39 (GMT)
commitd825807d4612ff87419068d3f4860f394ddbbf74 (patch)
tree0a3be5016dee65af449ac252b17dfa84f1e10636
parenta44478512904d7dfa4f93d1b8c38301e62d025ee (diff)
parent4427df1ae86acb1ff37c450bdf3e66e83c7917bd (diff)
downloadtcl-d825807d4612ff87419068d3f4860f394ddbbf74.zip
tcl-d825807d4612ff87419068d3f4860f394ddbbf74.tar.gz
tcl-d825807d4612ff87419068d3f4860f394ddbbf74.tar.bz2
Fix [f8608fc420]: linux : dynamic location of the tcl zipfs
-rw-r--r--generic/tclZipfs.c10
-rw-r--r--unix/Makefile.in2
2 files changed, 11 insertions, 1 deletions
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index 35b6712..4d43331 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -32,6 +32,10 @@
#define TBLS 1
#endif
+#if !defined(NO_DLFCN_H)
+#include <dlfcn.h>
+#endif
+
#ifdef HAVE_ZLIB
#include "zlib.h"
#include "crypt.h"
@@ -3907,6 +3911,12 @@ TclZipfs_TclLibrary(void)
if (ZipfsAppHookFindTclInit(dllName) == TCL_OK) {
return Tcl_NewStringObj(zipfs_literal_tcl_library, -1);
}
+#elif !defined(NO_DLFCN_H)
+ 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);
diff --git a/unix/Makefile.in b/unix/Makefile.in
index b405348..8c96906 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -1520,7 +1520,7 @@ tclZlib.o: $(GENERIC_DIR)/tclZlib.c
$(CC) -c $(CC_SWITCHES) $(ZLIB_INCLUDE) $(GENERIC_DIR)/tclZlib.c
tclZipfs.o: $(GENERIC_DIR)/tclZipfs.c
- $(CC) -c $(CC_SWITCHES) \
+ $(CC) -c $(CC_SWITCHES) -D_GNU_SOURCE \
-DCFG_RUNTIME_DLLFILE="\"$(TCL_LIB_FILE)\"" \
-DCFG_RUNTIME_LIBDIR="\"$(libdir)\"" \
-I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip \