From ebf4c78ed811b2c54015d5c0a0fb446da5ae5140 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 8 Feb 2021 18:23:40 +0000 Subject: Attempt to fix the last TIP #430 bits, needed to make it work for Tk (and other external packages) --- generic/tclPkgConfig.c | 1 - generic/tclZipfs.c | 18 ------------------ library/auto.tcl | 6 +++--- tests/config.test | 2 +- tests/zipfs.test | 7 +------ unix/Makefile.in | 19 +------------------ unix/configure | 9 +++------ unix/configure.ac | 6 ++---- win/Makefile.in | 9 +-------- win/configure | 9 +++------ win/configure.ac | 6 ++---- win/makefile.vc | 5 ++--- 12 files changed, 19 insertions(+), 78 deletions(-) diff --git a/generic/tclPkgConfig.c b/generic/tclPkgConfig.c index c8f0357..a802252 100644 --- a/generic/tclPkgConfig.c +++ b/generic/tclPkgConfig.c @@ -110,7 +110,6 @@ static Tcl_Config const cfg[] = { {"includedir,runtime", CFG_RUNTIME_INCDIR}, {"docdir,runtime", CFG_RUNTIME_DOCDIR}, {"dllfile,runtime", CFG_RUNTIME_DLLFILE}, - {"zipfile,runtime", CFG_RUNTIME_ZIPFILE}, /* Installation paths to various stuff */ diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index fc7be6f..7ee13a7 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -3179,24 +3179,6 @@ TclZipfs_TclLibrary(void) #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); - } - 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) { - return Tcl_NewStringObj(zipfs_literal_tcl_library, -1); - } -#endif /* CFG_RUNTIME_ZIPFILE */ - - /* * If anything set the cache (but subsequently failed) go with that * anyway. */ diff --git a/library/auto.tcl b/library/auto.tcl index 51d4ef1..ea2fe5e 100644 --- a/library/auto.tcl +++ b/library/auto.tcl @@ -100,12 +100,12 @@ proc tcl_findLibrary {basename version patch initScript enVarName varName} { lappend paths [file join $root app] lappend paths [::${basename}::pkgconfig get libdir,runtime] lappend paths [::${basename}::pkgconfig get bindir,runtime] - if {[catch {::${basename}::pkgconfig get zipfile,runtime} zipfile]} { - set zipfile "lib${basename}[join [split $patch .] _].zip" + if {[catch {::${basename}::pkgconfig get dllfile,runtime} dllfile]} { + set dllfile "lib${basename}${version}[info sharedlibextension]" } lappend paths [file dirname [file join [pwd] [info nameofexecutable]]] foreach path $paths { - set archive [file join $path $zipfile] + set archive [file join $path $dllfile] if {![file exists $archive]} { continue } diff --git a/tests/config.test b/tests/config.test index f87250a..d41021a 100644 --- a/tests/config.test +++ b/tests/config.test @@ -19,7 +19,7 @@ if {"::tcltest" ni [namespace children]} { test pkgconfig-1.1 {query keys} { lsort [::tcl::pkgconfig list] -} {64bit bindir,install bindir,runtime compile_debug compile_stats debug dllfile,runtime docdir,install docdir,runtime includedir,install includedir,runtime libdir,install libdir,runtime mem_debug optimized profiled scriptdir,install scriptdir,runtime threaded zipfile,runtime} +} {64bit bindir,install bindir,runtime compile_debug compile_stats debug dllfile,runtime docdir,install docdir,runtime includedir,install includedir,runtime libdir,install libdir,runtime mem_debug optimized profiled scriptdir,install scriptdir,runtime threaded} test pkgconfig-1.2 {query keys multiple times} { string compare [::tcl::pkgconfig list] [::tcl::pkgconfig list] } 0 diff --git a/tests/zipfs.test b/tests/zipfs.test index cdddc71..fd40f9e 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -20,11 +20,6 @@ testConstraint zipfs [expr { }] testConstraint zipfslib 1 -# Removed in tip430 - zipfs is no longer a static package -#test zipfs-0.0 {zipfs basics} -constraints zipfs -body { -# load {} zipfs -#} -result {} - set ziproot [zipfs root] set CWD [pwd] set tmpdir [file join $CWD tmp] @@ -44,7 +39,7 @@ if {![string match ${ziproot}* $tcl_library]} { # Hack the environment to pretend we did pull tcl_library from a zip # archive ### - set tclzip [file join $CWD [::tcl::pkgconfig get zipfile,runtime]] + set tclzip [file join $CWD [::tcl::pkgconfig get dllfile,runtime]] testConstraint zipfslib [file isfile $tclzip] if {[testConstraint zipfslib]} { zipfs mount /lib/tcl $tclzip diff --git a/unix/Makefile.in b/unix/Makefile.in index 5988ba6..00e29be 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -996,21 +996,6 @@ install-binaries: binaries @$(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/pkgconfig" @$(INSTALL_DATA) tcl.pc "$(LIB_INSTALL_DIR)/pkgconfig/tcl.pc" -install-libraries-zipfs-shared: libraries - @for i in "$(SCRIPT_INSTALL_DIR)"; do \ - if [ ! -d "$$i" ] ; then \ - echo "Making directory $$i"; \ - $(INSTALL_DATA_DIR) "$$i"; \ - fi; \ - done - @echo "Installing library files to $(SCRIPT_INSTALL_DIR)/" - @for i in $(UNIX_DIR)/tclAppInit.c @LDAIX_SRC@ @DTRACE_SRC@; do \ - $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"; \ - done - -install-libraries-zipfs-static: install-libraries-zipfs-shared - $(INSTALL_DATA) ${TCL_ZIP_FILE} "$(LIB_INSTALL_DIR)" - install-libraries: libraries @for i in "$(SCRIPT_INSTALL_DIR)" "$(MODULE_INSTALL_DIR)"; \ do \ @@ -1475,7 +1460,6 @@ tclPkgConfig.o: $(GENERIC_DIR)/tclPkgConfig.c -DCFG_RUNTIME_INCDIR="\"$(includedir)\"" \ -DCFG_RUNTIME_DOCDIR="\"$(mandir)\"" \ -DCFG_RUNTIME_DLLFILE="\"$(TCL_LIB_FILE)\"" \ - -DCFG_RUNTIME_ZIPFILE="\"$(TCL_ZIP_FILE)\"" \ $(GENERIC_DIR)/tclPkgConfig.c tclPosixStr.o: $(GENERIC_DIR)/tclPosixStr.c @@ -1529,7 +1513,6 @@ tclZlib.o: $(GENERIC_DIR)/tclZlib.c tclZipfs.o: $(GENERIC_DIR)/tclZipfs.c $(CC) -c $(CC_SWITCHES) \ -DCFG_RUNTIME_DLLFILE="\"$(TCL_LIB_FILE)\"" \ - -DCFG_RUNTIME_ZIPFILE="\"$(TCL_ZIP_FILE)\"" \ -DCFG_RUNTIME_LIBDIR="\"$(libdir)\"" \ -DCFG_RUNTIME_SCRDIR="\"$(TCL_LIBRARY)\"" \ -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip \ @@ -2412,7 +2395,7 @@ BUILD_HTML = \ .PHONY: install-tzdata install-msgs .PHONY: packages configure-packages test-packages clean-packages .PHONY: dist-packages distclean-packages install-packages -.PHONY: install-libraries-zipfs-shared install-libraries-zipfs-static tclzipfile +.PHONY: tclzipfile #-------------------------------------------------------------------------- # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/unix/configure b/unix/configure index 70e46d7..34500ba 100755 --- a/unix/configure +++ b/unix/configure @@ -11163,17 +11163,14 @@ if test "${ZIPFS_BUILD}" = 1; then printf "%s\n" "#define ZIPFS_BUILD 2" >>confdefs.h - INSTALL_LIBRARIES=install-libraries-zipfs-static - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } else + ZIPFS_BUILD=1; printf "%s\n" "#define ZIPFS_BUILD 1" >>confdefs.h \ - INSTALL_LIBRARIES=install-libraries-zipfs-shared - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } diff --git a/unix/configure.ac b/unix/configure.ac index 55ce886..ad837b9 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -899,13 +899,11 @@ if test "${ZIPFS_BUILD}" = 1; then if test "${SHARED_BUILD}" = 0; then ZIPFS_BUILD=2; AC_DEFINE(ZIPFS_BUILD, 2, [Are we building with zipfs enabled?]) - INSTALL_LIBRARIES=install-libraries-zipfs-static - AC_MSG_RESULT([yes]) else + ZIPFS_BUILD=1; AC_DEFINE(ZIPFS_BUILD, 1, [Are we building with zipfs enabled?])\ - INSTALL_LIBRARIES=install-libraries-zipfs-shared - AC_MSG_RESULT([yes]) fi + AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) INSTALL_LIBRARIES=install-libraries diff --git a/win/Makefile.in b/win/Makefile.in index 1da2455..b5b4f26 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -656,7 +656,6 @@ tclZipfs.${OBJEXT}: $(GENERIC_DIR)/tclZipfs.c $(CC) -c $(CC_SWITCHES) -DBUILD_tcl \ -DCFG_RUNTIME_PATH="\"$(bindir_native)\"" \ -DCFG_RUNTIME_DLLFILE="\"$(TCL_DLL_FILE)\"" \ - -DCFG_RUNTIME_ZIPFILE="\"$(TCL_ZIP_FILE)\"" \ -DCFG_RUNTIME_LIBDIR="\"$(bindir_native)\"" \ -DCFG_RUNTIME_SCRDIR="\"$(TCL_LIBRARY_NATIVE)\"" \ $(ZLIB_INCLUDE) -I$(MINIZIP_DIR_NATIVE) @DEPARG@ $(CC_OBJNAME) @@ -684,7 +683,6 @@ tclPkgConfig.${OBJEXT}: tclPkgConfig.c -DCFG_RUNTIME_INCDIR="\"$(includedir_native)\"" \ -DCFG_RUNTIME_DOCDIR="\"$(mandir_native)\"" \ -DCFG_RUNTIME_DLLFILE="\"$(TCL_DLL_FILE)\"" \ - -DCFG_RUNTIME_ZIPFILE="\"$(TCL_ZIP_FILE)\"" \ -DBUILD_tcl \ @DEPARG@ $(CC_OBJNAME) @@ -839,11 +837,6 @@ install-binaries: binaries $(COPY) $(REG_LIB_FILE) "$(LIB_INSTALL_DIR)/registry${REGDOTVER}"; \ fi -install-libraries-zipfs-shared: libraries - -install-libraries-zipfs-static: install-libraries-zipfs-shared - $(COPY) ${TCL_ZIP_FILE} "$(LIB_INSTALL_DIR)" - install-libraries: libraries install-tzdata install-msgs @for i in "$(prefix)/lib" "$(INCLUDE_INSTALL_DIR)" \ "$(SCRIPT_INSTALL_DIR)" "$(MODULE_INSTALL_DIR)"; \ @@ -1126,6 +1119,6 @@ html-tk: $(TCLSH) .PHONY: gdb depend cleanhelp clean distclean packages install-packages .PHONY: test-packages clean-packages distclean-packages genstubs html .PHONY: html-tcl html-tk -.PHONY: iinstall-libraries-zipfs-shared install-libraries-zipfs-static tclzipfile +.PHONY: tclzipfile # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/win/configure b/win/configure index 33716bc..090e040 100755 --- a/win/configure +++ b/win/configure @@ -5149,17 +5149,14 @@ if test "${ZIPFS_BUILD}" = 1; then printf "%s\n" "#define ZIPFS_BUILD 2" >>confdefs.h - INSTALL_LIBRARIES=install-libraries-zipfs-static - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } else + ZIPFS_BUILD=1; printf "%s\n" "#define ZIPFS_BUILD 1" >>confdefs.h \ - INSTALL_LIBRARIES=install-libraries-zipfs-shared - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } diff --git a/win/configure.ac b/win/configure.ac index 6184144..7dc9c6d 100644 --- a/win/configure.ac +++ b/win/configure.ac @@ -191,13 +191,11 @@ if test "${ZIPFS_BUILD}" = 1; then if test "${SHARED_BUILD}" = 0; then ZIPFS_BUILD=2; AC_DEFINE(ZIPFS_BUILD, 2, [Are we building with zipfs enabled?]) - INSTALL_LIBRARIES=install-libraries-zipfs-static - AC_MSG_RESULT([yes]) else + ZIPFS_BUILD=1; AC_DEFINE(ZIPFS_BUILD, 1, [Are we building with zipfs enabled?])\ - INSTALL_LIBRARIES=install-libraries-zipfs-shared - AC_MSG_RESULT([yes]) fi + AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) INSTALL_LIBRARIES=install-libraries diff --git a/win/makefile.vc b/win/makefile.vc index 66879ab..cde68dc 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -824,7 +824,7 @@ $(TMP_DIR)\tclZlib.obj: $(GENERICDIR)\tclZlib.c $(cc32) $(pkgcflags) -I$(COMPATDIR)\zlib -Fo$@ $? # Following the lead of the autoconf based make, we define the -# CFG_RUNTIME_DLLFILE and CFG_RUNTIME_ZIPFILE flags specifically for tclPkgConfig +# CFG_RUNTIME_*DIR flags specifically for tclPkgConfig # and not as part of the global defines. These are all defined # as empty strings because they are intended to represent paths # at *runtime*, not build time. This may make sense on Unix systems @@ -848,8 +848,7 @@ $(TMP_DIR)\tclPkgConfig.obj: $(GENERICDIR)\tclPkgConfig.c /DCFG_RUNTIME_SCRDIR="\"$(SCRIPT_INSTALL_DIR:\=\\)\"" \ /DCFG_RUNTIME_INCDIR="\"$(INCLUDE_INSTALL_DIR:\=\\)\"" \ /DCFG_RUNTIME_DOCDIR="\"$(DOC_INSTALL_DIR:\=\\)\"" \ - /DCFG_RUNTIME_DLLFILE="\"\"" \ - /DCFG_RUNTIME_ZIPFILE="\"\"" \ + /DCFG_RUNTIME_DLLFILE="\"$(TCL_LIB_FILE)\"" \ -Fo$@ $? $(TMP_DIR)\tclAppInit.obj: $(WIN_DIR)\tclAppInit.c -- cgit v0.12 From 5740a9e3d2db8f112a2af4353f86d9ca864b3a2f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 9 Feb 2021 07:34:01 +0000 Subject: Add --disable-zipfs flag to GNUmakefile --- macosx/GNUmakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile index 6451c66..1ee3bf1 100644 --- a/macosx/GNUmakefile +++ b/macosx/GNUmakefile @@ -144,7 +144,7 @@ ${objdir}/Makefile: ${UNIX_DIR}/Makefile.in ${UNIX_DIR}/configure \ mkdir -p "${OBJ_DIR}" && cd "${OBJ_DIR}" && \ if [ ${UNIX_DIR}/configure -nt config.status ]; then ${UNIX_DIR}/configure -C \ --prefix="${PREFIX}" --bindir="${BINDIR}" --libdir="${LIBDIR}" \ - --mandir="${MANDIR}" --enable-framework --enable-dtrace \ + --mandir="${MANDIR}" --enable-framework --enable-dtrace --disable-zipfs \ ${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS}; else ./config.status; fi build-${PROJECT}: ${objdir}/Makefile -- cgit v0.12 From af4a77f3e35d39964eeae9c3636a42d6d29f4d5d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 9 Feb 2021 12:07:09 +0000 Subject: Change TCL_ZIP_FILE name, just using dots in stead of underscores --- tests/zipfs.test | 2 +- unix/configure | 2 +- unix/configure.ac | 2 +- unix/tcl.pc.in | 1 - win/configure | 2 +- win/configure.ac | 2 +- win/tcl.m4 | 2 -- 7 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/zipfs.test b/tests/zipfs.test index fd40f9e..8689268 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -39,7 +39,7 @@ if {![string match ${ziproot}* $tcl_library]} { # Hack the environment to pretend we did pull tcl_library from a zip # archive ### - set tclzip [file join $CWD [::tcl::pkgconfig get dllfile,runtime]] + set tclzip [file join $CWD libtcl[info patchlevel].zip] testConstraint zipfslib [file isfile $tclzip] if {[testConstraint zipfslib]} { zipfs mount /lib/tcl $tclzip diff --git a/unix/configure b/unix/configure index 34500ba..f54edf9 100755 --- a/unix/configure +++ b/unix/configure @@ -11149,7 +11149,7 @@ printf "%s\n" "No zip found on PATH. Building minizip" >&6; } ZIPFS_BUILD=1 - TCL_ZIP_FILE=libtcl_${TCL_MAJOR_VERSION}_${TCL_MINOR_VERSION}${TCL_PATCH_LEVEL}.zip + TCL_ZIP_FILE=libtcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_PATCH_LEVEL}.zip else ZIPFS_BUILD=0 TCL_ZIP_FILE= diff --git a/unix/configure.ac b/unix/configure.ac index ad837b9..6b97f7e 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -888,7 +888,7 @@ if test "$tcl_ok" = "yes" -a "x$enable_framework" != "xyes"; then # SC_ZIPFS_SUPPORT ZIPFS_BUILD=1 - TCL_ZIP_FILE=libtcl_${TCL_MAJOR_VERSION}_${TCL_MINOR_VERSION}${TCL_PATCH_LEVEL}.zip + TCL_ZIP_FILE=libtcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_PATCH_LEVEL}.zip else ZIPFS_BUILD=0 TCL_ZIP_FILE= diff --git a/unix/tcl.pc.in b/unix/tcl.pc.in index a343707..2693cd8 100644 --- a/unix/tcl.pc.in +++ b/unix/tcl.pc.in @@ -5,7 +5,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ libfile=@TCL_LIB_FILE@ -zipfile=@TCL_ZIP_FILE@ Name: Tool Command Language Description: Tcl is a powerful, easy-to-learn dynamic programming language, suitable for a wide range of uses. diff --git a/win/configure b/win/configure index 090e040..2fd5ecc 100755 --- a/win/configure +++ b/win/configure @@ -5135,7 +5135,7 @@ printf "%s\n" "No zip found on PATH building minizip" >&6; } ZIPFS_BUILD=1 - TCL_ZIP_FILE=libtcl_${TCL_MAJOR_VERSION}_${TCL_MINOR_VERSION}${TCL_PATCH_LEVEL}.zip + TCL_ZIP_FILE=libtcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_PATCH_LEVEL}.zip else ZIPFS_BUILD=0 TCL_ZIP_FILE= diff --git a/win/configure.ac b/win/configure.ac index 7dc9c6d..a3c4c30 100644 --- a/win/configure.ac +++ b/win/configure.ac @@ -180,7 +180,7 @@ if test "$tcl_ok" = "yes" ; then SC_PROG_TCLSH SC_ZIPFS_SUPPORT ZIPFS_BUILD=1 - TCL_ZIP_FILE=libtcl_${TCL_MAJOR_VERSION}_${TCL_MINOR_VERSION}${TCL_PATCH_LEVEL}.zip + TCL_ZIP_FILE=libtcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_PATCH_LEVEL}.zip else ZIPFS_BUILD=0 TCL_ZIP_FILE= diff --git a/win/tcl.m4 b/win/tcl.m4 index b9a164c..76711dd 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -251,7 +251,6 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ # TCL_BIN_DIR # TCL_SRC_DIR # TCL_LIB_FILE -# TCL_ZIP_FILE # #------------------------------------------------------------------------ @@ -288,7 +287,6 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [ AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SRC_DIR) - AC_SUBST(TCL_ZIP_FILE) AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_LIB_SPEC) -- cgit v0.12 From 0043160893f36a39afbe5a4f9dff3fac577d0dec Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 9 Feb 2021 13:34:26 +0000 Subject: Handle the situation that ::${basename}::pkgconfig does not have bindir/libdir,runtime keys: Either get those from Tcl, or from [info nameofexecutable] --- library/auto.tcl | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/library/auto.tcl b/library/auto.tcl index ea2fe5e..dc37328 100644 --- a/library/auto.tcl +++ b/library/auto.tcl @@ -97,13 +97,22 @@ proc tcl_findLibrary {basename version patch initScript enVarName varName} { } if {!$found} { set paths {} - lappend paths [file join $root app] - lappend paths [::${basename}::pkgconfig get libdir,runtime] - lappend paths [::${basename}::pkgconfig get bindir,runtime] + if {![catch {::${basename}::pkgconfig get libdir,runtime} dir]} { + lappend paths $dir + } else { + catch {lappend paths [::tcl::pkgconfig get libdir,runtime]} + } + if {![catch {::${basename}::pkgconfig get bindir,runtime} dir]} { + lappend paths $dir + } else { + catch {lappend paths [::tcl::pkgconfig get bindir,runtime]} + } if {[catch {::${basename}::pkgconfig get dllfile,runtime} dllfile]} { set dllfile "lib${basename}${version}[info sharedlibextension]" } - lappend paths [file dirname [file join [pwd] [info nameofexecutable]]] + set dir [file dirname [file join [pwd] [info nameofexecutable]]] + lappend paths $dir + lappend paths [file join [file dirname $dir] lib] foreach path $paths { set archive [file join $path $dllfile] if {![file exists $archive]} { -- cgit v0.12 From aeeb808b303e434a1ccff182ded81904c935d88d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 9 Feb 2021 14:16:11 +0000 Subject: ZIPFS_BUILD=1 only needs to be set once --- unix/configure | 1 - unix/configure.ac | 1 - win/configure | 1 - win/configure.ac | 1 - 4 files changed, 4 deletions(-) diff --git a/unix/configure b/unix/configure index f54edf9..50a035b 100755 --- a/unix/configure +++ b/unix/configure @@ -11164,7 +11164,6 @@ if test "${ZIPFS_BUILD}" = 1; then printf "%s\n" "#define ZIPFS_BUILD 2" >>confdefs.h else - ZIPFS_BUILD=1; printf "%s\n" "#define ZIPFS_BUILD 1" >>confdefs.h \ diff --git a/unix/configure.ac b/unix/configure.ac index 6b97f7e..edf5f6d 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -900,7 +900,6 @@ if test "${ZIPFS_BUILD}" = 1; then ZIPFS_BUILD=2; AC_DEFINE(ZIPFS_BUILD, 2, [Are we building with zipfs enabled?]) else - ZIPFS_BUILD=1; AC_DEFINE(ZIPFS_BUILD, 1, [Are we building with zipfs enabled?])\ fi AC_MSG_RESULT([yes]) diff --git a/win/configure b/win/configure index 2fd5ecc..4659c61 100755 --- a/win/configure +++ b/win/configure @@ -5150,7 +5150,6 @@ if test "${ZIPFS_BUILD}" = 1; then printf "%s\n" "#define ZIPFS_BUILD 2" >>confdefs.h else - ZIPFS_BUILD=1; printf "%s\n" "#define ZIPFS_BUILD 1" >>confdefs.h \ diff --git a/win/configure.ac b/win/configure.ac index a3c4c30..87ffd8d 100644 --- a/win/configure.ac +++ b/win/configure.ac @@ -192,7 +192,6 @@ if test "${ZIPFS_BUILD}" = 1; then ZIPFS_BUILD=2; AC_DEFINE(ZIPFS_BUILD, 2, [Are we building with zipfs enabled?]) else - ZIPFS_BUILD=1; AC_DEFINE(ZIPFS_BUILD, 1, [Are we building with zipfs enabled?])\ fi AC_MSG_RESULT([yes]) -- cgit v0.12 From 6e603480b380cbf2699334cc475c3ffde87a5feb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 9 Feb 2021 16:43:57 +0000 Subject: Only set dllfile,runtime key info when doing a shared build --- generic/tclPkgConfig.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generic/tclPkgConfig.c b/generic/tclPkgConfig.c index a802252..672d3c9 100644 --- a/generic/tclPkgConfig.c +++ b/generic/tclPkgConfig.c @@ -109,7 +109,9 @@ static Tcl_Config const cfg[] = { {"scriptdir,runtime", CFG_RUNTIME_SCRDIR}, {"includedir,runtime", CFG_RUNTIME_INCDIR}, {"docdir,runtime", CFG_RUNTIME_DOCDIR}, +#if !defined(STATIC_BUILD) {"dllfile,runtime", CFG_RUNTIME_DLLFILE}, +#endif /* Installation paths to various stuff */ -- cgit v0.12 From 2ba1ef3db130005ec13803f56a5f8a64c1d2669c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 10 Feb 2021 08:11:29 +0000 Subject: In a static build, don't pack dde/registry in zip-file. In shared build, pack dde/registry dll's in zip-file. Rename zip-file --- win/makefile.vc | 7 +++++-- win/rules.vc | 12 ++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/win/makefile.vc b/win/makefile.vc index cde68dc..a124b34 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -576,18 +576,21 @@ $(OUT_DIR)\tommath.lib: $(TOMMATHDIR)\win32\tommath.lib $(COPY) $(TOMMATHDIR)\win32\tommath.lib $(OUT_DIR)\tommath.lib !endif -$(TCLSCRIPTZIP): .PHONY +$(TCLSCRIPTZIP): $(TCLDDELIB) $(TCLREGLIB) @echo Building Tcl library zip file @if exist "$(LIBTCLVFS)" $(RMDIR) "$(LIBTCLVFS)" @$(MKDIR) "$(LIBTCLVFS)" @$(CPYDIR) $(LIBDIR) "$(LIBTCLVFS)\tcl_library" @move /y "$(LIBTCLVFS)\tcl_library\manifest.txt" "$(LIBTCLVFS)\tcl_library\pkgIndex.tcl" > NUL -!if ! $(STATIC_BUILD) +!if $(STATIC_BUILD) # Remove the registry and dde directories as the DLLS are still external @del "$(LIBTCLVFS)\tcl_library\registry\pkgIndex.tcl" @rmdir "$(LIBTCLVFS)\tcl_library\registry" @del "$(LIBTCLVFS)\tcl_library\dde\pkgIndex.tcl" @rmdir "$(LIBTCLVFS)\tcl_library\dde" +!else + @$(COPY) $(TCLDDELIB) "$(LIBTCLVFS)\tcl_library\dde + @$(COPY) $(TCLREGLIB) "$(LIBTCLVFS)\tcl_library\registry !endif @echo file delete -force {$@} > "$(OUT_DIR)\zipper.tcl" @echo zipfs mkzip {$@} {$(LIBTCLVFS)} {$(LIBTCLVFS)} >> "$(OUT_DIR)\zipper.tcl" diff --git a/win/rules.vc b/win/rules.vc index e678c34..2ec5292 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -1122,16 +1122,8 @@ STUBPREFIX = $(PROJECT)stub # # TIP 430. Unused for 8.6 but no harm defining it to allow a common rules.vc -!if "$(TCL_PATCH_LETTER)" == "." -TCLSCRIPTZIPNAME = libtcl_$(TCL_MAJOR_VERSION)_$(TCL_MINOR_VERSION)_$(TCL_RELEASE_SERIAL).zip -!else -TCLSCRIPTZIPNAME = libtcl_$(TCL_MAJOR_VERSION)_$(TCL_MINOR_VERSION)_$(TCL_PATCH_LETTER)$(TCL_RELEASE_SERIAL).zip -!endif -!if "$(TK_PATCH_LETTER)" == "." -TKSCRIPTZIPNAME = libtk_$(TK_MAJOR_VERSION)_$(TK_MINOR_VERSION)_$(TK_RELEASE_SERIAL).zip -!else -TKSCRIPTZIPNAME = libtk_$(TK_MAJOR_VERSION)_$(TK_MINOR_VERSION)_$(TK_PATCH_LETTER)$(TK_RELEASE_SERIAL).zip -!endif +TCLSCRIPTZIPNAME = libtcl$(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION)$(TCL_PATCH_LETTER)$(TCL_RELEASE_SERIAL).zip +TKSCRIPTZIPNAME = libtk$(TK_MAJOR_VERSION)$(TK_MINOR_VERSION)$(TK_PATCH_LETTER)$(TK_RELEASE_SERIAL).zip !if $(DOING_TCL) TCLSHNAME = $(PROJECT)sh$(VERSION)$(SUFX).exe -- cgit v0.12 From ea4e2c54322fdec470e442447b66d815635851da Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 10 Feb 2021 08:52:08 +0000 Subject: Fix pkgconfig-1.1 testcase for static builds --- tests/config.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/config.test b/tests/config.test index d41021a..2d8b593 100644 --- a/tests/config.test +++ b/tests/config.test @@ -17,9 +17,9 @@ if {"::tcltest" ni [namespace children]} { namespace import -force ::tcltest::* } -test pkgconfig-1.1 {query keys} { +test pkgconfig-1.1 {query keys} -body { lsort [::tcl::pkgconfig list] -} {64bit bindir,install bindir,runtime compile_debug compile_stats debug dllfile,runtime docdir,install docdir,runtime includedir,install includedir,runtime libdir,install libdir,runtime mem_debug optimized profiled scriptdir,install scriptdir,runtime threaded} +} -match glob -result {64bit bindir,install bindir,runtime compile_debug compile_stats debug*docdir,install docdir,runtime includedir,install includedir,runtime libdir,install libdir,runtime mem_debug optimized profiled scriptdir,install scriptdir,runtime threaded} test pkgconfig-1.2 {query keys multiple times} { string compare [::tcl::pkgconfig list] [::tcl::pkgconfig list] } 0 -- cgit v0.12