blob: c68225b47fbb75129adf9672183def7164cd36f3 [file] [log] [blame]
DRC68fef832010-02-16 05:29:10 +00001*******************************************************************************
DRCf32640e2013-03-23 09:57:03 +00002** Building on Un*x Platforms (including Cygwin and OS X)
DRC68fef832010-02-16 05:29:10 +00003*******************************************************************************
4
DRCcc243742010-10-16 09:22:43 +00005
DRC68fef832010-02-16 05:29:10 +00006==================
7Build Requirements
8==================
9
10-- autoconf 2.56 or later
DRC68fef832010-02-16 05:29:10 +000011-- automake 1.7 or later
DRC68fef832010-02-16 05:29:10 +000012-- libtool 1.4 or later
DRCf32640e2013-03-23 09:57:03 +000013 * If using Xcode 4.3 or later on OS X, autoconf and automake are no longer
14 provided. The easiest way to obtain them is from MacPorts
15 (http://www.macports.org/).
DRC68fef832010-02-16 05:29:10 +000016
DRC939e4662015-08-03 23:56:09 -050017-- NASM or YASM (if building x86 or x86-64 SIMD extensions)
18 * NASM 0.98, or 2.01 or later is required for an x86 build (0.99 and 2.00 do
19 not work properly with libjpeg-turbo's x86 SIMD code.)
20 * NASM 2.00 or later is required for an x86-64 build.
21 * NASM 2.07, or 2.11.09 or later is required for an x86-64 Mac build
22 (2.11.08 does not work properly with libjpeg-turbo's x86-64 SIMD code when
23 building macho64 objects.) NASM or YASM can be obtained from MacPorts
24 (http://www.macports.org/).
DRC68fef832010-02-16 05:29:10 +000025
DRC254937b2011-04-16 13:35:35 +000026 The binary RPMs released by the NASM project do not work on older Linux
27 systems, such as Red Hat Enterprise Linux 4. On such systems, you can
28 easily build and install NASM from a source RPM by downloading one of the
29 SRPMs from
30
31 http://www.nasm.us/pub/nasm/releasebuilds
32
33 and executing the following as root:
DRC68fef832010-02-16 05:29:10 +000034
35 ARCH=`uname -m`
DRC254937b2011-04-16 13:35:35 +000036 rpmbuild --rebuild nasm-{version}.src.rpm
37 rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-{version}.$ARCH.rpm
DRC68fef832010-02-16 05:29:10 +000038
DRC254937b2011-04-16 13:35:35 +000039 NOTE: the NASM build will fail if texinfo is not installed.
DRCc3f4ac02010-02-19 21:51:26 +000040
DRC8f870c22010-02-24 00:30:00 +000041-- GCC v4.1 or later recommended for best performance
DRCf32640e2013-03-23 09:57:03 +000042 * Beginning with Xcode 4, Apple stopped distributing GCC and switched to
DRC08769b32013-03-23 21:35:41 +000043 the LLVM compiler. Xcode v4.0 through v4.6 provides a GCC front end
44 called LLVM-GCC. Unfortunately, as of this writing, neither LLVM-GCC nor
45 the LLVM (clang) compiler produces optimal performance with libjpeg-turbo.
DRCf32640e2013-03-23 09:57:03 +000046 Building libjpeg-turbo with LLVM-GCC v4.2 results in a 10% performance
47 degradation when compressing using 64-bit code, relative to building
48 libjpeg-turbo with GCC v4.2. Building libjpeg-turbo with LLVM (clang)
49 results in a 20% performance degradation when compressing using 64-bit
50 code, relative to building libjpeg-turbo with GCC v4.2. If you are
51 running Snow Leopard or earlier, it is suggested that you continue to use
52 Xcode v3.2.6, which provides GCC v4.2. If you are using Lion or later, it
DRC06bf10d2015-06-20 16:21:33 +000053 is suggested that you install Apple GCC v4.2 or GCC v5 through MacPorts.
DRC68fef832010-02-16 05:29:10 +000054
DRC5039d732013-01-21 23:42:12 +000055-- If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is
DRC79241e32014-03-23 18:06:11 +000056 required. Some systems, such as Solaris 10 and later and Red Hat Enterprise
57 Linux 5 and later, have this pre-installed. On OS X 10.5 and later, it will
58 be necessary to install the Java Developer Package, which can be downloaded
59 from http://developer.apple.com/downloads (Apple ID required.) For systems
60 that do not have a JDK installed, you can obtain the Oracle Java Development
61 Kit from http://www.java.com.
DRCf8e00552011-02-04 11:06:36 +000062
DRCcc243742010-10-16 09:22:43 +000063
64==================
65Out-of-Tree Builds
66==================
67
68Binary objects, libraries, and executables are generated in the same directory
69from which configure was executed (the "binary directory"), and this directory
70need not necessarily be the same as the libjpeg-turbo source directory. You
71can create multiple independent binary directories, in which different versions
72of libjpeg-turbo can be built from the same source tree using different
73compilers or settings. In the sections below, {build_directory} refers to the
74binary directory, whereas {source_directory} refers to the libjpeg-turbo source
75directory. For in-tree builds, these directories are the same.
76
77
DRC68fef832010-02-16 05:29:10 +000078======================
79Building libjpeg-turbo
80======================
81
DRC5039d732013-01-21 23:42:12 +000082The following procedure will build libjpeg-turbo on Linux, FreeBSD, Cygwin, and
83Solaris/x86 systems (on Solaris, this generates a 32-bit library. See below
84for 64-bit build instructions.)
DRC68fef832010-02-16 05:29:10 +000085
DRCcc243742010-10-16 09:22:43 +000086 cd {source_directory}
DRC68fef832010-02-16 05:29:10 +000087 autoreconf -fiv
DRCcc243742010-10-16 09:22:43 +000088 cd {build_directory}
DRC98dbe912010-11-04 22:22:30 +000089 sh {source_directory}/configure [additional configure flags]
DRC68fef832010-02-16 05:29:10 +000090 make
91
DRC93eaa372015-06-20 16:27:51 +000092NOTE: Running autoreconf in the source directory is not necessary if building
93libjpeg-turbo from one of the official release tarballs.
DRC68fef832010-02-16 05:29:10 +000094
95This will generate the following files under .libs/
96
97 libjpeg.a
DRC5039d732013-01-21 23:42:12 +000098 Static link library for the libjpeg API
DRC68fef832010-02-16 05:29:10 +000099
DRC5039d732013-01-21 23:42:12 +0000100 libjpeg.so.{version} (Linux, Unix)
DRCcc243742010-10-16 09:22:43 +0000101 libjpeg.{version}.dylib (OS X)
DRC81543312010-10-18 07:23:58 +0000102 cygjpeg-{version}.dll (Cygwin)
DRC5039d732013-01-21 23:42:12 +0000103 Shared library for the libjpeg API
DRC68fef832010-02-16 05:29:10 +0000104
DRC5039d732013-01-21 23:42:12 +0000105 By default, {version} is 62.1.0, 7.1.0, or 8.0.2, depending on whether
106 libjpeg v6b (default), v7, or v8 emulation is enabled. If using Cygwin,
107 {version} is 62, 7, or 8.
108
109 libjpeg.so (Linux, Unix)
DRC68fef832010-02-16 05:29:10 +0000110 libjpeg.dylib (OS X)
DRC5039d732013-01-21 23:42:12 +0000111 Development symlink for the libjpeg API
112
DRC81543312010-10-18 07:23:58 +0000113 libjpeg.dll.a (Cygwin)
DRC5039d732013-01-21 23:42:12 +0000114 Import library for the libjpeg API
DRC68fef832010-02-16 05:29:10 +0000115
116 libturbojpeg.a
DRC5039d732013-01-21 23:42:12 +0000117 Static link library for the TurboJPEG API
DRC68fef832010-02-16 05:29:10 +0000118
DRC79241e32014-03-23 18:06:11 +0000119 libturbojpeg.so.0.1.0 (Linux, Unix)
120 libturbojpeg.0.1.0.dylib (OS X)
DRC5039d732013-01-21 23:42:12 +0000121 cygturbojpeg-0.dll (Cygwin)
122 Shared library for the TurboJPEG API
123
124 libturbojpeg.so (Linux, Unix)
DRC68fef832010-02-16 05:29:10 +0000125 libturbojpeg.dylib (OS X)
DRC5039d732013-01-21 23:42:12 +0000126 Development symlink for the TurboJPEG API
DRC81543312010-10-18 07:23:58 +0000127
128 libturbojpeg.dll.a (Cygwin)
DRC5039d732013-01-21 23:42:12 +0000129 Import library for the TurboJPEG API
DRC81543312010-10-18 07:23:58 +0000130
131
DRC30913542012-01-27 09:53:33 +0000132libjpeg v7 or v8 API/ABI Emulation
133----------------------------------
DRC81543312010-10-18 07:23:58 +0000134
135Add --with-jpeg7 to the configure command line to build a version of
DRC30913542012-01-27 09:53:33 +0000136libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add --with-jpeg8 to
137the configure command to build a version of libjpeg-turbo that is
138API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
139on libjpeg v7 and v8 emulation.
DRC81543312010-10-18 07:23:58 +0000140
DRC68fef832010-02-16 05:29:10 +0000141
DRC5039d732013-01-21 23:42:12 +0000142In-Memory Source/Destination Managers
143-------------------------------------
144
145When using libjpeg v6b or v7 API/ABI emulation, add --without-mem-srcdst to the
146configure command line to build a version of libjpeg-turbo that lacks the
147jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of
148the original libjpeg v6b and v7 APIs, so removing them ensures strict
149conformance with those APIs. See README-turbo.txt for more information.
150
151
DRC245cfdf2010-11-23 17:11:06 +0000152Arithmetic Coding Support
153-------------------------
154
155Since the patent on arithmetic coding has expired, this functionality has been
156included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
DRCf38eee02011-02-18 07:00:38 +0000157based on the implementation in libjpeg v8, but it works when emulating libjpeg
DRC245cfdf2010-11-23 17:11:06 +0000158v7 or v6b as well. The default is to enable both arithmetic encoding and
159decoding, but those who have philosophical objections to arithmetic coding can
160add --without-arith-enc or --without-arith-dec to the configure command line to
161disable encoding or decoding (respectively.)
162
DRC68fef832010-02-16 05:29:10 +0000163
DRC5039d732013-01-21 23:42:12 +0000164TurboJPEG Java Wrapper
165----------------------
DRC88f54a42011-04-01 01:21:22 +0000166Add --with-java to the configure command line to incorporate an optional Java
DRC5039d732013-01-21 23:42:12 +0000167Native Interface wrapper into the TurboJPEG shared library and build the Java
168front-end classes to support it. This allows the TurboJPEG shared library to
169be used directly from Java applications. See java/README for more details.
DRC88f54a42011-04-01 01:21:22 +0000170
171You can set the JAVAC, JAR, and JAVA configure variables to specify
172alternate commands for javac, jar, and java (respectively.) You can also
173set the JAVACFLAGS configure variable to specify arguments that should be
174passed to the Java compiler when building the front-end classes, and JNI_CFLAGS
175to specify arguments that should be passed to the C compiler when building the
176JNI wrapper. Run 'configure --help' for more details.
DRCf8e00552011-02-04 11:06:36 +0000177
178
DRC68fef832010-02-16 05:29:10 +0000179========================
180Installing libjpeg-turbo
181========================
182
183If you intend to install these libraries and the associated header files, then
184replace 'make' in the instructions above with
185
186 make install prefix={base dir} libdir={library directory}
187
188For example,
189
190 make install prefix=/usr/local libdir=/usr/local/lib64
191
192will install the header files in /usr/local/include and the library files in
193/usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default
194is to install the header files in /opt/libjpeg-turbo/include and the library
DRCd7a642b2013-04-24 06:40:25 +0000195files in /opt/libjpeg-turbo/lib32 (32-bit) or /opt/libjpeg-turbo/lib64
196(64-bit.)
DRC68fef832010-02-16 05:29:10 +0000197
198NOTE: You can specify a prefix of /usr and a libdir of, for instance,
199/usr/lib64 to overwrite the system's version of libjpeg. If you do this,
200however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before
201overwriting it. It is recommended that you instead install libjpeg-turbo into
DRC5039d732013-01-21 23:42:12 +0000202a non-system directory and manipulate the LD_LIBRARY_PATH or create symlinks
DRC68fef832010-02-16 05:29:10 +0000203to force applications to use libjpeg-turbo instead of libjpeg. See
204README-turbo.txt for more information.
205
DRCcc243742010-10-16 09:22:43 +0000206
DRC68fef832010-02-16 05:29:10 +0000207=============
208Build Recipes
209=============
210
DRCcc243742010-10-16 09:22:43 +0000211
DRC5039d732013-01-21 23:42:12 +000021232-bit Build on 64-bit Linux
213----------------------------
DRC68fef832010-02-16 05:29:10 +0000214
DRCca5e7d12010-02-17 02:25:06 +0000215Add
DRC68fef832010-02-16 05:29:10 +0000216
DRC2e4d0442011-02-08 01:18:37 +0000217 --host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32
DRC68fef832010-02-16 05:29:10 +0000218
219to the configure command line.
220
221
DRC5039d732013-01-21 23:42:12 +000022264-bit Build on 64-bit OS X
223---------------------------
DRC68fef832010-02-16 05:29:10 +0000224
DRCca5e7d12010-02-17 02:25:06 +0000225Add
DRC68fef832010-02-16 05:29:10 +0000226
DRC0dedd1a2010-07-02 09:20:12 +0000227 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm
DRC68fef832010-02-16 05:29:10 +0000228
DRC7bac07b2010-04-10 05:53:35 +0000229to the configure command line. NASM 2.07 or later from MacPorts must be
230installed.
DRC68fef832010-02-16 05:29:10 +0000231
232
DRC5039d732013-01-21 23:42:12 +000023332-bit Build on 64-bit OS X
234---------------------------
DRC68fef832010-02-16 05:29:10 +0000235
DRCca5e7d12010-02-17 02:25:06 +0000236Add
DRC68fef832010-02-16 05:29:10 +0000237
DRC5950c5d2012-06-28 23:22:03 +0000238 --host i686-apple-darwin CFLAGS='-O3 -m32' LDFLAGS=-m32
DRC68fef832010-02-16 05:29:10 +0000239
240to the configure command line.
241
242
DRC5039d732013-01-21 23:42:12 +000024364-bit Backward-Compatible Build on 64-bit OS X
244-----------------------------------------------
DRC68fef832010-02-16 05:29:10 +0000245
DRCca5e7d12010-02-17 02:25:06 +0000246Add
DRC68fef832010-02-16 05:29:10 +0000247
DRC0dedd1a2010-07-02 09:20:12 +0000248 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
DRC79241e32014-03-23 18:06:11 +0000249 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
250 -mmacosx-version-min=10.5 -O3' \
251 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
252 -mmacosx-version-min=10.5'
DRC0dedd1a2010-07-02 09:20:12 +0000253
DRC79241e32014-03-23 18:06:11 +0000254to the configure command line. The OS X 10.5 SDK, and NASM 2.07 or later from
DRC575c3422010-07-08 07:01:20 +0000255MacPorts, must be installed.
DRC0dedd1a2010-07-02 09:20:12 +0000256
257
DRC5039d732013-01-21 23:42:12 +000025832-bit Backward-Compatible Build on OS X
259----------------------------------------
DRC0dedd1a2010-07-02 09:20:12 +0000260
261Add
262
DRC5950c5d2012-06-28 23:22:03 +0000263 --host i686-apple-darwin \
DRC79241e32014-03-23 18:06:11 +0000264 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
265 -mmacosx-version-min=10.5 -O3 -m32' \
266 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
267 -mmacosx-version-min=10.5 -m32'
DRC68fef832010-02-16 05:29:10 +0000268
DRC79241e32014-03-23 18:06:11 +0000269to the configure command line. The OS X 10.5 SDK must be installed.
DRC68fef832010-02-16 05:29:10 +0000270
271
27264-bit Library Build on 64-bit Solaris
273--------------------------------------
274
DRCca5e7d12010-02-17 02:25:06 +0000275Add
DRC68fef832010-02-16 05:29:10 +0000276
DRC2e4d0442011-02-08 01:18:37 +0000277 --host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64
DRC68fef832010-02-16 05:29:10 +0000278
279to the configure command line.
280
281
DRC5039d732013-01-21 23:42:12 +000028232-bit Build on 64-bit FreeBSD
283------------------------------
DRC7bac07b2010-04-10 05:53:35 +0000284
285Add
286
DRC2e4d0442011-02-08 01:18:37 +0000287 --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \
288 LDFLAGS='-B/usr/lib32'
DRC7bac07b2010-04-10 05:53:35 +0000289
290to the configure command line. NASM 2.07 or later from FreeBSD ports must be
291installed.
292
293
DRC0559e942012-03-23 03:12:35 +0000294Oracle Solaris Studio
295---------------------
DRCca5e7d12010-02-17 02:25:06 +0000296
297Add
298
DRC2e4d0442011-02-08 01:18:37 +0000299 CC=cc
DRCca5e7d12010-02-17 02:25:06 +0000300
301to the configure command line. libjpeg-turbo will automatically be built with
DRC2e4d0442011-02-08 01:18:37 +0000302the maximum optimization level (-xO5) unless you override CFLAGS.
DRCca5e7d12010-02-17 02:25:06 +0000303
DRC0559e942012-03-23 03:12:35 +0000304To build a 64-bit version of libjpeg-turbo using Oracle Solaris Studio, add
DRCca5e7d12010-02-17 02:25:06 +0000305
DRC2e4d0442011-02-08 01:18:37 +0000306 --host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64
DRCca5e7d12010-02-17 02:25:06 +0000307
308to the configure command line.
309
DRC8b014d72010-02-18 13:03:41 +0000310
DRC81543312010-10-18 07:23:58 +0000311MinGW Build on Cygwin
312---------------------
313
314Use CMake (see recipes below)
315
316
DRC94755ce2011-10-19 05:13:27 +0000317===========
318ARM Support
319===========
320
321This release of libjpeg-turbo can use ARM NEON SIMD instructions to accelerate
322JPEG compression/decompression by approximately 2-4x on ARMv7 and later
323platforms. If libjpeg-turbo is configured on an ARM Linux platform, then the
324build system will automatically include the NEON SIMD routines, if they are
DRCb0a9cca2014-05-06 21:03:35 +0000325supported. Build instructions for other ARM-based platforms follow.
DRC94755ce2011-10-19 05:13:27 +0000326
327
328Building libjpeg-turbo for iOS
329------------------------------
330
DRCdab6b8a2014-05-06 20:53:25 +0000331iOS platforms, such as the iPhone and iPad, use ARM processors, some of which
332support NEON instructions. Additional steps are required in order to build
333libjpeg-turbo for these platforms.
DRC94755ce2011-10-19 05:13:27 +0000334
335Additional build requirements:
336
DRC8d55c882014-01-29 19:32:23 +0000337 gas-preprocessor.pl
DRCa61fd322015-08-03 13:16:21 -0500338 (https://raw.githubusercontent.com/libjpeg-turbo/gas-preprocessor/master/gas-preprocessor.pl)
DRC8d55c882014-01-29 19:32:23 +0000339 should be installed in your PATH.
DRC94755ce2011-10-19 05:13:27 +0000340
DRC6e6b28c2014-12-19 17:34:30 +0000341
342ARM 32-bit Build (Xcode 4.6.x and earlier, LLVM-GCC):
343
DRC94755ce2011-10-19 05:13:27 +0000344Set the following shell variables for simplicity:
345
DRC0d0705f2014-03-27 03:35:21 +0000346 Xcode 4.2 and earlier:
DRC8d55c882014-01-29 19:32:23 +0000347 IOS_PLATFORMDIR=/Developer/Platforms/iPhoneOS.platform
DRC0d0705f2014-03-27 03:35:21 +0000348 Xcode 4.3 and later:
DRC8d55c882014-01-29 19:32:23 +0000349 IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
DRC8d55c882014-01-29 19:32:23 +0000350
DRC0d0705f2014-03-27 03:35:21 +0000351 IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk
DRC0d0705f2014-03-27 03:35:21 +0000352 IOS_GCC=$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
DRCa2a2cd62013-02-04 22:29:57 +0000353
DRC6e6b28c2014-12-19 17:34:30 +0000354 ARMv6 (code will run on all iOS devices, not SIMD-accelerated):
DRCa2a2cd62013-02-04 22:29:57 +0000355 [NOTE: Requires Xcode 4.4.x or earlier]
DRC94755ce2011-10-19 05:13:27 +0000356 IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp"
357
DRC6e6b28c2014-12-19 17:34:30 +0000358 ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer):
DRC94755ce2011-10-19 05:13:27 +0000359 IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon"
360
DRC6e6b28c2014-12-19 17:34:30 +0000361 ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer):
DRCa2a2cd62013-02-04 22:29:57 +0000362 [NOTE: Requires Xcode 4.5 or later]
363 IOS_CFLAGS="-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon"
364
DRC94755ce2011-10-19 05:13:27 +0000365Follow the procedure under "Building libjpeg-turbo" above, adding
366
DRCceb552a2014-12-19 10:44:09 +0000367 --host arm-apple-darwin10 \
DRC94755ce2011-10-19 05:13:27 +0000368 CC="$IOS_GCC" LD="$IOS_GCC" \
369 CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \
370 LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS"
371
DRC6e6b28c2014-12-19 17:34:30 +0000372to the configure command line.
DRC0d0705f2014-03-27 03:35:21 +0000373
DRC6e6b28c2014-12-19 17:34:30 +0000374
375ARM 32-bit Build (Xcode 5.0.x and later, Clang):
376
377Set the following shell variables for simplicity:
378
379 IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
380 IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk
381 IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
382
383 ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer):
384 IOS_CFLAGS="-arch armv7"
385
386 ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer):
387 IOS_CFLAGS="-arch armv7s"
388
389Follow the procedure under "Building libjpeg-turbo" above, adding
390
391 --host arm-apple-darwin10 \
392 CC="$IOS_GCC" LD="$IOS_GCC" \
393 CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \
394 LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS" \
DRC0d0705f2014-03-27 03:35:21 +0000395 CCASFLAGS="-no-integrated-as $IOS_CFLAGS"
396
DRC94755ce2011-10-19 05:13:27 +0000397to the configure command line.
398
DRC6e6b28c2014-12-19 17:34:30 +0000399
400ARMv8 64-bit Build (Xcode 5.0.x and later, Clang):
401
DRCeb319ed2015-01-28 00:26:28 +0000402Code will run on iPhone 5S/iPad Mini 2/iPad Air and newer.
DRC6e6b28c2014-12-19 17:34:30 +0000403
404Set the following shell variables for simplicity:
405
406 IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
407 IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk
408 IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
409 IOS_CFLAGS="-arch arm64"
410
411Follow the procedure under "Building libjpeg-turbo" above, adding
412
413 --host aarch64-apple-darwin \
414 CC="$IOS_GCC" LD="$IOS_GCC" \
415 CFLAGS="-isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \
416 LDFLAGS="-isysroot $IOS_SYSROOT $IOS_CFLAGS"
417
418to the configure command line.
419
420
DRC0d0705f2014-03-27 03:35:21 +0000421NOTE: You can also add -miphoneos-version-min={version} to $IOS_CFLAGS above
422in order to support older versions of iOS than the default version supported by
423the SDK.
424
DRC6e6b28c2014-12-19 17:34:30 +0000425Once built, lipo can be used to combine the ARMv6, v7, v7s, and/or v8 variants
DRCa2a2cd62013-02-04 22:29:57 +0000426into a universal library.
DRC5039d732013-01-21 23:42:12 +0000427
DRC81543312010-10-18 07:23:58 +0000428
DRCb0a9cca2014-05-06 21:03:35 +0000429Building libjpeg-turbo for Android
430----------------------------------
431
432Building libjpeg-turbo for Android platforms requires the Android NDK
433(https://developer.android.com/tools/sdk/ndk) and autotools. The following is
434a general recipe script that can be modified for your specific needs.
435
436 # Set these variables to suit your needs
437 NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/ndk}
438 BUILD_PLATFORM={the platform name for the NDK package you installed--
DRCcbfa6962016-02-01 11:28:55 -0600439 for example, "windows-x86" or "linux-x86_64" or "darwin-x86_64"}
440 TOOLCHAIN_VERSION={"4.8", "4.9", "clang3.5", etc. This corresponds to a
441 toolchain directory under ${NDK_PATH}/toolchains/.}
DRCb0a9cca2014-05-06 21:03:35 +0000442 ANDROID_VERSION={The minimum version of Android to support-- for example,
DRCcbfa6962016-02-01 11:28:55 -0600443 "16", "19", etc. "21" or later is required for a 64-bit build.}
DRCb0a9cca2014-05-06 21:03:35 +0000444
DRCcbfa6962016-02-01 11:28:55 -0600445 # 32-bit ARMv7 build
DRCb0a9cca2014-05-06 21:03:35 +0000446 HOST=arm-linux-androideabi
DRCb0a9cca2014-05-06 21:03:35 +0000447 SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm
DRCb0a9cca2014-05-06 21:03:35 +0000448 ANDROID_CFLAGS="-march=armv7-a -mfloat-abi=softfp -fprefetch-loop-arrays \
DRCcbfa6962016-02-01 11:28:55 -0600449 --sysroot=${SYSROOT}"
450
451 # 64-bit ARMv8 build
452 HOST=aarch64-linux-android
453 SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm64
454 ANDROID_CFLAGS="--sysroot=${SYSROOT}"
455
456 TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
457 ANDROID_INCLUDES="-I${SYSROOT}/usr/include -I${TOOLCHAIN}/include"
DRCb0a9cca2014-05-06 21:03:35 +0000458 export CPP=${TOOLCHAIN}/bin/${HOST}-cpp
459 export AR=${TOOLCHAIN}/bin/${HOST}-ar
460 export AS=${TOOLCHAIN}/bin/${HOST}-as
461 export NM=${TOOLCHAIN}/bin/${HOST}-nm
462 export CC=${TOOLCHAIN}/bin/${HOST}-gcc
463 export LD=${TOOLCHAIN}/bin/${HOST}-ld
464 export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib
465 export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump
466 export STRIP=${TOOLCHAIN}/bin/${HOST}-strip
467 cd {build_directory}
468 sh {source_directory}/configure --host=${HOST} \
DRCcbfa6962016-02-01 11:28:55 -0600469 CFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS} -O3 -fPIE" \
DRCb0a9cca2014-05-06 21:03:35 +0000470 CPPFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS}" \
DRCcbfa6962016-02-01 11:28:55 -0600471 LDFLAGS="${ANDROID_CFLAGS} -pie" --with-simd ${1+"$@"}
DRCb0a9cca2014-05-06 21:03:35 +0000472 make
473
DRCcbfa6962016-02-01 11:28:55 -0600474If building for Android 4.0.x (API level < 16) or earlier, remove -fPIE from
475CFLAGS and -pie from LDFLAGS.
476
DRCb0a9cca2014-05-06 21:03:35 +0000477
DRC68fef832010-02-16 05:29:10 +0000478*******************************************************************************
DRC81543312010-10-18 07:23:58 +0000479** Building on Windows (Visual C++ or MinGW)
DRC68fef832010-02-16 05:29:10 +0000480*******************************************************************************
481
DRCcc243742010-10-16 09:22:43 +0000482
DRC68fef832010-02-16 05:29:10 +0000483==================
484Build Requirements
485==================
486
DRC4d2ff7d2014-04-18 02:46:59 +0000487-- CMake (http://www.cmake.org) v2.8.8 or later
DRC68fef832010-02-16 05:29:10 +0000488
DRCcc243742010-10-16 09:22:43 +0000489-- Microsoft Visual C++ 2005 or later
DRC68fef832010-02-16 05:29:10 +0000490
DRCcc243742010-10-16 09:22:43 +0000491 If you don't already have Visual C++, then the easiest way to get it is by
492 installing the Windows SDK:
DRC68fef832010-02-16 05:29:10 +0000493
DRCcc243742010-10-16 09:22:43 +0000494 http://msdn.microsoft.com/en-us/windows/bb980924.aspx
495
496 The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
497 everything necessary to build libjpeg-turbo.
498
DRC4d2ff7d2014-04-18 02:46:59 +0000499 * You can also use Microsoft Visual Studio Express Edition, which is a free
500 download. (NOTE: versions prior to 2012 can only be used to build 32-bit
501 code.)
DRCcc243742010-10-16 09:22:43 +0000502 * If you intend to build libjpeg-turbo from the command line, then add the
503 appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH
504 environment variables. This is generally accomplished by executing
505 vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and
506 vcvars64.bat are part of Visual C++ and are located in the same directory
507 as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass
508 optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build
509 environment.
510
511... OR ...
512
DRC81543312010-10-18 07:23:58 +0000513-- MinGW
DRCcc243742010-10-16 09:22:43 +0000514
DRC4d2ff7d2014-04-18 02:46:59 +0000515 MinGW-builds (http://sourceforge.net/projects/mingwbuilds/) or
516 tdm-gcc (http://tdm-gcc.tdragon.net/) recommended if building on a Windows
517 machine. Both distributions install a Start Menu link that can be used to
518 launch a command prompt with the appropriate compiler paths automatically
519 set.
DRC68fef832010-02-16 05:29:10 +0000520
DRC377add72010-05-17 16:41:12 +0000521-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
522 a 64-bit build)
DRC68fef832010-02-16 05:29:10 +0000523
DRC5039d732013-01-21 23:42:12 +0000524-- If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This
525 can be downloaded from http://www.java.com.
DRC218c0c12011-02-05 06:01:18 +0000526
DRCcc243742010-10-16 09:22:43 +0000527
528==================
529Out-of-Tree Builds
530==================
531
532Binary objects, libraries, and executables are generated in the same directory
533from which cmake was executed (the "binary directory"), and this directory need
534not necessarily be the same as the libjpeg-turbo source directory. You can
535create multiple independent binary directories, in which different versions of
536libjpeg-turbo can be built from the same source tree using different compilers
537or settings. In the sections below, {build_directory} refers to the binary
538directory, whereas {source_directory} refers to the libjpeg-turbo source
539directory. For in-tree builds, these directories are the same.
540
541
DRC68fef832010-02-16 05:29:10 +0000542======================
543Building libjpeg-turbo
544======================
545
DRC68fef832010-02-16 05:29:10 +0000546
DRCcc243742010-10-16 09:22:43 +0000547Visual C++ (Command Line)
548-------------------------
DRC68fef832010-02-16 05:29:10 +0000549
DRCcc243742010-10-16 09:22:43 +0000550 cd {build_directory}
551 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory}
552 nmake
DRC68fef832010-02-16 05:29:10 +0000553
DRCcc243742010-10-16 09:22:43 +0000554This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending
555on which version of cl.exe is in the PATH.
DRC8b014d72010-02-18 13:03:41 +0000556
DRCcc243742010-10-16 09:22:43 +0000557The following files will be generated under {build_directory}:
558
559 jpeg-static.lib
DRC5039d732013-01-21 23:42:12 +0000560 Static link library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000561 sharedlib/jpeg{version}.dll
DRC5039d732013-01-21 23:42:12 +0000562 DLL for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000563 sharedlib/jpeg.lib
DRC5039d732013-01-21 23:42:12 +0000564 Import library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000565 turbojpeg-static.lib
DRC5039d732013-01-21 23:42:12 +0000566 Static link library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000567 turbojpeg.dll
DRC5039d732013-01-21 23:42:12 +0000568 DLL for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000569 turbojpeg.lib
DRC5039d732013-01-21 23:42:12 +0000570 Import library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000571
572{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
DRCf38eee02011-02-18 07:00:38 +0000573v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000574
575
576Visual C++ (IDE)
577----------------
578
579Choose the appropriate CMake generator option for your version of Visual Studio
580(run "cmake" with no arguments for a list of available generators.) For
581instance:
582
583 cd {build_directory}
DRC4d2ff7d2014-04-18 02:46:59 +0000584 cmake -G "Visual Studio 10" {source_directory}
DRCcc243742010-10-16 09:22:43 +0000585
DRCdab6b8a2014-05-06 20:53:25 +0000586NOTE: Add "Win64" to the generator name (for example, "Visual Studio 10
587Win64") to build a 64-bit version of libjpeg-turbo. Recent versions of CMake
588no longer document that. A separate build directory must be used for 32-bit
589and 64-bit builds.
DRCd0c9f0c2014-04-18 07:50:17 +0000590
DRCcc243742010-10-16 09:22:43 +0000591You can then open ALL_BUILD.vcproj in Visual Studio and build one of the
592configurations in that project ("Debug", "Release", etc.) to generate a full
593build of libjpeg-turbo.
594
595This will generate the following files under {build_directory}:
596
597 {configuration}/jpeg-static.lib
DRC5039d732013-01-21 23:42:12 +0000598 Static link library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000599 sharedlib/{configuration}/jpeg{version}.dll
DRC5039d732013-01-21 23:42:12 +0000600 DLL for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000601 sharedlib/{configuration}/jpeg.lib
DRC5039d732013-01-21 23:42:12 +0000602 Import library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000603 {configuration}/turbojpeg-static.lib
DRC5039d732013-01-21 23:42:12 +0000604 Static link library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000605 {configuration}/turbojpeg.dll
DRC5039d732013-01-21 23:42:12 +0000606 DLL for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000607 {configuration}/turbojpeg.lib
DRC5039d732013-01-21 23:42:12 +0000608 Import library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000609
610{configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on
611the configuration you built in the IDE, and {version} is 62, 7, or 8,
DRCf38eee02011-02-18 07:00:38 +0000612depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000613
614
615MinGW
616-----
617
DRC4d2ff7d2014-04-18 02:46:59 +0000618NOTE: This assumes that you are building on a Windows machine. If you are
619cross-compiling on a Linux/Unix machine, then see "Build Recipes" below.
620
DRCcc243742010-10-16 09:22:43 +0000621 cd {build_directory}
DRC4d2ff7d2014-04-18 02:46:59 +0000622 cmake -G "MinGW Makefiles" {source_directory}
623 mingw32-make
DRCcc243742010-10-16 09:22:43 +0000624
625This will generate the following files under {build_directory}
626
627 libjpeg.a
DRC5039d732013-01-21 23:42:12 +0000628 Static link library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000629 sharedlib/libjpeg-{version}.dll
DRC5039d732013-01-21 23:42:12 +0000630 DLL for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000631 sharedlib/libjpeg.dll.a
DRC5039d732013-01-21 23:42:12 +0000632 Import library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000633 libturbojpeg.a
DRC5039d732013-01-21 23:42:12 +0000634 Static link library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000635 libturbojpeg.dll
DRC5039d732013-01-21 23:42:12 +0000636 DLL for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000637 libturbojpeg.dll.a
DRC5039d732013-01-21 23:42:12 +0000638 Import library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000639
640{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
DRCf38eee02011-02-18 07:00:38 +0000641v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000642
643
DRCcc243742010-10-16 09:22:43 +0000644Debug Build
645-----------
646
647Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with
648NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
649NMake.)
650
651
DRC30913542012-01-27 09:53:33 +0000652libjpeg v7 or v8 API/ABI Emulation
653-----------------------------------
DRCcc243742010-10-16 09:22:43 +0000654
655Add "-DWITH_JPEG7=1" to the cmake command line to build a version of
DRC30913542012-01-27 09:53:33 +0000656libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add "-DWITH_JPEG8=1"
657to the cmake command to build a version of libjpeg-turbo that is
658API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
659on libjpeg v7 and v8 emulation.
DRCcc243742010-10-16 09:22:43 +0000660
661
DRC5039d732013-01-21 23:42:12 +0000662In-Memory Source/Destination Managers
663-------------------------------------
664
665When using libjpeg v6b or v7 API/ABI emulation, add -DWITH_MEM_SRCDST=0 to the
666CMake command line to build a version of libjpeg-turbo that lacks the
667jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of
668the original libjpeg v6b and v7 APIs, so removing them ensures strict
669conformance with those APIs. See README-turbo.txt for more information.
670
671
DRC245cfdf2010-11-23 17:11:06 +0000672Arithmetic Coding Support
673-------------------------
674
675Since the patent on arithmetic coding has expired, this functionality has been
676included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
DRCf38eee02011-02-18 07:00:38 +0000677based on the implementation in libjpeg v8, but it works when emulating libjpeg
DRC245cfdf2010-11-23 17:11:06 +0000678v7 or v6b as well. The default is to enable both arithmetic encoding and
679decoding, but those who have philosophical objections to arithmetic coding can
680add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to
681disable encoding or decoding (respectively.)
682
683
DRC5039d732013-01-21 23:42:12 +0000684TurboJPEG Java Wrapper
685----------------------
DRC279bd342011-04-02 05:17:12 +0000686Add "-DWITH_JAVA=1" to the cmake command line to incorporate an optional Java
DRC5039d732013-01-21 23:42:12 +0000687Native Interface wrapper into the TurboJPEG shared library and build the Java
688front-end classes to support it. This allows the TurboJPEG shared library to
689be used directly from Java applications. See java/README for more details.
DRC218c0c12011-02-05 06:01:18 +0000690
DRCdb425062011-04-03 06:10:18 +0000691If you are using CMake 2.8, you can set the Java_JAVAC_EXECUTABLE,
692Java_JAVA_EXECUTABLE, and Java_JAR_EXECUTABLE CMake variables to specify
693alternate commands or locations for javac, jar, and java (respectively.) If
694you are using CMake 2.6, set JAVA_COMPILE, JAVA_RUNTIME, and JAVA_ARCHIVE
695instead. You can also set the JAVACFLAGS CMake variable to specify arguments
696that should be passed to the Java compiler when building the front-end classes.
697
DRC218c0c12011-02-05 06:01:18 +0000698
DRC26658432010-10-16 22:04:29 +0000699========================
700Installing libjpeg-turbo
701========================
702
703You can use the build system to install libjpeg-turbo into a directory of your
704choosing (as opposed to creating an installer.) To do this, add:
705
706 -DCMAKE_INSTALL_PREFIX={install_directory}
707
708to the cmake command line.
709
710For example,
711
DRC81543312010-10-18 07:23:58 +0000712 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \
DRC26658432010-10-16 22:04:29 +0000713 -DCMAKE_INSTALL_PREFIX=c:\libjpeg-turbo {source_directory}
714 nmake install
715
716will install the header files in c:\libjpeg-turbo\include, the library files
717in c:\libjpeg-turbo\lib, the DLL's in c:\libjpeg-turbo\bin, and the
718documentation in c:\libjpeg-turbo\doc.
719
720
DRCcc243742010-10-16 09:22:43 +0000721=============
722Build Recipes
723=============
724
725
DRC1c73ce82010-10-16 21:02:54 +000072664-bit MinGW Build on Cygwin
727----------------------------
728
729 cd {build_directory}
DRC2e4d0442011-02-08 01:18:37 +0000730 CC=/usr/bin/x86_64-w64-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000731 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
DRC4d2ff7d2014-04-18 02:46:59 +0000732 -DCMAKE_RC_COMPILER=/usr/bin/x86_64-w64-mingw32-windres.exe \
733 {source_directory}
DRC1c73ce82010-10-16 21:02:54 +0000734 make
735
736This produces a 64-bit build of libjpeg-turbo that does not depend on
737cygwin1.dll or other Cygwin DLL's. The mingw64-x86_64-gcc-core and
738mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed.
739
740
74132-bit MinGW Build on Cygwin
742----------------------------
743
744 cd {build_directory}
DRC2e4d0442011-02-08 01:18:37 +0000745 CC=/usr/bin/i686-w64-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000746 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
DRC4d2ff7d2014-04-18 02:46:59 +0000747 -DCMAKE_RC_COMPILER=/usr/bin/i686-w64-mingw32-windres.exe \
748 {source_directory}
DRC1c73ce82010-10-16 21:02:54 +0000749 make
750
751This produces a 32-bit build of libjpeg-turbo that does not depend on
752cygwin1.dll or other Cygwin DLL's. The mingw64-i686-gcc-core and
753mingw64-i686-gcc-g++ packages (and their dependencies) must be installed.
754
755
DRCcc243742010-10-16 09:22:43 +0000756MinGW Build on Linux
757--------------------
758
759 cd {build_directory}
760 CC={mingw_binary_path}/i386-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000761 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
762 -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
DRCcc243742010-10-16 09:22:43 +0000763 -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
DRC68bf3f22010-10-18 07:56:14 +0000764 {source_directory}
DRCcc243742010-10-16 09:22:43 +0000765 make
DRC8b014d72010-02-18 13:03:41 +0000766
DRC68fef832010-02-16 05:29:10 +0000767
768*******************************************************************************
769** Creating Release Packages
770*******************************************************************************
771
772The following commands can be used to create various types of release packages:
773
DRCcc243742010-10-16 09:22:43 +0000774
DRCd7a642b2013-04-24 06:40:25 +0000775Unix/Linux
776----------
DRCcc243742010-10-16 09:22:43 +0000777
DRC68fef832010-02-16 05:29:10 +0000778make rpm
779
DRCcc243742010-10-16 09:22:43 +0000780 Create Red Hat-style binary RPM package. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000781
782make srpm
783
784 This runs 'make dist' to create a pristine source tarball, then creates a
DRCcc243742010-10-16 09:22:43 +0000785 Red Hat-style source RPM package from the tarball. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000786
787make deb
788
789 Create Debian-style binary package. Requires dpkg.
790
791make dmg
792
DRC377955e2014-03-25 05:27:16 +0000793 Create Macintosh package/disk image. This requires pkgbuild and
794 productbuild, which are installed by default on OS X 10.7 and later and which
795 can be obtained by installing Xcode 3.2.6 (with the "Unix Development"
796 option) on OS X 10.6. Packages built in this manner can be installed on OS X
797 10.5 and later, but they must be built on OS X 10.6 or later.
DRC68fef832010-02-16 05:29:10 +0000798
DRC9ef93db2010-10-18 08:24:42 +0000799make udmg [BUILDDIR32={32-bit build directory}]
DRC68fef832010-02-16 05:29:10 +0000800
DRC20b734e2012-02-10 01:30:37 +0000801 On 64-bit OS X systems, this creates a Macintosh package and disk image that
802 contains universal i386/x86-64 binaries. You should first configure a 32-bit
803 out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree
804 build, then run 'make udmg' from the 64-bit build directory. The build
805 system will look for the 32-bit build under {source_directory}/osxx86 by
806 default, but you can override this by setting the BUILDDIR32 variable on the
807 make command line as shown above.
808
809make iosdmg [BUILDDIR32={32-bit build directory}] \
DRC6e6b28c2014-12-19 17:34:30 +0000810 [BUILDDIRARMV6={ARMv6 build directory}] \
811 [BUILDDIRARMV7={ARMv7 build directory}] \
812 [BUILDDIRARMV7S={ARMv7s build directory}] \
813 [BUILDDIRARMV8={ARMv8 build directory}]
DRC20b734e2012-02-10 01:30:37 +0000814
815 On OS X systems, this creates a Macintosh package and disk image in which the
816 libjpeg-turbo static libraries contain ARM architectures necessary to build
817 iOS applications. If building on an x86-64 system, the binaries will also
818 contain the i386 architecture, as with 'make udmg' above. You should first
DRC6e6b28c2014-12-19 17:34:30 +0000819 configure ARMv6, ARMv7, ARMv7s, and/or ARMv8 out-of-tree builds of
820 libjpeg-turbo (see "Building libjpeg-turbo for iOS" above.) If you are
821 building an x86-64 version of libjpeg-turbo, you should configure a 32-bit
822 out-of-tree build as well. Next, build libjpeg-turbo as you would normally,
823 using an out-of-tree build. When it is built, run 'make iosdmg' from the
824 build directory. The build system will look for the ARMv6 build under
825 {source_directory}/iosarmv6 by default, the ARMv7 build under
826 {source_directory}/iosarmv7 by default, the ARMv7s build under
827 {source_directory}/iosarmv7s by default, the ARMv8 build under
828 {source_directory}/iosarmv8 by default, and (if applicable) the 32-bit build
829 under {source_directory}/osxx86 by default, but you can override this by
830 setting the BUILDDIR32, BUILDDIRARMV6, BUILDDIRARMV7, BUILDDIRARMV7S, and/or
831 BUILDDIRARMV8 variables on the make command line as shown above.
832
833 NOTE: If including an ARMv8 build in the package, then you may need to use
834 Xcode's version of lipo instead of the operating system's. To do this, pass
835 an argument of LIPO="xcrun lipo" on the make command line.
DRC68fef832010-02-16 05:29:10 +0000836
DRC81543312010-10-18 07:23:58 +0000837make cygwinpkg
838
839 Build a Cygwin binary package.
840
DRC0a1f68e2010-02-24 07:24:26 +0000841
DRCcc243742010-10-16 09:22:43 +0000842Windows
843-------
DRC0a1f68e2010-02-24 07:24:26 +0000844
DRCcc243742010-10-16 09:22:43 +0000845If using NMake:
DRC68fef832010-02-16 05:29:10 +0000846
DRCcc243742010-10-16 09:22:43 +0000847 cd {build_directory}
848 nmake installer
849
DRC81543312010-10-18 07:23:58 +0000850If using MinGW:
DRCcc243742010-10-16 09:22:43 +0000851
852 cd {build_directory}
853 make installer
854
855If using the Visual Studio IDE, build the "installer" project.
856
857The installer package (libjpeg-turbo[-gcc][64].exe) will be located under
858{build_directory}. If building using the Visual Studio IDE, then the installer
859package will be located in a subdirectory with the same name as the
860configuration you built (such as {build_directory}\Debug\ or
861{build_directory}\Release\).
862
863Building a Windows installer requires the Nullsoft Install System
864(http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.
DRC9cd4e4b2012-01-31 07:56:44 +0000865
866
867*******************************************************************************
868** Regression testing
869*******************************************************************************
870
871The most common way to test libjpeg-turbo is by invoking 'make test' on
872Unix/Linux platforms or 'ctest' on Windows platforms, once the build has
873completed. This runs a series of tests to ensure that mathematical
874compatibility has been maintained between libjpeg-turbo and libjpeg v6b. This
875also invokes the TurboJPEG unit tests, which ensure that the colorspace
876extensions, YUV encoding, decompression scaling, and other features of the
877TurboJPEG C and Java APIs are working properly (and, by extension, that the
878equivalent features of the underlying libjpeg API are also working.)
879
880Invoking 'make testclean' or 'nmake testclean' (if using NMake) or building
881the 'testclean' target (if using the Visual Studio IDE) will clean up the
882output images generated by 'make test'.
883
DRC5039d732013-01-21 23:42:12 +0000884On Unix/Linux platforms, more extensive tests of the TurboJPEG C and Java
DRC9cd4e4b2012-01-31 07:56:44 +0000885wrappers can be run by invoking 'make tjtest'. These extended TurboJPEG tests
886essentially iterate through all of the available features of the TurboJPEG APIs
887that are not covered by the TurboJPEG unit tests (this includes the lossless
888transform options) and compare the images generated by each feature to images
889generated using the equivalent feature in the libjpeg API. The extended
890TurboJPEG tests are meant to test for regressions in the TurboJPEG wrappers,
DRC5039d732013-01-21 23:42:12 +0000891not in the underlying libjpeg API library.