[PD-dev] Compiling fat external binaries for Mac OS X

reduzent at gmail.com reduzent at gmail.com
Tue Jun 14 14:23:16 CEST 2022


On Wed, 2022-06-08 at 20:04 +0200, Dan Wilcox wrote:
> You can simply pass in the arches you want using the "arch" makefile
> variable:
> 
> make arch="x86_64 arm64"

That's cool to know. In the case of purest_json, I believe it ships
with other dependencies (libjson?) and if those come from homebrew,
they're probably not fat. Is my assumption correct, that a fat binary
would have to link to fat binary? 

In the case for the mp3cast~ external, I went a different route. I
built separate binaries for different archs and used different
extensions so that they can be placed in the same package:

For M1:

make extension=d_arm64 

For Intel:

make extension=d_amd64


I also took care to place local dependencies into folders named $arch,
so that amd64 and arm64 libraries can co-exist in the same package.

Here is the Makefile and localdeps script:
https://github.com/pd-externals/mp3cast




On a related note:

In the past, when I wanted to use purest_json from Deken on Ubuntu
(can't recall the version), the package didn't ship with local
dependencies, but was linked against system-provided binaries. However,
my Ubuntu shipped an incompatible version of libjson, so I had to
compile purest_json locally. It would be nice, if you could add the
local dependencies _also_ to the Linux builds. 


Roman






More information about the Pd-dev mailing list