blob: 26a42ca1723ab4865c1c5f76b3409eed92b5baa0 [file] [log] [blame]
DRC68fef832010-02-16 05:29:10 +00001*******************************************************************************
DRC81543312010-10-18 07:23:58 +00002** Building on Unix Platforms (including Cygwin)
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
DRC68fef832010-02-16 05:29:10 +000013
DRC94755ce2011-10-19 05:13:27 +000014-- NASM (if building x86 or x86-64 SIMD extensions)
DRC254937b2011-04-16 13:35:35 +000015 * 0.98, or 2.01 or later is required for a 32-bit build
16 * NASM 2.00 or later is required for a 64-bit build
DRC9026b372011-04-16 13:37:22 +000017 * NASM 2.07 or later is required for a 64-bit build on OS X. This can be
DRC0dedd1a2010-07-02 09:20:12 +000018 obtained from MacPorts (http://www.macports.org/).
DRC68fef832010-02-16 05:29:10 +000019
DRC254937b2011-04-16 13:35:35 +000020 The binary RPMs released by the NASM project do not work on older Linux
21 systems, such as Red Hat Enterprise Linux 4. On such systems, you can
22 easily build and install NASM from a source RPM by downloading one of the
23 SRPMs from
24
25 http://www.nasm.us/pub/nasm/releasebuilds
26
27 and executing the following as root:
DRC68fef832010-02-16 05:29:10 +000028
29 ARCH=`uname -m`
DRC254937b2011-04-16 13:35:35 +000030 rpmbuild --rebuild nasm-{version}.src.rpm
31 rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-{version}.$ARCH.rpm
DRC68fef832010-02-16 05:29:10 +000032
DRC254937b2011-04-16 13:35:35 +000033 NOTE: the NASM build will fail if texinfo is not installed.
DRCc3f4ac02010-02-19 21:51:26 +000034
DRC8f870c22010-02-24 00:30:00 +000035-- GCC v4.1 or later recommended for best performance
DRC68fef832010-02-16 05:29:10 +000036
DRC279bd342011-04-02 05:17:12 +000037-- If building the TurboJPEG/OSS Java wrapper, JDK or OpenJDK 1.5 or later is
38 required. Some systems, such as OS X 10.4, Solaris 10 and later, and Red
39 Hat Enterprise Linux 5 and later, have this pre-installed. On OS X 10.5 and
40 later, it will be necessary to install the Java Developer Package, which can
41 be downloaded from http://connect.apple.com. For systems that do not have a
42 JDK installed, you can obtain the Oracle Java Development Kit from
43 http://www.java.com.
DRCf8e00552011-02-04 11:06:36 +000044
DRCcc243742010-10-16 09:22:43 +000045
46==================
47Out-of-Tree Builds
48==================
49
50Binary objects, libraries, and executables are generated in the same directory
51from which configure was executed (the "binary directory"), and this directory
52need not necessarily be the same as the libjpeg-turbo source directory. You
53can create multiple independent binary directories, in which different versions
54of libjpeg-turbo can be built from the same source tree using different
55compilers or settings. In the sections below, {build_directory} refers to the
56binary directory, whereas {source_directory} refers to the libjpeg-turbo source
57directory. For in-tree builds, these directories are the same.
58
59
DRC68fef832010-02-16 05:29:10 +000060======================
61Building libjpeg-turbo
62======================
63
DRC49597872010-05-17 20:47:57 +000064The following procedure will build libjpeg-turbo on Linux, FreeBSD, 32-bit
DRC81543312010-10-18 07:23:58 +000065OS X, Cygwin, and Solaris/x86 systems (on Solaris, this generates a 32-bit
66library. See below for 64-bit build instructions.)
DRC68fef832010-02-16 05:29:10 +000067
DRCcc243742010-10-16 09:22:43 +000068 cd {source_directory}
DRC68fef832010-02-16 05:29:10 +000069 autoreconf -fiv
DRCcc243742010-10-16 09:22:43 +000070 cd {build_directory}
DRC98dbe912010-11-04 22:22:30 +000071 sh {source_directory}/configure [additional configure flags]
DRC68fef832010-02-16 05:29:10 +000072 make
73
DRCcc243742010-10-16 09:22:43 +000074NOTE: Running autoreconf in the source directory is only necessary if building
75libjpeg-turbo from the SVN repository.
DRC68fef832010-02-16 05:29:10 +000076
77This will generate the following files under .libs/
78
79 libjpeg.a
80 Static link library for libjpeg-turbo
81
DRCcc243742010-10-16 09:22:43 +000082 libjpeg.so.{version} (Linux, Solaris)
83 libjpeg.{version}.dylib (OS X)
DRC81543312010-10-18 07:23:58 +000084 cygjpeg-{version}.dll (Cygwin)
DRC68fef832010-02-16 05:29:10 +000085 Shared library for libjpeg-turbo
86
87 libjpeg.so (Linux, Solaris)
88 libjpeg.dylib (OS X)
DRC81543312010-10-18 07:23:58 +000089 libjpeg.dll.a (Cygwin)
DRC68fef832010-02-16 05:29:10 +000090 Development stub for libjpeg-turbo shared library
91
92 libturbojpeg.a
93 Static link library for TurboJPEG/OSS
94
95 libturbojpeg.so (Linux, Solaris)
96 libturbojpeg.dylib (OS X)
97 Shared library and development stub for TurboJPEG/OSS
98
DRC81543312010-10-18 07:23:58 +000099 cygturbojpeg.dll (Cygwin)
100 Shared library for TurboJPEG/OSS
101
102 libturbojpeg.dll.a (Cygwin)
103 Development stub for TurboJPEG/OSS shared library
104
DRCcc243742010-10-16 09:22:43 +0000105{version} is 62.0.0, 7.0.0, or 8.0.2, depending on whether libjpeg v6b
DRCf38eee02011-02-18 07:00:38 +0000106(default), v7, or v8 emulation is enabled. If using Cygwin, {version} is
DRC81543312010-10-18 07:23:58 +000010762, 7, or 8.
108
109
DRC30913542012-01-27 09:53:33 +0000110libjpeg v7 or v8 API/ABI Emulation
111----------------------------------
DRC81543312010-10-18 07:23:58 +0000112
113Add --with-jpeg7 to the configure command line to build a version of
DRC30913542012-01-27 09:53:33 +0000114libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add --with-jpeg8 to
115the configure command to build a version of libjpeg-turbo that is
116API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
117on libjpeg v7 and v8 emulation.
DRC81543312010-10-18 07:23:58 +0000118
DRC68fef832010-02-16 05:29:10 +0000119
DRC245cfdf2010-11-23 17:11:06 +0000120Arithmetic Coding Support
121-------------------------
122
123Since the patent on arithmetic coding has expired, this functionality has been
124included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
DRCf38eee02011-02-18 07:00:38 +0000125based on the implementation in libjpeg v8, but it works when emulating libjpeg
DRC245cfdf2010-11-23 17:11:06 +0000126v7 or v6b as well. The default is to enable both arithmetic encoding and
127decoding, but those who have philosophical objections to arithmetic coding can
128add --without-arith-enc or --without-arith-dec to the configure command line to
129disable encoding or decoding (respectively.)
130
DRC68fef832010-02-16 05:29:10 +0000131
DRC279bd342011-04-02 05:17:12 +0000132TurboJPEG/OSS Java Wrapper
133--------------------------
DRC88f54a42011-04-01 01:21:22 +0000134Add --with-java to the configure command line to incorporate an optional Java
135Native Interface wrapper into the TurboJPEG/OSS dynamic library and build the
136Java front-end classes to support it. This allows the TurboJPEG/OSS dynamic
137library to be used directly from Java applications. See java/README for more
138details.
139
140You can set the JAVAC, JAR, and JAVA configure variables to specify
141alternate commands for javac, jar, and java (respectively.) You can also
142set the JAVACFLAGS configure variable to specify arguments that should be
143passed to the Java compiler when building the front-end classes, and JNI_CFLAGS
144to specify arguments that should be passed to the C compiler when building the
145JNI wrapper. Run 'configure --help' for more details.
DRCf8e00552011-02-04 11:06:36 +0000146
147
DRC68fef832010-02-16 05:29:10 +0000148========================
149Installing libjpeg-turbo
150========================
151
152If you intend to install these libraries and the associated header files, then
153replace 'make' in the instructions above with
154
155 make install prefix={base dir} libdir={library directory}
156
157For example,
158
159 make install prefix=/usr/local libdir=/usr/local/lib64
160
161will install the header files in /usr/local/include and the library files in
162/usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default
163is to install the header files in /opt/libjpeg-turbo/include and the library
164files in /opt/libjpeg-turbo/lib.
165
166NOTE: You can specify a prefix of /usr and a libdir of, for instance,
167/usr/lib64 to overwrite the system's version of libjpeg. If you do this,
168however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before
169overwriting it. It is recommended that you instead install libjpeg-turbo into
170a non-system directory and manipulate the LD_LIBRARY_PATH or create sym links
171to force applications to use libjpeg-turbo instead of libjpeg. See
172README-turbo.txt for more information.
173
DRCcc243742010-10-16 09:22:43 +0000174
DRC68fef832010-02-16 05:29:10 +0000175=============
176Build Recipes
177=============
178
DRCcc243742010-10-16 09:22:43 +0000179
DRC68fef832010-02-16 05:29:10 +000018032-bit Library Build on 64-bit Linux
181------------------------------------
182
DRCca5e7d12010-02-17 02:25:06 +0000183Add
DRC68fef832010-02-16 05:29:10 +0000184
DRC2e4d0442011-02-08 01:18:37 +0000185 --host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32
DRC68fef832010-02-16 05:29:10 +0000186
187to the configure command line.
188
189
DRC9026b372011-04-16 13:37:22 +000019064-bit Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000191-----------------------------------
192
DRCca5e7d12010-02-17 02:25:06 +0000193Add
DRC68fef832010-02-16 05:29:10 +0000194
DRC0dedd1a2010-07-02 09:20:12 +0000195 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm
DRC68fef832010-02-16 05:29:10 +0000196
DRC7bac07b2010-04-10 05:53:35 +0000197to the configure command line. NASM 2.07 or later from MacPorts must be
198installed.
DRC68fef832010-02-16 05:29:10 +0000199
200
DRC9026b372011-04-16 13:37:22 +000020132-bit Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000202-----------------------------------
203
DRCca5e7d12010-02-17 02:25:06 +0000204Add
DRC68fef832010-02-16 05:29:10 +0000205
DRC5950c5d2012-06-28 23:22:03 +0000206 --host i686-apple-darwin CFLAGS='-O3 -m32' LDFLAGS=-m32
DRC68fef832010-02-16 05:29:10 +0000207
208to the configure command line.
209
210
DRC9026b372011-04-16 13:37:22 +000021164-bit Backward-Compatible Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000212-------------------------------------------------------
213
DRCca5e7d12010-02-17 02:25:06 +0000214Add
DRC68fef832010-02-16 05:29:10 +0000215
DRC0dedd1a2010-07-02 09:20:12 +0000216 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
217 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
218 -mmacosx-version-min=10.4 -O3' \
DRC0dedd1a2010-07-02 09:20:12 +0000219 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
220 -mmacosx-version-min=10.4'
221
DRC575c3422010-07-08 07:01:20 +0000222to the configure command line. The OS X 10.4 SDK, and NASM 2.07 or later from
223MacPorts, must be installed.
DRC0dedd1a2010-07-02 09:20:12 +0000224
225
DRC9026b372011-04-16 13:37:22 +000022632-bit Backward-Compatible Library Build on OS X
DRC0dedd1a2010-07-02 09:20:12 +0000227------------------------------------------------
228
229Add
230
DRC5950c5d2012-06-28 23:22:03 +0000231 --host i686-apple-darwin \
232 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
DRC485cd802010-02-23 23:23:42 +0000233 -mmacosx-version-min=10.4 -O3 -m32' \
DRC68fef832010-02-16 05:29:10 +0000234 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
235 -mmacosx-version-min=10.4 -m32'
236
237to the configure command line. The OS X 10.4 SDK must be installed.
238
239
24064-bit Library Build on 64-bit Solaris
241--------------------------------------
242
DRCca5e7d12010-02-17 02:25:06 +0000243Add
DRC68fef832010-02-16 05:29:10 +0000244
DRC2e4d0442011-02-08 01:18:37 +0000245 --host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64
DRC68fef832010-02-16 05:29:10 +0000246
247to the configure command line.
248
249
DRC7bac07b2010-04-10 05:53:35 +000025032-bit Library Build on 64-bit FreeBSD
251--------------------------------------
252
253Add
254
DRC2e4d0442011-02-08 01:18:37 +0000255 --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \
256 LDFLAGS='-B/usr/lib32'
DRC7bac07b2010-04-10 05:53:35 +0000257
258to the configure command line. NASM 2.07 or later from FreeBSD ports must be
259installed.
260
261
DRC0559e942012-03-23 03:12:35 +0000262Oracle Solaris Studio
263---------------------
DRCca5e7d12010-02-17 02:25:06 +0000264
265Add
266
DRC2e4d0442011-02-08 01:18:37 +0000267 CC=cc
DRCca5e7d12010-02-17 02:25:06 +0000268
269to the configure command line. libjpeg-turbo will automatically be built with
DRC2e4d0442011-02-08 01:18:37 +0000270the maximum optimization level (-xO5) unless you override CFLAGS.
DRCca5e7d12010-02-17 02:25:06 +0000271
DRC0559e942012-03-23 03:12:35 +0000272To build a 64-bit version of libjpeg-turbo using Oracle Solaris Studio, add
DRCca5e7d12010-02-17 02:25:06 +0000273
DRC2e4d0442011-02-08 01:18:37 +0000274 --host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64
DRCca5e7d12010-02-17 02:25:06 +0000275
276to the configure command line.
277
DRC8b014d72010-02-18 13:03:41 +0000278
DRC81543312010-10-18 07:23:58 +0000279MinGW Build on Cygwin
280---------------------
281
282Use CMake (see recipes below)
283
284
DRC94755ce2011-10-19 05:13:27 +0000285===========
286ARM Support
287===========
288
289This release of libjpeg-turbo can use ARM NEON SIMD instructions to accelerate
290JPEG compression/decompression by approximately 2-4x on ARMv7 and later
291platforms. If libjpeg-turbo is configured on an ARM Linux platform, then the
292build system will automatically include the NEON SIMD routines, if they are
293supported.
294
295
296Building libjpeg-turbo for iOS
297------------------------------
298
299iOS platforms, such as the iPhone and iPad, also use ARM processors, some of
300which support NEON instructions. Additional steps are required to build
301libjpeg-turbo for these platforms. The steps below assume iOS SDK v4.3. If
302you are using a different SDK version, then you will need to modify the
303examples accordingly.
304
305Additional build requirements:
306
307 gas-preprocessor.pl (https://github.com/yuvi/gas-preprocessor) should be
308 installed in your PATH.
309
310Set the following shell variables for simplicity:
311
312 IOS_PLATFORMDIR="/Developer/Platforms/iPhoneOS.platform"
313 IOS_SYSROOT="$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS4.3.sdk"
314 IOS_GCC="$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2"
315
316 ARM v6 only (up to and including iPhone 3G):
317 IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp"
318
319 ARM v7 only (iPhone 3GS and newer, iPad):
320 IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon"
321
322Follow the procedure under "Building libjpeg-turbo" above, adding
323
DRC89c59dd2011-10-27 20:40:21 +0000324 --host arm-apple-darwin10 --enable-static --disable-shared \
DRC94755ce2011-10-19 05:13:27 +0000325 CC="$IOS_GCC" LD="$IOS_GCC" \
326 CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \
327 LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS"
328
329to the configure command line.
330
331Once built, lipo can be used to combine the ARM v6 and v7 variants into a
332universal library.
333
DRC81543312010-10-18 07:23:58 +0000334
DRC68fef832010-02-16 05:29:10 +0000335*******************************************************************************
DRC81543312010-10-18 07:23:58 +0000336** Building on Windows (Visual C++ or MinGW)
DRC68fef832010-02-16 05:29:10 +0000337*******************************************************************************
338
DRCcc243742010-10-16 09:22:43 +0000339
DRC68fef832010-02-16 05:29:10 +0000340==================
341Build Requirements
342==================
343
DRCcc243742010-10-16 09:22:43 +0000344-- CMake (http://www.cmake.org) v2.6 or later
DRC68fef832010-02-16 05:29:10 +0000345
DRCcc243742010-10-16 09:22:43 +0000346-- Microsoft Visual C++ 2005 or later
DRC68fef832010-02-16 05:29:10 +0000347
DRCcc243742010-10-16 09:22:43 +0000348 If you don't already have Visual C++, then the easiest way to get it is by
349 installing the Windows SDK:
DRC68fef832010-02-16 05:29:10 +0000350
DRCcc243742010-10-16 09:22:43 +0000351 http://msdn.microsoft.com/en-us/windows/bb980924.aspx
352
353 The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
354 everything necessary to build libjpeg-turbo.
355
356 * For 32-bit builds, you can also use Microsoft Visual C++ Express
357 Edition. Visual C++ Express Edition is a free download.
358 * If you intend to build libjpeg-turbo from the command line, then add the
359 appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH
360 environment variables. This is generally accomplished by executing
361 vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and
362 vcvars64.bat are part of Visual C++ and are located in the same directory
363 as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass
364 optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build
365 environment.
366
367... OR ...
368
DRC81543312010-10-18 07:23:58 +0000369-- MinGW
DRCcc243742010-10-16 09:22:43 +0000370
371 GCC v4.1 or later recommended for best performance
DRC68fef832010-02-16 05:29:10 +0000372
DRC377add72010-05-17 16:41:12 +0000373-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
374 a 64-bit build)
DRC68fef832010-02-16 05:29:10 +0000375
DRC279bd342011-04-02 05:17:12 +0000376-- If building the TurboJPEG/OSS Java wrapper, JDK 1.5 or later is required.
377 This can be downloaded from http://www.java.com.
DRC218c0c12011-02-05 06:01:18 +0000378
DRCcc243742010-10-16 09:22:43 +0000379
380==================
381Out-of-Tree Builds
382==================
383
384Binary objects, libraries, and executables are generated in the same directory
385from which cmake was executed (the "binary directory"), and this directory need
386not necessarily be the same as the libjpeg-turbo source directory. You can
387create multiple independent binary directories, in which different versions of
388libjpeg-turbo can be built from the same source tree using different compilers
389or settings. In the sections below, {build_directory} refers to the binary
390directory, whereas {source_directory} refers to the libjpeg-turbo source
391directory. For in-tree builds, these directories are the same.
392
393
DRC68fef832010-02-16 05:29:10 +0000394======================
395Building libjpeg-turbo
396======================
397
DRC68fef832010-02-16 05:29:10 +0000398
DRCcc243742010-10-16 09:22:43 +0000399Visual C++ (Command Line)
400-------------------------
DRC68fef832010-02-16 05:29:10 +0000401
DRCcc243742010-10-16 09:22:43 +0000402 cd {build_directory}
403 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory}
404 nmake
DRC68fef832010-02-16 05:29:10 +0000405
DRCcc243742010-10-16 09:22:43 +0000406This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending
407on which version of cl.exe is in the PATH.
DRC8b014d72010-02-18 13:03:41 +0000408
DRCcc243742010-10-16 09:22:43 +0000409The following files will be generated under {build_directory}:
410
411 jpeg-static.lib
412 Static link library for libjpeg-turbo
413 sharedlib/jpeg{version}.dll
414 DLL for libjpeg-turbo
415 sharedlib/jpeg.lib
416 Import library for libjpeg-turbo DLL
417 turbojpeg-static.lib
418 Static link library for TurboJPEG/OSS
419 turbojpeg.dll
420 DLL for TurboJPEG/OSS
421 turbojpeg.lib
422 Import library for TurboJPEG/OSS DLL
423
424{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
DRCf38eee02011-02-18 07:00:38 +0000425v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000426
427
428Visual C++ (IDE)
429----------------
430
431Choose the appropriate CMake generator option for your version of Visual Studio
432(run "cmake" with no arguments for a list of available generators.) For
433instance:
434
435 cd {build_directory}
436 cmake -G "Visual Studio 9 2008" {source_directory}
437
438You can then open ALL_BUILD.vcproj in Visual Studio and build one of the
439configurations in that project ("Debug", "Release", etc.) to generate a full
440build of libjpeg-turbo.
441
442This will generate the following files under {build_directory}:
443
444 {configuration}/jpeg-static.lib
445 Static link library for libjpeg-turbo
446 sharedlib/{configuration}/jpeg{version}.dll
447 DLL for libjpeg-turbo
448 sharedlib/{configuration}/jpeg.lib
449 Import library for libjpeg-turbo DLL
450 {configuration}/turbojpeg-static.lib
451 Static link library for TurboJPEG/OSS
452 {configuration}/turbojpeg.dll
453 DLL for TurboJPEG/OSS
454 {configuration}/turbojpeg.lib
455 Import library for TurboJPEG/OSS DLL
456
457{configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on
458the configuration you built in the IDE, and {version} is 62, 7, or 8,
DRCf38eee02011-02-18 07:00:38 +0000459depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000460
461
462MinGW
463-----
464
465 cd {build_directory}
466 cmake -G "MSYS Makefiles" {source_directory}
467 make
468
469This will generate the following files under {build_directory}
470
471 libjpeg.a
472 Static link library for libjpeg-turbo
473 sharedlib/libjpeg-{version}.dll
474 DLL for libjpeg-turbo
475 sharedlib/libjpeg.dll.a
476 Import library for libjpeg-turbo DLL
477 libturbojpeg.a
478 Static link library for TurboJPEG/OSS
479 libturbojpeg.dll
480 DLL for TurboJPEG/OSS
481 libturbojpeg.dll.a
482 Import library for TurboJPEG/OSS DLL
483
484{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
DRCf38eee02011-02-18 07:00:38 +0000485v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000486
487
DRCcc243742010-10-16 09:22:43 +0000488Debug Build
489-----------
490
491Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with
492NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
493NMake.)
494
495
DRC30913542012-01-27 09:53:33 +0000496libjpeg v7 or v8 API/ABI Emulation
497-----------------------------------
DRCcc243742010-10-16 09:22:43 +0000498
499Add "-DWITH_JPEG7=1" to the cmake command line to build a version of
DRC30913542012-01-27 09:53:33 +0000500libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add "-DWITH_JPEG8=1"
501to the cmake command to build a version of libjpeg-turbo that is
502API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
503on libjpeg v7 and v8 emulation.
DRCcc243742010-10-16 09:22:43 +0000504
505
DRC245cfdf2010-11-23 17:11:06 +0000506Arithmetic Coding Support
507-------------------------
508
509Since the patent on arithmetic coding has expired, this functionality has been
510included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
DRCf38eee02011-02-18 07:00:38 +0000511based on the implementation in libjpeg v8, but it works when emulating libjpeg
DRC245cfdf2010-11-23 17:11:06 +0000512v7 or v6b as well. The default is to enable both arithmetic encoding and
513decoding, but those who have philosophical objections to arithmetic coding can
514add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to
515disable encoding or decoding (respectively.)
516
517
DRC279bd342011-04-02 05:17:12 +0000518TurboJPEG/OSS Java Wrapper
519--------------------------
520Add "-DWITH_JAVA=1" to the cmake command line to incorporate an optional Java
521Native Interface wrapper into the TurboJPEG/OSS dynamic library and build the
522Java front-end classes to support it. This allows the TurboJPEG/OSS dynamic
523library to be used directly from Java applications. See java/README for more
524details.
DRC218c0c12011-02-05 06:01:18 +0000525
DRCdb425062011-04-03 06:10:18 +0000526If you are using CMake 2.8, you can set the Java_JAVAC_EXECUTABLE,
527Java_JAVA_EXECUTABLE, and Java_JAR_EXECUTABLE CMake variables to specify
528alternate commands or locations for javac, jar, and java (respectively.) If
529you are using CMake 2.6, set JAVA_COMPILE, JAVA_RUNTIME, and JAVA_ARCHIVE
530instead. You can also set the JAVACFLAGS CMake variable to specify arguments
531that should be passed to the Java compiler when building the front-end classes.
532
DRC218c0c12011-02-05 06:01:18 +0000533
DRC26658432010-10-16 22:04:29 +0000534========================
535Installing libjpeg-turbo
536========================
537
538You can use the build system to install libjpeg-turbo into a directory of your
539choosing (as opposed to creating an installer.) To do this, add:
540
541 -DCMAKE_INSTALL_PREFIX={install_directory}
542
543to the cmake command line.
544
545For example,
546
DRC81543312010-10-18 07:23:58 +0000547 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \
DRC26658432010-10-16 22:04:29 +0000548 -DCMAKE_INSTALL_PREFIX=c:\libjpeg-turbo {source_directory}
549 nmake install
550
551will install the header files in c:\libjpeg-turbo\include, the library files
552in c:\libjpeg-turbo\lib, the DLL's in c:\libjpeg-turbo\bin, and the
553documentation in c:\libjpeg-turbo\doc.
554
555
DRCcc243742010-10-16 09:22:43 +0000556=============
557Build Recipes
558=============
559
560
DRC1c73ce82010-10-16 21:02:54 +000056164-bit MinGW Build on Cygwin
562----------------------------
563
564 cd {build_directory}
DRC2e4d0442011-02-08 01:18:37 +0000565 CC=/usr/bin/x86_64-w64-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000566 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
567 -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
DRC1c73ce82010-10-16 21:02:54 +0000568 -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
569 make
570
571This produces a 64-bit build of libjpeg-turbo that does not depend on
572cygwin1.dll or other Cygwin DLL's. The mingw64-x86_64-gcc-core and
573mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed.
574
575
57632-bit MinGW Build on Cygwin
577----------------------------
578
579 cd {build_directory}
DRC2e4d0442011-02-08 01:18:37 +0000580 CC=/usr/bin/i686-w64-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000581 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
582 -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
DRC1c73ce82010-10-16 21:02:54 +0000583 -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
584 make
585
586This produces a 32-bit build of libjpeg-turbo that does not depend on
587cygwin1.dll or other Cygwin DLL's. The mingw64-i686-gcc-core and
588mingw64-i686-gcc-g++ packages (and their dependencies) must be installed.
589
590
591MinGW-w64 Build on Windows
592--------------------------
593
594This produces a 64-bit build of libjpeg-turbo using the "native" MinGW-w64
595toolchain (which is faster than the Cygwin version):
596
597 cd {build_directory}
598 CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
DRC81543312010-10-18 07:23:58 +0000599 cmake -G "MSYS Makefiles" \
DRC1c73ce82010-10-16 21:02:54 +0000600 -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
601 -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
602 {source_directory}
603 make
604
605
DRCcc243742010-10-16 09:22:43 +0000606MinGW Build on Linux
607--------------------
608
609 cd {build_directory}
610 CC={mingw_binary_path}/i386-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000611 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
612 -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
DRCcc243742010-10-16 09:22:43 +0000613 -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
DRC68bf3f22010-10-18 07:56:14 +0000614 {source_directory}
DRCcc243742010-10-16 09:22:43 +0000615 make
DRC8b014d72010-02-18 13:03:41 +0000616
DRC68fef832010-02-16 05:29:10 +0000617
618*******************************************************************************
619** Creating Release Packages
620*******************************************************************************
621
622The following commands can be used to create various types of release packages:
623
DRCcc243742010-10-16 09:22:43 +0000624
625Unix
626----
627
DRC68fef832010-02-16 05:29:10 +0000628make rpm
629
DRCcc243742010-10-16 09:22:43 +0000630 Create Red Hat-style binary RPM package. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000631
632make srpm
633
634 This runs 'make dist' to create a pristine source tarball, then creates a
DRCcc243742010-10-16 09:22:43 +0000635 Red Hat-style source RPM package from the tarball. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000636
637make deb
638
639 Create Debian-style binary package. Requires dpkg.
640
641make dmg
642
643 Create Macintosh package/disk image. This requires the PackageMaker
644 application, which must be installed in /Developer/Applications/Utilities.
645
DRC9ef93db2010-10-18 08:24:42 +0000646make udmg [BUILDDIR32={32-bit build directory}]
DRC68fef832010-02-16 05:29:10 +0000647
DRC20b734e2012-02-10 01:30:37 +0000648 On 64-bit OS X systems, this creates a Macintosh package and disk image that
649 contains universal i386/x86-64 binaries. You should first configure a 32-bit
650 out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree
651 build, then run 'make udmg' from the 64-bit build directory. The build
652 system will look for the 32-bit build under {source_directory}/osxx86 by
653 default, but you can override this by setting the BUILDDIR32 variable on the
654 make command line as shown above.
655
656make iosdmg [BUILDDIR32={32-bit build directory}] \
657 [BUILDDIRARMV6={ARM v6 build directory}] \
658 [BUILDDIRARMV7={ARM v7 build directory}] \
659
660 On OS X systems, this creates a Macintosh package and disk image in which the
661 libjpeg-turbo static libraries contain ARM architectures necessary to build
662 iOS applications. If building on an x86-64 system, the binaries will also
663 contain the i386 architecture, as with 'make udmg' above. You should first
664 configure ARM v6 and ARM v7 out-of-tree builds of libjpeg-turbo (see
665 "Building libjpeg-turbo for iOS" above.) If you are building an x86-64
666 version of libjpeg-turbo, you should configure a 32-bit out-of-tree build as
667 well. Next, build libjpeg-turbo as you would normally, using an out-of-tree
668 build. When it is built, run 'make iosdmg' from the build directory. The
669 build system will look for the ARM v6 build under {source_directory}/iosarmv6
670 by default, the ARM v7 build under {source_directory}/iosarmv7 by default,
671 and (if applicable) the 32-bit build under {source_directory}/osxx86 by
672 default, but you can override this by setting the BUILDDIR32, BUILDDIRARMV6,
673 and/or BUILDDIRARMV7 variables on the make command line as shown above.
DRC68fef832010-02-16 05:29:10 +0000674
DRC0f53df82010-10-21 19:47:06 +0000675make sunpkg
676
677 Build a Solaris package. This requires pkgmk, pkgtrans, and bzip2.
678
679make csunpkg [BUILDDIR32={32-bit build directory}]
680
DRC80803ae2011-12-15 13:12:59 +0000681 On 64-bit Solaris systems, this creates a combined package that contains
DRC0f53df82010-10-21 19:47:06 +0000682 both 32-bit and 64-bit libraries. You should first configure a 32-bit
683 out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree
684 build, then run 'make csunpkg' from the 64-bit build directory. The build
685 system will look for the 32-bit build under {source_directory}/solx86 by
686 default, but you can override this by setting the BUILDDIR32 variable on the
687 make command line as shown above.
688
DRC81543312010-10-18 07:23:58 +0000689make cygwinpkg
690
691 Build a Cygwin binary package.
692
DRC0a1f68e2010-02-24 07:24:26 +0000693
DRCcc243742010-10-16 09:22:43 +0000694Windows
695-------
DRC0a1f68e2010-02-24 07:24:26 +0000696
DRCcc243742010-10-16 09:22:43 +0000697If using NMake:
DRC68fef832010-02-16 05:29:10 +0000698
DRCcc243742010-10-16 09:22:43 +0000699 cd {build_directory}
700 nmake installer
701
DRC81543312010-10-18 07:23:58 +0000702If using MinGW:
DRCcc243742010-10-16 09:22:43 +0000703
704 cd {build_directory}
705 make installer
706
707If using the Visual Studio IDE, build the "installer" project.
708
709The installer package (libjpeg-turbo[-gcc][64].exe) will be located under
710{build_directory}. If building using the Visual Studio IDE, then the installer
711package will be located in a subdirectory with the same name as the
712configuration you built (such as {build_directory}\Debug\ or
713{build_directory}\Release\).
714
715Building a Windows installer requires the Nullsoft Install System
716(http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.
DRC9cd4e4b2012-01-31 07:56:44 +0000717
718
719*******************************************************************************
720** Regression testing
721*******************************************************************************
722
723The most common way to test libjpeg-turbo is by invoking 'make test' on
724Unix/Linux platforms or 'ctest' on Windows platforms, once the build has
725completed. This runs a series of tests to ensure that mathematical
726compatibility has been maintained between libjpeg-turbo and libjpeg v6b. This
727also invokes the TurboJPEG unit tests, which ensure that the colorspace
728extensions, YUV encoding, decompression scaling, and other features of the
729TurboJPEG C and Java APIs are working properly (and, by extension, that the
730equivalent features of the underlying libjpeg API are also working.)
731
732Invoking 'make testclean' or 'nmake testclean' (if using NMake) or building
733the 'testclean' target (if using the Visual Studio IDE) will clean up the
734output images generated by 'make test'.
735
736On Unix/Linux platforms, more extensive tests of the TurboJPEG/OSS C and Java
737wrappers can be run by invoking 'make tjtest'. These extended TurboJPEG tests
738essentially iterate through all of the available features of the TurboJPEG APIs
739that are not covered by the TurboJPEG unit tests (this includes the lossless
740transform options) and compare the images generated by each feature to images
741generated using the equivalent feature in the libjpeg API. The extended
742TurboJPEG tests are meant to test for regressions in the TurboJPEG wrappers,
743not in the underlying libjpeg-turbo library.