Hi, thanks for having a look.

On Mon, 6 Jul 2026, Stuart Henderson wrote:
> 
> This with ports/x/y/tcl8 and ports/x/y/tcl9 and various duplication
> and fiddling with Makefile.inc feels particularly awkward, especially
> when it needs replicating for every Tcl extension port.
> 
> It should be possible to do this with non-conflicting flavours of the
> same port, similar to how python ports used to handle py2 + py3. The
> difference compared to old python being that with this, one would
> need to depend on the other, but I don't think that's a problem.

Ok, I think I've got something working.
Could you name a port that does/did this that I can use for example?


> Most of the mechanism would be common to all Tcl extension ports
> so could go in lang/tcl/tcl.port.mk so it's mostly one-time work to
> do the setup there, with smaller changes to the individual ports as
> they're moved across to it.
> 
> For the files which need to be present in only one of the flavoured
> packages, I'd use the SUBST_VARS trick with a variable that defined to
> either "@comment " or "" and use that to prefix those files in PLIST so
> a single PLIST can be shared between the flavours. Other differences in
> PLISTs are mostly going to be formulaic so you'd have e.g. for these

Seems I'm successful with that, though I can't guess (yet) what could
be factored into tcl.port.mk.


> : libxyz123.so, libxyz123.so.0.0 and libxyzstub123.a.
> : libtcl9xyz123.so, libtcl9xyz123.so.0.0, and libxyzstub.a.
> 
> you could set this in the tcl-xyz port
> 
> MODTCL_LIBV=  123
> 
> and in the module, other vars depending on the flavour (tcl8/tcl9),
> to either of
> 
> MODTCL_EXTLIB=        libtcl9
> MODTCL_STUB=  stub.a
> 
> MODTCL_EXTLIB=        lib
> MODTCL_STUB=  stub${MODTCL_LIBV}.a

I don't really get this but it doesn't seem as important right now.
I figure the right bits will make themselves evident once a few 
ports have been converted.

I wan't too clear about the lib names.
Probably not obvious what they mean.
Basically two types: loadable-only and loadable/linkable+optional_stub.
Loadable libs in ${LOCALBASE}/lib/tcl/xyz
Linkable libs in ${LOCALBASE}/lib

The default names are:

Ver     Loadable                Linkable                Stub
Tcl8    libxyz123.so            libxyz123.so.0.0        libxyzstub123.a
Tcl9    libtcl9xyz123.so        libtcl9xyz123.so.0.0    libxyzstub.a


I want the Tcl9 stub name to conform: libtcl9xyzstub123.a

I do think that the Tcl9 stub lib can be used for both.
Until that gets worked-out, I'd like to use this consistent naming.


Stu

Reply via email to