- Xcode 10.0 or later. I use 10.2.1.
- libjpeg-turbo 1.*. I use 1.5.3, the build script cannot support version 2.0 or later.
- Homebrew, install other libraries. Run
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)". - automake 1.7 or later. Run
brew install automake. - autoconf 2.56 or later. It's automake configure script builder.
- libtool 1.4 or later. Run
brew install libtool. - NASM (if building x86 or x86-64 SIMD extensions). Run
brew install nasm.
- Run
$ [sudo] chmod +x build.sh(if./build.shcommand not found). - Run
$ ./build.sh. - You will find library in output directory.
Create architectures i386, x86_64, armv7, armv7s and arm64 by default. You can change ARCHS property which architecture you want in build.sh line 20.
Support minimum for iOS is 8.0 by default. MIN_OS_VERSION property in build.sh(line 19).
Important Check and set the SDK_VERSION available, otherwise cannot work. eg: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk SDK_VERSION=12.2 - open
build.sh, updateTARGET_VERSION(line 9). - download libjpeg-turbo and copy to src directory.
Important Cannot support libjpeg-turbo version 2.0 or later. You can use lipo -info or file command check architectures.
eg: $ file libjpeg.a libjpeg.a: Mach-O universal binary with 5 architectures: [i386:current ar archive random library] [arm64] libjpeg.a (for architecture i386): current ar archive random library libjpeg.a (for architecture armv7): current ar archive random library libjpeg.a (for architecture armv7s):current ar archive random library libjpeg.a (for architecture x86_64):current ar archive random library libjpeg.a (for architecture arm64): current ar archive random library $ lipo -info libturbojpeg.a Architectures in the fat file: libturbojpeg.a are: i386 armv7 armv7s x86_64 arm64 Submit libjpeg-turbo for searching CVE list.