blob: fae1a8add5cc31c388b1d58242f37ba978ff8ebe [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
DRC68fef832010-02-16 05:29:10 +000010-- automake 1.7 or later
DRC68fef832010-02-16 05:29:10 +000011-- libtool 1.4 or later
DRC377add72010-05-17 16:41:12 +000012 * If using MinGW, these can be obtained by installing the MSYS DTK
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
17 * NASM 2.07 or later is required for a 64-bit build on OS/X (10.6 "Snow
18 Leopard" or later.) This can be obtained from MacPorts
19 (http://www.macports.org/).
20
21 The NASM 2.05 RPMs do not work on older Linux systems, such as Enterprise
22 Linux 4. On such systems, you can easily build and install NASM 2.05
23 from the source RPM by executing the following as root:
24
25 ARCH=`uname -m`
26 wget http://www.nasm.us/pub/nasm/releasebuilds/2.05.01/nasm-2.05.01-1.src.rpm
27 rpmbuild --rebuild nasm-2.05.01-1.src.rpm
28 rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-2.05.01-1.$ARCH.rpm
29
DRCc3f4ac02010-02-19 21:51:26 +000030 NOTE: NASM build will fail if texinfo is not installed.
31
DRC8f870c22010-02-24 00:30:00 +000032-- GCC v4.1 or later recommended for best performance
DRC68fef832010-02-16 05:29:10 +000033
34======================
35Building libjpeg-turbo
36======================
37
DRC49597872010-05-17 20:47:57 +000038The following procedure will build libjpeg-turbo on Linux, FreeBSD, 32-bit
39OS X, and Solaris/x86 systems (on Solaris, this generates a 32-bit library.
40See below for 64-bit build instructions.)
DRC68fef832010-02-16 05:29:10 +000041
42 cd libjpeg-turbo
43 autoreconf -fiv
44 sh ./configure
45 make
46
47NOTE: Running autoreconf is only necessary if building libjpeg-turbo from the
48SVN repository.
49
50This will generate the following files under .libs/
51
52 libjpeg.a
53 Static link library for libjpeg-turbo
54
55 libjpeg.so.62.0.0 (Linux, Solaris)
56 libjpeg.62.dylib (OS X)
57 libjpeg-62.dll (MinGW)
58 cygjpeg-62.dll (Cygwin)
59 Shared library for libjpeg-turbo
60
61 libjpeg.so (Linux, Solaris)
62 libjpeg.dylib (OS X)
63 libjpeg.dll.a (Cygwin, MinGW)
64 Development stub for libjpeg-turbo shared library
65
66 libturbojpeg.a
67 Static link library for TurboJPEG/OSS
68
69 libturbojpeg.so (Linux, Solaris)
70 libturbojpeg.dylib (OS X)
71 Shared library and development stub for TurboJPEG/OSS
72
73 libturbojpeg.dll (MinGW)
74 cygturbojpeg.dll (Cygwin)
75 Shared library for TurboJPEG/OSS
76
77 libturbojpeg.dll.a (Cygwin, MinGW)
78 Development stub for TurboJPEG/OSS shared library
79
80========================
81Installing libjpeg-turbo
82========================
83
84If you intend to install these libraries and the associated header files, then
85replace 'make' in the instructions above with
86
87 make install prefix={base dir} libdir={library directory}
88
89For example,
90
91 make install prefix=/usr/local libdir=/usr/local/lib64
92
93will install the header files in /usr/local/include and the library files in
94/usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default
95is to install the header files in /opt/libjpeg-turbo/include and the library
96files in /opt/libjpeg-turbo/lib.
97
98NOTE: You can specify a prefix of /usr and a libdir of, for instance,
99/usr/lib64 to overwrite the system's version of libjpeg. If you do this,
100however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before
101overwriting it. It is recommended that you instead install libjpeg-turbo into
102a non-system directory and manipulate the LD_LIBRARY_PATH or create sym links
103to force applications to use libjpeg-turbo instead of libjpeg. See
104README-turbo.txt for more information.
105
106=============
107Build Recipes
108=============
109
11032-bit Library Build on 64-bit Linux
111------------------------------------
112
DRCca5e7d12010-02-17 02:25:06 +0000113Add
DRC68fef832010-02-16 05:29:10 +0000114
115 --host i686-pc-linux-gnu CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32'
116
117to the configure command line.
118
119
12064-bit Library Build on 64-bit OS/X
121-----------------------------------
122
DRCca5e7d12010-02-17 02:25:06 +0000123Add
DRC68fef832010-02-16 05:29:10 +0000124
125 --host x86_64-apple-darwin10.0.0 NASM=/opt/local/bin/nasm
126
DRC7bac07b2010-04-10 05:53:35 +0000127to the configure command line. NASM 2.07 or later from MacPorts must be
128installed.
DRC68fef832010-02-16 05:29:10 +0000129
130
13132-bit Library Build on 64-bit OS/X
132-----------------------------------
133
DRCca5e7d12010-02-17 02:25:06 +0000134Add
DRC68fef832010-02-16 05:29:10 +0000135
136 CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
137
138to the configure command line.
139
140
14132-bit Backward-Compatible Library Build on 64-bit OS/X
142-------------------------------------------------------
143
DRCca5e7d12010-02-17 02:25:06 +0000144Add
DRC68fef832010-02-16 05:29:10 +0000145
DRC485cd802010-02-23 23:23:42 +0000146 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
147 -mmacosx-version-min=10.4 -O3 -m32' \
148 CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
149 -mmacosx-version-min=10.4 -O3 -m32' \
DRC68fef832010-02-16 05:29:10 +0000150 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
DRC7bac07b2010-04-10 05:53:35 +000016632-bit Library Build on 64-bit FreeBSD
167--------------------------------------
168
169Add
170
171 --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CXX='g++ -B/usr/lib32' \
172 CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS='-B/usr/lib32'
173
174to the configure command line. NASM 2.07 or later from FreeBSD ports must be
175installed.
176
177
DRC68fef832010-02-16 05:29:10 +0000178MinGW Build on Cygwin
179---------------------
180
DRCca5e7d12010-02-17 02:25:06 +0000181Add
DRC68fef832010-02-16 05:29:10 +0000182
183 --host mingw32
184
185to the configure command line. This will produce libraries which do not
186depend on cygwin1.dll or other Cygwin DLL's.
187
188
DRCca5e7d12010-02-17 02:25:06 +0000189Sun Studio
190----------
191
192Add
193
194 CC=cc CXX=CC
195
196to the configure command line. libjpeg-turbo will automatically be built with
197the maximum optimization level (-xO5) unless you override CFLAGS and CXXFLAGS.
198
199To build a 64-bit version of libjpeg-turbo using Sun Studio, add
200
201 --host x86_64-pc-solaris CC=cc CXX=CC CFLAGS='-xO5 -m64' \
202 CXXFLAGS='-xO5 -m64' LDFLAGS=-m64
203
204to the configure command line.
205
DRC8b014d72010-02-18 13:03:41 +0000206
DRC68fef832010-02-16 05:29:10 +0000207*******************************************************************************
DRC8b014d72010-02-18 13:03:41 +0000208** Building on Windows (Visual C++)
DRC68fef832010-02-16 05:29:10 +0000209*******************************************************************************
210
211==================
212Build Requirements
213==================
214
215-- GNU Make v3.7 or later
216 * Can be found in MSYS (http://www.mingw.org/download.shtml) or
217 Cygwin (http://www.cygwin.com/)
218
DRC8b014d72010-02-18 13:03:41 +0000219-- Windows SDK for Windows Server 2008 and .NET Framework 3.5 (or a later
220 version)
DRC68fef832010-02-16 05:29:10 +0000221
DRC8b014d72010-02-18 13:03:41 +0000222 http://msdn.microsoft.com/en-us/windows/dd146047.aspx
DRC68fef832010-02-16 05:29:10 +0000223
DRC8b014d72010-02-18 13:03:41 +0000224 * The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
225 everything necessary to build libjpeg-turbo. If you do not already have
226 Visual C++ installed, then this is the recommended solution. Also tested
227 with Microsoft Visual C++ 2008 Express Edition (both are free downloads.)
228 * Add the compiler and SDK binary directories (for instance,
DRC68fef832010-02-16 05:29:10 +0000229 c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN;
DRC8b014d72010-02-18 13:03:41 +0000230 c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;
231 c:\Program Files\Microsoft SDKs\Windows\v6.1\bin)
DRC68fef832010-02-16 05:29:10 +0000232 to the system or user PATH environment variable prior to building
233 libjpeg-turbo.
DRC8b014d72010-02-18 13:03:41 +0000234 * Add the compiler and SDK include directories (for instance,
235 c:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE;
236 c:\Program Files\Microsoft SDKs\Windows\v6.1\include)
DRC68fef832010-02-16 05:29:10 +0000237 to the system or user INCLUDE environment variable prior to building
238 libjpeg-turbo.
239 * Add the compiler library directory (for instance,
DRC8b014d72010-02-18 13:03:41 +0000240 c:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;
241 c:\Program Files\Microsoft SDKs\Windows\v6.1\lib)
DRC68fef832010-02-16 05:29:10 +0000242 to the system or user LIB environment variable prior to building
243 libjpeg-turbo.
244
DRC377add72010-05-17 16:41:12 +0000245-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
246 a 64-bit build)
DRC68fef832010-02-16 05:29:10 +0000247
248======================
249Building libjpeg-turbo
250======================
251
252 cd libjpeg-turbo
253 make -f win/Makefile
254
DRC8b014d72010-02-18 13:03:41 +0000255This will generate the following files under libjpeg-turbo\windows\:
DRC68fef832010-02-16 05:29:10 +0000256
257 jpeg-static.lib Static link library for libjpeg-turbo
258 jpeg62.dll Shared library for libjpeg-turbo
259 jpeg.lib Development stub for libjpeg-turbo shared library
260 turbojpeg-static.lib Static link library for TurboJPEG/OSS
261 turbojpeg.dll Shared library for TurboJPEG/OSS
262 turbojpeg.lib Development stub for TurboJPEG/OSS shared library
263
DRCe728ed72010-04-20 19:15:09 +0000264If a 64-bit Windows platform is detected, then the build system will attempt
265to build a 64-bit version of libjpeg-turbo. You can override this by running
DRC8b014d72010-02-18 13:03:41 +0000266
DRCe728ed72010-04-20 19:15:09 +0000267 make -f win/Makefile WIN64=no
DRC8b014d72010-02-18 13:03:41 +0000268
DRC68fef832010-02-16 05:29:10 +0000269
270*******************************************************************************
271** Creating Release Packages
272*******************************************************************************
273
274The following commands can be used to create various types of release packages:
275
276make rpm
277
278 Create RedHat-style binary RPM package. Requires RPM v4 or later.
279
280make srpm
281
282 This runs 'make dist' to create a pristine source tarball, then creates a
283 RedHat-style source RPM package from the tarball. Requires RPM v4 or later.
284
285make deb
286
287 Create Debian-style binary package. Requires dpkg.
288
289make dmg
290
291 Create Macintosh package/disk image. This requires the PackageMaker
292 application, which must be installed in /Developer/Applications/Utilities.
293
294make udmg
295
296 On 64-bit OS X (10.6 "Snow Leopard" or later), this creates a version of the
297 Macintosh package/disk image which contains universal i386/x86-64 binaries.
298 The 32-bit fork of these binaries is backward compatible with OS X 10.4 and
299 later, whereas the 64-bit fork is compatible with OS X 10.6 and later. OS X
300 10.4 compatibility SDK required.
301
DRC0a1f68e2010-02-24 07:24:26 +0000302make nsi
303
304 When using MinGW, this creates a Win32 installer for the GCC version of the
305 libjpeg-turbo SDK. This requires the Nullsoft Install System
306 (http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.
307
DRC9ca23642010-05-10 22:19:24 +0000308make -f win/Makefile nsi
DRC68fef832010-02-16 05:29:10 +0000309
DRC0a1f68e2010-02-24 07:24:26 +0000310 This creates a Win32 installer for the Visual C++ version of the
311 libjpeg-turbo SDK. This requires the Nullsoft Install System
312 (http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.