blob: 86ca1c99dcd7dbd202f07ce42690bcbdeeae0806 [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
DRC218c0c12011-02-05 06:01:18 +000033-- If building the TurboJPEG/OSS JNI wrapper, jni.h is required. Some systems,
34 such as OS X 10.4 and Solaris 10, have this header pre-installed. On OS X
35 10.5 and later, the header can be obtained by installing the Java Developer
36 Package, which can be downloaded from http://connect.apple.com. On Linux
DRC8b38f492011-02-06 18:51:24 +000037 and other systems, the header can be obtained by installing the GCJ
38 (GCC-Java) development packages or the Oracle Java Development Kit (JDK).
DRCf8e00552011-02-04 11:06:36 +000039
DRCcc243742010-10-16 09:22:43 +000040
41==================
42Out-of-Tree Builds
43==================
44
45Binary objects, libraries, and executables are generated in the same directory
46from which configure was executed (the "binary directory"), and this directory
47need not necessarily be the same as the libjpeg-turbo source directory. You
48can create multiple independent binary directories, in which different versions
49of libjpeg-turbo can be built from the same source tree using different
50compilers or settings. In the sections below, {build_directory} refers to the
51binary directory, whereas {source_directory} refers to the libjpeg-turbo source
52directory. For in-tree builds, these directories are the same.
53
54
DRC68fef832010-02-16 05:29:10 +000055======================
56Building libjpeg-turbo
57======================
58
DRC49597872010-05-17 20:47:57 +000059The following procedure will build libjpeg-turbo on Linux, FreeBSD, 32-bit
DRC81543312010-10-18 07:23:58 +000060OS X, Cygwin, and Solaris/x86 systems (on Solaris, this generates a 32-bit
61library. See below for 64-bit build instructions.)
DRC68fef832010-02-16 05:29:10 +000062
DRCcc243742010-10-16 09:22:43 +000063 cd {source_directory}
DRC68fef832010-02-16 05:29:10 +000064 autoreconf -fiv
DRCcc243742010-10-16 09:22:43 +000065 cd {build_directory}
DRC98dbe912010-11-04 22:22:30 +000066 sh {source_directory}/configure [additional configure flags]
DRC68fef832010-02-16 05:29:10 +000067 make
68
DRCcc243742010-10-16 09:22:43 +000069NOTE: Running autoreconf in the source directory is only necessary if building
70libjpeg-turbo from the SVN repository.
DRC68fef832010-02-16 05:29:10 +000071
72This will generate the following files under .libs/
73
74 libjpeg.a
75 Static link library for libjpeg-turbo
76
DRCcc243742010-10-16 09:22:43 +000077 libjpeg.so.{version} (Linux, Solaris)
78 libjpeg.{version}.dylib (OS X)
DRC81543312010-10-18 07:23:58 +000079 cygjpeg-{version}.dll (Cygwin)
DRC68fef832010-02-16 05:29:10 +000080 Shared library for libjpeg-turbo
81
82 libjpeg.so (Linux, Solaris)
83 libjpeg.dylib (OS X)
DRC81543312010-10-18 07:23:58 +000084 libjpeg.dll.a (Cygwin)
DRC68fef832010-02-16 05:29:10 +000085 Development stub for libjpeg-turbo shared library
86
87 libturbojpeg.a
88 Static link library for TurboJPEG/OSS
89
90 libturbojpeg.so (Linux, Solaris)
91 libturbojpeg.dylib (OS X)
92 Shared library and development stub for TurboJPEG/OSS
93
DRC81543312010-10-18 07:23:58 +000094 cygturbojpeg.dll (Cygwin)
95 Shared library for TurboJPEG/OSS
96
97 libturbojpeg.dll.a (Cygwin)
98 Development stub for TurboJPEG/OSS shared library
99
DRCcc243742010-10-16 09:22:43 +0000100{version} is 62.0.0, 7.0.0, or 8.0.2, depending on whether libjpeg v6b
DRCf38eee02011-02-18 07:00:38 +0000101(default), v7, or v8 emulation is enabled. If using Cygwin, {version} is
DRC81543312010-10-18 07:23:58 +000010262, 7, or 8.
103
104
DRCf38eee02011-02-18 07:00:38 +0000105libjpeg v7 or v8 Emulation
106--------------------------
DRC81543312010-10-18 07:23:58 +0000107
108Add --with-jpeg7 to the configure command line to build a version of
109libjpeg-turbo that is compatible with libjpeg v7. Add --with-jpeg8 to the
110configure command to build a version of libjpeg-turbo that is compatible with
DRCf38eee02011-02-18 07:00:38 +0000111libjpeg v8. See README-turbo.txt for more information on libjpeg v7 and v8
DRC81543312010-10-18 07:23:58 +0000112emulation.
113
DRC68fef832010-02-16 05:29:10 +0000114
DRC245cfdf2010-11-23 17:11:06 +0000115Arithmetic Coding Support
116-------------------------
117
118Since the patent on arithmetic coding has expired, this functionality has been
119included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
DRCf38eee02011-02-18 07:00:38 +0000120based on the implementation in libjpeg v8, but it works when emulating libjpeg
DRC245cfdf2010-11-23 17:11:06 +0000121v7 or v6b as well. The default is to enable both arithmetic encoding and
122decoding, but those who have philosophical objections to arithmetic coding can
123add --without-arith-enc or --without-arith-dec to the configure command line to
124disable encoding or decoding (respectively.)
125
DRC68fef832010-02-16 05:29:10 +0000126
DRCf8e00552011-02-04 11:06:36 +0000127TurboJPEG/OSS JNI Wrapper
128-------------------------
DRC88f54a42011-04-01 01:21:22 +0000129Add --with-java to the configure command line to incorporate an optional Java
130Native Interface wrapper into the TurboJPEG/OSS dynamic library and build the
131Java front-end classes to support it. This allows the TurboJPEG/OSS dynamic
132library to be used directly from Java applications. See java/README for more
133details.
134
135You can set the JAVAC, JAR, and JAVA configure variables to specify
136alternate commands for javac, jar, and java (respectively.) You can also
137set the JAVACFLAGS configure variable to specify arguments that should be
138passed to the Java compiler when building the front-end classes, and JNI_CFLAGS
139to specify arguments that should be passed to the C compiler when building the
140JNI wrapper. Run 'configure --help' for more details.
DRCf8e00552011-02-04 11:06:36 +0000141
142
DRC68fef832010-02-16 05:29:10 +0000143========================
144Installing libjpeg-turbo
145========================
146
147If you intend to install these libraries and the associated header files, then
148replace 'make' in the instructions above with
149
150 make install prefix={base dir} libdir={library directory}
151
152For example,
153
154 make install prefix=/usr/local libdir=/usr/local/lib64
155
156will install the header files in /usr/local/include and the library files in
157/usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default
158is to install the header files in /opt/libjpeg-turbo/include and the library
159files in /opt/libjpeg-turbo/lib.
160
161NOTE: You can specify a prefix of /usr and a libdir of, for instance,
162/usr/lib64 to overwrite the system's version of libjpeg. If you do this,
163however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before
164overwriting it. It is recommended that you instead install libjpeg-turbo into
165a non-system directory and manipulate the LD_LIBRARY_PATH or create sym links
166to force applications to use libjpeg-turbo instead of libjpeg. See
167README-turbo.txt for more information.
168
DRCcc243742010-10-16 09:22:43 +0000169
DRC68fef832010-02-16 05:29:10 +0000170=============
171Build Recipes
172=============
173
DRCcc243742010-10-16 09:22:43 +0000174
DRC68fef832010-02-16 05:29:10 +000017532-bit Library Build on 64-bit Linux
176------------------------------------
177
DRCca5e7d12010-02-17 02:25:06 +0000178Add
DRC68fef832010-02-16 05:29:10 +0000179
DRC2e4d0442011-02-08 01:18:37 +0000180 --host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32
DRC68fef832010-02-16 05:29:10 +0000181
182to the configure command line.
183
184
DRC9026b372011-04-16 13:37:22 +000018564-bit Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000186-----------------------------------
187
DRCca5e7d12010-02-17 02:25:06 +0000188Add
DRC68fef832010-02-16 05:29:10 +0000189
DRC0dedd1a2010-07-02 09:20:12 +0000190 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm
DRC68fef832010-02-16 05:29:10 +0000191
DRC7bac07b2010-04-10 05:53:35 +0000192to the configure command line. NASM 2.07 or later from MacPorts must be
193installed.
DRC68fef832010-02-16 05:29:10 +0000194
195
DRC9026b372011-04-16 13:37:22 +000019632-bit Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000197-----------------------------------
198
DRCca5e7d12010-02-17 02:25:06 +0000199Add
DRC68fef832010-02-16 05:29:10 +0000200
DRC2e4d0442011-02-08 01:18:37 +0000201 CFLAGS='-O3 -m32' LDFLAGS=-m32
DRC68fef832010-02-16 05:29:10 +0000202
203to the configure command line.
204
205
DRC9026b372011-04-16 13:37:22 +000020664-bit Backward-Compatible Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000207-------------------------------------------------------
208
DRCca5e7d12010-02-17 02:25:06 +0000209Add
DRC68fef832010-02-16 05:29:10 +0000210
DRC0dedd1a2010-07-02 09:20:12 +0000211 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
212 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
213 -mmacosx-version-min=10.4 -O3' \
DRC0dedd1a2010-07-02 09:20:12 +0000214 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
215 -mmacosx-version-min=10.4'
216
DRC575c3422010-07-08 07:01:20 +0000217to the configure command line. The OS X 10.4 SDK, and NASM 2.07 or later from
218MacPorts, must be installed.
DRC0dedd1a2010-07-02 09:20:12 +0000219
220
DRC9026b372011-04-16 13:37:22 +000022132-bit Backward-Compatible Library Build on OS X
DRC0dedd1a2010-07-02 09:20:12 +0000222------------------------------------------------
223
224Add
225
DRC485cd802010-02-23 23:23:42 +0000226 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
227 -mmacosx-version-min=10.4 -O3 -m32' \
DRC68fef832010-02-16 05:29:10 +0000228 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
229 -mmacosx-version-min=10.4 -m32'
230
231to the configure command line. The OS X 10.4 SDK must be installed.
232
233
23464-bit Library Build on 64-bit Solaris
235--------------------------------------
236
DRCca5e7d12010-02-17 02:25:06 +0000237Add
DRC68fef832010-02-16 05:29:10 +0000238
DRC2e4d0442011-02-08 01:18:37 +0000239 --host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64
DRC68fef832010-02-16 05:29:10 +0000240
241to the configure command line.
242
243
DRC7bac07b2010-04-10 05:53:35 +000024432-bit Library Build on 64-bit FreeBSD
245--------------------------------------
246
247Add
248
DRC2e4d0442011-02-08 01:18:37 +0000249 --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \
250 LDFLAGS='-B/usr/lib32'
DRC7bac07b2010-04-10 05:53:35 +0000251
252to the configure command line. NASM 2.07 or later from FreeBSD ports must be
253installed.
254
255
DRCca5e7d12010-02-17 02:25:06 +0000256Sun Studio
257----------
258
259Add
260
DRC2e4d0442011-02-08 01:18:37 +0000261 CC=cc
DRCca5e7d12010-02-17 02:25:06 +0000262
263to the configure command line. libjpeg-turbo will automatically be built with
DRC2e4d0442011-02-08 01:18:37 +0000264the maximum optimization level (-xO5) unless you override CFLAGS.
DRCca5e7d12010-02-17 02:25:06 +0000265
266To build a 64-bit version of libjpeg-turbo using Sun Studio, add
267
DRC2e4d0442011-02-08 01:18:37 +0000268 --host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64
DRCca5e7d12010-02-17 02:25:06 +0000269
270to the configure command line.
271
DRC8b014d72010-02-18 13:03:41 +0000272
DRC81543312010-10-18 07:23:58 +0000273MinGW Build on Cygwin
274---------------------
275
276Use CMake (see recipes below)
277
278
279
DRC68fef832010-02-16 05:29:10 +0000280*******************************************************************************
DRC81543312010-10-18 07:23:58 +0000281** Building on Windows (Visual C++ or MinGW)
DRC68fef832010-02-16 05:29:10 +0000282*******************************************************************************
283
DRCcc243742010-10-16 09:22:43 +0000284
DRC68fef832010-02-16 05:29:10 +0000285==================
286Build Requirements
287==================
288
DRCcc243742010-10-16 09:22:43 +0000289-- CMake (http://www.cmake.org) v2.6 or later
DRC68fef832010-02-16 05:29:10 +0000290
DRCcc243742010-10-16 09:22:43 +0000291-- Microsoft Visual C++ 2005 or later
DRC68fef832010-02-16 05:29:10 +0000292
DRCcc243742010-10-16 09:22:43 +0000293 If you don't already have Visual C++, then the easiest way to get it is by
294 installing the Windows SDK:
DRC68fef832010-02-16 05:29:10 +0000295
DRCcc243742010-10-16 09:22:43 +0000296 http://msdn.microsoft.com/en-us/windows/bb980924.aspx
297
298 The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
299 everything necessary to build libjpeg-turbo.
300
301 * For 32-bit builds, you can also use Microsoft Visual C++ Express
302 Edition. Visual C++ Express Edition is a free download.
303 * If you intend to build libjpeg-turbo from the command line, then add the
304 appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH
305 environment variables. This is generally accomplished by executing
306 vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and
307 vcvars64.bat are part of Visual C++ and are located in the same directory
308 as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass
309 optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build
310 environment.
311
312... OR ...
313
DRC81543312010-10-18 07:23:58 +0000314-- MinGW
DRCcc243742010-10-16 09:22:43 +0000315
316 GCC v4.1 or later recommended for best performance
DRC68fef832010-02-16 05:29:10 +0000317
DRC377add72010-05-17 16:41:12 +0000318-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
319 a 64-bit build)
DRC68fef832010-02-16 05:29:10 +0000320
DRC218c0c12011-02-05 06:01:18 +0000321-- If building the TurboJPEG/OSS JNI wrapper, jni.h is required. This header
322 can be obtained by installing the Oracle Java Development Kit (JDK).
323 * If using Visual C++, then add the appropriate Java include directories
324 (Example: c:\Program Files\Java\jdk1.6.0_23\include;c:\Program Files\Java\jdk1.6.0_23\include\win32)
325 to the INCLUDE environment variable prior to building libjpeg-turbo.
326 * If using MinGW, then add the appropriate Java include directories
327 (Example: /c/Program Files/Java/jdk1.6.0_23/include:/c/Program Files/Java/jdk1.6.0_23/include/win32)
328 to the CPATH environment variable prior to building libjpeg-turbo.
329
DRCcc243742010-10-16 09:22:43 +0000330
331==================
332Out-of-Tree Builds
333==================
334
335Binary objects, libraries, and executables are generated in the same directory
336from which cmake was executed (the "binary directory"), and this directory need
337not necessarily be the same as the libjpeg-turbo source directory. You can
338create multiple independent binary directories, in which different versions of
339libjpeg-turbo can be built from the same source tree using different compilers
340or settings. In the sections below, {build_directory} refers to the binary
341directory, whereas {source_directory} refers to the libjpeg-turbo source
342directory. For in-tree builds, these directories are the same.
343
344
DRC68fef832010-02-16 05:29:10 +0000345======================
346Building libjpeg-turbo
347======================
348
DRC68fef832010-02-16 05:29:10 +0000349
DRCcc243742010-10-16 09:22:43 +0000350Visual C++ (Command Line)
351-------------------------
DRC68fef832010-02-16 05:29:10 +0000352
DRCcc243742010-10-16 09:22:43 +0000353 cd {build_directory}
354 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory}
355 nmake
DRC68fef832010-02-16 05:29:10 +0000356
DRCcc243742010-10-16 09:22:43 +0000357This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending
358on which version of cl.exe is in the PATH.
DRC8b014d72010-02-18 13:03:41 +0000359
DRCcc243742010-10-16 09:22:43 +0000360The following files will be generated under {build_directory}:
361
362 jpeg-static.lib
363 Static link library for libjpeg-turbo
364 sharedlib/jpeg{version}.dll
365 DLL for libjpeg-turbo
366 sharedlib/jpeg.lib
367 Import library for libjpeg-turbo DLL
368 turbojpeg-static.lib
369 Static link library for TurboJPEG/OSS
370 turbojpeg.dll
371 DLL for TurboJPEG/OSS
372 turbojpeg.lib
373 Import library for TurboJPEG/OSS DLL
374
375{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
DRCf38eee02011-02-18 07:00:38 +0000376v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000377
378
379Visual C++ (IDE)
380----------------
381
382Choose the appropriate CMake generator option for your version of Visual Studio
383(run "cmake" with no arguments for a list of available generators.) For
384instance:
385
386 cd {build_directory}
387 cmake -G "Visual Studio 9 2008" {source_directory}
388
389You can then open ALL_BUILD.vcproj in Visual Studio and build one of the
390configurations in that project ("Debug", "Release", etc.) to generate a full
391build of libjpeg-turbo.
392
393This will generate the following files under {build_directory}:
394
395 {configuration}/jpeg-static.lib
396 Static link library for libjpeg-turbo
397 sharedlib/{configuration}/jpeg{version}.dll
398 DLL for libjpeg-turbo
399 sharedlib/{configuration}/jpeg.lib
400 Import library for libjpeg-turbo DLL
401 {configuration}/turbojpeg-static.lib
402 Static link library for TurboJPEG/OSS
403 {configuration}/turbojpeg.dll
404 DLL for TurboJPEG/OSS
405 {configuration}/turbojpeg.lib
406 Import library for TurboJPEG/OSS DLL
407
408{configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on
409the configuration you built in the IDE, and {version} is 62, 7, or 8,
DRCf38eee02011-02-18 07:00:38 +0000410depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000411
412
413MinGW
414-----
415
416 cd {build_directory}
417 cmake -G "MSYS Makefiles" {source_directory}
418 make
419
420This will generate the following files under {build_directory}
421
422 libjpeg.a
423 Static link library for libjpeg-turbo
424 sharedlib/libjpeg-{version}.dll
425 DLL for libjpeg-turbo
426 sharedlib/libjpeg.dll.a
427 Import library for libjpeg-turbo DLL
428 libturbojpeg.a
429 Static link library for TurboJPEG/OSS
430 libturbojpeg.dll
431 DLL for TurboJPEG/OSS
432 libturbojpeg.dll.a
433 Import library for TurboJPEG/OSS DLL
434
435{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
DRCf38eee02011-02-18 07:00:38 +0000436v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000437
438
DRCcc243742010-10-16 09:22:43 +0000439Debug Build
440-----------
441
442Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with
443NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
444NMake.)
445
446
DRCf38eee02011-02-18 07:00:38 +0000447libjpeg v7 or v8 Emulation
448--------------------------
DRCcc243742010-10-16 09:22:43 +0000449
450Add "-DWITH_JPEG7=1" to the cmake command line to build a version of
451libjpeg-turbo that is compatible with libjpeg v7. Add "-DWITH_JPEG8=1" to the
452cmake command to build a version of libjpeg-turbo that is compatible with
DRCf38eee02011-02-18 07:00:38 +0000453libjpeg v8. See README-turbo.txt for more information on libjpeg v7 and v8
DRCcc243742010-10-16 09:22:43 +0000454emulation.
455
456
DRC245cfdf2010-11-23 17:11:06 +0000457Arithmetic Coding Support
458-------------------------
459
460Since the patent on arithmetic coding has expired, this functionality has been
461included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
DRCf38eee02011-02-18 07:00:38 +0000462based on the implementation in libjpeg v8, but it works when emulating libjpeg
DRC245cfdf2010-11-23 17:11:06 +0000463v7 or v6b as well. The default is to enable both arithmetic encoding and
464decoding, but those who have philosophical objections to arithmetic coding can
465add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to
466disable encoding or decoding (respectively.)
467
468
DRC218c0c12011-02-05 06:01:18 +0000469TurboJPEG/OSS JNI Wrapper
470-------------------------
471Add "-DWITH_JNI=1" to the cmake command line to incorporate an optional Java
472Native Interface wrapper into the TurboJPEG/OSS dynamic library. This allows
473the dynamic library to be used directly from Java applications. See
474java/README for more details.
475
476
DRC26658432010-10-16 22:04:29 +0000477========================
478Installing libjpeg-turbo
479========================
480
481You can use the build system to install libjpeg-turbo into a directory of your
482choosing (as opposed to creating an installer.) To do this, add:
483
484 -DCMAKE_INSTALL_PREFIX={install_directory}
485
486to the cmake command line.
487
488For example,
489
DRC81543312010-10-18 07:23:58 +0000490 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \
DRC26658432010-10-16 22:04:29 +0000491 -DCMAKE_INSTALL_PREFIX=c:\libjpeg-turbo {source_directory}
492 nmake install
493
494will install the header files in c:\libjpeg-turbo\include, the library files
495in c:\libjpeg-turbo\lib, the DLL's in c:\libjpeg-turbo\bin, and the
496documentation in c:\libjpeg-turbo\doc.
497
498
DRCcc243742010-10-16 09:22:43 +0000499=============
500Build Recipes
501=============
502
503
DRC1c73ce82010-10-16 21:02:54 +000050464-bit MinGW Build on Cygwin
505----------------------------
506
507 cd {build_directory}
DRC2e4d0442011-02-08 01:18:37 +0000508 CC=/usr/bin/x86_64-w64-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000509 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
510 -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
DRC1c73ce82010-10-16 21:02:54 +0000511 -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
512 make
513
514This produces a 64-bit build of libjpeg-turbo that does not depend on
515cygwin1.dll or other Cygwin DLL's. The mingw64-x86_64-gcc-core and
516mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed.
517
518
51932-bit MinGW Build on Cygwin
520----------------------------
521
522 cd {build_directory}
DRC2e4d0442011-02-08 01:18:37 +0000523 CC=/usr/bin/i686-w64-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000524 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
525 -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
DRC1c73ce82010-10-16 21:02:54 +0000526 -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
527 make
528
529This produces a 32-bit build of libjpeg-turbo that does not depend on
530cygwin1.dll or other Cygwin DLL's. The mingw64-i686-gcc-core and
531mingw64-i686-gcc-g++ packages (and their dependencies) must be installed.
532
533
534MinGW-w64 Build on Windows
535--------------------------
536
537This produces a 64-bit build of libjpeg-turbo using the "native" MinGW-w64
538toolchain (which is faster than the Cygwin version):
539
540 cd {build_directory}
541 CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
DRC81543312010-10-18 07:23:58 +0000542 cmake -G "MSYS Makefiles" \
DRC1c73ce82010-10-16 21:02:54 +0000543 -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
544 -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
545 {source_directory}
546 make
547
548
DRCcc243742010-10-16 09:22:43 +0000549MinGW Build on Linux
550--------------------
551
552 cd {build_directory}
553 CC={mingw_binary_path}/i386-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000554 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
555 -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
DRCcc243742010-10-16 09:22:43 +0000556 -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
DRC68bf3f22010-10-18 07:56:14 +0000557 {source_directory}
DRCcc243742010-10-16 09:22:43 +0000558 make
DRC8b014d72010-02-18 13:03:41 +0000559
DRC68fef832010-02-16 05:29:10 +0000560
561*******************************************************************************
562** Creating Release Packages
563*******************************************************************************
564
565The following commands can be used to create various types of release packages:
566
DRCcc243742010-10-16 09:22:43 +0000567
568Unix
569----
570
DRC68fef832010-02-16 05:29:10 +0000571make rpm
572
DRCcc243742010-10-16 09:22:43 +0000573 Create Red Hat-style binary RPM package. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000574
575make srpm
576
577 This runs 'make dist' to create a pristine source tarball, then creates a
DRCcc243742010-10-16 09:22:43 +0000578 Red Hat-style source RPM package from the tarball. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000579
580make deb
581
582 Create Debian-style binary package. Requires dpkg.
583
584make dmg
585
586 Create Macintosh package/disk image. This requires the PackageMaker
587 application, which must be installed in /Developer/Applications/Utilities.
588
DRC9ef93db2010-10-18 08:24:42 +0000589make udmg [BUILDDIR32={32-bit build directory}]
DRC68fef832010-02-16 05:29:10 +0000590
DRC0dedd1a2010-07-02 09:20:12 +0000591 On 64-bit OS X systems, this creates a version of the Macintosh package and
DRC9ef93db2010-10-18 08:24:42 +0000592 disk image which contains universal i386/x86-64 binaries. You should first
593 configure a 32-bit out-of-tree build of libjpeg-turbo, then configure a
594 64-bit out-of-tree build, then run 'make udmg' from the 64-bit build
595 directory. The build system will look for the 32-bit build under
596 {source_directory}/osxx86 by default, but you can override this by setting
597 the BUILDDIR32 variable on the make command line as shown above.
DRC68fef832010-02-16 05:29:10 +0000598
DRC0f53df82010-10-21 19:47:06 +0000599make sunpkg
600
601 Build a Solaris package. This requires pkgmk, pkgtrans, and bzip2.
602
603make csunpkg [BUILDDIR32={32-bit build directory}]
604
605 On 64-bit Solaris systems, this creates a combined package which contains
606 both 32-bit and 64-bit libraries. You should first configure a 32-bit
607 out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree
608 build, then run 'make csunpkg' from the 64-bit build directory. The build
609 system will look for the 32-bit build under {source_directory}/solx86 by
610 default, but you can override this by setting the BUILDDIR32 variable on the
611 make command line as shown above.
612
DRC81543312010-10-18 07:23:58 +0000613make cygwinpkg
614
615 Build a Cygwin binary package.
616
DRC0a1f68e2010-02-24 07:24:26 +0000617
DRCcc243742010-10-16 09:22:43 +0000618Windows
619-------
DRC0a1f68e2010-02-24 07:24:26 +0000620
DRCcc243742010-10-16 09:22:43 +0000621If using NMake:
DRC68fef832010-02-16 05:29:10 +0000622
DRCcc243742010-10-16 09:22:43 +0000623 cd {build_directory}
624 nmake installer
625
DRC81543312010-10-18 07:23:58 +0000626If using MinGW:
DRCcc243742010-10-16 09:22:43 +0000627
628 cd {build_directory}
629 make installer
630
631If using the Visual Studio IDE, build the "installer" project.
632
633The installer package (libjpeg-turbo[-gcc][64].exe) will be located under
634{build_directory}. If building using the Visual Studio IDE, then the installer
635package will be located in a subdirectory with the same name as the
636configuration you built (such as {build_directory}\Debug\ or
637{build_directory}\Release\).
638
639Building a Windows installer requires the Nullsoft Install System
640(http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.