|
From: Michael S. <ms...@ms...> - 2024-08-09 11:56:10
|
Matt,
> On Aug 8, 2024, at 4:01 PM, Matt Broughton <wal...@ma...> wrote:
> ...
> libusb is not included with any version of macos. What I am tyring to do is make an installer package for Gutenprint where gutenprint53+usb will work without having the macos Gutenprint installer actually installing libusb-- to build a statically linked binary or library.
So I actually do this for my LPrint and hp-printer-app packages on macOS, which depend on PAPPL and libusb.
The libusb configure script supports the "--disable-shared" option. Use it and then it will only link statically to libusb.
I also set the compiler flags before running the configure script as follows to build "fat" for macOS 11 and later:
CFLAGS="-mmacosx-version-min=11.0 -arch x86_64 -arch arm64"; export CFLAGS
CXXFLAGS="-mmacosx-version-min=11.0 -arch x86_64 -arch arm64"; export CXXFLAGS
LDFLAGS="-mmacosx-version-min=11.0 -arch x86_64 -arch arm64"; export LDFLAGS
You can change the min version to whatever you like, although the code signing and notarization stuff changed between macOS 10.13 and 10.14 so I personally wouldn't go any older than 10.14... If you decide to do a PPC-compatible build then you'll need an older system and use "-arch i386 -arch ppc" in the compiler options.
If it would be useful, I'm happy to share my (currently private) "macbase" project which I use to build a couple dozen common tools and libraries on my Macs, all using static libraries and "fat".
________________________
Michael Sweet
|