Any way to cross compile a port?

Ryan Schmidt ryandesign at macports.org
Fri Mar 25 23:42:30 PDT 2016


On Mar 25, 2016, at 8:40 PM, Carlo Tambuatco wrote:

> I’m just curious if there’s a way to cross compile a port for a different machine than the current one you’re using, for say compiling something huge and copying it over to a much slower mac (also running macports) and then updating the corresponding portfiles, etc...

MacPorts isn't meant to be used that way. There are some variables that can be set in macports.conf to do cross-compiling, such as build_arch, universal_archs, macosx_deployment_target and macosx_sdk_version, but not all ports will build correctly if you change these. And certainly you should only change these if you have no ports installed. If you change the macosx_*_version settings from their defaults, you must also set "buildfromsource always".

Which ports specifically are you asking about? We have an automated build system which makes binaries for most ports, which should make compiling on your machine unnecessary in many cases. However, we don't make binaries for very old versions of OS X, nor for all combinations of variants, nor for all ports; some ports cannot be distributed as binaries, and other ports deliberately disable the use of binaries because they compile differently on different processors, and so must be compiled on the machine they will run on.




More information about the macports-users mailing list