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