[MacPorts] #69839: Handle CC_FOR_BUILD and CXX_FOR_BUILD where they are used but not actually set

MacPorts noreply at macports.org
Tue Apr 30 00:54:52 UTC 2024


#69839: Handle CC_FOR_BUILD and CXX_FOR_BUILD where they are used but not actually
set
---------------------------+--------------------
  Reporter:  barracuda156  |      Owner:  (none)
      Type:  enhancement   |     Status:  new
  Priority:  Normal        |  Milestone:
 Component:  base          |    Version:  2.9.3
Resolution:                |   Keywords:
      Port:                |
---------------------------+--------------------

Comment (by ryandesign):

 As far as I know it is not a widespread problem because not many build
 systems use `CC_FOR_BUILD` or `CXX_FOR_BUILD`. Today I see only 18
 portfiles mentioning the former and 1 setting the latter. However it might
 be nice to handle it centrally.

 Presumably what you want is for new options `configure.cc_for_build` and
 `configure.cxx_for_build` to be introduced. These would default to
 `${configure.cc}` and `${configure.cxx}`. The `CC_FOR_BUILD` and
 `CXX_FOR_BUILD` environment variables would be set to
 `${configure.cc_for_build}` and `${configure.cxx_for_build}`.

 I see a couple ports (gtk3, gtk3-devel, fossil) including the `-arch`
 flag. I would guess that should not be done because the whole point of
 these env vars is to specify a compiler that builds things for the build
 machine and it should do so without needing to be told what arch to do it
 for, and especially if you are, for example, on an x86_64 machine building
 for arm64, then you do not want `-arch arm64` to be used to compile things
 that will need to run on the x86_64 build machine.

-- 
Ticket URL: <https://trac.macports.org/ticket/69839#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list