blob: 846e96989fbf3fbd55290f21ff5ccd9acd067d2e [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
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
DRCcc243742010-10-16 09:22:43 +000037
38==================
39Out-of-Tree Builds
40==================
41
42Binary objects, libraries, and executables are generated in the same directory
43from which configure was executed (the "binary directory"), and this directory
44need not necessarily be the same as the libjpeg-turbo source directory. You
45can create multiple independent binary directories, in which different versions
46of libjpeg-turbo can be built from the same source tree using different
47compilers or settings. In the sections below, {build_directory} refers to the
48binary directory, whereas {source_directory} refers to the libjpeg-turbo source
49directory. For in-tree builds, these directories are the same.
50
51
DRC68fef832010-02-16 05:29:10 +000052======================
53Building libjpeg-turbo
54======================
55
DRC49597872010-05-17 20:47:57 +000056The following procedure will build libjpeg-turbo on Linux, FreeBSD, 32-bit
DRC81543312010-10-18 07:23:58 +000057OS X, Cygwin, and Solaris/x86 systems (on Solaris, this generates a 32-bit
58library. See below for 64-bit build instructions.)
DRC68fef832010-02-16 05:29:10 +000059
DRCcc243742010-10-16 09:22:43 +000060 cd {source_directory}
DRC68fef832010-02-16 05:29:10 +000061 autoreconf -fiv
DRCcc243742010-10-16 09:22:43 +000062 cd {build_directory}
DRC98dbe912010-11-04 22:22:30 +000063 sh {source_directory}/configure [additional configure flags]
DRC68fef832010-02-16 05:29:10 +000064 make
65
DRCcc243742010-10-16 09:22:43 +000066NOTE: Running autoreconf in the source directory is only necessary if building
67libjpeg-turbo from the SVN repository.
DRC68fef832010-02-16 05:29:10 +000068
69This will generate the following files under .libs/
70
71 libjpeg.a
72 Static link library for libjpeg-turbo
73
DRCcc243742010-10-16 09:22:43 +000074 libjpeg.so.{version} (Linux, Solaris)
75 libjpeg.{version}.dylib (OS X)
DRC81543312010-10-18 07:23:58 +000076 cygjpeg-{version}.dll (Cygwin)
DRC68fef832010-02-16 05:29:10 +000077 Shared library for libjpeg-turbo
78
79 libjpeg.so (Linux, Solaris)
80 libjpeg.dylib (OS X)
DRC81543312010-10-18 07:23:58 +000081 libjpeg.dll.a (Cygwin)
DRC68fef832010-02-16 05:29:10 +000082 Development stub for libjpeg-turbo shared library
83
84 libturbojpeg.a
85 Static link library for TurboJPEG/OSS
86
87 libturbojpeg.so (Linux, Solaris)
88 libturbojpeg.dylib (OS X)
89 Shared library and development stub for TurboJPEG/OSS
90
DRC81543312010-10-18 07:23:58 +000091 cygturbojpeg.dll (Cygwin)
92 Shared library for TurboJPEG/OSS
93
94 libturbojpeg.dll.a (Cygwin)
95 Development stub for TurboJPEG/OSS shared library
96
DRCcc243742010-10-16 09:22:43 +000097{version} is 62.0.0, 7.0.0, or 8.0.2, depending on whether libjpeg v6b
DRCf38eee02011-02-18 07:00:38 +000098(default), v7, or v8 emulation is enabled. If using Cygwin, {version} is
DRC81543312010-10-18 07:23:58 +00009962, 7, or 8.
100
101
DRCf38eee02011-02-18 07:00:38 +0000102libjpeg v7 or v8 Emulation
103--------------------------
DRC81543312010-10-18 07:23:58 +0000104
105Add --with-jpeg7 to the configure command line to build a version of
106libjpeg-turbo that is compatible with libjpeg v7. Add --with-jpeg8 to the
107configure command to build a version of libjpeg-turbo that is compatible with
DRCf38eee02011-02-18 07:00:38 +0000108libjpeg v8. See README-turbo.txt for more information on libjpeg v7 and v8
DRC81543312010-10-18 07:23:58 +0000109emulation.
110
DRC68fef832010-02-16 05:29:10 +0000111
DRC245cfdf2010-11-23 17:11:06 +0000112Arithmetic Coding Support
113-------------------------
114
115Since the patent on arithmetic coding has expired, this functionality has been
116included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
DRCf38eee02011-02-18 07:00:38 +0000117based on the implementation in libjpeg v8, but it works when emulating libjpeg
DRC245cfdf2010-11-23 17:11:06 +0000118v7 or v6b as well. The default is to enable both arithmetic encoding and
119decoding, but those who have philosophical objections to arithmetic coding can
120add --without-arith-enc or --without-arith-dec to the configure command line to
121disable encoding or decoding (respectively.)
122
DRC68fef832010-02-16 05:29:10 +0000123
124========================
125Installing libjpeg-turbo
126========================
127
128If you intend to install these libraries and the associated header files, then
129replace 'make' in the instructions above with
130
131 make install prefix={base dir} libdir={library directory}
132
133For example,
134
135 make install prefix=/usr/local libdir=/usr/local/lib64
136
137will install the header files in /usr/local/include and the library files in
138/usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default
139is to install the header files in /opt/libjpeg-turbo/include and the library
140files in /opt/libjpeg-turbo/lib.
141
142NOTE: You can specify a prefix of /usr and a libdir of, for instance,
143/usr/lib64 to overwrite the system's version of libjpeg. If you do this,
144however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before
145overwriting it. It is recommended that you instead install libjpeg-turbo into
146a non-system directory and manipulate the LD_LIBRARY_PATH or create sym links
147to force applications to use libjpeg-turbo instead of libjpeg. See
148README-turbo.txt for more information.
149
DRCcc243742010-10-16 09:22:43 +0000150
DRC68fef832010-02-16 05:29:10 +0000151=============
152Build Recipes
153=============
154
DRCcc243742010-10-16 09:22:43 +0000155
DRC68fef832010-02-16 05:29:10 +000015632-bit Library Build on 64-bit Linux
157------------------------------------
158
DRCca5e7d12010-02-17 02:25:06 +0000159Add
DRC68fef832010-02-16 05:29:10 +0000160
DRC2e4d0442011-02-08 01:18:37 +0000161 --host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32
DRC68fef832010-02-16 05:29:10 +0000162
163to the configure command line.
164
165
DRC9026b372011-04-16 13:37:22 +000016664-bit Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000167-----------------------------------
168
DRCca5e7d12010-02-17 02:25:06 +0000169Add
DRC68fef832010-02-16 05:29:10 +0000170
DRC0dedd1a2010-07-02 09:20:12 +0000171 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm
DRC68fef832010-02-16 05:29:10 +0000172
DRC7bac07b2010-04-10 05:53:35 +0000173to the configure command line. NASM 2.07 or later from MacPorts must be
174installed.
DRC68fef832010-02-16 05:29:10 +0000175
176
DRC9026b372011-04-16 13:37:22 +000017732-bit Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000178-----------------------------------
179
DRCca5e7d12010-02-17 02:25:06 +0000180Add
DRC68fef832010-02-16 05:29:10 +0000181
DRC2e4d0442011-02-08 01:18:37 +0000182 CFLAGS='-O3 -m32' LDFLAGS=-m32
DRC68fef832010-02-16 05:29:10 +0000183
184to the configure command line.
185
186
DRC9026b372011-04-16 13:37:22 +000018764-bit Backward-Compatible Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000188-------------------------------------------------------
189
DRCca5e7d12010-02-17 02:25:06 +0000190Add
DRC68fef832010-02-16 05:29:10 +0000191
DRC0dedd1a2010-07-02 09:20:12 +0000192 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
193 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
194 -mmacosx-version-min=10.4 -O3' \
DRC0dedd1a2010-07-02 09:20:12 +0000195 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
196 -mmacosx-version-min=10.4'
197
DRC575c3422010-07-08 07:01:20 +0000198to the configure command line. The OS X 10.4 SDK, and NASM 2.07 or later from
199MacPorts, must be installed.
DRC0dedd1a2010-07-02 09:20:12 +0000200
201
DRC9026b372011-04-16 13:37:22 +000020232-bit Backward-Compatible Library Build on OS X
DRC0dedd1a2010-07-02 09:20:12 +0000203------------------------------------------------
204
205Add
206
DRC485cd802010-02-23 23:23:42 +0000207 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
208 -mmacosx-version-min=10.4 -O3 -m32' \
DRC68fef832010-02-16 05:29:10 +0000209 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
210 -mmacosx-version-min=10.4 -m32'
211
212to the configure command line. The OS X 10.4 SDK must be installed.
213
214
21564-bit Library Build on 64-bit Solaris
216--------------------------------------
217
DRCca5e7d12010-02-17 02:25:06 +0000218Add
DRC68fef832010-02-16 05:29:10 +0000219
DRC2e4d0442011-02-08 01:18:37 +0000220 --host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64
DRC68fef832010-02-16 05:29:10 +0000221
222to the configure command line.
223
224
DRC7bac07b2010-04-10 05:53:35 +000022532-bit Library Build on 64-bit FreeBSD
226--------------------------------------
227
228Add
229
DRC2e4d0442011-02-08 01:18:37 +0000230 --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \
231 LDFLAGS='-B/usr/lib32'
DRC7bac07b2010-04-10 05:53:35 +0000232
233to the configure command line. NASM 2.07 or later from FreeBSD ports must be
234installed.
235
236
DRCca5e7d12010-02-17 02:25:06 +0000237Sun Studio
238----------
239
240Add
241
DRC2e4d0442011-02-08 01:18:37 +0000242 CC=cc
DRCca5e7d12010-02-17 02:25:06 +0000243
244to the configure command line. libjpeg-turbo will automatically be built with
DRC2e4d0442011-02-08 01:18:37 +0000245the maximum optimization level (-xO5) unless you override CFLAGS.
DRCca5e7d12010-02-17 02:25:06 +0000246
247To build a 64-bit version of libjpeg-turbo using Sun Studio, add
248
DRC2e4d0442011-02-08 01:18:37 +0000249 --host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64
DRCca5e7d12010-02-17 02:25:06 +0000250
251to the configure command line.
252
DRC8b014d72010-02-18 13:03:41 +0000253
DRC81543312010-10-18 07:23:58 +0000254MinGW Build on Cygwin
255---------------------
256
257Use CMake (see recipes below)
258
259
260
DRC68fef832010-02-16 05:29:10 +0000261*******************************************************************************
DRC81543312010-10-18 07:23:58 +0000262** Building on Windows (Visual C++ or MinGW)
DRC68fef832010-02-16 05:29:10 +0000263*******************************************************************************
264
DRCcc243742010-10-16 09:22:43 +0000265
DRC68fef832010-02-16 05:29:10 +0000266==================
267Build Requirements
268==================
269
DRCcc243742010-10-16 09:22:43 +0000270-- CMake (http://www.cmake.org) v2.6 or later
DRC68fef832010-02-16 05:29:10 +0000271
DRCcc243742010-10-16 09:22:43 +0000272-- Microsoft Visual C++ 2005 or later
DRC68fef832010-02-16 05:29:10 +0000273
DRCcc243742010-10-16 09:22:43 +0000274 If you don't already have Visual C++, then the easiest way to get it is by
275 installing the Windows SDK:
DRC68fef832010-02-16 05:29:10 +0000276
DRCcc243742010-10-16 09:22:43 +0000277 http://msdn.microsoft.com/en-us/windows/bb980924.aspx
278
279 The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
280 everything necessary to build libjpeg-turbo.
281
282 * For 32-bit builds, you can also use Microsoft Visual C++ Express
283 Edition. Visual C++ Express Edition is a free download.
284 * If you intend to build libjpeg-turbo from the command line, then add the
285 appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH
286 environment variables. This is generally accomplished by executing
287 vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and
288 vcvars64.bat are part of Visual C++ and are located in the same directory
289 as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass
290 optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build
291 environment.
292
293... OR ...
294
DRC81543312010-10-18 07:23:58 +0000295-- MinGW
DRCcc243742010-10-16 09:22:43 +0000296
297 GCC v4.1 or later recommended for best performance
DRC68fef832010-02-16 05:29:10 +0000298
DRC377add72010-05-17 16:41:12 +0000299-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
300 a 64-bit build)
DRC68fef832010-02-16 05:29:10 +0000301
DRCcc243742010-10-16 09:22:43 +0000302
303==================
304Out-of-Tree Builds
305==================
306
307Binary objects, libraries, and executables are generated in the same directory
308from which cmake was executed (the "binary directory"), and this directory need
309not necessarily be the same as the libjpeg-turbo source directory. You can
310create multiple independent binary directories, in which different versions of
311libjpeg-turbo can be built from the same source tree using different compilers
312or settings. In the sections below, {build_directory} refers to the binary
313directory, whereas {source_directory} refers to the libjpeg-turbo source
314directory. For in-tree builds, these directories are the same.
315
316
DRC68fef832010-02-16 05:29:10 +0000317======================
318Building libjpeg-turbo
319======================
320
DRC68fef832010-02-16 05:29:10 +0000321
DRCcc243742010-10-16 09:22:43 +0000322Visual C++ (Command Line)
323-------------------------
DRC68fef832010-02-16 05:29:10 +0000324
DRCcc243742010-10-16 09:22:43 +0000325 cd {build_directory}
326 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory}
327 nmake
DRC68fef832010-02-16 05:29:10 +0000328
DRCcc243742010-10-16 09:22:43 +0000329This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending
330on which version of cl.exe is in the PATH.
DRC8b014d72010-02-18 13:03:41 +0000331
DRCcc243742010-10-16 09:22:43 +0000332The following files will be generated under {build_directory}:
333
334 jpeg-static.lib
335 Static link library for libjpeg-turbo
336 sharedlib/jpeg{version}.dll
337 DLL for libjpeg-turbo
338 sharedlib/jpeg.lib
339 Import library for libjpeg-turbo DLL
340 turbojpeg-static.lib
341 Static link library for TurboJPEG/OSS
342 turbojpeg.dll
343 DLL for TurboJPEG/OSS
344 turbojpeg.lib
345 Import library for TurboJPEG/OSS DLL
346
347{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
DRCf38eee02011-02-18 07:00:38 +0000348v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000349
350
351Visual C++ (IDE)
352----------------
353
354Choose the appropriate CMake generator option for your version of Visual Studio
355(run "cmake" with no arguments for a list of available generators.) For
356instance:
357
358 cd {build_directory}
359 cmake -G "Visual Studio 9 2008" {source_directory}
360
361You can then open ALL_BUILD.vcproj in Visual Studio and build one of the
362configurations in that project ("Debug", "Release", etc.) to generate a full
363build of libjpeg-turbo.
364
365This will generate the following files under {build_directory}:
366
367 {configuration}/jpeg-static.lib
368 Static link library for libjpeg-turbo
369 sharedlib/{configuration}/jpeg{version}.dll
370 DLL for libjpeg-turbo
371 sharedlib/{configuration}/jpeg.lib
372 Import library for libjpeg-turbo DLL
373 {configuration}/turbojpeg-static.lib
374 Static link library for TurboJPEG/OSS
375 {configuration}/turbojpeg.dll
376 DLL for TurboJPEG/OSS
377 {configuration}/turbojpeg.lib
378 Import library for TurboJPEG/OSS DLL
379
380{configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on
381the configuration you built in the IDE, and {version} is 62, 7, or 8,
DRCf38eee02011-02-18 07:00:38 +0000382depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000383
384
385MinGW
386-----
387
388 cd {build_directory}
389 cmake -G "MSYS Makefiles" {source_directory}
390 make
391
392This will generate the following files under {build_directory}
393
394 libjpeg.a
395 Static link library for libjpeg-turbo
396 sharedlib/libjpeg-{version}.dll
397 DLL for libjpeg-turbo
398 sharedlib/libjpeg.dll.a
399 Import library for libjpeg-turbo DLL
400 libturbojpeg.a
401 Static link library for TurboJPEG/OSS
402 libturbojpeg.dll
403 DLL for TurboJPEG/OSS
404 libturbojpeg.dll.a
405 Import library for TurboJPEG/OSS DLL
406
407{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
DRCf38eee02011-02-18 07:00:38 +0000408v8 emulation is enabled.
DRCcc243742010-10-16 09:22:43 +0000409
410
DRCcc243742010-10-16 09:22:43 +0000411Debug Build
412-----------
413
414Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with
415NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
416NMake.)
417
418
DRCf38eee02011-02-18 07:00:38 +0000419libjpeg v7 or v8 Emulation
420--------------------------
DRCcc243742010-10-16 09:22:43 +0000421
422Add "-DWITH_JPEG7=1" to the cmake command line to build a version of
423libjpeg-turbo that is compatible with libjpeg v7. Add "-DWITH_JPEG8=1" to the
424cmake command to build a version of libjpeg-turbo that is compatible with
DRCf38eee02011-02-18 07:00:38 +0000425libjpeg v8. See README-turbo.txt for more information on libjpeg v7 and v8
DRCcc243742010-10-16 09:22:43 +0000426emulation.
427
428
DRC245cfdf2010-11-23 17:11:06 +0000429Arithmetic Coding Support
430-------------------------
431
432Since the patent on arithmetic coding has expired, this functionality has been
433included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
DRCf38eee02011-02-18 07:00:38 +0000434based on the implementation in libjpeg v8, but it works when emulating libjpeg
DRC245cfdf2010-11-23 17:11:06 +0000435v7 or v6b as well. The default is to enable both arithmetic encoding and
436decoding, but those who have philosophical objections to arithmetic coding can
437add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to
438disable encoding or decoding (respectively.)
439
440
DRC26658432010-10-16 22:04:29 +0000441========================
442Installing libjpeg-turbo
443========================
444
445You can use the build system to install libjpeg-turbo into a directory of your
446choosing (as opposed to creating an installer.) To do this, add:
447
448 -DCMAKE_INSTALL_PREFIX={install_directory}
449
450to the cmake command line.
451
452For example,
453
DRC81543312010-10-18 07:23:58 +0000454 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \
DRC26658432010-10-16 22:04:29 +0000455 -DCMAKE_INSTALL_PREFIX=c:\libjpeg-turbo {source_directory}
456 nmake install
457
458will install the header files in c:\libjpeg-turbo\include, the library files
459in c:\libjpeg-turbo\lib, the DLL's in c:\libjpeg-turbo\bin, and the
460documentation in c:\libjpeg-turbo\doc.
461
462
DRCcc243742010-10-16 09:22:43 +0000463=============
464Build Recipes
465=============
466
467
DRC1c73ce82010-10-16 21:02:54 +000046864-bit MinGW Build on Cygwin
469----------------------------
470
471 cd {build_directory}
DRC2e4d0442011-02-08 01:18:37 +0000472 CC=/usr/bin/x86_64-w64-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000473 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
474 -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
DRC1c73ce82010-10-16 21:02:54 +0000475 -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
476 make
477
478This produces a 64-bit build of libjpeg-turbo that does not depend on
479cygwin1.dll or other Cygwin DLL's. The mingw64-x86_64-gcc-core and
480mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed.
481
482
48332-bit MinGW Build on Cygwin
484----------------------------
485
486 cd {build_directory}
DRC2e4d0442011-02-08 01:18:37 +0000487 CC=/usr/bin/i686-w64-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000488 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
489 -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
DRC1c73ce82010-10-16 21:02:54 +0000490 -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
491 make
492
493This produces a 32-bit build of libjpeg-turbo that does not depend on
494cygwin1.dll or other Cygwin DLL's. The mingw64-i686-gcc-core and
495mingw64-i686-gcc-g++ packages (and their dependencies) must be installed.
496
497
498MinGW-w64 Build on Windows
499--------------------------
500
501This produces a 64-bit build of libjpeg-turbo using the "native" MinGW-w64
502toolchain (which is faster than the Cygwin version):
503
504 cd {build_directory}
505 CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
DRC81543312010-10-18 07:23:58 +0000506 cmake -G "MSYS Makefiles" \
DRC1c73ce82010-10-16 21:02:54 +0000507 -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
508 -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
509 {source_directory}
510 make
511
512
DRCcc243742010-10-16 09:22:43 +0000513MinGW Build on Linux
514--------------------
515
516 cd {build_directory}
517 CC={mingw_binary_path}/i386-mingw32-gcc \
DRC68bf3f22010-10-18 07:56:14 +0000518 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
519 -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
DRCcc243742010-10-16 09:22:43 +0000520 -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
DRC68bf3f22010-10-18 07:56:14 +0000521 {source_directory}
DRCcc243742010-10-16 09:22:43 +0000522 make
DRC8b014d72010-02-18 13:03:41 +0000523
DRC68fef832010-02-16 05:29:10 +0000524
525*******************************************************************************
526** Creating Release Packages
527*******************************************************************************
528
529The following commands can be used to create various types of release packages:
530
DRCcc243742010-10-16 09:22:43 +0000531
532Unix
533----
534
DRC68fef832010-02-16 05:29:10 +0000535make rpm
536
DRCcc243742010-10-16 09:22:43 +0000537 Create Red Hat-style binary RPM package. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000538
539make srpm
540
541 This runs 'make dist' to create a pristine source tarball, then creates a
DRCcc243742010-10-16 09:22:43 +0000542 Red Hat-style source RPM package from the tarball. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000543
544make deb
545
546 Create Debian-style binary package. Requires dpkg.
547
548make dmg
549
550 Create Macintosh package/disk image. This requires the PackageMaker
551 application, which must be installed in /Developer/Applications/Utilities.
552
DRC9ef93db2010-10-18 08:24:42 +0000553make udmg [BUILDDIR32={32-bit build directory}]
DRC68fef832010-02-16 05:29:10 +0000554
DRC0dedd1a2010-07-02 09:20:12 +0000555 On 64-bit OS X systems, this creates a version of the Macintosh package and
DRC9ef93db2010-10-18 08:24:42 +0000556 disk image which contains universal i386/x86-64 binaries. You should first
557 configure a 32-bit out-of-tree build of libjpeg-turbo, then configure a
558 64-bit out-of-tree build, then run 'make udmg' from the 64-bit build
559 directory. The build system will look for the 32-bit build under
560 {source_directory}/osxx86 by default, but you can override this by setting
561 the BUILDDIR32 variable on the make command line as shown above.
DRC68fef832010-02-16 05:29:10 +0000562
DRC0f53df82010-10-21 19:47:06 +0000563make sunpkg
564
565 Build a Solaris package. This requires pkgmk, pkgtrans, and bzip2.
566
567make csunpkg [BUILDDIR32={32-bit build directory}]
568
569 On 64-bit Solaris systems, this creates a combined package which contains
570 both 32-bit and 64-bit libraries. You should first configure a 32-bit
571 out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree
572 build, then run 'make csunpkg' from the 64-bit build directory. The build
573 system will look for the 32-bit build under {source_directory}/solx86 by
574 default, but you can override this by setting the BUILDDIR32 variable on the
575 make command line as shown above.
576
DRC81543312010-10-18 07:23:58 +0000577make cygwinpkg
578
579 Build a Cygwin binary package.
580
DRC0a1f68e2010-02-24 07:24:26 +0000581
DRCcc243742010-10-16 09:22:43 +0000582Windows
583-------
DRC0a1f68e2010-02-24 07:24:26 +0000584
DRCcc243742010-10-16 09:22:43 +0000585If using NMake:
DRC68fef832010-02-16 05:29:10 +0000586
DRCcc243742010-10-16 09:22:43 +0000587 cd {build_directory}
588 nmake installer
589
DRC81543312010-10-18 07:23:58 +0000590If using MinGW:
DRCcc243742010-10-16 09:22:43 +0000591
592 cd {build_directory}
593 make installer
594
595If using the Visual Studio IDE, build the "installer" project.
596
597The installer package (libjpeg-turbo[-gcc][64].exe) will be located under
598{build_directory}. If building using the Visual Studio IDE, then the installer
599package will be located in a subdirectory with the same name as the
600configuration you built (such as {build_directory}\Debug\ or
601{build_directory}\Release\).
602
603Building a Windows installer requires the Nullsoft Install System
604(http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.