I need to know whether I compiled libjpeg for 32 or 64 bits architecture, but don't know how to find out, is there a command that will let me check?
To determine system type for macOSOpen the Apple menu and choose About This Mac. Click the System Report button. If you do not see a System Report button, click the More Info button and then click the System Report button. Under the Hardware panel, locate the Processor Name in the Hardware Overview.
If you are looking at a binary library / framework (perhaps it's precompiled by a 3rd party) and want to know if it's a static or dynamic binary, just use file command with the path to the binary file. Example (static framework) - static binaries are usually marked with ar archive or similar.
MacBinary is a file format that combines the two forks of a classic Mac OS file into a single file, along with HFS's extended metadata. The resulting file is suitable for transmission over FTP, the World Wide Web, and electronic mail.
lipo is a command tool which has been around in Mac OS X for a long time. It not only checks Mach-O files for their support of different architectures, but creates Universal Binaries too. In the past, a basic version of lipo has been provided in /usr/bin , and a more advanced version with Xcode.
just type file libjpeg.dylib
and you'll get output like the following
libpoll.dylib: Mach-O universal binary with 3 architectures libpoll.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 libpoll.dylib (for architecture i386): Mach-O dynamically linked shared library i386 libpoll.dylib (for architecture ppc7400): Mach-O dynamically linked shared library ppc
The file
command will work just fine. Alternatively, you can use otool
to print the fat headers.
$ otool -vf /usr/lib/libSystem.B.dylib Fat headers fat_magic FAT_MAGIC nfat_arch 2 architecture ppc cputype CPU_TYPE_POWERPC cpusubtype CPU_SUBTYPE_POWERPC_ALL offset 4096 size 2221800 align 2^12 (4096) architecture ppc64 cputype CPU_TYPE_POWERPC64 cpusubtype CPU_SUBTYPE_POWERPC64_ALL offset 2228224 size 2169980 align 2^12 (4096)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With