blob: 15155184ac5879c989d0f2764565180015d8fa2a [file] [log] [blame]
DRC68fef832010-02-16 05:29:10 +00001*******************************************************************************
2** Building on Unix Platforms, Cygwin, and MinGW
3*******************************************************************************
4
5==================
6Build Requirements
7==================
8
9-- autoconf 2.56 or later
10 * If using MinGW, this can be obtained by installing the MSYS DTK
11
12-- automake 1.7 or later
13 * If using MinGW, this can be obtained by installing the MSYS DTK
14
15-- libtool 1.4 or later
16 * If using MinGW, this can be obtained by installing the MSYS DTK
17
18-- NASM
19 * 0.98 or later is required for a 32-bit build
20 * NASM 2.05 or later is required for a 64-bit build
21 * NASM 2.07 or later is required for a 64-bit build on OS/X (10.6 "Snow
22 Leopard" or later.) This can be obtained from MacPorts
23 (http://www.macports.org/).
24
25 The NASM 2.05 RPMs do not work on older Linux systems, such as Enterprise
26 Linux 4. On such systems, you can easily build and install NASM 2.05
27 from the source RPM by executing the following as root:
28
29 ARCH=`uname -m`
30 wget http://www.nasm.us/pub/nasm/releasebuilds/2.05.01/nasm-2.05.01-1.src.rpm
31 rpmbuild --rebuild nasm-2.05.01-1.src.rpm
32 rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-2.05.01-1.$ARCH.rpm
33
DRCc3f4ac02010-02-19 21:51:26 +000034 NOTE: NASM build will fail if texinfo is not installed.
35
DRC8f870c22010-02-24 00:30:00 +000036-- GCC v4.1 or later recommended for best performance
DRC68fef832010-02-16 05:29:10 +000037
38======================
39Building libjpeg-turbo
40======================
41
42The following procedure will build libjpeg-turbo on Linux, 32-bit OS X, and
43Solaris/x86 systems (on Solaris, this generates a 32-bit library. See below
44for 64-bit build instructions.)
45
46 cd libjpeg-turbo
47 autoreconf -fiv
48 sh ./configure
49 make
50
51NOTE: Running autoreconf is only necessary if building libjpeg-turbo from the
52SVN repository.
53
54This will generate the following files under .libs/
55
56 libjpeg.a
57 Static link library for libjpeg-turbo
58
59 libjpeg.so.62.0.0 (Linux, Solaris)
60 libjpeg.62.dylib (OS X)
61 libjpeg-62.dll (MinGW)
62 cygjpeg-62.dll (Cygwin)
63 Shared library for libjpeg-turbo
64
65 libjpeg.so (Linux, Solaris)
66 libjpeg.dylib (OS X)
67 libjpeg.dll.a (Cygwin, MinGW)
68 Development stub for libjpeg-turbo shared library
69
70 libturbojpeg.a
71 Static link library for TurboJPEG/OSS
72
73 libturbojpeg.so (Linux, Solaris)
74 libturbojpeg.dylib (OS X)
75 Shared library and development stub for TurboJPEG/OSS
76
77 libturbojpeg.dll (MinGW)
78 cygturbojpeg.dll (Cygwin)
79 Shared library for TurboJPEG/OSS
80
81 libturbojpeg.dll.a (Cygwin, MinGW)
82 Development stub for TurboJPEG/OSS shared library
83
84========================
85Installing libjpeg-turbo
86========================
87
88If you intend to install these libraries and the associated header files, then
89replace 'make' in the instructions above with
90
91 make install prefix={base dir} libdir={library directory}
92
93For example,
94
95 make install prefix=/usr/local libdir=/usr/local/lib64
96
97will install the header files in /usr/local/include and the library files in
98/usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default
99is to install the header files in /opt/libjpeg-turbo/include and the library
100files in /opt/libjpeg-turbo/lib.
101
102NOTE: You can specify a prefix of /usr and a libdir of, for instance,
103/usr/lib64 to overwrite the system's version of libjpeg. If you do this,
104however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before
105overwriting it. It is recommended that you instead install libjpeg-turbo into
106a non-system directory and manipulate the LD_LIBRARY_PATH or create sym links
107to force applications to use libjpeg-turbo instead of libjpeg. See
108README-turbo.txt for more information.
109
110=============
111Build Recipes
112=============
113
11432-bit Library Build on 64-bit Linux
115------------------------------------
116
DRCca5e7d12010-02-17 02:25:06 +0000117Add
DRC68fef832010-02-16 05:29:10 +0000118
119 --host i686-pc-linux-gnu CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32'
120
121to the configure command line.
122
123
12464-bit Library Build on 64-bit OS/X
125-----------------------------------
126
DRCca5e7d12010-02-17 02:25:06 +0000127Add
DRC68fef832010-02-16 05:29:10 +0000128
129 --host x86_64-apple-darwin10.0.0 NASM=/opt/local/bin/nasm
130
DRC7bac07b2010-04-10 05:53:35 +0000131to the configure command line. NASM 2.07 or later from MacPorts must be
132installed.
DRC68fef832010-02-16 05:29:10 +0000133
134
13532-bit Library Build on 64-bit OS/X
136-----------------------------------
137
DRCca5e7d12010-02-17 02:25:06 +0000138Add
DRC68fef832010-02-16 05:29:10 +0000139
140 CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
141
142to the configure command line.
143
144
14532-bit Backward-Compatible Library Build on 64-bit OS/X
146-------------------------------------------------------
147
DRCca5e7d12010-02-17 02:25:06 +0000148Add
DRC68fef832010-02-16 05:29:10 +0000149
DRC485cd802010-02-23 23:23:42 +0000150 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
151 -mmacosx-version-min=10.4 -O3 -m32' \
152 CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
153 -mmacosx-version-min=10.4 -O3 -m32' \
DRC68fef832010-02-16 05:29:10 +0000154 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
155 -mmacosx-version-min=10.4 -m32'
156
157to the configure command line. The OS X 10.4 SDK must be installed.
158
159
16064-bit Library Build on 64-bit Solaris
161--------------------------------------
162
DRCca5e7d12010-02-17 02:25:06 +0000163Add
DRC68fef832010-02-16 05:29:10 +0000164
165 --host x86_64-pc-solaris CFLAGS='-O3 -m64' CXXFLAGS='-O3 -m64' LDFLAGS=-m64
166
167to the configure command line.
168
169
DRC7bac07b2010-04-10 05:53:35 +000017064-bit Library Build on 64-bit FreeBSD
171--------------------------------------
172
173Add
174
175 --host x86_64-unknown-freebsd
176
177to the configure command line. NASM 2.07 or later from FreeBSD ports must be
178installed.
179
180
18132-bit Library Build on 64-bit FreeBSD
182--------------------------------------
183
184Add
185
186 --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CXX='g++ -B/usr/lib32' \
187 CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS='-B/usr/lib32'
188
189to the configure command line. NASM 2.07 or later from FreeBSD ports must be
190installed.
191
192
DRC68fef832010-02-16 05:29:10 +0000193MinGW Build on Cygwin
194---------------------
195
DRCca5e7d12010-02-17 02:25:06 +0000196Add
DRC68fef832010-02-16 05:29:10 +0000197
198 --host mingw32
199
200to the configure command line. This will produce libraries which do not
201depend on cygwin1.dll or other Cygwin DLL's.
202
203
DRCca5e7d12010-02-17 02:25:06 +0000204Sun Studio
205----------
206
207Add
208
209 CC=cc CXX=CC
210
211to the configure command line. libjpeg-turbo will automatically be built with
212the maximum optimization level (-xO5) unless you override CFLAGS and CXXFLAGS.
213
214To build a 64-bit version of libjpeg-turbo using Sun Studio, add
215
216 --host x86_64-pc-solaris CC=cc CXX=CC CFLAGS='-xO5 -m64' \
217 CXXFLAGS='-xO5 -m64' LDFLAGS=-m64
218
219to the configure command line.
220
DRC8b014d72010-02-18 13:03:41 +0000221
DRC68fef832010-02-16 05:29:10 +0000222*******************************************************************************
DRC8b014d72010-02-18 13:03:41 +0000223** Building on Windows (Visual C++)
DRC68fef832010-02-16 05:29:10 +0000224*******************************************************************************
225
226==================
227Build Requirements
228==================
229
230-- GNU Make v3.7 or later
231 * Can be found in MSYS (http://www.mingw.org/download.shtml) or
232 Cygwin (http://www.cygwin.com/)
233
DRC8b014d72010-02-18 13:03:41 +0000234-- Windows SDK for Windows Server 2008 and .NET Framework 3.5 (or a later
235 version)
DRC68fef832010-02-16 05:29:10 +0000236
DRC8b014d72010-02-18 13:03:41 +0000237 http://msdn.microsoft.com/en-us/windows/dd146047.aspx
DRC68fef832010-02-16 05:29:10 +0000238
DRC8b014d72010-02-18 13:03:41 +0000239 * The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
240 everything necessary to build libjpeg-turbo. If you do not already have
241 Visual C++ installed, then this is the recommended solution. Also tested
242 with Microsoft Visual C++ 2008 Express Edition (both are free downloads.)
243 * Add the compiler and SDK binary directories (for instance,
DRC68fef832010-02-16 05:29:10 +0000244 c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN;
DRC8b014d72010-02-18 13:03:41 +0000245 c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;
246 c:\Program Files\Microsoft SDKs\Windows\v6.1\bin)
DRC68fef832010-02-16 05:29:10 +0000247 to the system or user PATH environment variable prior to building
248 libjpeg-turbo.
DRC8b014d72010-02-18 13:03:41 +0000249 * Add the compiler and SDK include directories (for instance,
250 c:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE;
251 c:\Program Files\Microsoft SDKs\Windows\v6.1\include)
DRC68fef832010-02-16 05:29:10 +0000252 to the system or user INCLUDE environment variable prior to building
253 libjpeg-turbo.
254 * Add the compiler library directory (for instance,
DRC8b014d72010-02-18 13:03:41 +0000255 c:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;
256 c:\Program Files\Microsoft SDKs\Windows\v6.1\lib)
DRC68fef832010-02-16 05:29:10 +0000257 to the system or user LIB environment variable prior to building
258 libjpeg-turbo.
259
260-- NASM (http://www.nasm.us/) 0.98 or later
261
262======================
263Building libjpeg-turbo
264======================
265
266 cd libjpeg-turbo
267 make -f win/Makefile
268
DRC8b014d72010-02-18 13:03:41 +0000269This will generate the following files under libjpeg-turbo\windows\:
DRC68fef832010-02-16 05:29:10 +0000270
271 jpeg-static.lib Static link library for libjpeg-turbo
272 jpeg62.dll Shared library for libjpeg-turbo
273 jpeg.lib Development stub for libjpeg-turbo shared library
274 turbojpeg-static.lib Static link library for TurboJPEG/OSS
275 turbojpeg.dll Shared library for TurboJPEG/OSS
276 turbojpeg.lib Development stub for TurboJPEG/OSS shared library
277
DRCe728ed72010-04-20 19:15:09 +0000278If a 64-bit Windows platform is detected, then the build system will attempt
279to build a 64-bit version of libjpeg-turbo. You can override this by running
DRC8b014d72010-02-18 13:03:41 +0000280
DRCe728ed72010-04-20 19:15:09 +0000281 make -f win/Makefile WIN64=no
DRC8b014d72010-02-18 13:03:41 +0000282
DRC68fef832010-02-16 05:29:10 +0000283
284*******************************************************************************
285** Creating Release Packages
286*******************************************************************************
287
288The following commands can be used to create various types of release packages:
289
290make rpm
291
292 Create RedHat-style binary RPM package. Requires RPM v4 or later.
293
294make srpm
295
296 This runs 'make dist' to create a pristine source tarball, then creates a
297 RedHat-style source RPM package from the tarball. Requires RPM v4 or later.
298
299make deb
300
301 Create Debian-style binary package. Requires dpkg.
302
303make dmg
304
305 Create Macintosh package/disk image. This requires the PackageMaker
306 application, which must be installed in /Developer/Applications/Utilities.
307
308make udmg
309
310 On 64-bit OS X (10.6 "Snow Leopard" or later), this creates a version of the
311 Macintosh package/disk image which contains universal i386/x86-64 binaries.
312 The 32-bit fork of these binaries is backward compatible with OS X 10.4 and
313 later, whereas the 64-bit fork is compatible with OS X 10.6 and later. OS X
314 10.4 compatibility SDK required.
315
DRC0a1f68e2010-02-24 07:24:26 +0000316make nsi
317
318 When using MinGW, this creates a Win32 installer for the GCC version of the
319 libjpeg-turbo SDK. This requires the Nullsoft Install System
320 (http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.
321
DRC68fef832010-02-16 05:29:10 +0000322make -f win/Makefile dist
323
DRC0a1f68e2010-02-24 07:24:26 +0000324 This creates a Win32 installer for the Visual C++ version of the
325 libjpeg-turbo SDK. This requires the Nullsoft Install System
326 (http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.