Tcl help ...

Christopher Jones jonesc at
Mon Mar 29 19:35:49 UTC 2021

Hi All,

Working on fixing a build issue and hitting a limit in my current understanding of Tcl… I am trying to set some new env vars in the build.env

        set ldflags ${configure.ldflags}       
        build.env-append   GO_EXTLINK_ENABLED=1
        build.env-append   GO_LDFLAGS='-extldflags\=$ldflags’

however, when the port in question using ${build.env} I get

DEBUG: system -W /opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_devel_codesearch/codesearch/work/gopath/src/ GOPATH=/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_devel_codesearch/codesearch/work/gopath GOARCH=amd64 GOOS=darwin CC=/usr/bin/clang CXX=/usr/bin/clang++ GOPROXY=off GO111MODULE=off C_INCLUDE_PATH=/opt/local/include/LegacySupport OBJC_INCLUDE_PATH=/opt/local/include/LegacySupport CPLUS_INCLUDE_PATH=/opt/local/include/LegacySupport OBJCPLUS_INCLUDE_PATH=/opt/local/include/LegacySupport GO_EXTLINK_ENABLED=1 {GO_LDFLAGS='-extldflags=-L/opt/local/lib -Wl,-headerpad_max_install_names -lMacportsLegacySupport'} /opt/local/bin/go build cmd/cgrep/cgrep.go
sh: {GO_LDFLAGS=-extldflags=-L/opt/local/lib -Wl,-headerpad_max_install_names -lMacportsLegacySupport}: 

See how the second env var I define above is shown inside {} braces, which of course sh cannot parse.

I have tried numerous forms of how to set

build.env-append   GO_LDFLAGS='-extldflags\=$ldflags’

but they all have the same issue.

I suspect this is just my lack of really undertanding quoting in tcl, so I am hoping someone can tell me what I am doing wrong ?

cheers Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1930 bytes
Desc: not available
URL: <>

More information about the macports-dev mailing list