blob: 986de22b94474dab2940b8387a45257ce1aa2561 [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
DRC94755ce2011-10-19 05:13:27 +000017-- NASM (if building x86 or x86-64 SIMD extensions)
DRC254937b2011-04-16 13:35:35 +000018 * 0.98, or 2.01 or later is required for a 32-bit build
19 * NASM 2.00 or later is required for a 64-bit build
DRC9026b372011-04-16 13:37:22 +000020 * NASM 2.07 or later is required for a 64-bit build on OS X. This can be
DRC0dedd1a2010-07-02 09:20:12 +000021 obtained from MacPorts (http://www.macports.org/).
DRC68fef832010-02-16 05:29:10 +000022
DRC254937b2011-04-16 13:35:35 +000023 The binary RPMs released by the NASM project do not work on older Linux
24 systems, such as Red Hat Enterprise Linux 4. On such systems, you can
25 easily build and install NASM from a source RPM by downloading one of the
26 SRPMs from
27
28 http://www.nasm.us/pub/nasm/releasebuilds
29
30 and executing the following as root:
DRC68fef832010-02-16 05:29:10 +000031
32 ARCH=`uname -m`
DRC254937b2011-04-16 13:35:35 +000033 rpmbuild --rebuild nasm-{version}.src.rpm
34 rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-{version}.$ARCH.rpm
DRC68fef832010-02-16 05:29:10 +000035
DRC254937b2011-04-16 13:35:35 +000036 NOTE: the NASM build will fail if texinfo is not installed.
DRCc3f4ac02010-02-19 21:51:26 +000037
DRC8f870c22010-02-24 00:30:00 +000038-- GCC v4.1 or later recommended for best performance
DRCf32640e2013-03-23 09:57:03 +000039 * Beginning with Xcode 4, Apple stopped distributing GCC and switched to
DRC08769b32013-03-23 21:35:41 +000040 the LLVM compiler. Xcode v4.0 through v4.6 provides a GCC front end
41 called LLVM-GCC. Unfortunately, as of this writing, neither LLVM-GCC nor
42 the LLVM (clang) compiler produces optimal performance with libjpeg-turbo.
DRCf32640e2013-03-23 09:57:03 +000043 Building libjpeg-turbo with LLVM-GCC v4.2 results in a 10% performance
44 degradation when compressing using 64-bit code, relative to building
45 libjpeg-turbo with GCC v4.2. Building libjpeg-turbo with LLVM (clang)
46 results in a 20% performance degradation when compressing using 64-bit
47 code, relative to building libjpeg-turbo with GCC v4.2. If you are
48 running Snow Leopard or earlier, it is suggested that you continue to use
49 Xcode v3.2.6, which provides GCC v4.2. If you are using Lion or later, it
50 is suggested that you install Apple GCC v4.2 through MacPorts.
DRC68fef832010-02-16 05:29:10 +000051
DRC5039d732013-01-21 23:42:12 +000052-- If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is
DRC279bd342011-04-02 05:17:12 +000053 required. Some systems, such as OS X 10.4, Solaris 10 and later, and Red
54 Hat Enterprise Linux 5 and later, have this pre-installed. On OS X 10.5 and
55 later, it will be necessary to install the Java Developer Package, which can
DRC24f11a72013-09-23 18:38:20 +000056 be downloaded from http://developer.apple.com/downloads (Apple ID required.)
57 For systems that do not have a JDK installed, you can obtain the Oracle Java
58 Development Kit from http://www.java.com.
DRCf8e00552011-02-04 11:06:36 +000059
DRCcc243742010-10-16 09:22:43 +000060
61==================
62Out-of-Tree Builds
63==================
64
65Binary objects, libraries, and executables are generated in the same directory
66from which configure was executed (the "binary directory"), and this directory
67need not necessarily be the same as the libjpeg-turbo source directory. You
68can create multiple independent binary directories, in which different versions
69of libjpeg-turbo can be built from the same source tree using different
70compilers or settings. In the sections below, {build_directory} refers to the
71binary directory, whereas {source_directory} refers to the libjpeg-turbo source
72directory. For in-tree builds, these directories are the same.
73
74
DRC68fef832010-02-16 05:29:10 +000075======================
76Building libjpeg-turbo
77======================
78
DRC5039d732013-01-21 23:42:12 +000079The following procedure will build libjpeg-turbo on Linux, FreeBSD, Cygwin, and
80Solaris/x86 systems (on Solaris, this generates a 32-bit library. See below
81for 64-bit build instructions.)
DRC68fef832010-02-16 05:29:10 +000082
DRCcc243742010-10-16 09:22:43 +000083 cd {source_directory}
DRC68fef832010-02-16 05:29:10 +000084 autoreconf -fiv
DRCcc243742010-10-16 09:22:43 +000085 cd {build_directory}
DRC98dbe912010-11-04 22:22:30 +000086 sh {source_directory}/configure [additional configure flags]
DRC68fef832010-02-16 05:29:10 +000087 make
88
DRCfde862b2013-02-11 03:38:53 +000089NOTE: Running autoreconf in the source directory is usually only necessary if
90building libjpeg-turbo from the SVN repository.
DRC68fef832010-02-16 05:29:10 +000091
92This will generate the following files under .libs/
93
94 libjpeg.a
DRC5039d732013-01-21 23:42:12 +000095 Static link library for the libjpeg API
DRC68fef832010-02-16 05:29:10 +000096
DRC5039d732013-01-21 23:42:12 +000097 libjpeg.so.{version} (Linux, Unix)
DRCcc243742010-10-16 09:22:43 +000098 libjpeg.{version}.dylib (OS X)
DRC81543312010-10-18 07:23:58 +000099 cygjpeg-{version}.dll (Cygwin)
DRC5039d732013-01-21 23:42:12 +0000100 Shared library for the libjpeg API
DRC68fef832010-02-16 05:29:10 +0000101
DRC5039d732013-01-21 23:42:12 +0000102 By default, {version} is 62.1.0, 7.1.0, or 8.0.2, depending on whether
103 libjpeg v6b (default), v7, or v8 emulation is enabled. If using Cygwin,
104 {version} is 62, 7, or 8.
105
106 libjpeg.so (Linux, Unix)
DRC68fef832010-02-16 05:29:10 +0000107 libjpeg.dylib (OS X)
DRC5039d732013-01-21 23:42:12 +0000108 Development symlink for the libjpeg API
109
DRC81543312010-10-18 07:23:58 +0000110 libjpeg.dll.a (Cygwin)
DRC5039d732013-01-21 23:42:12 +0000111 Import library for the libjpeg API
DRC68fef832010-02-16 05:29:10 +0000112
113 libturbojpeg.a
DRC5039d732013-01-21 23:42:12 +0000114 Static link library for the TurboJPEG API
DRC68fef832010-02-16 05:29:10 +0000115
DRC5039d732013-01-21 23:42:12 +0000116 libturbojpeg.so.0.0.0 (Linux, Unix)
117 libturbojpeg.0.0.0.dylib (OS X)
118 cygturbojpeg-0.dll (Cygwin)
119 Shared library for the TurboJPEG API
120
121 libturbojpeg.so (Linux, Unix)
DRC68fef832010-02-16 05:29:10 +0000122 libturbojpeg.dylib (OS X)
DRC5039d732013-01-21 23:42:12 +0000123 Development symlink for the TurboJPEG API
DRC81543312010-10-18 07:23:58 +0000124
125 libturbojpeg.dll.a (Cygwin)
DRC5039d732013-01-21 23:42:12 +0000126 Import library for the TurboJPEG API
DRC81543312010-10-18 07:23:58 +0000127
128
DRC30913542012-01-27 09:53:33 +0000129libjpeg v7 or v8 API/ABI Emulation
130----------------------------------
DRC81543312010-10-18 07:23:58 +0000131
132Add --with-jpeg7 to the configure command line to build a version of
DRC30913542012-01-27 09:53:33 +0000133libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add --with-jpeg8 to
134the configure command to build a version of libjpeg-turbo that is
135API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
136on libjpeg v7 and v8 emulation.
DRC81543312010-10-18 07:23:58 +0000137
DRC68fef832010-02-16 05:29:10 +0000138
DRC5039d732013-01-21 23:42:12 +0000139In-Memory Source/Destination Managers
140-------------------------------------
141
142When using libjpeg v6b or v7 API/ABI emulation, add --without-mem-srcdst to the
143configure command line to build a version of libjpeg-turbo that lacks the
144jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of
145the original libjpeg v6b and v7 APIs, so removing them ensures strict
146conformance with those APIs. See README-turbo.txt for more information.
147
148
DRC245cfdf2010-11-23 17:11:06 +0000149Arithmetic Coding Support
150-------------------------
151
152Since the patent on arithmetic coding has expired, this functionality has been
153included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
DRCf38eee02011-02-18 07:00:38 +0000154based on the implementation in libjpeg v8, but it works when emulating libjpeg
DRC245cfdf2010-11-23 17:11:06 +0000155v7 or v6b as well. The default is to enable both arithmetic encoding and
156decoding, but those who have philosophical objections to arithmetic coding can
157add --without-arith-enc or --without-arith-dec to the configure command line to
158disable encoding or decoding (respectively.)
159
DRC68fef832010-02-16 05:29:10 +0000160
DRC5039d732013-01-21 23:42:12 +0000161TurboJPEG Java Wrapper
162----------------------
DRC88f54a42011-04-01 01:21:22 +0000163Add --with-java to the configure command line to incorporate an optional Java
DRC5039d732013-01-21 23:42:12 +0000164Native Interface wrapper into the TurboJPEG shared library and build the Java
165front-end classes to support it. This allows the TurboJPEG shared library to
166be used directly from Java applications. See java/README for more details.
DRC88f54a42011-04-01 01:21:22 +0000167
168You can set the JAVAC, JAR, and JAVA configure variables to specify
169alternate commands for javac, jar, and java (respectively.) You can also
170set the JAVACFLAGS configure variable to specify arguments that should be
171passed to the Java compiler when building the front-end classes, and JNI_CFLAGS
172to specify arguments that should be passed to the C compiler when building the
173JNI wrapper. Run 'configure --help' for more details.
DRCf8e00552011-02-04 11:06:36 +0000174
175
DRC68fef832010-02-16 05:29:10 +0000176========================
177Installing libjpeg-turbo
178========================
179
180If you intend to install these libraries and the associated header files, then
181replace 'make' in the instructions above with
182
183 make install prefix={base dir} libdir={library directory}
184
185For example,
186
187 make install prefix=/usr/local libdir=/usr/local/lib64
188
189will install the header files in /usr/local/include and the library files in
190/usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default
191is to install the header files in /opt/libjpeg-turbo/include and the library
DRCd7a642b2013-04-24 06:40:25 +0000192files in /opt/libjpeg-turbo/lib32 (32-bit) or /opt/libjpeg-turbo/lib64
193(64-bit.)
DRC68fef832010-02-16 05:29:10 +0000194
195NOTE: You can specify a prefix of /usr and a libdir of, for instance,
196/usr/lib64 to overwrite the system's version of libjpeg. If you do this,
197however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before
198overwriting it. It is recommended that you instead install libjpeg-turbo into
DRC5039d732013-01-21 23:42:12 +0000199a non-system directory and manipulate the LD_LIBRARY_PATH or create symlinks
DRC68fef832010-02-16 05:29:10 +0000200to force applications to use libjpeg-turbo instead of libjpeg. See
201README-turbo.txt for more information.
202
DRCcc243742010-10-16 09:22:43 +0000203
DRC68fef832010-02-16 05:29:10 +0000204=============
205Build Recipes
206=============
207
DRCcc243742010-10-16 09:22:43 +0000208
DRC5039d732013-01-21 23:42:12 +000020932-bit Build on 64-bit Linux
210----------------------------
DRC68fef832010-02-16 05:29:10 +0000211
DRCca5e7d12010-02-17 02:25:06 +0000212Add
DRC68fef832010-02-16 05:29:10 +0000213
DRC2e4d0442011-02-08 01:18:37 +0000214 --host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32
DRC68fef832010-02-16 05:29:10 +0000215
216to the configure command line.
217
218
DRC5039d732013-01-21 23:42:12 +000021964-bit Build on 64-bit OS X
220---------------------------
DRC68fef832010-02-16 05:29:10 +0000221
DRCca5e7d12010-02-17 02:25:06 +0000222Add
DRC68fef832010-02-16 05:29:10 +0000223
DRC0dedd1a2010-07-02 09:20:12 +0000224 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm
DRC68fef832010-02-16 05:29:10 +0000225
DRC7bac07b2010-04-10 05:53:35 +0000226to the configure command line. NASM 2.07 or later from MacPorts must be
227installed.
DRC68fef832010-02-16 05:29:10 +0000228
229
DRC5039d732013-01-21 23:42:12 +000023032-bit Build on 64-bit OS X
231---------------------------
DRC68fef832010-02-16 05:29:10 +0000232
DRCca5e7d12010-02-17 02:25:06 +0000233Add
DRC68fef832010-02-16 05:29:10 +0000234
DRC5950c5d2012-06-28 23:22:03 +0000235 --host i686-apple-darwin CFLAGS='-O3 -m32' LDFLAGS=-m32
DRC68fef832010-02-16 05:29:10 +0000236
237to the configure command line.
238
239
DRC5039d732013-01-21 23:42:12 +000024064-bit Backward-Compatible Build on 64-bit OS X
241-----------------------------------------------
DRC68fef832010-02-16 05:29:10 +0000242
DRCca5e7d12010-02-17 02:25:06 +0000243Add
DRC68fef832010-02-16 05:29:10 +0000244
DRC0dedd1a2010-07-02 09:20:12 +0000245 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
246 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
247 -mmacosx-version-min=10.4 -O3' \
DRC0dedd1a2010-07-02 09:20:12 +0000248 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
249 -mmacosx-version-min=10.4'
250
DRC575c3422010-07-08 07:01:20 +0000251to the configure command line. The OS X 10.4 SDK, and NASM 2.07 or later from
252MacPorts, must be installed.
DRC0dedd1a2010-07-02 09:20:12 +0000253
254
DRC5039d732013-01-21 23:42:12 +000025532-bit Backward-Compatible Build on OS X
256----------------------------------------
DRC0dedd1a2010-07-02 09:20:12 +0000257
258Add
259
DRC5950c5d2012-06-28 23:22:03 +0000260 --host i686-apple-darwin \
261 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
DRC485cd802010-02-23 23:23:42 +0000262 -mmacosx-version-min=10.4 -O3 -m32' \
DRC68fef832010-02-16 05:29:10 +0000263 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
264 -mmacosx-version-min=10.4 -m32'
265
266to the configure command line. The OS X 10.4 SDK must be installed.
267
268
26964-bit Library Build on 64-bit Solaris
270--------------------------------------
271
DRCca5e7d12010-02-17 02:25:06 +0000272Add
DRC68fef832010-02-16 05:29:10 +0000273
DRC2e4d0442011-02-08 01:18:37 +0000274 --host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64
DRC68fef832010-02-16 05:29:10 +0000275
276to the configure command line.
277
278
DRC5039d732013-01-21 23:42:12 +000027932-bit Build on 64-bit FreeBSD
280------------------------------
DRC7bac07b2010-04-10 05:53:35 +0000281
282Add
283
DRC2e4d0442011-02-08 01:18:37 +0000284 --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \
285 LDFLAGS='-B/usr/lib32'
DRC7bac07b2010-04-10 05:53:35 +0000286
287to the configure command line. NASM 2.07 or later from FreeBSD ports must be
288installed.
289
290
DRC0559e942012-03-23 03:12:35 +0000291Oracle Solaris Studio
292---------------------
DRCca5e7d12010-02-17 02:25:06 +0000293
294Add
295
DRC2e4d0442011-02-08 01:18:37 +0000296 CC=cc
DRCca5e7d12010-02-17 02:25:06 +0000297
298to the configure command line. libjpeg-turbo will automatically be built with
DRC2e4d0442011-02-08 01:18:37 +0000299the maximum optimization level (-xO5) unless you override CFLAGS.
DRCca5e7d12010-02-17 02:25:06 +0000300
DRC0559e942012-03-23 03:12:35 +0000301To build a 64-bit version of libjpeg-turbo using Oracle Solaris Studio, add
DRCca5e7d12010-02-17 02:25:06 +0000302
DRC2e4d0442011-02-08 01:18:37 +0000303 --host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64
DRCca5e7d12010-02-17 02:25:06 +0000304
305to the configure command line.
306
DRC8b014d72010-02-18 13:03:41 +0000307
DRC81543312010-10-18 07:23:58 +0000308MinGW Build on Cygwin
309---------------------
310
311Use CMake (see recipes below)
312
313
DRC94755ce2011-10-19 05:13:27 +0000314===========
315ARM Support
316===========
317
318This release of libjpeg-turbo can use ARM NEON SIMD instructions to accelerate
319JPEG compression/decompression by approximately 2-4x on ARMv7 and later
320platforms. If libjpeg-turbo is configured on an ARM Linux platform, then the
321build system will automatically include the NEON SIMD routines, if they are
DRC393bac62014-05-06 21:59:31 +0000322supported. Build instructions for other ARM-based platforms follow.
DRC94755ce2011-10-19 05:13:27 +0000323
324
325Building libjpeg-turbo for iOS
326------------------------------
327
DRC425c5a52014-05-06 20:56:01 +0000328iOS platforms, such as the iPhone and iPad, use ARM processors, some of which
329support NEON instructions. Additional steps are required in order to build
330libjpeg-turbo for these platforms.
DRC94755ce2011-10-19 05:13:27 +0000331
332Additional build requirements:
333
DRC8d55c882014-01-29 19:32:23 +0000334 gas-preprocessor.pl
335 (https://sourceforge.net/p/libjpeg-turbo/code/HEAD/tree/gas-preprocessor)
336 should be installed in your PATH.
DRC94755ce2011-10-19 05:13:27 +0000337
338Set the following shell variables for simplicity:
339
DRC26c66062014-03-27 03:36:04 +0000340 Xcode 4.2 and earlier:
DRC8d55c882014-01-29 19:32:23 +0000341 IOS_PLATFORMDIR=/Developer/Platforms/iPhoneOS.platform
DRC26c66062014-03-27 03:36:04 +0000342 Xcode 4.3 and later:
DRC8d55c882014-01-29 19:32:23 +0000343 IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
DRC8d55c882014-01-29 19:32:23 +0000344
DRC26c66062014-03-27 03:36:04 +0000345 IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk
DRC8d55c882014-01-29 19:32:23 +0000346
DRC26c66062014-03-27 03:36:04 +0000347 Xcode 4.6.x and earlier:
348 IOS_GCC=$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
349 Xcode 5.0.x and later:
350 IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
351
352 Xcode 5.1.x / iOS 7.0 SDK:
DRC8d55c882014-01-29 19:32:23 +0000353 IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
DRC26c66062014-03-27 03:36:04 +0000354 IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS7.1.sdk
DRC8d55c882014-01-29 19:32:23 +0000355 IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
DRCa2a2cd62013-02-04 22:29:57 +0000356
DRC94755ce2011-10-19 05:13:27 +0000357 ARM v6 only (up to and including iPhone 3G):
DRCa2a2cd62013-02-04 22:29:57 +0000358 [NOTE: Requires Xcode 4.4.x or earlier]
DRC94755ce2011-10-19 05:13:27 +0000359 IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp"
360
DRC5039d732013-01-21 23:42:12 +0000361 ARM v7 only (iPhone 3GS-4S, iPad 1st-3rd Generation):
DRC26c66062014-03-27 03:36:04 +0000362 Xcode 4.6.x and earlier:
DRC94755ce2011-10-19 05:13:27 +0000363 IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon"
DRC26c66062014-03-27 03:36:04 +0000364 Xcode 5.0.x and later:
365 IOS_CFLAGS="-arch armv7"
DRC94755ce2011-10-19 05:13:27 +0000366
DRCa2a2cd62013-02-04 22:29:57 +0000367 ARM v7s only (iPhone 5, iPad 4th Generation):
368 [NOTE: Requires Xcode 4.5 or later]
DRC26c66062014-03-27 03:36:04 +0000369 Xcode 4.6.x and earlier:
DRCa2a2cd62013-02-04 22:29:57 +0000370 IOS_CFLAGS="-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon"
DRC26c66062014-03-27 03:36:04 +0000371 Xcode 5.0.x and later:
372 IOS_CFLAGS="-arch armv7s"
DRCa2a2cd62013-02-04 22:29:57 +0000373
DRC94755ce2011-10-19 05:13:27 +0000374Follow the procedure under "Building libjpeg-turbo" above, adding
375
DRC89c59dd2011-10-27 20:40:21 +0000376 --host arm-apple-darwin10 --enable-static --disable-shared \
DRC94755ce2011-10-19 05:13:27 +0000377 CC="$IOS_GCC" LD="$IOS_GCC" \
378 CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \
379 LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS"
380
DRC26c66062014-03-27 03:36:04 +0000381to the configure command line. If using Xcode 5.0.x or later, also add
382
383 CCASFLAGS="-no-integrated-as $IOS_CFLAGS"
384
DRC94755ce2011-10-19 05:13:27 +0000385to the configure command line.
386
DRC26c66062014-03-27 03:36:04 +0000387NOTE: You can also add -miphoneos-version-min={version} to $IOS_CFLAGS above
388in order to support older versions of iOS than the default version supported by
389the SDK.
390
DRCa2a2cd62013-02-04 22:29:57 +0000391Once built, lipo can be used to combine the ARM v6, v7, and/or v7s variants
392into a universal library.
DRC5039d732013-01-21 23:42:12 +0000393
DRCfde862b2013-02-11 03:38:53 +0000394NOTE: If you are building libjpeg-turbo from the "official" project tarball,
395then it is highly likely that you will need to run 'autoreconf -fiv' in the
396source tree prior to building ARM v7 or v7s iOS binaries using the techniques
397described above. Otherwise, you may get a libtool error such as "unable to
398infer tagged configuration."
399
DRC81543312010-10-18 07:23:58 +0000400
DRC393bac62014-05-06 21:59:31 +0000401Building libjpeg-turbo for Android
402----------------------------------
403
404Building libjpeg-turbo for Android platforms requires the Android NDK
405(https://developer.android.com/tools/sdk/ndk) and autotools. The following is
406a general recipe script that can be modified for your specific needs.
407
408 # Set these variables to suit your needs
409 NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/ndk}
410 BUILD_PLATFORM={the platform name for the NDK package you installed--
411 for example, "windows-x86" or "linux-x86_64"}
412 TOOLCHAIN_VERSION={"4.6", "4.8", etc. This corresponds to a toolchain
413 directory under ${NDK_PATH}/toolchains/.}
414 ANDROID_VERSION={The minimum version of Android to support-- for example,
415 "9", "19", etc.}
416
417 HOST=arm-linux-androideabi
418 TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
419 SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm
420 ANDROID_INCLUDES="-I${SYSROOT}/usr/include -I${TOOLCHAIN}/include"
421 ANDROID_CFLAGS="-march=armv7-a -mfloat-abi=softfp -fprefetch-loop-arrays \
422 -fstrict-aliasing --sysroot=${SYSROOT}"
423 export CPP=${TOOLCHAIN}/bin/${HOST}-cpp
424 export AR=${TOOLCHAIN}/bin/${HOST}-ar
425 export AS=${TOOLCHAIN}/bin/${HOST}-as
426 export NM=${TOOLCHAIN}/bin/${HOST}-nm
427 export CC=${TOOLCHAIN}/bin/${HOST}-gcc
428 export LD=${TOOLCHAIN}/bin/${HOST}-ld
429 export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib
430 export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump
431 export STRIP=${TOOLCHAIN}/bin/${HOST}-strip
432 cd {build_directory}
433 sh {source_directory}/configure --host=${HOST} \
434 CFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS} -O3" \
435 CPPFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS}" \
436 LDFLAGS="${ANDROID_CFLAGS}" --with-simd ${1+"$@"}
437 make
438
439
DRC68fef832010-02-16 05:29:10 +0000440*******************************************************************************
DRC81543312010-10-18 07:23:58 +0000441** Building on Windows (Visual C++ or MinGW)
DRC68fef832010-02-16 05:29:10 +0000442*******************************************************************************
443
DRCcc243742010-10-16 09:22:43 +0000444
DRC68fef832010-02-16 05:29:10 +0000445==================
446Build Requirements
447==================
448
DRC4d2ff7d2014-04-18 02:46:59 +0000449-- CMake (http://www.cmake.org) v2.8.8 or later
DRC68fef832010-02-16 05:29:10 +0000450
DRCcc243742010-10-16 09:22:43 +0000451-- Microsoft Visual C++ 2005 or later
DRC68fef832010-02-16 05:29:10 +0000452
DRCcc243742010-10-16 09:22:43 +0000453 If you don't already have Visual C++, then the easiest way to get it is by
454 installing the Windows SDK:
DRC68fef832010-02-16 05:29:10 +0000455
DRCcc243742010-10-16 09:22:43 +0000456 http://msdn.microsoft.com/en-us/windows/bb980924.aspx
457
458 The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
459 everything necessary to build libjpeg-turbo.
460
DRC4d2ff7d2014-04-18 02:46:59 +0000461 * You can also use Microsoft Visual Studio Express Edition, which is a free
462 download. (NOTE: versions prior to 2012 can only be used to build 32-bit
463 code.)
DRCcc243742010-10-16 09:22:43 +0000464 * If you intend to build libjpeg-turbo from the command line, then add the
465 appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH
466 environment variables. This is generally accomplished by executing
467 vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and
468 vcvars64.bat are part of Visual C++ and are located in the same directory
469 as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass
470 optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build
471 environment.
472
473... OR ...
474
DRC81543312010-10-18 07:23:58 +0000475-- MinGW
DRCcc243742010-10-16 09:22:43 +0000476
DRC4d2ff7d2014-04-18 02:46:59 +0000477 MinGW-builds (http://sourceforge.net/projects/mingwbuilds/) or
478 tdm-gcc (http://tdm-gcc.tdragon.net/) recommended if building on a Windows
479 machine. Both distributions install a Start Menu link that can be used to
480 launch a command prompt with the appropriate compiler paths automatically
481 set.
DRC68fef832010-02-16 05:29:10 +0000482
DRC377add72010-05-17 16:41:12 +0000483-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
484 a 64-bit build)
DRC68fef832010-02-16 05:29:10 +0000485
DRC5039d732013-01-21 23:42:12 +0000486-- If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This
487 can be downloaded from http://www.java.com.
DRC218c0c12011-02-05 06:01:18 +0000488
DRCcc243742010-10-16 09:22:43 +0000489
490==================
491Out-of-Tree Builds
492==================
493
494Binary objects, libraries, and executables are generated in the same directory
495from which cmake was executed (the "binary directory"), and this directory need
496not necessarily be the same as the libjpeg-turbo source directory. You can
497create multiple independent binary directories, in which different versions of
498libjpeg-turbo can be built from the same source tree using different compilers
499or settings. In the sections below, {build_directory} refers to the binary
500directory, whereas {source_directory} refers to the libjpeg-turbo source
501directory. For in-tree builds, these directories are the same.
502
503
DRC68fef832010-02-16 05:29:10 +0000504======================
505Building libjpeg-turbo
506======================
507
DRC68fef832010-02-16 05:29:10 +0000508
DRCcc243742010-10-16 09:22:43 +0000509Visual C++ (Command Line)
510-------------------------
DRC68fef832010-02-16 05:29:10 +0000511
DRCcc243742010-10-16 09:22:43 +0000512 cd {build_directory}
513 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory}
514 nmake
DRC68fef832010-02-16 05:29:10 +0000515
DRCcc243742010-10-16 09:22:43 +0000516This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending
517on which version of cl.exe is in the PATH.
DRC8b014d72010-02-18 13:03:41 +0000518
DRCcc243742010-10-16 09:22:43 +0000519The following files will be generated under {build_directory}:
520
521 jpeg-static.lib
DRC5039d732013-01-21 23:42:12 +0000522 Static link library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000523 sharedlib/jpeg{version}.dll
DRC5039d732013-01-21 23:42:12 +0000524 DLL for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000525 sharedlib/jpeg.lib
DRC5039d732013-01-21 23:42:12 +0000526 Import library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000527 turbojpeg-static.lib
DRC5039d732013-01-21 23:42:12 +0000528 Static link library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000529 turbojpeg.dll
DRC5039d732013-01-21 23:42:12 +0000530 DLL for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000531 turbojpeg.lib
DRC5039d732013-01-21 23:42:12 +0000532 Import library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000533
534{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
DRCf38eee02011-02-18 07:00:38 +0000535v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000536
537
538Visual C++ (IDE)
539----------------
540
541Choose the appropriate CMake generator option for your version of Visual Studio
542(run "cmake" with no arguments for a list of available generators.) For
543instance:
544
545 cd {build_directory}
DRC4d2ff7d2014-04-18 02:46:59 +0000546 cmake -G "Visual Studio 10" {source_directory}
DRCcc243742010-10-16 09:22:43 +0000547
DRC425c5a52014-05-06 20:56:01 +0000548NOTE: Add "Win64" to the generator name (for example, "Visual Studio 10
549Win64") to build a 64-bit version of libjpeg-turbo. Recent versions of CMake
550no longer document that. A separate build directory must be used for 32-bit
551and 64-bit builds.
DRCd0c9f0c2014-04-18 07:50:17 +0000552
DRCcc243742010-10-16 09:22:43 +0000553You can then open ALL_BUILD.vcproj in Visual Studio and build one of the
554configurations in that project ("Debug", "Release", etc.) to generate a full
555build of libjpeg-turbo.
556
557This will generate the following files under {build_directory}:
558
559 {configuration}/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/{configuration}/jpeg{version}.dll
DRC5039d732013-01-21 23:42:12 +0000562 DLL for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000563 sharedlib/{configuration}/jpeg.lib
DRC5039d732013-01-21 23:42:12 +0000564 Import library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000565 {configuration}/turbojpeg-static.lib
DRC5039d732013-01-21 23:42:12 +0000566 Static link library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000567 {configuration}/turbojpeg.dll
DRC5039d732013-01-21 23:42:12 +0000568 DLL for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000569 {configuration}/turbojpeg.lib
DRC5039d732013-01-21 23:42:12 +0000570 Import library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000571
572{configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on
573the configuration you built in the IDE, and {version} is 62, 7, or 8,
DRCf38eee02011-02-18 07:00:38 +0000574depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000575
576
577MinGW
578-----
579
DRC4d2ff7d2014-04-18 02:46:59 +0000580NOTE: This assumes that you are building on a Windows machine. If you are
581cross-compiling on a Linux/Unix machine, then see "Build Recipes" below.
582
DRCcc243742010-10-16 09:22:43 +0000583 cd {build_directory}
DRC4d2ff7d2014-04-18 02:46:59 +0000584 cmake -G "MinGW Makefiles" {source_directory}
585 mingw32-make
DRCcc243742010-10-16 09:22:43 +0000586
587This will generate the following files under {build_directory}
588
589 libjpeg.a
DRC5039d732013-01-21 23:42:12 +0000590 Static link library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000591 sharedlib/libjpeg-{version}.dll
DRC5039d732013-01-21 23:42:12 +0000592 DLL for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000593 sharedlib/libjpeg.dll.a
DRC5039d732013-01-21 23:42:12 +0000594 Import library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000595 libturbojpeg.a
DRC5039d732013-01-21 23:42:12 +0000596 Static link library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000597 libturbojpeg.dll
DRC5039d732013-01-21 23:42:12 +0000598 DLL for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000599 libturbojpeg.dll.a
DRC5039d732013-01-21 23:42:12 +0000600 Import library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000601
602{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
DRCf38eee02011-02-18 07:00:38 +0000603v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000604
605
DRCcc243742010-10-16 09:22:43 +0000606Debug Build
607-----------
608
609Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with
610NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
611NMake.)
612
613
DRC30913542012-01-27 09:53:33 +0000614libjpeg v7 or v8 API/ABI Emulation
615-----------------------------------
DRCcc243742010-10-16 09:22:43 +0000616
617Add "-DWITH_JPEG7=1" to the cmake command line to build a version of
DRC30913542012-01-27 09:53:33 +0000618libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add "-DWITH_JPEG8=1"
619to the cmake command to build a version of libjpeg-turbo that is
620API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
621on libjpeg v7 and v8 emulation.
DRCcc243742010-10-16 09:22:43 +0000622
623
DRC5039d732013-01-21 23:42:12 +0000624In-Memory Source/Destination Managers
625-------------------------------------
626
627When using libjpeg v6b or v7 API/ABI emulation, add -DWITH_MEM_SRCDST=0 to the
628CMake command line to build a version of libjpeg-turbo that lacks the
629jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of
630the original libjpeg v6b and v7 APIs, so removing them ensures strict
631conformance with those APIs. See README-turbo.txt for more information.
632
633
DRC245cfdf2010-11-23 17:11:06 +0000634Arithmetic Coding Support
635-------------------------
636
637Since the patent on arithmetic coding has expired, this functionality has been
638included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
DRCf38eee02011-02-18 07:00:38 +0000639based on the implementation in libjpeg v8, but it works when emulating libjpeg
DRC245cfdf2010-11-23 17:11:06 +0000640v7 or v6b as well. The default is to enable both arithmetic encoding and
641decoding, but those who have philosophical objections to arithmetic coding can
642add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to
643disable encoding or decoding (respectively.)
644
645
DRC5039d732013-01-21 23:42:12 +0000646TurboJPEG Java Wrapper
647----------------------
DRC279bd342011-04-02 05:17:12 +0000648Add "-DWITH_JAVA=1" to the cmake command line to incorporate an optional Java
DRC5039d732013-01-21 23:42:12 +0000649Native Interface wrapper into the TurboJPEG shared library and build the Java
650front-end classes to support it. This allows the TurboJPEG shared library to
651be used directly from Java applications. See java/README for more details.
DRC218c0c12011-02-05 06:01:18 +0000652
DRCdb425062011-04-03 06:10:18 +0000653If you are using CMake 2.8, you can set the Java_JAVAC_EXECUTABLE,
654Java_JAVA_EXECUTABLE, and Java_JAR_EXECUTABLE CMake variables to specify
655alternate commands or locations for javac, jar, and java (respectively.) If
656you are using CMake 2.6, set JAVA_COMPILE, JAVA_RUNTIME, and JAVA_ARCHIVE
657instead. You can also set the JAVACFLAGS CMake variable to specify arguments
658that should be passed to the Java compiler when building the front-end classes.
659
DRC218c0c12011-02-05 06:01:18 +0000660
DRC26658432010-10-16 22:04:29 +0000661========================
662Installing libjpeg-turbo
663========================
664
665You can use the build system to install libjpeg-turbo into a directory of your
666choosing (as opposed to creating an installer.) To do this, add:
667
668 -DCMAKE_INSTALL_PREFIX={install_directory}
669
670to the cmake command line.
671
672For example,
673
DRC81543312010-10-18 07:23:58 +0000674 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \
DRC26658432010-10-16 22:04:29 +0000675 -DCMAKE_INSTALL_PREFIX=c:\libjpeg-turbo {source_directory}
676 nmake install
677
678will install the header files in c:\libjpeg-turbo\include, the library files
679in c:\libjpeg-turbo\lib, the DLL's in c:\libjpeg-turbo\bin, and the
680documentation in c:\libjpeg-turbo\doc.
681
682
DRCcc243742010-10-16 09:22:43 +0000683=============
684Build Recipes
685=============
686
687
DRC1c73ce82010-10-16 21:02:54 +000068864-bit MinGW Build on Cygwin
689----------------------------
690
691 cd {build_directory}
DRC2e4d0442011-02-08 01:18:37 +0000692 CC=/usr/bin/x86_64-w64-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000693 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
DRC4d2ff7d2014-04-18 02:46:59 +0000694 -DCMAKE_RC_COMPILER=/usr/bin/x86_64-w64-mingw32-windres.exe \
695 {source_directory}
DRC1c73ce82010-10-16 21:02:54 +0000696 make
697
698This produces a 64-bit build of libjpeg-turbo that does not depend on
699cygwin1.dll or other Cygwin DLL's. The mingw64-x86_64-gcc-core and
700mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed.
701
702
70332-bit MinGW Build on Cygwin
704----------------------------
705
706 cd {build_directory}
DRC2e4d0442011-02-08 01:18:37 +0000707 CC=/usr/bin/i686-w64-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000708 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
DRC4d2ff7d2014-04-18 02:46:59 +0000709 -DCMAKE_RC_COMPILER=/usr/bin/i686-w64-mingw32-windres.exe \
710 {source_directory}
DRC1c73ce82010-10-16 21:02:54 +0000711 make
712
713This produces a 32-bit build of libjpeg-turbo that does not depend on
714cygwin1.dll or other Cygwin DLL's. The mingw64-i686-gcc-core and
715mingw64-i686-gcc-g++ packages (and their dependencies) must be installed.
716
717
DRCcc243742010-10-16 09:22:43 +0000718MinGW Build on Linux
719--------------------
720
721 cd {build_directory}
722 CC={mingw_binary_path}/i386-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000723 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
724 -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
DRCcc243742010-10-16 09:22:43 +0000725 -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
DRC68bf3f22010-10-18 07:56:14 +0000726 {source_directory}
DRCcc243742010-10-16 09:22:43 +0000727 make
DRC8b014d72010-02-18 13:03:41 +0000728
DRC68fef832010-02-16 05:29:10 +0000729
730*******************************************************************************
731** Creating Release Packages
732*******************************************************************************
733
734The following commands can be used to create various types of release packages:
735
DRCcc243742010-10-16 09:22:43 +0000736
DRCd7a642b2013-04-24 06:40:25 +0000737Unix/Linux
738----------
DRCcc243742010-10-16 09:22:43 +0000739
DRC68fef832010-02-16 05:29:10 +0000740make rpm
741
DRCcc243742010-10-16 09:22:43 +0000742 Create Red Hat-style binary RPM package. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000743
744make srpm
745
746 This runs 'make dist' to create a pristine source tarball, then creates a
DRCcc243742010-10-16 09:22:43 +0000747 Red Hat-style source RPM package from the tarball. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000748
749make deb
750
751 Create Debian-style binary package. Requires dpkg.
752
753make dmg
754
755 Create Macintosh package/disk image. This requires the PackageMaker
756 application, which must be installed in /Developer/Applications/Utilities.
DRC7ed0aeb2013-02-24 20:39:30 +0000757 Note that PackageMaker is not included in recent releases of Xcode, but it
758 can be obtained by downloading the "Auxiliary Tools for Xcode" package from
759 http://developer.apple.com/downloads.
DRC68fef832010-02-16 05:29:10 +0000760
DRC9ef93db2010-10-18 08:24:42 +0000761make udmg [BUILDDIR32={32-bit build directory}]
DRC68fef832010-02-16 05:29:10 +0000762
DRC20b734e2012-02-10 01:30:37 +0000763 On 64-bit OS X systems, this creates a Macintosh package and disk image that
764 contains universal i386/x86-64 binaries. You should first configure a 32-bit
765 out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree
766 build, then run 'make udmg' from the 64-bit build directory. The build
767 system will look for the 32-bit build under {source_directory}/osxx86 by
768 default, but you can override this by setting the BUILDDIR32 variable on the
769 make command line as shown above.
770
771make iosdmg [BUILDDIR32={32-bit build directory}] \
772 [BUILDDIRARMV6={ARM v6 build directory}] \
773 [BUILDDIRARMV7={ARM v7 build directory}] \
DRCa2a2cd62013-02-04 22:29:57 +0000774 [BUILDDIRARMV7S={ARM v7s build directory}]
DRC20b734e2012-02-10 01:30:37 +0000775
776 On OS X systems, this creates a Macintosh package and disk image in which the
777 libjpeg-turbo static libraries contain ARM architectures necessary to build
778 iOS applications. If building on an x86-64 system, the binaries will also
779 contain the i386 architecture, as with 'make udmg' above. You should first
DRCa2a2cd62013-02-04 22:29:57 +0000780 configure ARM v6, ARM v7, and/or ARM v7s out-of-tree builds of libjpeg-turbo
781 (see "Building libjpeg-turbo for iOS" above.) If you are building an x86-64
DRC20b734e2012-02-10 01:30:37 +0000782 version of libjpeg-turbo, you should configure a 32-bit out-of-tree build as
783 well. Next, build libjpeg-turbo as you would normally, using an out-of-tree
784 build. When it is built, run 'make iosdmg' from the build directory. The
785 build system will look for the ARM v6 build under {source_directory}/iosarmv6
786 by default, the ARM v7 build under {source_directory}/iosarmv7 by default,
DRCa2a2cd62013-02-04 22:29:57 +0000787 the ARM v7s build under {source_directory}/iosarmv7s by default, and (if
788 applicable) the 32-bit build under {source_directory}/osxx86 by default, but
789 you can override this by setting the BUILDDIR32, BUILDDIRARMV6,
790 BUILDDIRARMV7, and/or BUILDDIRARMV7S variables on the make command line as
791 shown above.
DRC68fef832010-02-16 05:29:10 +0000792
DRC81543312010-10-18 07:23:58 +0000793make cygwinpkg
794
795 Build a Cygwin binary package.
796
DRC0a1f68e2010-02-24 07:24:26 +0000797
DRCcc243742010-10-16 09:22:43 +0000798Windows
799-------
DRC0a1f68e2010-02-24 07:24:26 +0000800
DRCcc243742010-10-16 09:22:43 +0000801If using NMake:
DRC68fef832010-02-16 05:29:10 +0000802
DRCcc243742010-10-16 09:22:43 +0000803 cd {build_directory}
804 nmake installer
805
DRC81543312010-10-18 07:23:58 +0000806If using MinGW:
DRCcc243742010-10-16 09:22:43 +0000807
808 cd {build_directory}
809 make installer
810
811If using the Visual Studio IDE, build the "installer" project.
812
813The installer package (libjpeg-turbo[-gcc][64].exe) will be located under
814{build_directory}. If building using the Visual Studio IDE, then the installer
815package will be located in a subdirectory with the same name as the
816configuration you built (such as {build_directory}\Debug\ or
817{build_directory}\Release\).
818
819Building a Windows installer requires the Nullsoft Install System
820(http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.
DRC9cd4e4b2012-01-31 07:56:44 +0000821
822
823*******************************************************************************
824** Regression testing
825*******************************************************************************
826
827The most common way to test libjpeg-turbo is by invoking 'make test' on
828Unix/Linux platforms or 'ctest' on Windows platforms, once the build has
829completed. This runs a series of tests to ensure that mathematical
830compatibility has been maintained between libjpeg-turbo and libjpeg v6b. This
831also invokes the TurboJPEG unit tests, which ensure that the colorspace
832extensions, YUV encoding, decompression scaling, and other features of the
833TurboJPEG C and Java APIs are working properly (and, by extension, that the
834equivalent features of the underlying libjpeg API are also working.)
835
836Invoking 'make testclean' or 'nmake testclean' (if using NMake) or building
837the 'testclean' target (if using the Visual Studio IDE) will clean up the
838output images generated by 'make test'.
839
DRC5039d732013-01-21 23:42:12 +0000840On Unix/Linux platforms, more extensive tests of the TurboJPEG C and Java
DRC9cd4e4b2012-01-31 07:56:44 +0000841wrappers can be run by invoking 'make tjtest'. These extended TurboJPEG tests
842essentially iterate through all of the available features of the TurboJPEG APIs
843that are not covered by the TurboJPEG unit tests (this includes the lossless
844transform options) and compare the images generated by each feature to images
845generated using the equivalent feature in the libjpeg API. The extended
846TurboJPEG tests are meant to test for regressions in the TurboJPEG wrappers,
DRC5039d732013-01-21 23:42:12 +0000847not in the underlying libjpeg API library.