blob: d5693b1a350c1ee32a60d2d0de85a6231d444837 [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
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
20 The NASM 2.05 RPMs do not work on older Linux systems, such as Enterprise
21 Linux 4. On such systems, you can easily build and install NASM 2.05
22 from the source RPM by executing the following as root:
23
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
33======================
34Building libjpeg-turbo
35======================
36
DRC49597872010-05-17 20:47:57 +000037The following procedure will build libjpeg-turbo on Linux, FreeBSD, 32-bit
38OS X, and Solaris/x86 systems (on Solaris, this generates a 32-bit library.
39See below for 64-bit build instructions.)
DRC68fef832010-02-16 05:29:10 +000040
41 cd libjpeg-turbo
42 autoreconf -fiv
43 sh ./configure
44 make
45
46NOTE: Running autoreconf is only necessary if building libjpeg-turbo from the
47SVN repository.
48
49This will generate the following files under .libs/
50
51 libjpeg.a
52 Static link library for libjpeg-turbo
53
54 libjpeg.so.62.0.0 (Linux, Solaris)
55 libjpeg.62.dylib (OS X)
56 libjpeg-62.dll (MinGW)
57 cygjpeg-62.dll (Cygwin)
58 Shared library for libjpeg-turbo
59
60 libjpeg.so (Linux, Solaris)
61 libjpeg.dylib (OS X)
62 libjpeg.dll.a (Cygwin, MinGW)
63 Development stub for libjpeg-turbo shared library
64
65 libturbojpeg.a
66 Static link library for TurboJPEG/OSS
67
68 libturbojpeg.so (Linux, Solaris)
69 libturbojpeg.dylib (OS X)
70 Shared library and development stub for TurboJPEG/OSS
71
72 libturbojpeg.dll (MinGW)
73 cygturbojpeg.dll (Cygwin)
74 Shared library for TurboJPEG/OSS
75
76 libturbojpeg.dll.a (Cygwin, MinGW)
77 Development stub for TurboJPEG/OSS shared library
78
79========================
80Installing libjpeg-turbo
81========================
82
83If you intend to install these libraries and the associated header files, then
84replace 'make' in the instructions above with
85
86 make install prefix={base dir} libdir={library directory}
87
88For example,
89
90 make install prefix=/usr/local libdir=/usr/local/lib64
91
92will install the header files in /usr/local/include and the library files in
93/usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default
94is to install the header files in /opt/libjpeg-turbo/include and the library
95files in /opt/libjpeg-turbo/lib.
96
97NOTE: You can specify a prefix of /usr and a libdir of, for instance,
98/usr/lib64 to overwrite the system's version of libjpeg. If you do this,
99however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before
100overwriting it. It is recommended that you instead install libjpeg-turbo into
101a non-system directory and manipulate the LD_LIBRARY_PATH or create sym links
102to force applications to use libjpeg-turbo instead of libjpeg. See
103README-turbo.txt for more information.
104
105=============
106Build Recipes
107=============
108
10932-bit Library Build on 64-bit Linux
110------------------------------------
111
DRCca5e7d12010-02-17 02:25:06 +0000112Add
DRC68fef832010-02-16 05:29:10 +0000113
DRC8c2b9fa2010-06-04 23:09:00 +0000114 --host i686-pc-linux-gnu CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
DRC68fef832010-02-16 05:29:10 +0000115
116to the configure command line.
117
118
DRC9026b372011-04-16 13:37:22 +000011964-bit Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000120-----------------------------------
121
DRCca5e7d12010-02-17 02:25:06 +0000122Add
DRC68fef832010-02-16 05:29:10 +0000123
DRC0dedd1a2010-07-02 09:20:12 +0000124 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm
DRC68fef832010-02-16 05:29:10 +0000125
DRC7bac07b2010-04-10 05:53:35 +0000126to the configure command line. NASM 2.07 or later from MacPorts must be
127installed.
DRC68fef832010-02-16 05:29:10 +0000128
129
DRC9026b372011-04-16 13:37:22 +000013032-bit Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000131-----------------------------------
132
DRCca5e7d12010-02-17 02:25:06 +0000133Add
DRC68fef832010-02-16 05:29:10 +0000134
135 CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
136
137to the configure command line.
138
139
DRC9026b372011-04-16 13:37:22 +000014064-bit Backward-Compatible Library Build on 64-bit OS X
DRC68fef832010-02-16 05:29:10 +0000141-------------------------------------------------------
142
DRCca5e7d12010-02-17 02:25:06 +0000143Add
DRC68fef832010-02-16 05:29:10 +0000144
DRC0dedd1a2010-07-02 09:20:12 +0000145 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
146 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
147 -mmacosx-version-min=10.4 -O3' \
148 CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
149 -mmacosx-version-min=10.4 -O3' \
150 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
151 -mmacosx-version-min=10.4'
152
DRC575c3422010-07-08 07:01:20 +0000153to the configure command line. The OS X 10.4 SDK, and NASM 2.07 or later from
154MacPorts, must be installed.
DRC0dedd1a2010-07-02 09:20:12 +0000155
156
DRC9026b372011-04-16 13:37:22 +000015732-bit Backward-Compatible Library Build on OS X
DRC0dedd1a2010-07-02 09:20:12 +0000158------------------------------------------------
159
160Add
161
DRC485cd802010-02-23 23:23:42 +0000162 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
163 -mmacosx-version-min=10.4 -O3 -m32' \
164 CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
165 -mmacosx-version-min=10.4 -O3 -m32' \
DRC68fef832010-02-16 05:29:10 +0000166 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
167 -mmacosx-version-min=10.4 -m32'
168
169to the configure command line. The OS X 10.4 SDK must be installed.
170
171
17264-bit Library Build on 64-bit Solaris
173--------------------------------------
174
DRCca5e7d12010-02-17 02:25:06 +0000175Add
DRC68fef832010-02-16 05:29:10 +0000176
177 --host x86_64-pc-solaris CFLAGS='-O3 -m64' CXXFLAGS='-O3 -m64' LDFLAGS=-m64
178
179to the configure command line.
180
181
DRC7bac07b2010-04-10 05:53:35 +000018232-bit Library Build on 64-bit FreeBSD
183--------------------------------------
184
185Add
186
187 --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CXX='g++ -B/usr/lib32' \
188 CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS='-B/usr/lib32'
189
190to the configure command line. NASM 2.07 or later from FreeBSD ports must be
191installed.
192
193
DRC68fef832010-02-16 05:29:10 +0000194MinGW Build on Cygwin
195---------------------
196
DRCca5e7d12010-02-17 02:25:06 +0000197Add
DRC68fef832010-02-16 05:29:10 +0000198
199 --host mingw32
200
201to the configure command line. This will produce libraries which do not
202depend on cygwin1.dll or other Cygwin DLL's.
203
204
DRCca5e7d12010-02-17 02:25:06 +0000205Sun Studio
206----------
207
208Add
209
210 CC=cc CXX=CC
211
212to the configure command line. libjpeg-turbo will automatically be built with
213the maximum optimization level (-xO5) unless you override CFLAGS and CXXFLAGS.
214
215To build a 64-bit version of libjpeg-turbo using Sun Studio, add
216
217 --host x86_64-pc-solaris CC=cc CXX=CC CFLAGS='-xO5 -m64' \
218 CXXFLAGS='-xO5 -m64' LDFLAGS=-m64
219
220to the configure command line.
221
DRC8b014d72010-02-18 13:03:41 +0000222
DRC68fef832010-02-16 05:29:10 +0000223*******************************************************************************
DRC8b014d72010-02-18 13:03:41 +0000224** Building on Windows (Visual C++)
DRC68fef832010-02-16 05:29:10 +0000225*******************************************************************************
226
227==================
228Build Requirements
229==================
230
231-- GNU Make v3.7 or later
232 * Can be found in MSYS (http://www.mingw.org/download.shtml) or
233 Cygwin (http://www.cygwin.com/)
234
DRC8b014d72010-02-18 13:03:41 +0000235-- Windows SDK for Windows Server 2008 and .NET Framework 3.5 (or a later
236 version)
DRC68fef832010-02-16 05:29:10 +0000237
DRC8b014d72010-02-18 13:03:41 +0000238 http://msdn.microsoft.com/en-us/windows/dd146047.aspx
DRC68fef832010-02-16 05:29:10 +0000239
DRC8b014d72010-02-18 13:03:41 +0000240 * The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
241 everything necessary to build libjpeg-turbo. If you do not already have
242 Visual C++ installed, then this is the recommended solution. Also tested
243 with Microsoft Visual C++ 2008 Express Edition (both are free downloads.)
244 * Add the compiler and SDK binary directories (for instance,
DRC68fef832010-02-16 05:29:10 +0000245 c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN;
DRC8b014d72010-02-18 13:03:41 +0000246 c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;
247 c:\Program Files\Microsoft SDKs\Windows\v6.1\bin)
DRC68fef832010-02-16 05:29:10 +0000248 to the system or user PATH environment variable prior to building
249 libjpeg-turbo.
DRC8b014d72010-02-18 13:03:41 +0000250 * Add the compiler and SDK include directories (for instance,
251 c:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE;
252 c:\Program Files\Microsoft SDKs\Windows\v6.1\include)
DRC68fef832010-02-16 05:29:10 +0000253 to the system or user INCLUDE environment variable prior to building
254 libjpeg-turbo.
255 * Add the compiler library directory (for instance,
DRC8b014d72010-02-18 13:03:41 +0000256 c:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;
257 c:\Program Files\Microsoft SDKs\Windows\v6.1\lib)
DRC68fef832010-02-16 05:29:10 +0000258 to the system or user LIB environment variable prior to building
259 libjpeg-turbo.
260
DRC377add72010-05-17 16:41:12 +0000261-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
262 a 64-bit build)
DRC68fef832010-02-16 05:29:10 +0000263
264======================
265Building libjpeg-turbo
266======================
267
268 cd libjpeg-turbo
269 make -f win/Makefile
270
DRC8b014d72010-02-18 13:03:41 +0000271This will generate the following files under libjpeg-turbo\windows\:
DRC68fef832010-02-16 05:29:10 +0000272
273 jpeg-static.lib Static link library for libjpeg-turbo
274 jpeg62.dll Shared library for libjpeg-turbo
275 jpeg.lib Development stub for libjpeg-turbo shared library
276 turbojpeg-static.lib Static link library for TurboJPEG/OSS
277 turbojpeg.dll Shared library for TurboJPEG/OSS
278 turbojpeg.lib Development stub for TurboJPEG/OSS shared library
279
DRCe728ed72010-04-20 19:15:09 +0000280If a 64-bit Windows platform is detected, then the build system will attempt
281to build a 64-bit version of libjpeg-turbo. You can override this by running
DRC8b014d72010-02-18 13:03:41 +0000282
DRCe728ed72010-04-20 19:15:09 +0000283 make -f win/Makefile WIN64=no
DRC8b014d72010-02-18 13:03:41 +0000284
DRC68fef832010-02-16 05:29:10 +0000285
286*******************************************************************************
287** Creating Release Packages
288*******************************************************************************
289
290The following commands can be used to create various types of release packages:
291
292make rpm
293
294 Create RedHat-style binary RPM package. Requires RPM v4 or later.
295
296make srpm
297
298 This runs 'make dist' to create a pristine source tarball, then creates a
299 RedHat-style source RPM package from the tarball. Requires RPM v4 or later.
300
301make deb
302
303 Create Debian-style binary package. Requires dpkg.
304
305make dmg
306
307 Create Macintosh package/disk image. This requires the PackageMaker
308 application, which must be installed in /Developer/Applications/Utilities.
309
310make udmg
311
DRC0dedd1a2010-07-02 09:20:12 +0000312 On 64-bit OS X systems, this creates a version of the Macintosh package and
313 disk image which contains universal i386/x86-64 binaries. The 32-bit fork of
314 these binaries is backward compatible with OS X 10.4 and later. The 64-bit
315 fork can be made backward compatible as well by using the instructions in
316 the "Build Recipes" section. OS X 10.4 compatibility SDK required.
DRC68fef832010-02-16 05:29:10 +0000317
DRC0a1f68e2010-02-24 07:24:26 +0000318make nsi
319
320 When using MinGW, this creates a Win32 installer for the GCC version of the
321 libjpeg-turbo SDK. This requires the Nullsoft Install System
322 (http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.
323
DRC9ca23642010-05-10 22:19:24 +0000324make -f win/Makefile nsi
DRC68fef832010-02-16 05:29:10 +0000325
DRC0a1f68e2010-02-24 07:24:26 +0000326 This creates a Win32 installer for the Visual C++ version of the
327 libjpeg-turbo SDK. This requires the Nullsoft Install System
328 (http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.