Setting system gcc when `port select --set gcc app-gcc*` is set

Mojca Miklavec mojca at macports.org
Thu Oct 3 18:25:14 UTC 2019


On Thu, 3 Oct 2019 at 19:50, Steven Smith wrote:
>
> I have a build failure on a system with `port select --set gcc mp-gcc9` set:
>
> :info:build /opt/local/lib/gcc9/gcc/x86_64-apple-darwin18/9.2.0/include-fixed/ma
> th.h:45:10: error:
> :info:build      fatal error: sys/cdefs.h: No such file or directory
> :info:build        45 | #include <sys/cdefs.h>
> :info:build           |          ^~~~~~~~~~~~~
>
>
> This is with the port hlint, which uses port group haskell_cabal:
> https://github.com/macports/macports-ports/blob/master/_resources/port1.0/group/haskell_cabal-1.0.tcl
>
> The build works if I make sure that “gcc” points to /usr/bin/gcc.
>
> How should this be done in MacPorts to avoid this issue?

Convince upstream to address
    https://github.com/haskell/cabal/issues/1325

While cabal should be able to pick its own favourite compiler, it
should not prevent the user to specify what precisely is needed /
wanted. Who says that all compilers are called "gcc"?

Other than that ... I don't know. Make a temporary bin folder insider
the build tree, make a symlink gcc -> ${configure.cc}, prepend that
folder to PATH. We also have an issue with git, not just with C.

Mojca


More information about the macports-dev mailing list