DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 1 | ******************************************************************************* |
| 2 | ** Building on Unix Platforms, Cygwin, and MinGW |
| 3 | ******************************************************************************* |
| 4 | |
| 5 | ================== |
| 6 | Build Requirements |
| 7 | ================== |
| 8 | |
| 9 | -- autoconf 2.56 or later |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 10 | -- automake 1.7 or later |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 11 | -- libtool 1.4 or later |
DRC | 377add7 | 2010-05-17 16:41:12 +0000 | [diff] [blame] | 12 | * If using MinGW, these can be obtained by installing the MSYS DTK |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 13 | |
| 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 |
DRC | 9026b37 | 2011-04-16 13:37:22 +0000 | [diff] [blame] | 17 | * NASM 2.07 or later is required for a 64-bit build on OS X. This can be |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 18 | obtained from MacPorts (http://www.macports.org/). |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 19 | |
| 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 | |
DRC | c3f4ac0 | 2010-02-19 21:51:26 +0000 | [diff] [blame] | 29 | NOTE: NASM build will fail if texinfo is not installed. |
| 30 | |
DRC | 8f870c2 | 2010-02-24 00:30:00 +0000 | [diff] [blame] | 31 | -- GCC v4.1 or later recommended for best performance |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 32 | |
| 33 | ====================== |
| 34 | Building libjpeg-turbo |
| 35 | ====================== |
| 36 | |
DRC | 4959787 | 2010-05-17 20:47:57 +0000 | [diff] [blame] | 37 | The following procedure will build libjpeg-turbo on Linux, FreeBSD, 32-bit |
| 38 | OS X, and Solaris/x86 systems (on Solaris, this generates a 32-bit library. |
| 39 | See below for 64-bit build instructions.) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 40 | |
| 41 | cd libjpeg-turbo |
| 42 | autoreconf -fiv |
| 43 | sh ./configure |
| 44 | make |
| 45 | |
| 46 | NOTE: Running autoreconf is only necessary if building libjpeg-turbo from the |
| 47 | SVN repository. |
| 48 | |
| 49 | This 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 | ======================== |
| 80 | Installing libjpeg-turbo |
| 81 | ======================== |
| 82 | |
| 83 | If you intend to install these libraries and the associated header files, then |
| 84 | replace 'make' in the instructions above with |
| 85 | |
| 86 | make install prefix={base dir} libdir={library directory} |
| 87 | |
| 88 | For example, |
| 89 | |
| 90 | make install prefix=/usr/local libdir=/usr/local/lib64 |
| 91 | |
| 92 | will 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 |
| 94 | is to install the header files in /opt/libjpeg-turbo/include and the library |
| 95 | files in /opt/libjpeg-turbo/lib. |
| 96 | |
| 97 | NOTE: 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, |
| 99 | however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before |
| 100 | overwriting it. It is recommended that you instead install libjpeg-turbo into |
| 101 | a non-system directory and manipulate the LD_LIBRARY_PATH or create sym links |
| 102 | to force applications to use libjpeg-turbo instead of libjpeg. See |
| 103 | README-turbo.txt for more information. |
| 104 | |
| 105 | ============= |
| 106 | Build Recipes |
| 107 | ============= |
| 108 | |
| 109 | 32-bit Library Build on 64-bit Linux |
| 110 | ------------------------------------ |
| 111 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 112 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 113 | |
DRC | 8c2b9fa | 2010-06-04 23:09:00 +0000 | [diff] [blame] | 114 | --host i686-pc-linux-gnu CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32 |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 115 | |
| 116 | to the configure command line. |
| 117 | |
| 118 | |
DRC | 9026b37 | 2011-04-16 13:37:22 +0000 | [diff] [blame] | 119 | 64-bit Library Build on 64-bit OS X |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 120 | ----------------------------------- |
| 121 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 122 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 123 | |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 124 | --host x86_64-apple-darwin NASM=/opt/local/bin/nasm |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 125 | |
DRC | 7bac07b | 2010-04-10 05:53:35 +0000 | [diff] [blame] | 126 | to the configure command line. NASM 2.07 or later from MacPorts must be |
| 127 | installed. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 128 | |
| 129 | |
DRC | 9026b37 | 2011-04-16 13:37:22 +0000 | [diff] [blame] | 130 | 32-bit Library Build on 64-bit OS X |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 131 | ----------------------------------- |
| 132 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 133 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 134 | |
| 135 | CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32 |
| 136 | |
| 137 | to the configure command line. |
| 138 | |
| 139 | |
DRC | 9026b37 | 2011-04-16 13:37:22 +0000 | [diff] [blame] | 140 | 64-bit Backward-Compatible Library Build on 64-bit OS X |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 141 | ------------------------------------------------------- |
| 142 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 143 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 144 | |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 145 | --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 | |
DRC | 575c342 | 2010-07-08 07:01:20 +0000 | [diff] [blame] | 153 | to the configure command line. The OS X 10.4 SDK, and NASM 2.07 or later from |
| 154 | MacPorts, must be installed. |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 155 | |
| 156 | |
DRC | 9026b37 | 2011-04-16 13:37:22 +0000 | [diff] [blame] | 157 | 32-bit Backward-Compatible Library Build on OS X |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 158 | ------------------------------------------------ |
| 159 | |
| 160 | Add |
| 161 | |
DRC | 485cd80 | 2010-02-23 23:23:42 +0000 | [diff] [blame] | 162 | 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' \ |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 166 | LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ |
| 167 | -mmacosx-version-min=10.4 -m32' |
| 168 | |
| 169 | to the configure command line. The OS X 10.4 SDK must be installed. |
| 170 | |
| 171 | |
| 172 | 64-bit Library Build on 64-bit Solaris |
| 173 | -------------------------------------- |
| 174 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 175 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 176 | |
| 177 | --host x86_64-pc-solaris CFLAGS='-O3 -m64' CXXFLAGS='-O3 -m64' LDFLAGS=-m64 |
| 178 | |
| 179 | to the configure command line. |
| 180 | |
| 181 | |
DRC | 7bac07b | 2010-04-10 05:53:35 +0000 | [diff] [blame] | 182 | 32-bit Library Build on 64-bit FreeBSD |
| 183 | -------------------------------------- |
| 184 | |
| 185 | Add |
| 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 | |
| 190 | to the configure command line. NASM 2.07 or later from FreeBSD ports must be |
| 191 | installed. |
| 192 | |
| 193 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 194 | MinGW Build on Cygwin |
| 195 | --------------------- |
| 196 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 197 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 198 | |
| 199 | --host mingw32 |
| 200 | |
| 201 | to the configure command line. This will produce libraries which do not |
| 202 | depend on cygwin1.dll or other Cygwin DLL's. |
| 203 | |
| 204 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 205 | Sun Studio |
| 206 | ---------- |
| 207 | |
| 208 | Add |
| 209 | |
| 210 | CC=cc CXX=CC |
| 211 | |
| 212 | to the configure command line. libjpeg-turbo will automatically be built with |
| 213 | the maximum optimization level (-xO5) unless you override CFLAGS and CXXFLAGS. |
| 214 | |
| 215 | To 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 | |
| 220 | to the configure command line. |
| 221 | |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 222 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 223 | ******************************************************************************* |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 224 | ** Building on Windows (Visual C++) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 225 | ******************************************************************************* |
| 226 | |
| 227 | ================== |
| 228 | Build 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 | |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 235 | -- Windows SDK for Windows Server 2008 and .NET Framework 3.5 (or a later |
| 236 | version) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 237 | |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 238 | http://msdn.microsoft.com/en-us/windows/dd146047.aspx |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 239 | |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 240 | * 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, |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 245 | c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN; |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 246 | c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE; |
| 247 | c:\Program Files\Microsoft SDKs\Windows\v6.1\bin) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 248 | to the system or user PATH environment variable prior to building |
| 249 | libjpeg-turbo. |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 250 | * 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) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 253 | to the system or user INCLUDE environment variable prior to building |
| 254 | libjpeg-turbo. |
| 255 | * Add the compiler library directory (for instance, |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 256 | c:\Program Files\Microsoft Visual Studio 9.0\VC\LIB; |
| 257 | c:\Program Files\Microsoft SDKs\Windows\v6.1\lib) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 258 | to the system or user LIB environment variable prior to building |
| 259 | libjpeg-turbo. |
| 260 | |
DRC | 377add7 | 2010-05-17 16:41:12 +0000 | [diff] [blame] | 261 | -- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for |
| 262 | a 64-bit build) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 263 | |
| 264 | ====================== |
| 265 | Building libjpeg-turbo |
| 266 | ====================== |
| 267 | |
| 268 | cd libjpeg-turbo |
| 269 | make -f win/Makefile |
| 270 | |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 271 | This will generate the following files under libjpeg-turbo\windows\: |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 272 | |
| 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 | |
DRC | e728ed7 | 2010-04-20 19:15:09 +0000 | [diff] [blame] | 280 | If a 64-bit Windows platform is detected, then the build system will attempt |
| 281 | to build a 64-bit version of libjpeg-turbo. You can override this by running |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 282 | |
DRC | e728ed7 | 2010-04-20 19:15:09 +0000 | [diff] [blame] | 283 | make -f win/Makefile WIN64=no |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 284 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 285 | |
| 286 | ******************************************************************************* |
| 287 | ** Creating Release Packages |
| 288 | ******************************************************************************* |
| 289 | |
| 290 | The following commands can be used to create various types of release packages: |
| 291 | |
| 292 | make rpm |
| 293 | |
| 294 | Create RedHat-style binary RPM package. Requires RPM v4 or later. |
| 295 | |
| 296 | make 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 | |
| 301 | make deb |
| 302 | |
| 303 | Create Debian-style binary package. Requires dpkg. |
| 304 | |
| 305 | make dmg |
| 306 | |
| 307 | Create Macintosh package/disk image. This requires the PackageMaker |
| 308 | application, which must be installed in /Developer/Applications/Utilities. |
| 309 | |
| 310 | make udmg |
| 311 | |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 312 | 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. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 317 | |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 318 | make 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 | |
DRC | 9ca2364 | 2010-05-10 22:19:24 +0000 | [diff] [blame] | 324 | make -f win/Makefile nsi |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 325 | |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 326 | 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. |