blob: 8b245d77c3e6704678c259d3a2ef8d6f312c6094 [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
37 and other systems, the header can be obtained by installing the GCC Java
38 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
DRC81543312010-10-18 07:23:58 +0000101(default), v7, or v8b emulation is enabled. If using Cygwin, {version} is
10262, 7, or 8.
103
104
105libjpeg v7 or v8b Emulation
106---------------------------
107
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
111libjpeg v8b. See README-turbo.txt for more information on libjpeg v7 and v8b
112emulation.
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
120based on the implementation in libjpeg v8b, but it works when emulating libjpeg
121v7 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-------------------------
129Add --with-jni to the configure command line to incorporate an optional Java
130Native Interface wrapper into the TurboJPEG/OSS dynamic library. This allows
131the dynamic library to be used directly from Java applications. See
132java/README for more details.
133
134
DRC68fef832010-02-16 05:29:10 +0000135========================
136Installing libjpeg-turbo
137========================
138
139If you intend to install these libraries and the associated header files, then
140replace 'make' in the instructions above with
141
142 make install prefix={base dir} libdir={library directory}
143
144For example,
145
146 make install prefix=/usr/local libdir=/usr/local/lib64
147
148will install the header files in /usr/local/include and the library files in
149/usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default
150is to install the header files in /opt/libjpeg-turbo/include and the library
151files in /opt/libjpeg-turbo/lib.
152
153NOTE: You can specify a prefix of /usr and a libdir of, for instance,
154/usr/lib64 to overwrite the system's version of libjpeg. If you do this,
155however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before
156overwriting it. It is recommended that you instead install libjpeg-turbo into
157a non-system directory and manipulate the LD_LIBRARY_PATH or create sym links
158to force applications to use libjpeg-turbo instead of libjpeg. See
159README-turbo.txt for more information.
160
DRCcc243742010-10-16 09:22:43 +0000161
DRC68fef832010-02-16 05:29:10 +0000162=============
163Build Recipes
164=============
165
DRCcc243742010-10-16 09:22:43 +0000166
DRC68fef832010-02-16 05:29:10 +000016732-bit Library Build on 64-bit Linux
168------------------------------------
169
DRCca5e7d12010-02-17 02:25:06 +0000170Add
DRC68fef832010-02-16 05:29:10 +0000171
DRC8c2b9fa2010-06-04 23:09:00 +0000172 --host i686-pc-linux-gnu CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
DRC68fef832010-02-16 05:29:10 +0000173
174to the configure command line.
175
176
DRC9026b372011-04-16 13:37:22 +000017764-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
DRC0dedd1a2010-07-02 09:20:12 +0000182 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm
DRC68fef832010-02-16 05:29:10 +0000183
DRC7bac07b2010-04-10 05:53:35 +0000184to the configure command line. NASM 2.07 or later from MacPorts must be
185installed.
DRC68fef832010-02-16 05:29:10 +0000186
187
DRC9026b372011-04-16 13:37:22 +000018832-bit Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000189-----------------------------------
190
DRCca5e7d12010-02-17 02:25:06 +0000191Add
DRC68fef832010-02-16 05:29:10 +0000192
193 CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
194
195to the configure command line.
196
197
DRC9026b372011-04-16 13:37:22 +000019864-bit Backward-Compatible Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000199-------------------------------------------------------
200
DRCca5e7d12010-02-17 02:25:06 +0000201Add
DRC68fef832010-02-16 05:29:10 +0000202
DRC0dedd1a2010-07-02 09:20:12 +0000203 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
204 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
205 -mmacosx-version-min=10.4 -O3' \
206 CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
207 -mmacosx-version-min=10.4 -O3' \
208 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
209 -mmacosx-version-min=10.4'
210
DRC575c3422010-07-08 07:01:20 +0000211to the configure command line. The OS X 10.4 SDK, and NASM 2.07 or later from
212MacPorts, must be installed.
DRC0dedd1a2010-07-02 09:20:12 +0000213
214
DRC9026b372011-04-16 13:37:22 +000021532-bit Backward-Compatible Library Build on OS X
DRC0dedd1a2010-07-02 09:20:12 +0000216------------------------------------------------
217
218Add
219
DRC485cd802010-02-23 23:23:42 +0000220 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
221 -mmacosx-version-min=10.4 -O3 -m32' \
222 CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
223 -mmacosx-version-min=10.4 -O3 -m32' \
DRC68fef832010-02-16 05:29:10 +0000224 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
225 -mmacosx-version-min=10.4 -m32'
226
227to the configure command line. The OS X 10.4 SDK must be installed.
228
229
23064-bit Library Build on 64-bit Solaris
231--------------------------------------
232
DRCca5e7d12010-02-17 02:25:06 +0000233Add
DRC68fef832010-02-16 05:29:10 +0000234
235 --host x86_64-pc-solaris CFLAGS='-O3 -m64' CXXFLAGS='-O3 -m64' LDFLAGS=-m64
236
237to the configure command line.
238
239
DRC7bac07b2010-04-10 05:53:35 +000024032-bit Library Build on 64-bit FreeBSD
241--------------------------------------
242
243Add
244
245 --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CXX='g++ -B/usr/lib32' \
246 CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS='-B/usr/lib32'
247
248to the configure command line. NASM 2.07 or later from FreeBSD ports must be
249installed.
250
251
DRCca5e7d12010-02-17 02:25:06 +0000252Sun Studio
253----------
254
255Add
256
257 CC=cc CXX=CC
258
259to the configure command line. libjpeg-turbo will automatically be built with
260the maximum optimization level (-xO5) unless you override CFLAGS and CXXFLAGS.
261
262To build a 64-bit version of libjpeg-turbo using Sun Studio, add
263
264 --host x86_64-pc-solaris CC=cc CXX=CC CFLAGS='-xO5 -m64' \
265 CXXFLAGS='-xO5 -m64' LDFLAGS=-m64
266
267to the configure command line.
268
DRC8b014d72010-02-18 13:03:41 +0000269
DRC81543312010-10-18 07:23:58 +0000270MinGW Build on Cygwin
271---------------------
272
273Use CMake (see recipes below)
274
275
276
DRC68fef832010-02-16 05:29:10 +0000277*******************************************************************************
DRC81543312010-10-18 07:23:58 +0000278** Building on Windows (Visual C++ or MinGW)
DRC68fef832010-02-16 05:29:10 +0000279*******************************************************************************
280
DRCcc243742010-10-16 09:22:43 +0000281
DRC68fef832010-02-16 05:29:10 +0000282==================
283Build Requirements
284==================
285
DRCcc243742010-10-16 09:22:43 +0000286-- CMake (http://www.cmake.org) v2.6 or later
DRC68fef832010-02-16 05:29:10 +0000287
DRCcc243742010-10-16 09:22:43 +0000288-- Microsoft Visual C++ 2005 or later
DRC68fef832010-02-16 05:29:10 +0000289
DRCcc243742010-10-16 09:22:43 +0000290 If you don't already have Visual C++, then the easiest way to get it is by
291 installing the Windows SDK:
DRC68fef832010-02-16 05:29:10 +0000292
DRCcc243742010-10-16 09:22:43 +0000293 http://msdn.microsoft.com/en-us/windows/bb980924.aspx
294
295 The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
296 everything necessary to build libjpeg-turbo.
297
298 * For 32-bit builds, you can also use Microsoft Visual C++ Express
299 Edition. Visual C++ Express Edition is a free download.
300 * If you intend to build libjpeg-turbo from the command line, then add the
301 appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH
302 environment variables. This is generally accomplished by executing
303 vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and
304 vcvars64.bat are part of Visual C++ and are located in the same directory
305 as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass
306 optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build
307 environment.
308
309... OR ...
310
DRC81543312010-10-18 07:23:58 +0000311-- MinGW
DRCcc243742010-10-16 09:22:43 +0000312
313 GCC v4.1 or later recommended for best performance
DRC68fef832010-02-16 05:29:10 +0000314
DRC377add72010-05-17 16:41:12 +0000315-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
316 a 64-bit build)
DRC68fef832010-02-16 05:29:10 +0000317
DRC218c0c12011-02-05 06:01:18 +0000318-- If building the TurboJPEG/OSS JNI wrapper, jni.h is required. This header
319 can be obtained by installing the Oracle Java Development Kit (JDK).
320 * If using Visual C++, then add the appropriate Java include directories
321 (Example: c:\Program Files\Java\jdk1.6.0_23\include;c:\Program Files\Java\jdk1.6.0_23\include\win32)
322 to the INCLUDE environment variable prior to building libjpeg-turbo.
323 * If using MinGW, 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 CPATH environment variable prior to building libjpeg-turbo.
326
DRCcc243742010-10-16 09:22:43 +0000327
328==================
329Out-of-Tree Builds
330==================
331
332Binary objects, libraries, and executables are generated in the same directory
333from which cmake was executed (the "binary directory"), and this directory need
334not necessarily be the same as the libjpeg-turbo source directory. You can
335create multiple independent binary directories, in which different versions of
336libjpeg-turbo can be built from the same source tree using different compilers
337or settings. In the sections below, {build_directory} refers to the binary
338directory, whereas {source_directory} refers to the libjpeg-turbo source
339directory. For in-tree builds, these directories are the same.
340
341
DRC68fef832010-02-16 05:29:10 +0000342======================
343Building libjpeg-turbo
344======================
345
DRC68fef832010-02-16 05:29:10 +0000346
DRCcc243742010-10-16 09:22:43 +0000347Visual C++ (Command Line)
348-------------------------
DRC68fef832010-02-16 05:29:10 +0000349
DRCcc243742010-10-16 09:22:43 +0000350 cd {build_directory}
351 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory}
352 nmake
DRC68fef832010-02-16 05:29:10 +0000353
DRCcc243742010-10-16 09:22:43 +0000354This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending
355on which version of cl.exe is in the PATH.
DRC8b014d72010-02-18 13:03:41 +0000356
DRCcc243742010-10-16 09:22:43 +0000357The following files will be generated under {build_directory}:
358
359 jpeg-static.lib
360 Static link library for libjpeg-turbo
361 sharedlib/jpeg{version}.dll
362 DLL for libjpeg-turbo
363 sharedlib/jpeg.lib
364 Import library for libjpeg-turbo DLL
365 turbojpeg-static.lib
366 Static link library for TurboJPEG/OSS
367 turbojpeg.dll
368 DLL for TurboJPEG/OSS
369 turbojpeg.lib
370 Import library for TurboJPEG/OSS DLL
371
372{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
373v8b emulation is enabled.
374
375
376Visual C++ (IDE)
377----------------
378
379Choose the appropriate CMake generator option for your version of Visual Studio
380(run "cmake" with no arguments for a list of available generators.) For
381instance:
382
383 cd {build_directory}
384 cmake -G "Visual Studio 9 2008" {source_directory}
385
386You can then open ALL_BUILD.vcproj in Visual Studio and build one of the
387configurations in that project ("Debug", "Release", etc.) to generate a full
388build of libjpeg-turbo.
389
390This will generate the following files under {build_directory}:
391
392 {configuration}/jpeg-static.lib
393 Static link library for libjpeg-turbo
394 sharedlib/{configuration}/jpeg{version}.dll
395 DLL for libjpeg-turbo
396 sharedlib/{configuration}/jpeg.lib
397 Import library for libjpeg-turbo DLL
398 {configuration}/turbojpeg-static.lib
399 Static link library for TurboJPEG/OSS
400 {configuration}/turbojpeg.dll
401 DLL for TurboJPEG/OSS
402 {configuration}/turbojpeg.lib
403 Import library for TurboJPEG/OSS DLL
404
405{configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on
406the configuration you built in the IDE, and {version} is 62, 7, or 8,
407depending on whether libjpeg v6b (default), v7, or v8b emulation is enabled.
408
409
410MinGW
411-----
412
413 cd {build_directory}
414 cmake -G "MSYS Makefiles" {source_directory}
415 make
416
417This will generate the following files under {build_directory}
418
419 libjpeg.a
420 Static link library for libjpeg-turbo
421 sharedlib/libjpeg-{version}.dll
422 DLL for libjpeg-turbo
423 sharedlib/libjpeg.dll.a
424 Import library for libjpeg-turbo DLL
425 libturbojpeg.a
426 Static link library for TurboJPEG/OSS
427 libturbojpeg.dll
428 DLL for TurboJPEG/OSS
429 libturbojpeg.dll.a
430 Import library for TurboJPEG/OSS DLL
431
432{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
433v8b emulation is enabled.
434
435
DRCcc243742010-10-16 09:22:43 +0000436Debug Build
437-----------
438
439Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with
440NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
441NMake.)
442
443
444libjpeg v7 or v8b Emulation
445---------------------------
446
447Add "-DWITH_JPEG7=1" to the cmake command line to build a version of
448libjpeg-turbo that is compatible with libjpeg v7. Add "-DWITH_JPEG8=1" to the
449cmake command to build a version of libjpeg-turbo that is compatible with
DRC81543312010-10-18 07:23:58 +0000450libjpeg v8b. See README-turbo.txt for more information on libjpeg v7 and v8b
DRCcc243742010-10-16 09:22:43 +0000451emulation.
452
453
DRC245cfdf2010-11-23 17:11:06 +0000454Arithmetic Coding Support
455-------------------------
456
457Since the patent on arithmetic coding has expired, this functionality has been
458included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
459based on the implementation in libjpeg v8b, but it works when emulating libjpeg
460v7 or v6b as well. The default is to enable both arithmetic encoding and
461decoding, but those who have philosophical objections to arithmetic coding can
462add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to
463disable encoding or decoding (respectively.)
464
465
DRC218c0c12011-02-05 06:01:18 +0000466TurboJPEG/OSS JNI Wrapper
467-------------------------
468Add "-DWITH_JNI=1" to the cmake command line to incorporate an optional Java
469Native Interface wrapper into the TurboJPEG/OSS dynamic library. This allows
470the dynamic library to be used directly from Java applications. See
471java/README for more details.
472
473
DRC26658432010-10-16 22:04:29 +0000474========================
475Installing libjpeg-turbo
476========================
477
478You can use the build system to install libjpeg-turbo into a directory of your
479choosing (as opposed to creating an installer.) To do this, add:
480
481 -DCMAKE_INSTALL_PREFIX={install_directory}
482
483to the cmake command line.
484
485For example,
486
DRC81543312010-10-18 07:23:58 +0000487 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \
DRC26658432010-10-16 22:04:29 +0000488 -DCMAKE_INSTALL_PREFIX=c:\libjpeg-turbo {source_directory}
489 nmake install
490
491will install the header files in c:\libjpeg-turbo\include, the library files
492in c:\libjpeg-turbo\lib, the DLL's in c:\libjpeg-turbo\bin, and the
493documentation in c:\libjpeg-turbo\doc.
494
495
DRCcc243742010-10-16 09:22:43 +0000496=============
497Build Recipes
498=============
499
500
DRC1c73ce82010-10-16 21:02:54 +000050164-bit MinGW Build on Cygwin
502----------------------------
503
504 cd {build_directory}
505 CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ \
DRC68bf3f22010-10-18 07:56:14 +0000506 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
507 -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
DRC1c73ce82010-10-16 21:02:54 +0000508 -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
509 make
510
511This produces a 64-bit build of libjpeg-turbo that does not depend on
512cygwin1.dll or other Cygwin DLL's. The mingw64-x86_64-gcc-core and
513mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed.
514
515
51632-bit MinGW Build on Cygwin
517----------------------------
518
519 cd {build_directory}
520 CC=/usr/bin/i686-w64-mingw32-gcc CXX=/usr/bin/i686-w64-mingw32-g++ \
DRC68bf3f22010-10-18 07:56:14 +0000521 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
522 -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
DRC1c73ce82010-10-16 21:02:54 +0000523 -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
524 make
525
526This produces a 32-bit build of libjpeg-turbo that does not depend on
527cygwin1.dll or other Cygwin DLL's. The mingw64-i686-gcc-core and
528mingw64-i686-gcc-g++ packages (and their dependencies) must be installed.
529
530
531MinGW-w64 Build on Windows
532--------------------------
533
534This produces a 64-bit build of libjpeg-turbo using the "native" MinGW-w64
535toolchain (which is faster than the Cygwin version):
536
537 cd {build_directory}
538 CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
539 CXX={mingw-w64_binary_path}/x86_64-w64-mingw32-g++ \
DRC81543312010-10-18 07:23:58 +0000540 cmake -G "MSYS Makefiles" \
DRC1c73ce82010-10-16 21:02:54 +0000541 -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
542 -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
543 {source_directory}
544 make
545
546
DRCcc243742010-10-16 09:22:43 +0000547MinGW Build on Linux
548--------------------
549
550 cd {build_directory}
551 CC={mingw_binary_path}/i386-mingw32-gcc \
552 CXX={mingw_binary_path}/i386-mingw32-g++ \
DRC68bf3f22010-10-18 07:56:14 +0000553 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
554 -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
DRCcc243742010-10-16 09:22:43 +0000555 -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
DRC68bf3f22010-10-18 07:56:14 +0000556 {source_directory}
DRCcc243742010-10-16 09:22:43 +0000557 make
DRC8b014d72010-02-18 13:03:41 +0000558
DRC68fef832010-02-16 05:29:10 +0000559
560*******************************************************************************
561** Creating Release Packages
562*******************************************************************************
563
564The following commands can be used to create various types of release packages:
565
DRCcc243742010-10-16 09:22:43 +0000566
567Unix
568----
569
DRC68fef832010-02-16 05:29:10 +0000570make rpm
571
DRCcc243742010-10-16 09:22:43 +0000572 Create Red Hat-style binary RPM package. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000573
574make srpm
575
576 This runs 'make dist' to create a pristine source tarball, then creates a
DRCcc243742010-10-16 09:22:43 +0000577 Red Hat-style source RPM package from the tarball. Requires RPM v4 or later.
DRC68fef832010-02-16 05:29:10 +0000578
579make deb
580
581 Create Debian-style binary package. Requires dpkg.
582
583make dmg
584
585 Create Macintosh package/disk image. This requires the PackageMaker
586 application, which must be installed in /Developer/Applications/Utilities.
587
DRC9ef93db2010-10-18 08:24:42 +0000588make udmg [BUILDDIR32={32-bit build directory}]
DRC68fef832010-02-16 05:29:10 +0000589
DRC0dedd1a2010-07-02 09:20:12 +0000590 On 64-bit OS X systems, this creates a version of the Macintosh package and
DRC9ef93db2010-10-18 08:24:42 +0000591 disk image which contains universal i386/x86-64 binaries. You should first
592 configure a 32-bit out-of-tree build of libjpeg-turbo, then configure a
593 64-bit out-of-tree build, then run 'make udmg' from the 64-bit build
594 directory. The build system will look for the 32-bit build under
595 {source_directory}/osxx86 by default, but you can override this by setting
596 the BUILDDIR32 variable on the make command line as shown above.
DRC68fef832010-02-16 05:29:10 +0000597
DRC0f53df82010-10-21 19:47:06 +0000598make sunpkg
599
600 Build a Solaris package. This requires pkgmk, pkgtrans, and bzip2.
601
602make csunpkg [BUILDDIR32={32-bit build directory}]
603
604 On 64-bit Solaris systems, this creates a combined package which contains
605 both 32-bit and 64-bit libraries. You should first configure a 32-bit
606 out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree
607 build, then run 'make csunpkg' from the 64-bit build directory. The build
608 system will look for the 32-bit build under {source_directory}/solx86 by
609 default, but you can override this by setting the BUILDDIR32 variable on the
610 make command line as shown above.
611
DRC81543312010-10-18 07:23:58 +0000612make cygwinpkg
613
614 Build a Cygwin binary package.
615
DRC0a1f68e2010-02-24 07:24:26 +0000616
DRCcc243742010-10-16 09:22:43 +0000617Windows
618-------
DRC0a1f68e2010-02-24 07:24:26 +0000619
DRCcc243742010-10-16 09:22:43 +0000620If using NMake:
DRC68fef832010-02-16 05:29:10 +0000621
DRCcc243742010-10-16 09:22:43 +0000622 cd {build_directory}
623 nmake installer
624
DRC81543312010-10-18 07:23:58 +0000625If using MinGW:
DRCcc243742010-10-16 09:22:43 +0000626
627 cd {build_directory}
628 make installer
629
630If using the Visual Studio IDE, build the "installer" project.
631
632The installer package (libjpeg-turbo[-gcc][64].exe) will be located under
633{build_directory}. If building using the Visual Studio IDE, then the installer
634package will be located in a subdirectory with the same name as the
635configuration you built (such as {build_directory}\Debug\ or
636{build_directory}\Release\).
637
638Building a Windows installer requires the Nullsoft Install System
639(http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.