Workarounds for cross compiling to Windows?
Richard L. Hamilton
rlhamil at smart.net
Fri Jul 10 18:45:10 UTC 2020
I suspect that the answer might not be entirely yes or no, but more like maybe sometimes. One can apparently cross-compile to iOS from the command line:
but I'm not aware of ANY specific support within MacPorts for using cross-compiling tools (aside from universal builds, which do not apply, because right now there aren't fat binaries for both iOS/ARM and macOS/Intel); and various ports may have build dependencies that would be a problem. There may be any number of other things that need tweaking for iOS builds too, so although it might not be strictly impossible to configure (a perhaps preferably separate installation of) MacPorts to do that, I suspect that unless you want to build a LOT of ports for iOS, it''d be more trouble than it's worth.
I have no idea whether anyone has configured compilers, linkers, etc that run on macOS but cross-compile and build for Windows or Android; and even if they have, MacPorts almost certainly doesn't know about them; and the difficulties getting it to use them might be at least as great if not greater than those for cross-compiling to iOS.
Cross-compiling tools exist that run on Linux and target all the OS's you've mentioned. Supposedly, MacPorts can (experimentally) be gotten to work on Linux, although you have to to a lot of work yourself.
If you're going to have to do a lot of work yourself anyway, that might be easier than building all the cross-compiling toolchains to run on macOS. Or not. And you could always run Linux in a VM under macOS, perhaps using VirtualBox, which is free for personal use.
Then again, I haven't spent any significant time reading about or looking at MacPorts internals, let alone experimental features. For someone with really deep knowledge, it might not be THAT difficult; but for most of us, it would be if not impossible, at least a lot of trouble.
> On Jul 10, 2020, at 14:05, Ces VLC <cesarillovlc at gmail.com> wrote:
> El El vie, 10 jul 2020 a las 18:15, Ken Cunningham <ken.cunningham.webuse at gmail.com <mailto:ken.cunningham.webuse at gmail.com>> escribió:
> There is a full description on the point-by-point details here:
> <https://guide.macports.org/chunked/development.local-repositories.html <https://guide.macports.org/chunked/development.local-repositories.html>>
> Yes, I know how to do that, but I assumed MacPorts will build for MacOS only. Can you write a portfile that will crosscompile to other OSs such as Windows? And, if affirmative, can you also write portfiles that build to iOS and Android? That would greatly improve my workflow!!
> Kind regards and thanks a lot,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the macports-users