implementation of configure.env-append

Ken Cunningham ken.cunningham.webuse at gmail.com
Sun Oct 6 19:05:26 UTC 2019


I think I have tried this enough ways to be close, but I just want to be certain.

I want to *append* a value onto an existing environment variable from a Portfile. I don’t want to overwrite what is there in the environment variable already.


adding for example this in the Portfile:

configure.env-append "LDFLAGS=-Wl,-w”


adds my new LDFLAGS onto the existing LDFLAGS in the environment, as far as I can tell.

without:
LDFLAGS='-L/opt/universalnew/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -arch x86_64 -arch i386'

with:
LDFLAGS='-Wl,-w -L/opt/universalnew/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -arch x86_64 -arch i386'


So that works (better than I initially thought, actually).


However, as we previously noted in another ticket exploring this:

${configure.ldflags}

does not pick up any of the modifications that are done to LDFLAGS in portconfigure.tcl or in Portfile, and so is, practically, seriously flawed:

pre-build {
    puts ${configure.ldflags}
}

-L/opt/universalnew/lib -Wl,-headerpad_max_install_names


Have we discovered a way in the Portfile to force ${configure.ldflags} to be updated to be the same as the fully processed LDFLAGS in configure.env?

Ken




More information about the macports-dev mailing list