blob: fc583ee349aef1071234a24623aa22c330d7a1f9 [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
DRC2e4d0442011-02-08 01:18:37 +0000206 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
DRC485cd802010-02-23 23:23:42 +0000231 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
232 -mmacosx-version-min=10.4 -O3 -m32' \
DRC68fef832010-02-16 05:29:10 +0000233 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
234 -mmacosx-version-min=10.4 -m32'
235
236to the configure command line. The OS X 10.4 SDK must be installed.
237
238
23964-bit Library Build on 64-bit Solaris
240--------------------------------------
241
DRCca5e7d12010-02-17 02:25:06 +0000242Add
DRC68fef832010-02-16 05:29:10 +0000243
DRC2e4d0442011-02-08 01:18:37 +0000244 --host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64
DRC68fef832010-02-16 05:29:10 +0000245
246to the configure command line.
247
248
DRC7bac07b2010-04-10 05:53:35 +000024932-bit Library Build on 64-bit FreeBSD
250--------------------------------------
251
252Add
253
DRC2e4d0442011-02-08 01:18:37 +0000254 --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \
255 LDFLAGS='-B/usr/lib32'
DRC7bac07b2010-04-10 05:53:35 +0000256
257to the configure command line. NASM 2.07 or later from FreeBSD ports must be
258installed.
259
260
DRCca5e7d12010-02-17 02:25:06 +0000261Sun Studio
262----------
263
264Add
265
DRC2e4d0442011-02-08 01:18:37 +0000266 CC=cc
DRCca5e7d12010-02-17 02:25:06 +0000267
268to the configure command line. libjpeg-turbo will automatically be built with
DRC2e4d0442011-02-08 01:18:37 +0000269the maximum optimization level (-xO5) unless you override CFLAGS.
DRCca5e7d12010-02-17 02:25:06 +0000270
271To build a 64-bit version of libjpeg-turbo using Sun Studio, add
272
DRC2e4d0442011-02-08 01:18:37 +0000273 --host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64
DRCca5e7d12010-02-17 02:25:06 +0000274
275to the configure command line.
276
DRC8b014d72010-02-18 13:03:41 +0000277
DRC81543312010-10-18 07:23:58 +0000278MinGW Build on Cygwin
279---------------------
280
281Use CMake (see recipes below)
282
283
DRC94755ce2011-10-19 05:13:27 +0000284===========
285ARM Support
286===========
287
288This release of libjpeg-turbo can use ARM NEON SIMD instructions to accelerate
289JPEG compression/decompression by approximately 2-4x on ARMv7 and later
290platforms. If libjpeg-turbo is configured on an ARM Linux platform, then the
291build system will automatically include the NEON SIMD routines, if they are
292supported.
293
294
295Building libjpeg-turbo for iOS
296------------------------------
297
298iOS platforms, such as the iPhone and iPad, also use ARM processors, some of
299which support NEON instructions. Additional steps are required to build
300libjpeg-turbo for these platforms. The steps below assume iOS SDK v4.3. If
301you are using a different SDK version, then you will need to modify the
302examples accordingly.
303
304Additional build requirements:
305
306 gas-preprocessor.pl (https://github.com/yuvi/gas-preprocessor) should be
307 installed in your PATH.
308
309Set the following shell variables for simplicity:
310
311 IOS_PLATFORMDIR="/Developer/Platforms/iPhoneOS.platform"
312 IOS_SYSROOT="$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS4.3.sdk"
313 IOS_GCC="$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2"
314
315 ARM v6 only (up to and including iPhone 3G):
316 IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp"
317
318 ARM v7 only (iPhone 3GS and newer, iPad):
319 IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon"
320
321Follow the procedure under "Building libjpeg-turbo" above, adding
322
DRC89c59dd2011-10-27 20:40:21 +0000323 --host arm-apple-darwin10 --enable-static --disable-shared \
DRC94755ce2011-10-19 05:13:27 +0000324 CC="$IOS_GCC" LD="$IOS_GCC" \
325 CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \
326 LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS"
327
328to the configure command line.
329
330Once built, lipo can be used to combine the ARM v6 and v7 variants into a
331universal library.
332
DRC81543312010-10-18 07:23:58 +0000333
DRC68fef832010-02-16 05:29:10 +0000334*******************************************************************************
DRC81543312010-10-18 07:23:58 +0000335** Building on Windows (Visual C++ or MinGW)
DRC68fef832010-02-16 05:29:10 +0000336*******************************************************************************
337
DRCcc243742010-10-16 09:22:43 +0000338
DRC68fef832010-02-16 05:29:10 +0000339==================
340Build Requirements
341==================
342
DRCcc243742010-10-16 09:22:43 +0000343-- CMake (http://www.cmake.org) v2.6 or later
DRC68fef832010-02-16 05:29:10 +0000344
DRCcc243742010-10-16 09:22:43 +0000345-- Microsoft Visual C++ 2005 or later
DRC68fef832010-02-16 05:29:10 +0000346
DRCcc243742010-10-16 09:22:43 +0000347 If you don't already have Visual C++, then the easiest way to get it is by
348 installing the Windows SDK:
DRC68fef832010-02-16 05:29:10 +0000349
DRCcc243742010-10-16 09:22:43 +0000350 http://msdn.microsoft.com/en-us/windows/bb980924.aspx
351
352 The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
353 everything necessary to build libjpeg-turbo.
354
355 * For 32-bit builds, you can also use Microsoft Visual C++ Express
356 Edition. Visual C++ Express Edition is a free download.
357 * If you intend to build libjpeg-turbo from the command line, then add the
358 appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH
359 environment variables. This is generally accomplished by executing
360 vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and
361 vcvars64.bat are part of Visual C++ and are located in the same directory
362 as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass
363 optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build
364 environment.
365
366... OR ...
367
DRC81543312010-10-18 07:23:58 +0000368-- MinGW
DRCcc243742010-10-16 09:22:43 +0000369
370 GCC v4.1 or later recommended for best performance
DRC68fef832010-02-16 05:29:10 +0000371
DRC377add72010-05-17 16:41:12 +0000372-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
373 a 64-bit build)
DRC68fef832010-02-16 05:29:10 +0000374
DRC279bd342011-04-02 05:17:12 +0000375-- If building the TurboJPEG/OSS Java wrapper, JDK 1.5 or later is required.
376 This can be downloaded from http://www.java.com.
DRC218c0c12011-02-05 06:01:18 +0000377
DRCcc243742010-10-16 09:22:43 +0000378
379==================
380Out-of-Tree Builds
381==================
382
383Binary objects, libraries, and executables are generated in the same directory
384from which cmake was executed (the "binary directory"), and this directory need
385not necessarily be the same as the libjpeg-turbo source directory. You can
386create multiple independent binary directories, in which different versions of
387libjpeg-turbo can be built from the same source tree using different compilers
388or settings. In the sections below, {build_directory} refers to the binary
389directory, whereas {source_directory} refers to the libjpeg-turbo source
390directory. For in-tree builds, these directories are the same.
391
392
DRC68fef832010-02-16 05:29:10 +0000393======================
394Building libjpeg-turbo
395======================
396
DRC68fef832010-02-16 05:29:10 +0000397
DRCcc243742010-10-16 09:22:43 +0000398Visual C++ (Command Line)
399-------------------------
DRC68fef832010-02-16 05:29:10 +0000400
DRCcc243742010-10-16 09:22:43 +0000401 cd {build_directory}
402 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory}
403 nmake
DRC68fef832010-02-16 05:29:10 +0000404
DRCcc243742010-10-16 09:22:43 +0000405This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending
406on which version of cl.exe is in the PATH.
DRC8b014d72010-02-18 13:03:41 +0000407
DRCcc243742010-10-16 09:22:43 +0000408The following files will be generated under {build_directory}:
409
410 jpeg-static.lib
411 Static link library for libjpeg-turbo
412 sharedlib/jpeg{version}.dll
413 DLL for libjpeg-turbo
414 sharedlib/jpeg.lib
415 Import library for libjpeg-turbo DLL
416 turbojpeg-static.lib
417 Static link library for TurboJPEG/OSS
418 turbojpeg.dll
419 DLL for TurboJPEG/OSS
420 turbojpeg.lib
421 Import library for TurboJPEG/OSS DLL
422
423{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
DRCf38eee02011-02-18 07:00:38 +0000424v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000425
426
427Visual C++ (IDE)
428----------------
429
430Choose the appropriate CMake generator option for your version of Visual Studio
431(run "cmake" with no arguments for a list of available generators.) For
432instance:
433
434 cd {build_directory}
435 cmake -G "Visual Studio 9 2008" {source_directory}
436
437You can then open ALL_BUILD.vcproj in Visual Studio and build one of the
438configurations in that project ("Debug", "Release", etc.) to generate a full
439build of libjpeg-turbo.
440
441This will generate the following files under {build_directory}:
442
443 {configuration}/jpeg-static.lib
444 Static link library for libjpeg-turbo
445 sharedlib/{configuration}/jpeg{version}.dll
446 DLL for libjpeg-turbo
447 sharedlib/{configuration}/jpeg.lib
448 Import library for libjpeg-turbo DLL
449 {configuration}/turbojpeg-static.lib
450 Static link library for TurboJPEG/OSS
451 {configuration}/turbojpeg.dll
452 DLL for TurboJPEG/OSS
453 {configuration}/turbojpeg.lib
454 Import library for TurboJPEG/OSS DLL
455
456{configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on
457the configuration you built in the IDE, and {version} is 62, 7, or 8,
DRCf38eee02011-02-18 07:00:38 +0000458depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000459
460
461MinGW
462-----
463
464 cd {build_directory}
465 cmake -G "MSYS Makefiles" {source_directory}
466 make
467
468This will generate the following files under {build_directory}
469
470 libjpeg.a
471 Static link library for libjpeg-turbo
472 sharedlib/libjpeg-{version}.dll
473 DLL for libjpeg-turbo
474 sharedlib/libjpeg.dll.a
475 Import library for libjpeg-turbo DLL
476 libturbojpeg.a
477 Static link library for TurboJPEG/OSS
478 libturbojpeg.dll
479 DLL for TurboJPEG/OSS
480 libturbojpeg.dll.a
481 Import library for TurboJPEG/OSS DLL
482
483{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
DRCf38eee02011-02-18 07:00:38 +0000484v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000485
486
DRCcc243742010-10-16 09:22:43 +0000487Debug Build
488-----------
489
490Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with
491NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
492NMake.)
493
494
DRC30913542012-01-27 09:53:33 +0000495libjpeg v7 or v8 API/ABI Emulation
496-----------------------------------
DRCcc243742010-10-16 09:22:43 +0000497
498Add "-DWITH_JPEG7=1" to the cmake command line to build a version of
DRC30913542012-01-27 09:53:33 +0000499libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add "-DWITH_JPEG8=1"
500to the cmake command to build a version of libjpeg-turbo that is
501API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
502on libjpeg v7 and v8 emulation.
DRCcc243742010-10-16 09:22:43 +0000503
504
DRC245cfdf2010-11-23 17:11:06 +0000505Arithmetic Coding Support
506-------------------------
507
508Since the patent on arithmetic coding has expired, this functionality has been
509included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
DRCf38eee02011-02-18 07:00:38 +0000510based on the implementation in libjpeg v8, but it works when emulating libjpeg
DRC245cfdf2010-11-23 17:11:06 +0000511v7 or v6b as well. The default is to enable both arithmetic encoding and
512decoding, but those who have philosophical objections to arithmetic coding can
513add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to
514disable encoding or decoding (respectively.)
515
516
DRC279bd342011-04-02 05:17:12 +0000517TurboJPEG/OSS Java Wrapper
518--------------------------
519Add "-DWITH_JAVA=1" to the cmake command line to incorporate an optional Java
520Native Interface wrapper into the TurboJPEG/OSS dynamic library and build the
521Java front-end classes to support it. This allows the TurboJPEG/OSS dynamic
522library to be used directly from Java applications. See java/README for more
523details.
DRC218c0c12011-02-05 06:01:18 +0000524
DRCdb425062011-04-03 06:10:18 +0000525If you are using CMake 2.8, you can set the Java_JAVAC_EXECUTABLE,
526Java_JAVA_EXECUTABLE, and Java_JAR_EXECUTABLE CMake variables to specify
527alternate commands or locations for javac, jar, and java (respectively.) If
528you are using CMake 2.6, set JAVA_COMPILE, JAVA_RUNTIME, and JAVA_ARCHIVE
529instead. You can also set the JAVACFLAGS CMake variable to specify arguments
530that should be passed to the Java compiler when building the front-end classes.
531
DRC218c0c12011-02-05 06:01:18 +0000532
DRC26658432010-10-16 22:04:29 +0000533========================
534Installing libjpeg-turbo
535========================
536
537You can use the build system to install libjpeg-turbo into a directory of your
538choosing (as opposed to creating an installer.) To do this, add:
539
540 -DCMAKE_INSTALL_PREFIX={install_directory}
541
542to the cmake command line.
543
544For example,
545
DRC81543312010-10-18 07:23:58 +0000546 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \
DRC26658432010-10-16 22:04:29 +0000547 -DCMAKE_INSTALL_PREFIX=c:\libjpeg-turbo {source_directory}
548 nmake install
549
550will install the header files in c:\libjpeg-turbo\include, the library files
551in c:\libjpeg-turbo\lib, the DLL's in c:\libjpeg-turbo\bin, and the
552documentation in c:\libjpeg-turbo\doc.
553
554
DRCcc243742010-10-16 09:22:43 +0000555=============
556Build Recipes
557=============
558
559
DRC1c73ce82010-10-16 21:02:54 +000056064-bit MinGW Build on Cygwin
561----------------------------
562
563 cd {build_directory}
DRC2e4d0442011-02-08 01:18:37 +0000564 CC=/usr/bin/x86_64-w64-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000565 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
566 -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
DRC1c73ce82010-10-16 21:02:54 +0000567 -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
568 make
569
570This produces a 64-bit build of libjpeg-turbo that does not depend on
571cygwin1.dll or other Cygwin DLL's. The mingw64-x86_64-gcc-core and
572mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed.
573
574
57532-bit MinGW Build on Cygwin
576----------------------------
577
578 cd {build_directory}
DRC2e4d0442011-02-08 01:18:37 +0000579 CC=/usr/bin/i686-w64-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000580 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
581 -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
DRC1c73ce82010-10-16 21:02:54 +0000582 -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
583 make
584
585This produces a 32-bit build of libjpeg-turbo that does not depend on
586cygwin1.dll or other Cygwin DLL's. The mingw64-i686-gcc-core and
587mingw64-i686-gcc-g++ packages (and their dependencies) must be installed.
588
589
590MinGW-w64 Build on Windows
591--------------------------
592
593This produces a 64-bit build of libjpeg-turbo using the "native" MinGW-w64
594toolchain (which is faster than the Cygwin version):
595
596 cd {build_directory}
597 CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
DRC81543312010-10-18 07:23:58 +0000598 cmake -G "MSYS Makefiles" \
DRC1c73ce82010-10-16 21:02:54 +0000599 -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
600 -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
601 {source_directory}
602 make
603
604
DRCcc243742010-10-16 09:22:43 +0000605MinGW Build on Linux
606--------------------
607
608 cd {build_directory}
609 CC={mingw_binary_path}/i386-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000610 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
611 -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
DRCcc243742010-10-16 09:22:43 +0000612 -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
DRC68bf3f22010-10-18 07:56:14 +0000613 {source_directory}
DRCcc243742010-10-16 09:22:43 +0000614 make
DRC8b014d72010-02-18 13:03:41 +0000615
DRC68fef832010-02-16 05:29:10 +0000616
617*******************************************************************************
618** Creating Release Packages
619*******************************************************************************
620
621The following commands can be used to create various types of release packages:
622
DRCcc243742010-10-16 09:22:43 +0000623
624Unix
625----
626
DRC68fef832010-02-16 05:29:10 +0000627make rpm
628
DRCcc243742010-10-16 09:22:43 +0000629 Create Red Hat-style binary RPM package. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000630
631make srpm
632
633 This runs 'make dist' to create a pristine source tarball, then creates a
DRCcc243742010-10-16 09:22:43 +0000634 Red Hat-style source RPM package from the tarball. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000635
636make deb
637
638 Create Debian-style binary package. Requires dpkg.
639
640make dmg
641
642 Create Macintosh package/disk image. This requires the PackageMaker
643 application, which must be installed in /Developer/Applications/Utilities.
644
DRC9ef93db2010-10-18 08:24:42 +0000645make udmg [BUILDDIR32={32-bit build directory}]
DRC68fef832010-02-16 05:29:10 +0000646
DRCbbaf4c92012-02-10 01:24:26 +0000647 On 64-bit OS X systems, this creates a Macintosh package and disk image that
648 contains universal i386/x86-64 binaries. You should first configure a 32-bit
649 out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree
650 build, then run 'make udmg' from the 64-bit build directory. The build
651 system will look for the 32-bit build under {source_directory}/osxx86 by
652 default, but you can override this by setting the BUILDDIR32 variable on the
653 make command line as shown above.
DRC68fef832010-02-16 05:29:10 +0000654
DRC1fbae842012-02-09 09:23:30 +0000655make iosdmg [BUILDDIR32={32-bit build directory}] \
656 [BUILDDIRARMV6={ARM v6 build directory}] \
657 [BUILDDIRARMV7={ARM v7 build directory}] \
658
DRCbbaf4c92012-02-10 01:24:26 +0000659 On OS X systems, this creates a Macintosh package and disk image in which the
660 libjpeg-turbo static libraries contain ARM architectures necessary to build
661 iOS applications. If building on an x86-64 system, the binaries will also
662 contain the i386 architecture, as with 'make udmg' above. You should first
663 configure ARM v6 and ARM v7 out-of-tree builds of libjpeg-turbo (see
664 "Building libjpeg-turbo for iOS" above.) If you are building an x86-64
665 version of libjpeg-turbo, you should configure a 32-bit out-of-tree build as
666 well. Next, build libjpeg-turbo as you would normally, using an out-of-tree
667 build. When it is built, run 'make iosdmg' from the build directory. The
668 build system will look for the ARM v6 build under {source_directory}/iosarmv6
669 by default, the ARM v7 build under {source_directory}/iosarmv7 by default,
670 and (if applicable) the 32-bit build under {source_directory}/osxx86 by
671 default, but you can override this by setting the BUILDDIR32, BUILDDIRARMV6,
672 and/or BUILDDIRARMV7 variables on the make command line as shown above.
DRC1fbae842012-02-09 09:23:30 +0000673
DRC0f53df82010-10-21 19:47:06 +0000674make sunpkg
675
676 Build a Solaris package. This requires pkgmk, pkgtrans, and bzip2.
677
678make csunpkg [BUILDDIR32={32-bit build directory}]
679
DRC80803ae2011-12-15 13:12:59 +0000680 On 64-bit Solaris systems, this creates a combined package that contains
DRC0f53df82010-10-21 19:47:06 +0000681 both 32-bit and 64-bit libraries. You should first configure a 32-bit
682 out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree
683 build, then run 'make csunpkg' from the 64-bit build directory. The build
684 system will look for the 32-bit build under {source_directory}/solx86 by
685 default, but you can override this by setting the BUILDDIR32 variable on the
686 make command line as shown above.
687
DRC81543312010-10-18 07:23:58 +0000688make cygwinpkg
689
690 Build a Cygwin binary package.
691
DRC0a1f68e2010-02-24 07:24:26 +0000692
DRCcc243742010-10-16 09:22:43 +0000693Windows
694-------
DRC0a1f68e2010-02-24 07:24:26 +0000695
DRCcc243742010-10-16 09:22:43 +0000696If using NMake:
DRC68fef832010-02-16 05:29:10 +0000697
DRCcc243742010-10-16 09:22:43 +0000698 cd {build_directory}
699 nmake installer
700
DRC81543312010-10-18 07:23:58 +0000701If using MinGW:
DRCcc243742010-10-16 09:22:43 +0000702
703 cd {build_directory}
704 make installer
705
706If using the Visual Studio IDE, build the "installer" project.
707
708The installer package (libjpeg-turbo[-gcc][64].exe) will be located under
709{build_directory}. If building using the Visual Studio IDE, then the installer
710package will be located in a subdirectory with the same name as the
711configuration you built (such as {build_directory}\Debug\ or
712{build_directory}\Release\).
713
714Building a Windows installer requires the Nullsoft Install System
715(http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.
DRCcb6157b2012-01-31 11:38:13 +0000716
717
718*******************************************************************************
719** Regression testing
720*******************************************************************************
721
722The most common way to test libjpeg-turbo is by invoking 'make test' on
723Unix/Linux platforms or 'ctest' on Windows platforms, once the build has
724completed. This runs a series of tests to ensure that mathematical
725compatibility has been maintained between libjpeg-turbo and libjpeg v6b. This
726also invokes the TurboJPEG unit tests, which ensure that the colorspace
727extensions, YUV encoding, decompression scaling, and other features of the
728TurboJPEG C and Java APIs are working properly (and, by extension, that the
729equivalent features of the underlying libjpeg API are also working.)
730
731Invoking 'make testclean' or 'nmake testclean' (if using NMake) or building
732the 'testclean' target (if using the Visual Studio IDE) will clean up the
733output images generated by 'make test'.
734
735On Unix/Linux platforms, more extensive tests of the TurboJPEG/OSS C and Java
736wrappers can be run by invoking 'make tjtest'. These extended TurboJPEG tests
737essentially iterate through all of the available features of the TurboJPEG APIs
738that are not covered by the TurboJPEG unit tests (this includes the lossless
739transform options) and compare the images generated by each feature to images
740generated using the equivalent feature in the libjpeg API. The extended
741TurboJPEG tests are meant to test for regressions in the TurboJPEG wrappers,
742not in the underlying libjpeg-turbo library.