[m-users.] Product deployment on multiple platforms.
Peter Wang
novalazy at gmail.com
Sat Jul 9 11:34:54 AEST 2022
On Tue, 05 Jul 2022 09:31:52 +0100 "Sean Charles (emacstheviking)" <objitsu at gmail.com> wrote:
> Hi,
>
> I am close to completing a simple tool that I want to sell / donate-ware across multiple platforms using Mercury.
> Has anybody any experience of this?
> Do I build a static image or a linked image, if I state ahead of time what the platform requirements are etc?
>
> I want to be able to target :-
>
> - Apple, both intel and M1, I have one of each so that's no an issue.
> - *nix on intel/amd, I have Ubuntu under emulation on my intel iMac
> - Pi, I have a Pi4.
> - Windows, intel/AMD. I can probably use Parallels for that
>
> Has anybody been through the process of supporting multiple platform builds of Mercury projects, are there any good links out there that might guide me?
> I have plans for it all but it feels like something somebody else probably already did so I thought I'd ask.
Hi,
Assuming you are using a C backend then it's much the same as
distributing a compiled C program.
For Linux, you are expected to dynamically link to GNU libc. But due to
symbol versioning, if you build on a newer Linux distribution then
chances are the resulting binary will require some symbols newer than
those available on an older Linux distribution. So pick a Linux
distribution with the oldest version of glibc that you wish to support,
and build on that. You can check which glibc version a binary requires
with:
objdump -p $BINARY | grep GLIBC
If your host is a Linux system, you can use Linux namespaces/containers
instead of emulating a whole machine to run another Linux distribution.
For Windows, I would suggest installing a MinGW cross-compiler on a
Linux system (or MacOS?), installing a copy of Mercury as a
cross-compiler, and using that to build your Windows binaries.
For MacOS, you probably want to set the MACOSX_DEPLOYMENT_TARGET
environment variable to improve compatibility with older MacOS versions.
Mercury's configure script has a --with-macosx-deployment-target switch,
but I've never tested it (don't have a Mac).
Peter
More information about the users
mailing list