blob: 416d8c1091efb6df4515bdad0bbd0b388bede00d [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
14-- NASM
15 * 0.98 or later is required for a 32-bit build
16 * NASM 2.05 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
DRCcc243742010-10-16 09:22:43 +000020 The NASM 2.05 RPMs do not work on older Linux systems, such as Red Hat
21 Enterprise Linux 4. On such systems, you can easily build and install NASM
22 2.05 from the source RPM by executing the following as root:
DRC68fef832010-02-16 05:29:10 +000023
24 ARCH=`uname -m`
25 wget http://www.nasm.us/pub/nasm/releasebuilds/2.05.01/nasm-2.05.01-1.src.rpm
26 rpmbuild --rebuild nasm-2.05.01-1.src.rpm
27 rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-2.05.01-1.$ARCH.rpm
28
DRCc3f4ac02010-02-19 21:51:26 +000029 NOTE: NASM build will fail if texinfo is not installed.
30
DRC8f870c22010-02-24 00:30:00 +000031-- GCC v4.1 or later recommended for best performance
DRC68fef832010-02-16 05:29:10 +000032
DRC279bd342011-04-02 05:17:12 +000033-- If building the TurboJPEG/OSS Java wrapper, JDK or OpenJDK 1.5 or later is
34 required. Some systems, such as OS X 10.4, Solaris 10 and later, and Red
35 Hat Enterprise Linux 5 and later, have this pre-installed. On OS X 10.5 and
36 later, it will be necessary to install the Java Developer Package, which can
37 be downloaded from http://connect.apple.com. For systems that do not have a
38 JDK installed, you can obtain the Oracle Java Development Kit from
39 http://www.java.com.
DRCf8e00552011-02-04 11:06:36 +000040
DRCcc243742010-10-16 09:22:43 +000041
42==================
43Out-of-Tree Builds
44==================
45
46Binary objects, libraries, and executables are generated in the same directory
47from which configure was executed (the "binary directory"), and this directory
48need not necessarily be the same as the libjpeg-turbo source directory. You
49can create multiple independent binary directories, in which different versions
50of libjpeg-turbo can be built from the same source tree using different
51compilers or settings. In the sections below, {build_directory} refers to the
52binary directory, whereas {source_directory} refers to the libjpeg-turbo source
53directory. For in-tree builds, these directories are the same.
54
55
DRC68fef832010-02-16 05:29:10 +000056======================
57Building libjpeg-turbo
58======================
59
DRC49597872010-05-17 20:47:57 +000060The following procedure will build libjpeg-turbo on Linux, FreeBSD, 32-bit
DRC81543312010-10-18 07:23:58 +000061OS X, Cygwin, and Solaris/x86 systems (on Solaris, this generates a 32-bit
62library. See below for 64-bit build instructions.)
DRC68fef832010-02-16 05:29:10 +000063
DRCcc243742010-10-16 09:22:43 +000064 cd {source_directory}
DRC68fef832010-02-16 05:29:10 +000065 autoreconf -fiv
DRCcc243742010-10-16 09:22:43 +000066 cd {build_directory}
DRC98dbe912010-11-04 22:22:30 +000067 sh {source_directory}/configure [additional configure flags]
DRC68fef832010-02-16 05:29:10 +000068 make
69
DRCcc243742010-10-16 09:22:43 +000070NOTE: Running autoreconf in the source directory is only necessary if building
71libjpeg-turbo from the SVN repository.
DRC68fef832010-02-16 05:29:10 +000072
73This will generate the following files under .libs/
74
75 libjpeg.a
76 Static link library for libjpeg-turbo
77
DRCcc243742010-10-16 09:22:43 +000078 libjpeg.so.{version} (Linux, Solaris)
79 libjpeg.{version}.dylib (OS X)
DRC81543312010-10-18 07:23:58 +000080 cygjpeg-{version}.dll (Cygwin)
DRC68fef832010-02-16 05:29:10 +000081 Shared library for libjpeg-turbo
82
83 libjpeg.so (Linux, Solaris)
84 libjpeg.dylib (OS X)
DRC81543312010-10-18 07:23:58 +000085 libjpeg.dll.a (Cygwin)
DRC68fef832010-02-16 05:29:10 +000086 Development stub for libjpeg-turbo shared library
87
88 libturbojpeg.a
89 Static link library for TurboJPEG/OSS
90
91 libturbojpeg.so (Linux, Solaris)
92 libturbojpeg.dylib (OS X)
93 Shared library and development stub for TurboJPEG/OSS
94
DRC81543312010-10-18 07:23:58 +000095 cygturbojpeg.dll (Cygwin)
96 Shared library for TurboJPEG/OSS
97
98 libturbojpeg.dll.a (Cygwin)
99 Development stub for TurboJPEG/OSS shared library
100
DRCcc243742010-10-16 09:22:43 +0000101{version} is 62.0.0, 7.0.0, or 8.0.2, depending on whether libjpeg v6b
DRCf38eee02011-02-18 07:00:38 +0000102(default), v7, or v8 emulation is enabled. If using Cygwin, {version} is
DRC81543312010-10-18 07:23:58 +000010362, 7, or 8.
104
105
DRCf38eee02011-02-18 07:00:38 +0000106libjpeg v7 or v8 Emulation
107--------------------------
DRC81543312010-10-18 07:23:58 +0000108
109Add --with-jpeg7 to the configure command line to build a version of
110libjpeg-turbo that is compatible with libjpeg v7. Add --with-jpeg8 to the
111configure command to build a version of libjpeg-turbo that is compatible with
DRCf38eee02011-02-18 07:00:38 +0000112libjpeg v8. See README-turbo.txt for more information on libjpeg v7 and v8
DRC81543312010-10-18 07:23:58 +0000113emulation.
114
DRC68fef832010-02-16 05:29:10 +0000115
DRC245cfdf2010-11-23 17:11:06 +0000116Arithmetic Coding Support
117-------------------------
118
119Since the patent on arithmetic coding has expired, this functionality has been
120included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
DRCf38eee02011-02-18 07:00:38 +0000121based on the implementation in libjpeg v8, but it works when emulating libjpeg
DRC245cfdf2010-11-23 17:11:06 +0000122v7 or v6b as well. The default is to enable both arithmetic encoding and
123decoding, but those who have philosophical objections to arithmetic coding can
124add --without-arith-enc or --without-arith-dec to the configure command line to
125disable encoding or decoding (respectively.)
126
DRC68fef832010-02-16 05:29:10 +0000127
DRC279bd342011-04-02 05:17:12 +0000128TurboJPEG/OSS Java Wrapper
129--------------------------
DRC88f54a42011-04-01 01:21:22 +0000130Add --with-java to the configure command line to incorporate an optional Java
131Native Interface wrapper into the TurboJPEG/OSS dynamic library and build the
132Java front-end classes to support it. This allows the TurboJPEG/OSS dynamic
133library to be used directly from Java applications. See java/README for more
134details.
135
136You can set the JAVAC, JAR, and JAVA configure variables to specify
137alternate commands for javac, jar, and java (respectively.) You can also
138set the JAVACFLAGS configure variable to specify arguments that should be
139passed to the Java compiler when building the front-end classes, and JNI_CFLAGS
140to specify arguments that should be passed to the C compiler when building the
141JNI wrapper. Run 'configure --help' for more details.
DRCf8e00552011-02-04 11:06:36 +0000142
143
DRC68fef832010-02-16 05:29:10 +0000144========================
145Installing libjpeg-turbo
146========================
147
148If you intend to install these libraries and the associated header files, then
149replace 'make' in the instructions above with
150
151 make install prefix={base dir} libdir={library directory}
152
153For example,
154
155 make install prefix=/usr/local libdir=/usr/local/lib64
156
157will install the header files in /usr/local/include and the library files in
158/usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default
159is to install the header files in /opt/libjpeg-turbo/include and the library
160files in /opt/libjpeg-turbo/lib.
161
162NOTE: You can specify a prefix of /usr and a libdir of, for instance,
163/usr/lib64 to overwrite the system's version of libjpeg. If you do this,
164however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before
165overwriting it. It is recommended that you instead install libjpeg-turbo into
166a non-system directory and manipulate the LD_LIBRARY_PATH or create sym links
167to force applications to use libjpeg-turbo instead of libjpeg. See
168README-turbo.txt for more information.
169
DRCcc243742010-10-16 09:22:43 +0000170
DRC68fef832010-02-16 05:29:10 +0000171=============
172Build Recipes
173=============
174
DRCcc243742010-10-16 09:22:43 +0000175
DRC68fef832010-02-16 05:29:10 +000017632-bit Library Build on 64-bit Linux
177------------------------------------
178
DRCca5e7d12010-02-17 02:25:06 +0000179Add
DRC68fef832010-02-16 05:29:10 +0000180
DRC2e4d0442011-02-08 01:18:37 +0000181 --host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32
DRC68fef832010-02-16 05:29:10 +0000182
183to the configure command line.
184
185
DRC9026b372011-04-16 13:37:22 +000018664-bit Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000187-----------------------------------
188
DRCca5e7d12010-02-17 02:25:06 +0000189Add
DRC68fef832010-02-16 05:29:10 +0000190
DRC0dedd1a2010-07-02 09:20:12 +0000191 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm
DRC68fef832010-02-16 05:29:10 +0000192
DRC7bac07b2010-04-10 05:53:35 +0000193to the configure command line. NASM 2.07 or later from MacPorts must be
194installed.
DRC68fef832010-02-16 05:29:10 +0000195
196
DRC9026b372011-04-16 13:37:22 +000019732-bit Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000198-----------------------------------
199
DRCca5e7d12010-02-17 02:25:06 +0000200Add
DRC68fef832010-02-16 05:29:10 +0000201
DRC2e4d0442011-02-08 01:18:37 +0000202 CFLAGS='-O3 -m32' LDFLAGS=-m32
DRC68fef832010-02-16 05:29:10 +0000203
204to the configure command line.
205
206
DRC9026b372011-04-16 13:37:22 +000020764-bit Backward-Compatible Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000208-------------------------------------------------------
209
DRCca5e7d12010-02-17 02:25:06 +0000210Add
DRC68fef832010-02-16 05:29:10 +0000211
DRC0dedd1a2010-07-02 09:20:12 +0000212 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
213 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
214 -mmacosx-version-min=10.4 -O3' \
DRC0dedd1a2010-07-02 09:20:12 +0000215 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
216 -mmacosx-version-min=10.4'
217
DRC575c3422010-07-08 07:01:20 +0000218to the configure command line. The OS X 10.4 SDK, and NASM 2.07 or later from
219MacPorts, must be installed.
DRC0dedd1a2010-07-02 09:20:12 +0000220
221
DRC9026b372011-04-16 13:37:22 +000022232-bit Backward-Compatible Library Build on OS X
DRC0dedd1a2010-07-02 09:20:12 +0000223------------------------------------------------
224
225Add
226
DRC485cd802010-02-23 23:23:42 +0000227 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
228 -mmacosx-version-min=10.4 -O3 -m32' \
DRC68fef832010-02-16 05:29:10 +0000229 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
230 -mmacosx-version-min=10.4 -m32'
231
232to the configure command line. The OS X 10.4 SDK must be installed.
233
234
23564-bit Library Build on 64-bit Solaris
236--------------------------------------
237
DRCca5e7d12010-02-17 02:25:06 +0000238Add
DRC68fef832010-02-16 05:29:10 +0000239
DRC2e4d0442011-02-08 01:18:37 +0000240 --host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64
DRC68fef832010-02-16 05:29:10 +0000241
242to the configure command line.
243
244
DRC7bac07b2010-04-10 05:53:35 +000024532-bit Library Build on 64-bit FreeBSD
246--------------------------------------
247
248Add
249
DRC2e4d0442011-02-08 01:18:37 +0000250 --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \
251 LDFLAGS='-B/usr/lib32'
DRC7bac07b2010-04-10 05:53:35 +0000252
253to the configure command line. NASM 2.07 or later from FreeBSD ports must be
254installed.
255
256
DRCca5e7d12010-02-17 02:25:06 +0000257Sun Studio
258----------
259
260Add
261
DRC2e4d0442011-02-08 01:18:37 +0000262 CC=cc
DRCca5e7d12010-02-17 02:25:06 +0000263
264to the configure command line. libjpeg-turbo will automatically be built with
DRC2e4d0442011-02-08 01:18:37 +0000265the maximum optimization level (-xO5) unless you override CFLAGS.
DRCca5e7d12010-02-17 02:25:06 +0000266
267To build a 64-bit version of libjpeg-turbo using Sun Studio, add
268
DRC2e4d0442011-02-08 01:18:37 +0000269 --host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64
DRCca5e7d12010-02-17 02:25:06 +0000270
271to the configure command line.
272
DRC8b014d72010-02-18 13:03:41 +0000273
DRC81543312010-10-18 07:23:58 +0000274MinGW Build on Cygwin
275---------------------
276
277Use CMake (see recipes below)
278
279
280
DRC68fef832010-02-16 05:29:10 +0000281*******************************************************************************
DRC81543312010-10-18 07:23:58 +0000282** Building on Windows (Visual C++ or MinGW)
DRC68fef832010-02-16 05:29:10 +0000283*******************************************************************************
284
DRCcc243742010-10-16 09:22:43 +0000285
DRC68fef832010-02-16 05:29:10 +0000286==================
287Build Requirements
288==================
289
DRCcc243742010-10-16 09:22:43 +0000290-- CMake (http://www.cmake.org) v2.6 or later
DRC68fef832010-02-16 05:29:10 +0000291
DRCcc243742010-10-16 09:22:43 +0000292-- Microsoft Visual C++ 2005 or later
DRC68fef832010-02-16 05:29:10 +0000293
DRCcc243742010-10-16 09:22:43 +0000294 If you don't already have Visual C++, then the easiest way to get it is by
295 installing the Windows SDK:
DRC68fef832010-02-16 05:29:10 +0000296
DRCcc243742010-10-16 09:22:43 +0000297 http://msdn.microsoft.com/en-us/windows/bb980924.aspx
298
299 The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
300 everything necessary to build libjpeg-turbo.
301
302 * For 32-bit builds, you can also use Microsoft Visual C++ Express
303 Edition. Visual C++ Express Edition is a free download.
304 * If you intend to build libjpeg-turbo from the command line, then add the
305 appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH
306 environment variables. This is generally accomplished by executing
307 vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and
308 vcvars64.bat are part of Visual C++ and are located in the same directory
309 as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass
310 optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build
311 environment.
312
313... OR ...
314
DRC81543312010-10-18 07:23:58 +0000315-- MinGW
DRCcc243742010-10-16 09:22:43 +0000316
317 GCC v4.1 or later recommended for best performance
DRC68fef832010-02-16 05:29:10 +0000318
DRC377add72010-05-17 16:41:12 +0000319-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
320 a 64-bit build)
DRC68fef832010-02-16 05:29:10 +0000321
DRC279bd342011-04-02 05:17:12 +0000322-- If building the TurboJPEG/OSS Java wrapper, JDK 1.5 or later is required.
323 This can be downloaded from http://www.java.com.
DRC218c0c12011-02-05 06:01:18 +0000324
DRCcc243742010-10-16 09:22:43 +0000325
326==================
327Out-of-Tree Builds
328==================
329
330Binary objects, libraries, and executables are generated in the same directory
331from which cmake was executed (the "binary directory"), and this directory need
332not necessarily be the same as the libjpeg-turbo source directory. You can
333create multiple independent binary directories, in which different versions of
334libjpeg-turbo can be built from the same source tree using different compilers
335or settings. In the sections below, {build_directory} refers to the binary
336directory, whereas {source_directory} refers to the libjpeg-turbo source
337directory. For in-tree builds, these directories are the same.
338
339
DRC68fef832010-02-16 05:29:10 +0000340======================
341Building libjpeg-turbo
342======================
343
DRC68fef832010-02-16 05:29:10 +0000344
DRCcc243742010-10-16 09:22:43 +0000345Visual C++ (Command Line)
346-------------------------
DRC68fef832010-02-16 05:29:10 +0000347
DRCcc243742010-10-16 09:22:43 +0000348 cd {build_directory}
349 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory}
350 nmake
DRC68fef832010-02-16 05:29:10 +0000351
DRCcc243742010-10-16 09:22:43 +0000352This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending
353on which version of cl.exe is in the PATH.
DRC8b014d72010-02-18 13:03:41 +0000354
DRCcc243742010-10-16 09:22:43 +0000355The following files will be generated under {build_directory}:
356
357 jpeg-static.lib
358 Static link library for libjpeg-turbo
359 sharedlib/jpeg{version}.dll
360 DLL for libjpeg-turbo
361 sharedlib/jpeg.lib
362 Import library for libjpeg-turbo DLL
363 turbojpeg-static.lib
364 Static link library for TurboJPEG/OSS
365 turbojpeg.dll
366 DLL for TurboJPEG/OSS
367 turbojpeg.lib
368 Import library for TurboJPEG/OSS DLL
369
370{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
DRCf38eee02011-02-18 07:00:38 +0000371v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000372
373
374Visual C++ (IDE)
375----------------
376
377Choose the appropriate CMake generator option for your version of Visual Studio
378(run "cmake" with no arguments for a list of available generators.) For
379instance:
380
381 cd {build_directory}
382 cmake -G "Visual Studio 9 2008" {source_directory}
383
384You can then open ALL_BUILD.vcproj in Visual Studio and build one of the
385configurations in that project ("Debug", "Release", etc.) to generate a full
386build of libjpeg-turbo.
387
388This will generate the following files under {build_directory}:
389
390 {configuration}/jpeg-static.lib
391 Static link library for libjpeg-turbo
392 sharedlib/{configuration}/jpeg{version}.dll
393 DLL for libjpeg-turbo
394 sharedlib/{configuration}/jpeg.lib
395 Import library for libjpeg-turbo DLL
396 {configuration}/turbojpeg-static.lib
397 Static link library for TurboJPEG/OSS
398 {configuration}/turbojpeg.dll
399 DLL for TurboJPEG/OSS
400 {configuration}/turbojpeg.lib
401 Import library for TurboJPEG/OSS DLL
402
403{configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on
404the configuration you built in the IDE, and {version} is 62, 7, or 8,
DRCf38eee02011-02-18 07:00:38 +0000405depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000406
407
408MinGW
409-----
410
411 cd {build_directory}
412 cmake -G "MSYS Makefiles" {source_directory}
413 make
414
415This will generate the following files under {build_directory}
416
417 libjpeg.a
418 Static link library for libjpeg-turbo
419 sharedlib/libjpeg-{version}.dll
420 DLL for libjpeg-turbo
421 sharedlib/libjpeg.dll.a
422 Import library for libjpeg-turbo DLL
423 libturbojpeg.a
424 Static link library for TurboJPEG/OSS
425 libturbojpeg.dll
426 DLL for TurboJPEG/OSS
427 libturbojpeg.dll.a
428 Import library for TurboJPEG/OSS DLL
429
430{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
DRCf38eee02011-02-18 07:00:38 +0000431v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000432
433
DRCcc243742010-10-16 09:22:43 +0000434Debug Build
435-----------
436
437Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with
438NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
439NMake.)
440
441
DRCf38eee02011-02-18 07:00:38 +0000442libjpeg v7 or v8 Emulation
443--------------------------
DRCcc243742010-10-16 09:22:43 +0000444
445Add "-DWITH_JPEG7=1" to the cmake command line to build a version of
446libjpeg-turbo that is compatible with libjpeg v7. Add "-DWITH_JPEG8=1" to the
447cmake command to build a version of libjpeg-turbo that is compatible with
DRCf38eee02011-02-18 07:00:38 +0000448libjpeg v8. See README-turbo.txt for more information on libjpeg v7 and v8
DRCcc243742010-10-16 09:22:43 +0000449emulation.
450
451
DRC245cfdf2010-11-23 17:11:06 +0000452Arithmetic Coding Support
453-------------------------
454
455Since the patent on arithmetic coding has expired, this functionality has been
456included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
DRCf38eee02011-02-18 07:00:38 +0000457based on the implementation in libjpeg v8, but it works when emulating libjpeg
DRC245cfdf2010-11-23 17:11:06 +0000458v7 or v6b as well. The default is to enable both arithmetic encoding and
459decoding, but those who have philosophical objections to arithmetic coding can
460add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to
461disable encoding or decoding (respectively.)
462
463
DRC279bd342011-04-02 05:17:12 +0000464TurboJPEG/OSS Java Wrapper
465--------------------------
466Add "-DWITH_JAVA=1" to the cmake command line to incorporate an optional Java
467Native Interface wrapper into the TurboJPEG/OSS dynamic library and build the
468Java front-end classes to support it. This allows the TurboJPEG/OSS dynamic
469library to be used directly from Java applications. See java/README for more
470details.
DRC218c0c12011-02-05 06:01:18 +0000471
DRCdb425062011-04-03 06:10:18 +0000472If you are using CMake 2.8, you can set the Java_JAVAC_EXECUTABLE,
473Java_JAVA_EXECUTABLE, and Java_JAR_EXECUTABLE CMake variables to specify
474alternate commands or locations for javac, jar, and java (respectively.) If
475you are using CMake 2.6, set JAVA_COMPILE, JAVA_RUNTIME, and JAVA_ARCHIVE
476instead. You can also set the JAVACFLAGS CMake variable to specify arguments
477that should be passed to the Java compiler when building the front-end classes.
478
DRC218c0c12011-02-05 06:01:18 +0000479
DRC26658432010-10-16 22:04:29 +0000480========================
481Installing libjpeg-turbo
482========================
483
484You can use the build system to install libjpeg-turbo into a directory of your
485choosing (as opposed to creating an installer.) To do this, add:
486
487 -DCMAKE_INSTALL_PREFIX={install_directory}
488
489to the cmake command line.
490
491For example,
492
DRC81543312010-10-18 07:23:58 +0000493 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \
DRC26658432010-10-16 22:04:29 +0000494 -DCMAKE_INSTALL_PREFIX=c:\libjpeg-turbo {source_directory}
495 nmake install
496
497will install the header files in c:\libjpeg-turbo\include, the library files
498in c:\libjpeg-turbo\lib, the DLL's in c:\libjpeg-turbo\bin, and the
499documentation in c:\libjpeg-turbo\doc.
500
501
DRCcc243742010-10-16 09:22:43 +0000502=============
503Build Recipes
504=============
505
506
DRC1c73ce82010-10-16 21:02:54 +000050764-bit MinGW Build on Cygwin
508----------------------------
509
510 cd {build_directory}
DRC2e4d0442011-02-08 01:18:37 +0000511 CC=/usr/bin/x86_64-w64-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000512 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
513 -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
DRC1c73ce82010-10-16 21:02:54 +0000514 -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
515 make
516
517This produces a 64-bit build of libjpeg-turbo that does not depend on
518cygwin1.dll or other Cygwin DLL's. The mingw64-x86_64-gcc-core and
519mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed.
520
521
52232-bit MinGW Build on Cygwin
523----------------------------
524
525 cd {build_directory}
DRC2e4d0442011-02-08 01:18:37 +0000526 CC=/usr/bin/i686-w64-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000527 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
528 -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
DRC1c73ce82010-10-16 21:02:54 +0000529 -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
530 make
531
532This produces a 32-bit build of libjpeg-turbo that does not depend on
533cygwin1.dll or other Cygwin DLL's. The mingw64-i686-gcc-core and
534mingw64-i686-gcc-g++ packages (and their dependencies) must be installed.
535
536
537MinGW-w64 Build on Windows
538--------------------------
539
540This produces a 64-bit build of libjpeg-turbo using the "native" MinGW-w64
541toolchain (which is faster than the Cygwin version):
542
543 cd {build_directory}
544 CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
DRC81543312010-10-18 07:23:58 +0000545 cmake -G "MSYS Makefiles" \
DRC1c73ce82010-10-16 21:02:54 +0000546 -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
547 -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
548 {source_directory}
549 make
550
551
DRCcc243742010-10-16 09:22:43 +0000552MinGW Build on Linux
553--------------------
554
555 cd {build_directory}
556 CC={mingw_binary_path}/i386-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000557 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
558 -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
DRCcc243742010-10-16 09:22:43 +0000559 -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
DRC68bf3f22010-10-18 07:56:14 +0000560 {source_directory}
DRCcc243742010-10-16 09:22:43 +0000561 make
DRC8b014d72010-02-18 13:03:41 +0000562
DRC68fef832010-02-16 05:29:10 +0000563
564*******************************************************************************
565** Creating Release Packages
566*******************************************************************************
567
568The following commands can be used to create various types of release packages:
569
DRCcc243742010-10-16 09:22:43 +0000570
571Unix
572----
573
DRC68fef832010-02-16 05:29:10 +0000574make rpm
575
DRCcc243742010-10-16 09:22:43 +0000576 Create Red Hat-style binary RPM package. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000577
578make srpm
579
580 This runs 'make dist' to create a pristine source tarball, then creates a
DRCcc243742010-10-16 09:22:43 +0000581 Red Hat-style source RPM package from the tarball. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000582
583make deb
584
585 Create Debian-style binary package. Requires dpkg.
586
587make dmg
588
589 Create Macintosh package/disk image. This requires the PackageMaker
590 application, which must be installed in /Developer/Applications/Utilities.
591
DRC9ef93db2010-10-18 08:24:42 +0000592make udmg [BUILDDIR32={32-bit build directory}]
DRC68fef832010-02-16 05:29:10 +0000593
DRC0dedd1a2010-07-02 09:20:12 +0000594 On 64-bit OS X systems, this creates a version of the Macintosh package and
DRC9ef93db2010-10-18 08:24:42 +0000595 disk image which contains universal i386/x86-64 binaries. You should first
596 configure a 32-bit out-of-tree build of libjpeg-turbo, then configure a
597 64-bit out-of-tree build, then run 'make udmg' from the 64-bit build
598 directory. The build system will look for the 32-bit build under
599 {source_directory}/osxx86 by default, but you can override this by setting
600 the BUILDDIR32 variable on the make command line as shown above.
DRC68fef832010-02-16 05:29:10 +0000601
DRC0f53df82010-10-21 19:47:06 +0000602make sunpkg
603
604 Build a Solaris package. This requires pkgmk, pkgtrans, and bzip2.
605
606make csunpkg [BUILDDIR32={32-bit build directory}]
607
608 On 64-bit Solaris systems, this creates a combined package which contains
609 both 32-bit and 64-bit libraries. You should first configure a 32-bit
610 out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree
611 build, then run 'make csunpkg' from the 64-bit build directory. The build
612 system will look for the 32-bit build under {source_directory}/solx86 by
613 default, but you can override this by setting the BUILDDIR32 variable on the
614 make command line as shown above.
615
DRC81543312010-10-18 07:23:58 +0000616make cygwinpkg
617
618 Build a Cygwin binary package.
619
DRC0a1f68e2010-02-24 07:24:26 +0000620
DRCcc243742010-10-16 09:22:43 +0000621Windows
622-------
DRC0a1f68e2010-02-24 07:24:26 +0000623
DRCcc243742010-10-16 09:22:43 +0000624If using NMake:
DRC68fef832010-02-16 05:29:10 +0000625
DRCcc243742010-10-16 09:22:43 +0000626 cd {build_directory}
627 nmake installer
628
DRC81543312010-10-18 07:23:58 +0000629If using MinGW:
DRCcc243742010-10-16 09:22:43 +0000630
631 cd {build_directory}
632 make installer
633
634If using the Visual Studio IDE, build the "installer" project.
635
636The installer package (libjpeg-turbo[-gcc][64].exe) will be located under
637{build_directory}. If building using the Visual Studio IDE, then the installer
638package will be located in a subdirectory with the same name as the
639configuration you built (such as {build_directory}\Debug\ or
640{build_directory}\Release\).
641
642Building a Windows installer requires the Nullsoft Install System
643(http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.