blob: 169a1be566420d5b23953ceb3c35c984cf9cb8b4 [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
53 is suggested that you install Apple GCC v4.2 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
DRC279bd342011-04-02 05:17:12 +000056 required. Some systems, such as OS X 10.4, Solaris 10 and later, and Red
57 Hat Enterprise Linux 5 and later, have this pre-installed. On OS X 10.5 and
58 later, it will be necessary to install the Java Developer Package, which can
DRC24f11a72013-09-23 18:38:20 +000059 be downloaded from http://developer.apple.com/downloads (Apple ID required.)
60 For systems that do not have a JDK installed, you can obtain the Oracle Java
61 Development 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
DRCfde862b2013-02-11 03:38:53 +000092NOTE: Running autoreconf in the source directory is usually only necessary if
93building libjpeg-turbo from the SVN repository.
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
DRC5039d732013-01-21 23:42:12 +0000119 libturbojpeg.so.0.0.0 (Linux, Unix)
120 libturbojpeg.0.0.0.dylib (OS X)
121 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 \
249 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
250 -mmacosx-version-min=10.4 -O3' \
DRC0dedd1a2010-07-02 09:20:12 +0000251 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
252 -mmacosx-version-min=10.4'
253
DRC575c3422010-07-08 07:01:20 +0000254to the configure command line. The OS X 10.4 SDK, and NASM 2.07 or later from
255MacPorts, 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 \
264 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
DRC485cd802010-02-23 23:23:42 +0000265 -mmacosx-version-min=10.4 -O3 -m32' \
DRC68fef832010-02-16 05:29:10 +0000266 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
267 -mmacosx-version-min=10.4 -m32'
268
269to the configure command line. The OS X 10.4 SDK must be installed.
270
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
DRC393bac62014-05-06 21:59:31 +0000325supported. Build instructions for other ARM-based platforms follow.
DRC94755ce2011-10-19 05:13:27 +0000326
327
328Building libjpeg-turbo for iOS
329------------------------------
330
DRC425c5a52014-05-06 20:56:01 +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
338 (https://sourceforge.net/p/libjpeg-turbo/code/HEAD/tree/gas-preprocessor)
339 should be installed in your PATH.
DRC94755ce2011-10-19 05:13:27 +0000340
341Set the following shell variables for simplicity:
342
DRC26c66062014-03-27 03:36:04 +0000343 Xcode 4.2 and earlier:
DRC8d55c882014-01-29 19:32:23 +0000344 IOS_PLATFORMDIR=/Developer/Platforms/iPhoneOS.platform
DRC26c66062014-03-27 03:36:04 +0000345 Xcode 4.3 and later:
DRC8d55c882014-01-29 19:32:23 +0000346 IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
DRC8d55c882014-01-29 19:32:23 +0000347
DRC26c66062014-03-27 03:36:04 +0000348 IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk
DRC8d55c882014-01-29 19:32:23 +0000349
DRC26c66062014-03-27 03:36:04 +0000350 Xcode 4.6.x and earlier:
351 IOS_GCC=$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
352 Xcode 5.0.x and later:
353 IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
354
355 Xcode 5.1.x / iOS 7.0 SDK:
DRC8d55c882014-01-29 19:32:23 +0000356 IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
DRC26c66062014-03-27 03:36:04 +0000357 IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS7.1.sdk
DRC8d55c882014-01-29 19:32:23 +0000358 IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
DRCa2a2cd62013-02-04 22:29:57 +0000359
DRC94755ce2011-10-19 05:13:27 +0000360 ARM v6 only (up to and including iPhone 3G):
DRCa2a2cd62013-02-04 22:29:57 +0000361 [NOTE: Requires Xcode 4.4.x or earlier]
DRC94755ce2011-10-19 05:13:27 +0000362 IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp"
363
DRC5039d732013-01-21 23:42:12 +0000364 ARM v7 only (iPhone 3GS-4S, iPad 1st-3rd Generation):
DRC26c66062014-03-27 03:36:04 +0000365 Xcode 4.6.x and earlier:
DRC94755ce2011-10-19 05:13:27 +0000366 IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon"
DRC26c66062014-03-27 03:36:04 +0000367 Xcode 5.0.x and later:
368 IOS_CFLAGS="-arch armv7"
DRC94755ce2011-10-19 05:13:27 +0000369
DRCa2a2cd62013-02-04 22:29:57 +0000370 ARM v7s only (iPhone 5, iPad 4th Generation):
371 [NOTE: Requires Xcode 4.5 or later]
DRC26c66062014-03-27 03:36:04 +0000372 Xcode 4.6.x and earlier:
DRCa2a2cd62013-02-04 22:29:57 +0000373 IOS_CFLAGS="-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon"
DRC26c66062014-03-27 03:36:04 +0000374 Xcode 5.0.x and later:
375 IOS_CFLAGS="-arch armv7s"
DRCa2a2cd62013-02-04 22:29:57 +0000376
DRC94755ce2011-10-19 05:13:27 +0000377Follow the procedure under "Building libjpeg-turbo" above, adding
378
DRC89c59dd2011-10-27 20:40:21 +0000379 --host arm-apple-darwin10 --enable-static --disable-shared \
DRC94755ce2011-10-19 05:13:27 +0000380 CC="$IOS_GCC" LD="$IOS_GCC" \
381 CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \
382 LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS"
383
DRC26c66062014-03-27 03:36:04 +0000384to the configure command line. If using Xcode 5.0.x or later, also add
385
386 CCASFLAGS="-no-integrated-as $IOS_CFLAGS"
387
DRC94755ce2011-10-19 05:13:27 +0000388to the configure command line.
389
DRC26c66062014-03-27 03:36:04 +0000390NOTE: You can also add -miphoneos-version-min={version} to $IOS_CFLAGS above
391in order to support older versions of iOS than the default version supported by
392the SDK.
393
DRCa2a2cd62013-02-04 22:29:57 +0000394Once built, lipo can be used to combine the ARM v6, v7, and/or v7s variants
395into a universal library.
DRC5039d732013-01-21 23:42:12 +0000396
DRCfde862b2013-02-11 03:38:53 +0000397NOTE: If you are building libjpeg-turbo from the "official" project tarball,
398then it is highly likely that you will need to run 'autoreconf -fiv' in the
399source tree prior to building ARM v7 or v7s iOS binaries using the techniques
400described above. Otherwise, you may get a libtool error such as "unable to
401infer tagged configuration."
402
DRC81543312010-10-18 07:23:58 +0000403
DRC393bac62014-05-06 21:59:31 +0000404Building libjpeg-turbo for Android
405----------------------------------
406
407Building libjpeg-turbo for Android platforms requires the Android NDK
408(https://developer.android.com/tools/sdk/ndk) and autotools. The following is
409a general recipe script that can be modified for your specific needs.
410
411 # Set these variables to suit your needs
412 NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/ndk}
413 BUILD_PLATFORM={the platform name for the NDK package you installed--
414 for example, "windows-x86" or "linux-x86_64"}
415 TOOLCHAIN_VERSION={"4.6", "4.8", etc. This corresponds to a toolchain
416 directory under ${NDK_PATH}/toolchains/.}
417 ANDROID_VERSION={The minimum version of Android to support-- for example,
418 "9", "19", etc.}
419
420 HOST=arm-linux-androideabi
421 TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
422 SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm
423 ANDROID_INCLUDES="-I${SYSROOT}/usr/include -I${TOOLCHAIN}/include"
424 ANDROID_CFLAGS="-march=armv7-a -mfloat-abi=softfp -fprefetch-loop-arrays \
425 -fstrict-aliasing --sysroot=${SYSROOT}"
426 export CPP=${TOOLCHAIN}/bin/${HOST}-cpp
427 export AR=${TOOLCHAIN}/bin/${HOST}-ar
428 export AS=${TOOLCHAIN}/bin/${HOST}-as
429 export NM=${TOOLCHAIN}/bin/${HOST}-nm
430 export CC=${TOOLCHAIN}/bin/${HOST}-gcc
431 export LD=${TOOLCHAIN}/bin/${HOST}-ld
432 export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib
433 export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump
434 export STRIP=${TOOLCHAIN}/bin/${HOST}-strip
435 cd {build_directory}
436 sh {source_directory}/configure --host=${HOST} \
437 CFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS} -O3" \
438 CPPFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS}" \
439 LDFLAGS="${ANDROID_CFLAGS}" --with-simd ${1+"$@"}
440 make
441
442
DRC68fef832010-02-16 05:29:10 +0000443*******************************************************************************
DRC81543312010-10-18 07:23:58 +0000444** Building on Windows (Visual C++ or MinGW)
DRC68fef832010-02-16 05:29:10 +0000445*******************************************************************************
446
DRCcc243742010-10-16 09:22:43 +0000447
DRC68fef832010-02-16 05:29:10 +0000448==================
449Build Requirements
450==================
451
DRC4d2ff7d2014-04-18 02:46:59 +0000452-- CMake (http://www.cmake.org) v2.8.8 or later
DRC68fef832010-02-16 05:29:10 +0000453
DRCcc243742010-10-16 09:22:43 +0000454-- Microsoft Visual C++ 2005 or later
DRC68fef832010-02-16 05:29:10 +0000455
DRCcc243742010-10-16 09:22:43 +0000456 If you don't already have Visual C++, then the easiest way to get it is by
457 installing the Windows SDK:
DRC68fef832010-02-16 05:29:10 +0000458
DRCcc243742010-10-16 09:22:43 +0000459 http://msdn.microsoft.com/en-us/windows/bb980924.aspx
460
461 The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
462 everything necessary to build libjpeg-turbo.
463
DRC4d2ff7d2014-04-18 02:46:59 +0000464 * You can also use Microsoft Visual Studio Express Edition, which is a free
465 download. (NOTE: versions prior to 2012 can only be used to build 32-bit
466 code.)
DRCcc243742010-10-16 09:22:43 +0000467 * If you intend to build libjpeg-turbo from the command line, then add the
468 appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH
469 environment variables. This is generally accomplished by executing
470 vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and
471 vcvars64.bat are part of Visual C++ and are located in the same directory
472 as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass
473 optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build
474 environment.
475
476... OR ...
477
DRC81543312010-10-18 07:23:58 +0000478-- MinGW
DRCcc243742010-10-16 09:22:43 +0000479
DRC4d2ff7d2014-04-18 02:46:59 +0000480 MinGW-builds (http://sourceforge.net/projects/mingwbuilds/) or
481 tdm-gcc (http://tdm-gcc.tdragon.net/) recommended if building on a Windows
482 machine. Both distributions install a Start Menu link that can be used to
483 launch a command prompt with the appropriate compiler paths automatically
484 set.
DRC68fef832010-02-16 05:29:10 +0000485
DRC377add72010-05-17 16:41:12 +0000486-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
487 a 64-bit build)
DRC68fef832010-02-16 05:29:10 +0000488
DRC5039d732013-01-21 23:42:12 +0000489-- If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This
490 can be downloaded from http://www.java.com.
DRC218c0c12011-02-05 06:01:18 +0000491
DRCcc243742010-10-16 09:22:43 +0000492
493==================
494Out-of-Tree Builds
495==================
496
497Binary objects, libraries, and executables are generated in the same directory
498from which cmake was executed (the "binary directory"), and this directory need
499not necessarily be the same as the libjpeg-turbo source directory. You can
500create multiple independent binary directories, in which different versions of
501libjpeg-turbo can be built from the same source tree using different compilers
502or settings. In the sections below, {build_directory} refers to the binary
503directory, whereas {source_directory} refers to the libjpeg-turbo source
504directory. For in-tree builds, these directories are the same.
505
506
DRC68fef832010-02-16 05:29:10 +0000507======================
508Building libjpeg-turbo
509======================
510
DRC68fef832010-02-16 05:29:10 +0000511
DRCcc243742010-10-16 09:22:43 +0000512Visual C++ (Command Line)
513-------------------------
DRC68fef832010-02-16 05:29:10 +0000514
DRCcc243742010-10-16 09:22:43 +0000515 cd {build_directory}
516 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory}
517 nmake
DRC68fef832010-02-16 05:29:10 +0000518
DRCcc243742010-10-16 09:22:43 +0000519This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending
520on which version of cl.exe is in the PATH.
DRC8b014d72010-02-18 13:03:41 +0000521
DRCcc243742010-10-16 09:22:43 +0000522The following files will be generated under {build_directory}:
523
524 jpeg-static.lib
DRC5039d732013-01-21 23:42:12 +0000525 Static link library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000526 sharedlib/jpeg{version}.dll
DRC5039d732013-01-21 23:42:12 +0000527 DLL for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000528 sharedlib/jpeg.lib
DRC5039d732013-01-21 23:42:12 +0000529 Import library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000530 turbojpeg-static.lib
DRC5039d732013-01-21 23:42:12 +0000531 Static link library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000532 turbojpeg.dll
DRC5039d732013-01-21 23:42:12 +0000533 DLL for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000534 turbojpeg.lib
DRC5039d732013-01-21 23:42:12 +0000535 Import library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000536
537{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
DRCf38eee02011-02-18 07:00:38 +0000538v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000539
540
541Visual C++ (IDE)
542----------------
543
544Choose the appropriate CMake generator option for your version of Visual Studio
545(run "cmake" with no arguments for a list of available generators.) For
546instance:
547
548 cd {build_directory}
DRC4d2ff7d2014-04-18 02:46:59 +0000549 cmake -G "Visual Studio 10" {source_directory}
DRCcc243742010-10-16 09:22:43 +0000550
DRC425c5a52014-05-06 20:56:01 +0000551NOTE: Add "Win64" to the generator name (for example, "Visual Studio 10
552Win64") to build a 64-bit version of libjpeg-turbo. Recent versions of CMake
553no longer document that. A separate build directory must be used for 32-bit
554and 64-bit builds.
DRCd0c9f0c2014-04-18 07:50:17 +0000555
DRCcc243742010-10-16 09:22:43 +0000556You can then open ALL_BUILD.vcproj in Visual Studio and build one of the
557configurations in that project ("Debug", "Release", etc.) to generate a full
558build of libjpeg-turbo.
559
560This will generate the following files under {build_directory}:
561
562 {configuration}/jpeg-static.lib
DRC5039d732013-01-21 23:42:12 +0000563 Static link library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000564 sharedlib/{configuration}/jpeg{version}.dll
DRC5039d732013-01-21 23:42:12 +0000565 DLL for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000566 sharedlib/{configuration}/jpeg.lib
DRC5039d732013-01-21 23:42:12 +0000567 Import library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000568 {configuration}/turbojpeg-static.lib
DRC5039d732013-01-21 23:42:12 +0000569 Static link library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000570 {configuration}/turbojpeg.dll
DRC5039d732013-01-21 23:42:12 +0000571 DLL for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000572 {configuration}/turbojpeg.lib
DRC5039d732013-01-21 23:42:12 +0000573 Import library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000574
575{configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on
576the configuration you built in the IDE, and {version} is 62, 7, or 8,
DRCf38eee02011-02-18 07:00:38 +0000577depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000578
579
580MinGW
581-----
582
DRC4d2ff7d2014-04-18 02:46:59 +0000583NOTE: This assumes that you are building on a Windows machine. If you are
584cross-compiling on a Linux/Unix machine, then see "Build Recipes" below.
585
DRCcc243742010-10-16 09:22:43 +0000586 cd {build_directory}
DRC4d2ff7d2014-04-18 02:46:59 +0000587 cmake -G "MinGW Makefiles" {source_directory}
588 mingw32-make
DRCcc243742010-10-16 09:22:43 +0000589
590This will generate the following files under {build_directory}
591
592 libjpeg.a
DRC5039d732013-01-21 23:42:12 +0000593 Static link library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000594 sharedlib/libjpeg-{version}.dll
DRC5039d732013-01-21 23:42:12 +0000595 DLL for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000596 sharedlib/libjpeg.dll.a
DRC5039d732013-01-21 23:42:12 +0000597 Import library for the libjpeg API
DRCcc243742010-10-16 09:22:43 +0000598 libturbojpeg.a
DRC5039d732013-01-21 23:42:12 +0000599 Static link library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000600 libturbojpeg.dll
DRC5039d732013-01-21 23:42:12 +0000601 DLL for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000602 libturbojpeg.dll.a
DRC5039d732013-01-21 23:42:12 +0000603 Import library for the TurboJPEG API
DRCcc243742010-10-16 09:22:43 +0000604
605{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
DRCf38eee02011-02-18 07:00:38 +0000606v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000607
608
DRCcc243742010-10-16 09:22:43 +0000609Debug Build
610-----------
611
612Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with
613NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
614NMake.)
615
616
DRC30913542012-01-27 09:53:33 +0000617libjpeg v7 or v8 API/ABI Emulation
618-----------------------------------
DRCcc243742010-10-16 09:22:43 +0000619
620Add "-DWITH_JPEG7=1" to the cmake command line to build a version of
DRC30913542012-01-27 09:53:33 +0000621libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add "-DWITH_JPEG8=1"
622to the cmake command to build a version of libjpeg-turbo that is
623API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
624on libjpeg v7 and v8 emulation.
DRCcc243742010-10-16 09:22:43 +0000625
626
DRC5039d732013-01-21 23:42:12 +0000627In-Memory Source/Destination Managers
628-------------------------------------
629
630When using libjpeg v6b or v7 API/ABI emulation, add -DWITH_MEM_SRCDST=0 to the
631CMake command line to build a version of libjpeg-turbo that lacks the
632jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of
633the original libjpeg v6b and v7 APIs, so removing them ensures strict
634conformance with those APIs. See README-turbo.txt for more information.
635
636
DRC245cfdf2010-11-23 17:11:06 +0000637Arithmetic Coding Support
638-------------------------
639
640Since the patent on arithmetic coding has expired, this functionality has been
641included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
DRCf38eee02011-02-18 07:00:38 +0000642based on the implementation in libjpeg v8, but it works when emulating libjpeg
DRC245cfdf2010-11-23 17:11:06 +0000643v7 or v6b as well. The default is to enable both arithmetic encoding and
644decoding, but those who have philosophical objections to arithmetic coding can
645add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to
646disable encoding or decoding (respectively.)
647
648
DRC5039d732013-01-21 23:42:12 +0000649TurboJPEG Java Wrapper
650----------------------
DRC279bd342011-04-02 05:17:12 +0000651Add "-DWITH_JAVA=1" to the cmake command line to incorporate an optional Java
DRC5039d732013-01-21 23:42:12 +0000652Native Interface wrapper into the TurboJPEG shared library and build the Java
653front-end classes to support it. This allows the TurboJPEG shared library to
654be used directly from Java applications. See java/README for more details.
DRC218c0c12011-02-05 06:01:18 +0000655
DRCdb425062011-04-03 06:10:18 +0000656If you are using CMake 2.8, you can set the Java_JAVAC_EXECUTABLE,
657Java_JAVA_EXECUTABLE, and Java_JAR_EXECUTABLE CMake variables to specify
658alternate commands or locations for javac, jar, and java (respectively.) If
659you are using CMake 2.6, set JAVA_COMPILE, JAVA_RUNTIME, and JAVA_ARCHIVE
660instead. You can also set the JAVACFLAGS CMake variable to specify arguments
661that should be passed to the Java compiler when building the front-end classes.
662
DRC218c0c12011-02-05 06:01:18 +0000663
DRC26658432010-10-16 22:04:29 +0000664========================
665Installing libjpeg-turbo
666========================
667
668You can use the build system to install libjpeg-turbo into a directory of your
669choosing (as opposed to creating an installer.) To do this, add:
670
671 -DCMAKE_INSTALL_PREFIX={install_directory}
672
673to the cmake command line.
674
675For example,
676
DRC81543312010-10-18 07:23:58 +0000677 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \
DRC26658432010-10-16 22:04:29 +0000678 -DCMAKE_INSTALL_PREFIX=c:\libjpeg-turbo {source_directory}
679 nmake install
680
681will install the header files in c:\libjpeg-turbo\include, the library files
682in c:\libjpeg-turbo\lib, the DLL's in c:\libjpeg-turbo\bin, and the
683documentation in c:\libjpeg-turbo\doc.
684
685
DRCcc243742010-10-16 09:22:43 +0000686=============
687Build Recipes
688=============
689
690
DRC1c73ce82010-10-16 21:02:54 +000069164-bit MinGW Build on Cygwin
692----------------------------
693
694 cd {build_directory}
DRC2e4d0442011-02-08 01:18:37 +0000695 CC=/usr/bin/x86_64-w64-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000696 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
DRC4d2ff7d2014-04-18 02:46:59 +0000697 -DCMAKE_RC_COMPILER=/usr/bin/x86_64-w64-mingw32-windres.exe \
698 {source_directory}
DRC1c73ce82010-10-16 21:02:54 +0000699 make
700
701This produces a 64-bit build of libjpeg-turbo that does not depend on
702cygwin1.dll or other Cygwin DLL's. The mingw64-x86_64-gcc-core and
703mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed.
704
705
70632-bit MinGW Build on Cygwin
707----------------------------
708
709 cd {build_directory}
DRC2e4d0442011-02-08 01:18:37 +0000710 CC=/usr/bin/i686-w64-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000711 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
DRC4d2ff7d2014-04-18 02:46:59 +0000712 -DCMAKE_RC_COMPILER=/usr/bin/i686-w64-mingw32-windres.exe \
713 {source_directory}
DRC1c73ce82010-10-16 21:02:54 +0000714 make
715
716This produces a 32-bit build of libjpeg-turbo that does not depend on
717cygwin1.dll or other Cygwin DLL's. The mingw64-i686-gcc-core and
718mingw64-i686-gcc-g++ packages (and their dependencies) must be installed.
719
720
DRCcc243742010-10-16 09:22:43 +0000721MinGW Build on Linux
722--------------------
723
724 cd {build_directory}
725 CC={mingw_binary_path}/i386-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000726 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
727 -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
DRCcc243742010-10-16 09:22:43 +0000728 -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
DRC68bf3f22010-10-18 07:56:14 +0000729 {source_directory}
DRCcc243742010-10-16 09:22:43 +0000730 make
DRC8b014d72010-02-18 13:03:41 +0000731
DRC68fef832010-02-16 05:29:10 +0000732
733*******************************************************************************
734** Creating Release Packages
735*******************************************************************************
736
737The following commands can be used to create various types of release packages:
738
DRCcc243742010-10-16 09:22:43 +0000739
DRCd7a642b2013-04-24 06:40:25 +0000740Unix/Linux
741----------
DRCcc243742010-10-16 09:22:43 +0000742
DRC68fef832010-02-16 05:29:10 +0000743make rpm
744
DRCcc243742010-10-16 09:22:43 +0000745 Create Red Hat-style binary RPM package. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000746
747make srpm
748
749 This runs 'make dist' to create a pristine source tarball, then creates a
DRCcc243742010-10-16 09:22:43 +0000750 Red Hat-style source RPM package from the tarball. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000751
752make deb
753
754 Create Debian-style binary package. Requires dpkg.
755
756make dmg
757
758 Create Macintosh package/disk image. This requires the PackageMaker
759 application, which must be installed in /Developer/Applications/Utilities.
DRC7ed0aeb2013-02-24 20:39:30 +0000760 Note that PackageMaker is not included in recent releases of Xcode, but it
761 can be obtained by downloading the "Auxiliary Tools for Xcode" package from
762 http://developer.apple.com/downloads.
DRC68fef832010-02-16 05:29:10 +0000763
DRC9ef93db2010-10-18 08:24:42 +0000764make udmg [BUILDDIR32={32-bit build directory}]
DRC68fef832010-02-16 05:29:10 +0000765
DRC20b734e2012-02-10 01:30:37 +0000766 On 64-bit OS X systems, this creates a Macintosh package and disk image that
767 contains universal i386/x86-64 binaries. You should first configure a 32-bit
768 out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree
769 build, then run 'make udmg' from the 64-bit build directory. The build
770 system will look for the 32-bit build under {source_directory}/osxx86 by
771 default, but you can override this by setting the BUILDDIR32 variable on the
772 make command line as shown above.
773
774make iosdmg [BUILDDIR32={32-bit build directory}] \
775 [BUILDDIRARMV6={ARM v6 build directory}] \
776 [BUILDDIRARMV7={ARM v7 build directory}] \
DRCa2a2cd62013-02-04 22:29:57 +0000777 [BUILDDIRARMV7S={ARM v7s build directory}]
DRC20b734e2012-02-10 01:30:37 +0000778
779 On OS X systems, this creates a Macintosh package and disk image in which the
780 libjpeg-turbo static libraries contain ARM architectures necessary to build
781 iOS applications. If building on an x86-64 system, the binaries will also
782 contain the i386 architecture, as with 'make udmg' above. You should first
DRCa2a2cd62013-02-04 22:29:57 +0000783 configure ARM v6, ARM v7, and/or ARM v7s out-of-tree builds of libjpeg-turbo
784 (see "Building libjpeg-turbo for iOS" above.) If you are building an x86-64
DRC20b734e2012-02-10 01:30:37 +0000785 version of libjpeg-turbo, you should configure a 32-bit out-of-tree build as
786 well. Next, build libjpeg-turbo as you would normally, using an out-of-tree
787 build. When it is built, run 'make iosdmg' from the build directory. The
788 build system will look for the ARM v6 build under {source_directory}/iosarmv6
789 by default, the ARM v7 build under {source_directory}/iosarmv7 by default,
DRCa2a2cd62013-02-04 22:29:57 +0000790 the ARM v7s build under {source_directory}/iosarmv7s by default, and (if
791 applicable) the 32-bit build under {source_directory}/osxx86 by default, but
792 you can override this by setting the BUILDDIR32, BUILDDIRARMV6,
793 BUILDDIRARMV7, and/or BUILDDIRARMV7S variables on the make command line as
794 shown above.
DRC68fef832010-02-16 05:29:10 +0000795
DRC81543312010-10-18 07:23:58 +0000796make cygwinpkg
797
798 Build a Cygwin binary package.
799
DRC0a1f68e2010-02-24 07:24:26 +0000800
DRCcc243742010-10-16 09:22:43 +0000801Windows
802-------
DRC0a1f68e2010-02-24 07:24:26 +0000803
DRCcc243742010-10-16 09:22:43 +0000804If using NMake:
DRC68fef832010-02-16 05:29:10 +0000805
DRCcc243742010-10-16 09:22:43 +0000806 cd {build_directory}
807 nmake installer
808
DRC81543312010-10-18 07:23:58 +0000809If using MinGW:
DRCcc243742010-10-16 09:22:43 +0000810
811 cd {build_directory}
812 make installer
813
814If using the Visual Studio IDE, build the "installer" project.
815
816The installer package (libjpeg-turbo[-gcc][64].exe) will be located under
817{build_directory}. If building using the Visual Studio IDE, then the installer
818package will be located in a subdirectory with the same name as the
819configuration you built (such as {build_directory}\Debug\ or
820{build_directory}\Release\).
821
822Building a Windows installer requires the Nullsoft Install System
823(http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.
DRC9cd4e4b2012-01-31 07:56:44 +0000824
825
826*******************************************************************************
827** Regression testing
828*******************************************************************************
829
830The most common way to test libjpeg-turbo is by invoking 'make test' on
831Unix/Linux platforms or 'ctest' on Windows platforms, once the build has
832completed. This runs a series of tests to ensure that mathematical
833compatibility has been maintained between libjpeg-turbo and libjpeg v6b. This
834also invokes the TurboJPEG unit tests, which ensure that the colorspace
835extensions, YUV encoding, decompression scaling, and other features of the
836TurboJPEG C and Java APIs are working properly (and, by extension, that the
837equivalent features of the underlying libjpeg API are also working.)
838
839Invoking 'make testclean' or 'nmake testclean' (if using NMake) or building
840the 'testclean' target (if using the Visual Studio IDE) will clean up the
841output images generated by 'make test'.
842
DRC5039d732013-01-21 23:42:12 +0000843On Unix/Linux platforms, more extensive tests of the TurboJPEG C and Java
DRC9cd4e4b2012-01-31 07:56:44 +0000844wrappers can be run by invoking 'make tjtest'. These extended TurboJPEG tests
845essentially iterate through all of the available features of the TurboJPEG APIs
846that are not covered by the TurboJPEG unit tests (this includes the lossless
847transform options) and compare the images generated by each feature to images
848generated using the equivalent feature in the libjpeg API. The extended
849TurboJPEG tests are meant to test for regressions in the TurboJPEG wrappers,
DRC5039d732013-01-21 23:42:12 +0000850not in the underlying libjpeg API library.