blob: d17423132250cba161607bd88f7c11abb7d234d3 [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
34-- GCC v4 or later recommended for best performance
35
36======================
37Building libjpeg-turbo
38======================
39
40The following procedure will build libjpeg-turbo on Linux, 32-bit OS X, and
41Solaris/x86 systems (on Solaris, this generates a 32-bit library. See below
42for 64-bit build instructions.)
43
44 cd libjpeg-turbo
45 autoreconf -fiv
46 sh ./configure
47 make
48
49NOTE: Running autoreconf is only necessary if building libjpeg-turbo from the
50SVN repository.
51
52This will generate the following files under .libs/
53
54 libjpeg.a
55 Static link library for libjpeg-turbo
56
57 libjpeg.so.62.0.0 (Linux, Solaris)
58 libjpeg.62.dylib (OS X)
59 libjpeg-62.dll (MinGW)
60 cygjpeg-62.dll (Cygwin)
61 Shared library for libjpeg-turbo
62
63 libjpeg.so (Linux, Solaris)
64 libjpeg.dylib (OS X)
65 libjpeg.dll.a (Cygwin, MinGW)
66 Development stub for libjpeg-turbo shared library
67
68 libturbojpeg.a
69 Static link library for TurboJPEG/OSS
70
71 libturbojpeg.so (Linux, Solaris)
72 libturbojpeg.dylib (OS X)
73 Shared library and development stub for TurboJPEG/OSS
74
75 libturbojpeg.dll (MinGW)
76 cygturbojpeg.dll (Cygwin)
77 Shared library for TurboJPEG/OSS
78
79 libturbojpeg.dll.a (Cygwin, MinGW)
80 Development stub for TurboJPEG/OSS shared library
81
82========================
83Installing libjpeg-turbo
84========================
85
86If you intend to install these libraries and the associated header files, then
87replace 'make' in the instructions above with
88
89 make install prefix={base dir} libdir={library directory}
90
91For example,
92
93 make install prefix=/usr/local libdir=/usr/local/lib64
94
95will install the header files in /usr/local/include and the library files in
96/usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default
97is to install the header files in /opt/libjpeg-turbo/include and the library
98files in /opt/libjpeg-turbo/lib.
99
100NOTE: You can specify a prefix of /usr and a libdir of, for instance,
101/usr/lib64 to overwrite the system's version of libjpeg. If you do this,
102however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before
103overwriting it. It is recommended that you instead install libjpeg-turbo into
104a non-system directory and manipulate the LD_LIBRARY_PATH or create sym links
105to force applications to use libjpeg-turbo instead of libjpeg. See
106README-turbo.txt for more information.
107
108=============
109Build Recipes
110=============
111
11232-bit Library Build on 64-bit Linux
113------------------------------------
114
DRCca5e7d12010-02-17 02:25:06 +0000115Add
DRC68fef832010-02-16 05:29:10 +0000116
117 --host i686-pc-linux-gnu CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32'
118
119to the configure command line.
120
121
12264-bit Library Build on 64-bit OS/X
123-----------------------------------
124
DRCca5e7d12010-02-17 02:25:06 +0000125Add
DRC68fef832010-02-16 05:29:10 +0000126
127 --host x86_64-apple-darwin10.0.0 NASM=/opt/local/bin/nasm
128
129to the configure command line. NASM 2.07 from MacPorts must be installed.
130
131
13232-bit Library Build on 64-bit OS/X
133-----------------------------------
134
DRCca5e7d12010-02-17 02:25:06 +0000135Add
DRC68fef832010-02-16 05:29:10 +0000136
137 CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
138
139to the configure command line.
140
141
14232-bit Backward-Compatible Library Build on 64-bit OS/X
143-------------------------------------------------------
144
DRCca5e7d12010-02-17 02:25:06 +0000145Add
DRC68fef832010-02-16 05:29:10 +0000146
147 CC=gcc-4.0 CXX=g++-4.0 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
148 -mmacosx-version-min=10.4 -O3 -m32' CXXFLAGS='-isysroot \
149 /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -O3 -m32' \
150 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
151 -mmacosx-version-min=10.4 -m32'
152
153to the configure command line. The OS X 10.4 SDK must be installed.
154
155
15664-bit Library Build on 64-bit Solaris
157--------------------------------------
158
DRCca5e7d12010-02-17 02:25:06 +0000159Add
DRC68fef832010-02-16 05:29:10 +0000160
161 --host x86_64-pc-solaris CFLAGS='-O3 -m64' CXXFLAGS='-O3 -m64' LDFLAGS=-m64
162
163to the configure command line.
164
165
166MinGW Build on Cygwin
167---------------------
168
DRCca5e7d12010-02-17 02:25:06 +0000169Add
DRC68fef832010-02-16 05:29:10 +0000170
171 --host mingw32
172
173to the configure command line. This will produce libraries which do not
174depend on cygwin1.dll or other Cygwin DLL's.
175
176
DRCca5e7d12010-02-17 02:25:06 +0000177Sun Studio
178----------
179
180Add
181
182 CC=cc CXX=CC
183
184to the configure command line. libjpeg-turbo will automatically be built with
185the maximum optimization level (-xO5) unless you override CFLAGS and CXXFLAGS.
186
187To build a 64-bit version of libjpeg-turbo using Sun Studio, add
188
189 --host x86_64-pc-solaris CC=cc CXX=CC CFLAGS='-xO5 -m64' \
190 CXXFLAGS='-xO5 -m64' LDFLAGS=-m64
191
192to the configure command line.
193
DRC8b014d72010-02-18 13:03:41 +0000194
DRC68fef832010-02-16 05:29:10 +0000195*******************************************************************************
DRC8b014d72010-02-18 13:03:41 +0000196** Building on Windows (Visual C++)
DRC68fef832010-02-16 05:29:10 +0000197*******************************************************************************
198
199==================
200Build Requirements
201==================
202
203-- GNU Make v3.7 or later
204 * Can be found in MSYS (http://www.mingw.org/download.shtml) or
205 Cygwin (http://www.cygwin.com/)
206
DRC8b014d72010-02-18 13:03:41 +0000207-- Windows SDK for Windows Server 2008 and .NET Framework 3.5 (or a later
208 version)
DRC68fef832010-02-16 05:29:10 +0000209
DRC8b014d72010-02-18 13:03:41 +0000210 http://msdn.microsoft.com/en-us/windows/dd146047.aspx
DRC68fef832010-02-16 05:29:10 +0000211
DRC8b014d72010-02-18 13:03:41 +0000212 * The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
213 everything necessary to build libjpeg-turbo. If you do not already have
214 Visual C++ installed, then this is the recommended solution. Also tested
215 with Microsoft Visual C++ 2008 Express Edition (both are free downloads.)
216 * Add the compiler and SDK binary directories (for instance,
DRC68fef832010-02-16 05:29:10 +0000217 c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN;
DRC8b014d72010-02-18 13:03:41 +0000218 c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;
219 c:\Program Files\Microsoft SDKs\Windows\v6.1\bin)
DRC68fef832010-02-16 05:29:10 +0000220 to the system or user PATH environment variable prior to building
221 libjpeg-turbo.
DRC8b014d72010-02-18 13:03:41 +0000222 * Add the compiler and SDK include directories (for instance,
223 c:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE;
224 c:\Program Files\Microsoft SDKs\Windows\v6.1\include)
DRC68fef832010-02-16 05:29:10 +0000225 to the system or user INCLUDE environment variable prior to building
226 libjpeg-turbo.
227 * Add the compiler library directory (for instance,
DRC8b014d72010-02-18 13:03:41 +0000228 c:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;
229 c:\Program Files\Microsoft SDKs\Windows\v6.1\lib)
DRC68fef832010-02-16 05:29:10 +0000230 to the system or user LIB environment variable prior to building
231 libjpeg-turbo.
232
233-- NASM (http://www.nasm.us/) 0.98 or later
234
235======================
236Building libjpeg-turbo
237======================
238
239 cd libjpeg-turbo
240 make -f win/Makefile
241
DRC8b014d72010-02-18 13:03:41 +0000242This will generate the following files under libjpeg-turbo\windows\:
DRC68fef832010-02-16 05:29:10 +0000243
244 jpeg-static.lib Static link library for libjpeg-turbo
245 jpeg62.dll Shared library for libjpeg-turbo
246 jpeg.lib Development stub for libjpeg-turbo shared library
247 turbojpeg-static.lib Static link library for TurboJPEG/OSS
248 turbojpeg.dll Shared library for TurboJPEG/OSS
249 turbojpeg.lib Development stub for TurboJPEG/OSS shared library
250
DRC8b014d72010-02-18 13:03:41 +0000251#If a 64-bit Windows platform is detected, then the build system will attempt
252#to build a 64-bit version of libjpeg-turbo. You can override this by running
253#
254# make -f win/Makefile WIN64=no
255
256Win64 doesn't work yet
257
DRC68fef832010-02-16 05:29:10 +0000258
259*******************************************************************************
260** Creating Release Packages
261*******************************************************************************
262
263The following commands can be used to create various types of release packages:
264
265make rpm
266
267 Create RedHat-style binary RPM package. Requires RPM v4 or later.
268
269make srpm
270
271 This runs 'make dist' to create a pristine source tarball, then creates a
272 RedHat-style source RPM package from the tarball. Requires RPM v4 or later.
273
274make deb
275
276 Create Debian-style binary package. Requires dpkg.
277
278make dmg
279
280 Create Macintosh package/disk image. This requires the PackageMaker
281 application, which must be installed in /Developer/Applications/Utilities.
282
283make udmg
284
285 On 64-bit OS X (10.6 "Snow Leopard" or later), this creates a version of the
286 Macintosh package/disk image which contains universal i386/x86-64 binaries.
287 The 32-bit fork of these binaries is backward compatible with OS X 10.4 and
288 later, whereas the 64-bit fork is compatible with OS X 10.6 and later. OS X
289 10.4 compatibility SDK required.
290
291make -f win/Makefile dist
292
293 This creates a Win32 installer for the libjpeg-turbo SDK. This requires the
294 Nullsoft Install System (http://nsis.sourceforge.net/.) makensis.exe should
295 be in your PATH.