|
2026-10-30
| ||
| 21:11 | • Closed ticket [9cdb0d5858]: unix/Makefile.in problem when building pkgs for stat... artifact: 28fec64fac user: jan.nijtmans | |
|
2026-10-21
| ||
| 18:05 | • Ticket [9cdb0d5858]: 3 changes artifact: 659567891f user: dgp | |
|
2026-10-20
| ||
| 12:29 | • Ticket [8228750a0a] Makefile issue when building packages status still Open ... artifact: 206df9c005 user: serhiy.storchaka | |
| 12:29 | • Ticket [9cdb0d5858] unix/Makefile.in problem when building pkgs for static build... artifact: 7b5f5624de user: serhiy.storchaka | |
| 12:23 | Fix [9cdb0d5858] and [8228750a0a]: the bundled packages were always built as shared libraries, even ... closed check-in: 732583df8c user: serhiy.storchaka tags: pkgs-shared-make-var | |
| 12:22 | Fix [9cdb0d5858] and [8228750a0a]: with --disable-shared the bundled packages were still built as sh... closed check-in: 9d87df83e9 user: serhiy.storchaka tags: pkgs-respect-disable-shared | |
|
2020-11-02
| ||
| 21:37 | • New ticket [9cdb0d5858] unix/Makefile.in problem when building pkgs for static b... artifact: 6a78fc963a user: anonymous | |
unix/Makefile.in problem when building pkgs for static builds
In unix/Makefile.in, the lines
$(PKG_CFG_ARGS) --libdir=$(PACKAGE_DIR) \
--enable-shared --enable-threads; ) || exit $$?; \
want to be
--libdir=$(PACKAGE_DIR) \
--enable-shared --enable-threads $(PKG_CFG_ARGS) ; ) || exit $$?; \
so that the PKG_CFG_ARGS are not overridden by --enable-shared, and --disable-shared can take effect for static builds.
206df9c005Ticket [8228750a0a] Makefile issue when building packages status still Open with 3 other changes ticket2026-10-20 12:29:51732583df8cFix [9cdb0d5858] and [8228750a0a]: the bundled packages were always built as shared libraries, even with --disable-shared. Keep that default, so that [package require] can load them also from a static Tcl, but allow "make PKG_SHARED=--disable-shared" to build them as static libraries, in unix/Makefile.in and win/Makefile.in. check-in2026-10-20 12:23:349d87df83e9Fix [9cdb0d5858] and [8228750a0a]: with --disable-shared the bundled packages were still built as shared libraries, since --enable-shared came after the arguments passed on to their configure. Put it before them, in unix/Makefile.in and win/Makefile.in, so that --disable-shared builds static packages too. Note that static packages cannot be loaded with [package require] unless linked into the application. check-in2026-10-20 12:22:15
Still present in 8.6, 9.0 and 9.1, on Unix and Windows: the fixed --enable-shared comes after the arguments passed on to the packages' configure, so --disable-shared never reaches them. This may be intended: shared, stub-enabled packages can be loaded with [package require] also from a static Tcl, while static ones only help when linked into the application. So there are two proposed fixes, please choose:
- pkgs-respect-disable-shared, as suggested here: --disable-shared builds static packages too (--libdir stays last). Incompatible for static Tcl builds that load the bundled packages.
- pkgs-shared-make-var: packages stay shared by default, and make PKG_SHARED=--disable-shared builds them static. No change for existing builds.
Both tested with Thread in pkgs/, on Linux and with a MinGW cross build.
The purpose of the `make *packages` targets in Tcl's unix Makefile is to make installable builds of the bundled collection of packages that can then successfully be [package require]d or [load]ed into the Tcl built by the same Makefile. Forcing the --enable-shared build is intentional to achieve this aim. Back when it made a difference, forcing --enable-threads had similar justification. I believe in Tcl 9 we can drop that since we require thread-enabled code for everything now. The Tcl+pkgs source code distribution contains the full source code releases of all the packages. Anyone who needs a --disable-shared build of one of those packages is welcome to do that by directly working within the package's source directory and using its own configuration and build mechanism. I strongly prefer we do not enable that control in Tcl's unix/Makefile. If you choose to build one of the bundled packages through the Tcl+pkgs collection, then you get the build configuration suitable for Tcl+pkgs installation.
I agree with Don. If you build a package with --disable-shared, the only thing built is a static library (*.a or *.lib). This library is not useful in itself, it still has to be linked in the application, neither Tcl nor Tk have the machinery to do that. So, when being part of the Tcl 'batteries included', --disable-shared makes no sense for the included packages.
So, closing as 'Won't fix' (in fact 'works as designed') makes most sense.
Anyway, thanks for bringing this up! Closing the two branches. Sorry!