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 |
| 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 | |
DRC | c3f4ac0 | 2010-02-19 21:51:26 +0000 | [diff] [blame] | 34 | NOTE: NASM build will fail if texinfo is not installed. |
| 35 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 36 | -- GCC v4 or later recommended for best performance |
| 37 | |
| 38 | ====================== |
| 39 | Building libjpeg-turbo |
| 40 | ====================== |
| 41 | |
| 42 | The following procedure will build libjpeg-turbo on Linux, 32-bit OS X, and |
| 43 | Solaris/x86 systems (on Solaris, this generates a 32-bit library. See below |
| 44 | for 64-bit build instructions.) |
| 45 | |
| 46 | cd libjpeg-turbo |
| 47 | autoreconf -fiv |
| 48 | sh ./configure |
| 49 | make |
| 50 | |
| 51 | NOTE: Running autoreconf is only necessary if building libjpeg-turbo from the |
| 52 | SVN repository. |
| 53 | |
| 54 | This 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 | ======================== |
| 85 | Installing libjpeg-turbo |
| 86 | ======================== |
| 87 | |
| 88 | If you intend to install these libraries and the associated header files, then |
| 89 | replace 'make' in the instructions above with |
| 90 | |
| 91 | make install prefix={base dir} libdir={library directory} |
| 92 | |
| 93 | For example, |
| 94 | |
| 95 | make install prefix=/usr/local libdir=/usr/local/lib64 |
| 96 | |
| 97 | will 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 |
| 99 | is to install the header files in /opt/libjpeg-turbo/include and the library |
| 100 | files in /opt/libjpeg-turbo/lib. |
| 101 | |
| 102 | NOTE: 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, |
| 104 | however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before |
| 105 | overwriting it. It is recommended that you instead install libjpeg-turbo into |
| 106 | a non-system directory and manipulate the LD_LIBRARY_PATH or create sym links |
| 107 | to force applications to use libjpeg-turbo instead of libjpeg. See |
| 108 | README-turbo.txt for more information. |
| 109 | |
| 110 | ============= |
| 111 | Build Recipes |
| 112 | ============= |
| 113 | |
| 114 | 32-bit Library Build on 64-bit Linux |
| 115 | ------------------------------------ |
| 116 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 117 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 118 | |
| 119 | --host i686-pc-linux-gnu CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' |
| 120 | |
| 121 | to the configure command line. |
| 122 | |
| 123 | |
| 124 | 64-bit Library Build on 64-bit OS/X |
| 125 | ----------------------------------- |
| 126 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 127 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 128 | |
| 129 | --host x86_64-apple-darwin10.0.0 NASM=/opt/local/bin/nasm |
| 130 | |
| 131 | to the configure command line. NASM 2.07 from MacPorts must be installed. |
| 132 | |
| 133 | |
| 134 | 32-bit Library Build on 64-bit OS/X |
| 135 | ----------------------------------- |
| 136 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 137 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 138 | |
| 139 | CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32 |
| 140 | |
| 141 | to the configure command line. |
| 142 | |
| 143 | |
| 144 | 32-bit Backward-Compatible Library Build on 64-bit OS/X |
| 145 | ------------------------------------------------------- |
| 146 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 147 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 148 | |
| 149 | CC=gcc-4.0 CXX=g++-4.0 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ |
| 150 | -mmacosx-version-min=10.4 -O3 -m32' CXXFLAGS='-isysroot \ |
| 151 | /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -O3 -m32' \ |
| 152 | LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ |
| 153 | -mmacosx-version-min=10.4 -m32' |
| 154 | |
| 155 | to the configure command line. The OS X 10.4 SDK must be installed. |
| 156 | |
| 157 | |
| 158 | 64-bit Library Build on 64-bit Solaris |
| 159 | -------------------------------------- |
| 160 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 161 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 162 | |
| 163 | --host x86_64-pc-solaris CFLAGS='-O3 -m64' CXXFLAGS='-O3 -m64' LDFLAGS=-m64 |
| 164 | |
| 165 | to the configure command line. |
| 166 | |
| 167 | |
| 168 | MinGW Build on Cygwin |
| 169 | --------------------- |
| 170 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 171 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 172 | |
| 173 | --host mingw32 |
| 174 | |
| 175 | to the configure command line. This will produce libraries which do not |
| 176 | depend on cygwin1.dll or other Cygwin DLL's. |
| 177 | |
| 178 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 179 | Sun Studio |
| 180 | ---------- |
| 181 | |
| 182 | Add |
| 183 | |
| 184 | CC=cc CXX=CC |
| 185 | |
| 186 | to the configure command line. libjpeg-turbo will automatically be built with |
| 187 | the maximum optimization level (-xO5) unless you override CFLAGS and CXXFLAGS. |
| 188 | |
| 189 | To build a 64-bit version of libjpeg-turbo using Sun Studio, add |
| 190 | |
| 191 | --host x86_64-pc-solaris CC=cc CXX=CC CFLAGS='-xO5 -m64' \ |
| 192 | CXXFLAGS='-xO5 -m64' LDFLAGS=-m64 |
| 193 | |
| 194 | to the configure command line. |
| 195 | |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 196 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 197 | ******************************************************************************* |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 198 | ** Building on Windows (Visual C++) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 199 | ******************************************************************************* |
| 200 | |
| 201 | ================== |
| 202 | Build Requirements |
| 203 | ================== |
| 204 | |
| 205 | -- GNU Make v3.7 or later |
| 206 | * Can be found in MSYS (http://www.mingw.org/download.shtml) or |
| 207 | Cygwin (http://www.cygwin.com/) |
| 208 | |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 209 | -- Windows SDK for Windows Server 2008 and .NET Framework 3.5 (or a later |
| 210 | version) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 211 | |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 212 | http://msdn.microsoft.com/en-us/windows/dd146047.aspx |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 213 | |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 214 | * The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and |
| 215 | everything necessary to build libjpeg-turbo. If you do not already have |
| 216 | Visual C++ installed, then this is the recommended solution. Also tested |
| 217 | with Microsoft Visual C++ 2008 Express Edition (both are free downloads.) |
| 218 | * Add the compiler and SDK binary directories (for instance, |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 219 | c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN; |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 220 | c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE; |
| 221 | c:\Program Files\Microsoft SDKs\Windows\v6.1\bin) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 222 | to the system or user PATH environment variable prior to building |
| 223 | libjpeg-turbo. |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 224 | * Add the compiler and SDK include directories (for instance, |
| 225 | c:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE; |
| 226 | c:\Program Files\Microsoft SDKs\Windows\v6.1\include) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 227 | to the system or user INCLUDE environment variable prior to building |
| 228 | libjpeg-turbo. |
| 229 | * Add the compiler library directory (for instance, |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 230 | c:\Program Files\Microsoft Visual Studio 9.0\VC\LIB; |
| 231 | c:\Program Files\Microsoft SDKs\Windows\v6.1\lib) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 232 | to the system or user LIB environment variable prior to building |
| 233 | libjpeg-turbo. |
| 234 | |
| 235 | -- NASM (http://www.nasm.us/) 0.98 or later |
| 236 | |
| 237 | ====================== |
| 238 | Building libjpeg-turbo |
| 239 | ====================== |
| 240 | |
| 241 | cd libjpeg-turbo |
| 242 | make -f win/Makefile |
| 243 | |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 244 | This will generate the following files under libjpeg-turbo\windows\: |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 245 | |
| 246 | jpeg-static.lib Static link library for libjpeg-turbo |
| 247 | jpeg62.dll Shared library for libjpeg-turbo |
| 248 | jpeg.lib Development stub for libjpeg-turbo shared library |
| 249 | turbojpeg-static.lib Static link library for TurboJPEG/OSS |
| 250 | turbojpeg.dll Shared library for TurboJPEG/OSS |
| 251 | turbojpeg.lib Development stub for TurboJPEG/OSS shared library |
| 252 | |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 253 | #If a 64-bit Windows platform is detected, then the build system will attempt |
| 254 | #to build a 64-bit version of libjpeg-turbo. You can override this by running |
| 255 | # |
| 256 | # make -f win/Makefile WIN64=no |
| 257 | |
DRC | 4df84bf | 2010-02-22 04:55:23 +0000 | [diff] [blame] | 258 | NOTE: For unknown reasons, Win64 support doesn't work yet, so at the moment, |
| 259 | you have to run 'make -f win/Makefile WIN64=yes' to get a 64-bit build on |
| 260 | 64-bit Windows. The paragraph above will apply once Win64 support is working. |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 261 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 262 | |
| 263 | ******************************************************************************* |
| 264 | ** Creating Release Packages |
| 265 | ******************************************************************************* |
| 266 | |
| 267 | The following commands can be used to create various types of release packages: |
| 268 | |
| 269 | make rpm |
| 270 | |
| 271 | Create RedHat-style binary RPM package. Requires RPM v4 or later. |
| 272 | |
| 273 | make srpm |
| 274 | |
| 275 | This runs 'make dist' to create a pristine source tarball, then creates a |
| 276 | RedHat-style source RPM package from the tarball. Requires RPM v4 or later. |
| 277 | |
| 278 | make deb |
| 279 | |
| 280 | Create Debian-style binary package. Requires dpkg. |
| 281 | |
| 282 | make dmg |
| 283 | |
| 284 | Create Macintosh package/disk image. This requires the PackageMaker |
| 285 | application, which must be installed in /Developer/Applications/Utilities. |
| 286 | |
| 287 | make udmg |
| 288 | |
| 289 | On 64-bit OS X (10.6 "Snow Leopard" or later), this creates a version of the |
| 290 | Macintosh package/disk image which contains universal i386/x86-64 binaries. |
| 291 | The 32-bit fork of these binaries is backward compatible with OS X 10.4 and |
| 292 | later, whereas the 64-bit fork is compatible with OS X 10.6 and later. OS X |
| 293 | 10.4 compatibility SDK required. |
| 294 | |
| 295 | make -f win/Makefile dist |
| 296 | |
| 297 | This creates a Win32 installer for the libjpeg-turbo SDK. This requires the |
| 298 | Nullsoft Install System (http://nsis.sourceforge.net/.) makensis.exe should |
| 299 | be in your PATH. |