A question about a potential error in portconfigure::should_add_stdlib{} in the master branch

René J.V. Bertin rjvbertin at gmail.com
Wed May 29 20:46:26 UTC 2024


Hi,

I'm rebasing my LinuxPorts adaptation of "base" to a few days old checkout of the master branch, and saw something in the portconfigure::should_add_stdlib{} procedure:

```
    # GCC also supports -stdlib starting with GCC 10 (and devel), but
    # not with PPC builds
    global configure.build_arch
    if {[string match *g*-mp-* ${configure.cxx}]
            && ${configure.build_arch} ni {ppc ppc64}} {
        # Do not pass stdlib to gcc if it is MacPorts custom macports-libstdc++ setting
        # as gcc does not uderstand this. Instead do nothing, which means gcc will
        # default to using its own libstdc++, which is in fact what we mean by
        # configure.cxx_stdlib=macports-libstdc++
```

Besides the typo in the comment ;) I fear that `[string match *g*-mp-* ${configure.cxx}]` will also match `${prefix}/bin/clang++-mp-XY`.
I understand the reason for the leading wildcard, but isn't the expression you want `[string match */g*-mp-* ${configure.cxx}]` ?


R.


More information about the macports-dev mailing list