DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 1 | ******************************************************************************* |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 2 | ** Building on Unix Platforms |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 3 | ******************************************************************************* |
| 4 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 5 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 6 | ================== |
| 7 | Build Requirements |
| 8 | ================== |
| 9 | |
| 10 | -- autoconf 2.56 or later |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 11 | -- automake 1.7 or later |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 12 | -- libtool 1.4 or later |
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 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 20 | The NASM 2.05 RPMs do not work on older Linux systems, such as Red Hat |
| 21 | Enterprise Linux 4. On such systems, you can easily build and install NASM |
| 22 | 2.05 from the source RPM by executing the following as root: |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 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 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 33 | |
| 34 | ================== |
| 35 | Out-of-Tree Builds |
| 36 | ================== |
| 37 | |
| 38 | Binary objects, libraries, and executables are generated in the same directory |
| 39 | from which configure was executed (the "binary directory"), and this directory |
| 40 | need not necessarily be the same as the libjpeg-turbo source directory. You |
| 41 | can create multiple independent binary directories, in which different versions |
| 42 | of libjpeg-turbo can be built from the same source tree using different |
| 43 | compilers or settings. In the sections below, {build_directory} refers to the |
| 44 | binary directory, whereas {source_directory} refers to the libjpeg-turbo source |
| 45 | directory. For in-tree builds, these directories are the same. |
| 46 | |
| 47 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 48 | ====================== |
| 49 | Building libjpeg-turbo |
| 50 | ====================== |
| 51 | |
DRC | 4959787 | 2010-05-17 20:47:57 +0000 | [diff] [blame] | 52 | The following procedure will build libjpeg-turbo on Linux, FreeBSD, 32-bit |
| 53 | OS X, and Solaris/x86 systems (on Solaris, this generates a 32-bit library. |
| 54 | See below for 64-bit build instructions.) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 55 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 56 | cd {source_directory} |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 57 | autoreconf -fiv |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 58 | cd {build_directory} |
| 59 | sh {source_directory}/configure |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 60 | make |
| 61 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 62 | NOTE: Running autoreconf in the source directory is only necessary if building |
| 63 | libjpeg-turbo from the SVN repository. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 64 | |
| 65 | This will generate the following files under .libs/ |
| 66 | |
| 67 | libjpeg.a |
| 68 | Static link library for libjpeg-turbo |
| 69 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 70 | libjpeg.so.{version} (Linux, Solaris) |
| 71 | libjpeg.{version}.dylib (OS X) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 72 | Shared library for libjpeg-turbo |
| 73 | |
| 74 | libjpeg.so (Linux, Solaris) |
| 75 | libjpeg.dylib (OS X) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 76 | Development stub for libjpeg-turbo shared library |
| 77 | |
| 78 | libturbojpeg.a |
| 79 | Static link library for TurboJPEG/OSS |
| 80 | |
| 81 | libturbojpeg.so (Linux, Solaris) |
| 82 | libturbojpeg.dylib (OS X) |
| 83 | Shared library and development stub for TurboJPEG/OSS |
| 84 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 85 | {version} is 62.0.0, 7.0.0, or 8.0.2, depending on whether libjpeg v6b |
| 86 | (default), v7, or v8b emulation is enabled. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 87 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 88 | |
| 89 | ======================== |
| 90 | Installing libjpeg-turbo |
| 91 | ======================== |
| 92 | |
| 93 | If you intend to install these libraries and the associated header files, then |
| 94 | replace 'make' in the instructions above with |
| 95 | |
| 96 | make install prefix={base dir} libdir={library directory} |
| 97 | |
| 98 | For example, |
| 99 | |
| 100 | make install prefix=/usr/local libdir=/usr/local/lib64 |
| 101 | |
| 102 | will install the header files in /usr/local/include and the library files in |
| 103 | /usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default |
| 104 | is to install the header files in /opt/libjpeg-turbo/include and the library |
| 105 | files in /opt/libjpeg-turbo/lib. |
| 106 | |
| 107 | NOTE: You can specify a prefix of /usr and a libdir of, for instance, |
| 108 | /usr/lib64 to overwrite the system's version of libjpeg. If you do this, |
| 109 | however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before |
| 110 | overwriting it. It is recommended that you instead install libjpeg-turbo into |
| 111 | a non-system directory and manipulate the LD_LIBRARY_PATH or create sym links |
| 112 | to force applications to use libjpeg-turbo instead of libjpeg. See |
| 113 | README-turbo.txt for more information. |
| 114 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 115 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 116 | ============= |
| 117 | Build Recipes |
| 118 | ============= |
| 119 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 120 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 121 | 32-bit Library Build on 64-bit Linux |
| 122 | ------------------------------------ |
| 123 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 124 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 125 | |
DRC | 8c2b9fa | 2010-06-04 23:09:00 +0000 | [diff] [blame] | 126 | --host i686-pc-linux-gnu CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32 |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 127 | |
| 128 | to the configure command line. |
| 129 | |
| 130 | |
DRC | 9026b37 | 2011-04-16 13:37:22 +0000 | [diff] [blame] | 131 | 64-bit Library Build on 64-bit OS X |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 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 | |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 136 | --host x86_64-apple-darwin NASM=/opt/local/bin/nasm |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 137 | |
DRC | 7bac07b | 2010-04-10 05:53:35 +0000 | [diff] [blame] | 138 | to the configure command line. NASM 2.07 or later from MacPorts must be |
| 139 | installed. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 140 | |
| 141 | |
DRC | 9026b37 | 2011-04-16 13:37:22 +0000 | [diff] [blame] | 142 | 32-bit Library Build on 64-bit OS X |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 143 | ----------------------------------- |
| 144 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 145 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 146 | |
| 147 | CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32 |
| 148 | |
| 149 | to the configure command line. |
| 150 | |
| 151 | |
DRC | 9026b37 | 2011-04-16 13:37:22 +0000 | [diff] [blame] | 152 | 64-bit Backward-Compatible Library Build on 64-bit OS X |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 153 | ------------------------------------------------------- |
| 154 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 155 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 156 | |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 157 | --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \ |
| 158 | CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ |
| 159 | -mmacosx-version-min=10.4 -O3' \ |
| 160 | CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ |
| 161 | -mmacosx-version-min=10.4 -O3' \ |
| 162 | LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ |
| 163 | -mmacosx-version-min=10.4' |
| 164 | |
DRC | 575c342 | 2010-07-08 07:01:20 +0000 | [diff] [blame] | 165 | to the configure command line. The OS X 10.4 SDK, and NASM 2.07 or later from |
| 166 | MacPorts, must be installed. |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 167 | |
| 168 | |
DRC | 9026b37 | 2011-04-16 13:37:22 +0000 | [diff] [blame] | 169 | 32-bit Backward-Compatible Library Build on OS X |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 170 | ------------------------------------------------ |
| 171 | |
| 172 | Add |
| 173 | |
DRC | 485cd80 | 2010-02-23 23:23:42 +0000 | [diff] [blame] | 174 | CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ |
| 175 | -mmacosx-version-min=10.4 -O3 -m32' \ |
| 176 | CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ |
| 177 | -mmacosx-version-min=10.4 -O3 -m32' \ |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 178 | LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ |
| 179 | -mmacosx-version-min=10.4 -m32' |
| 180 | |
| 181 | to the configure command line. The OS X 10.4 SDK must be installed. |
| 182 | |
| 183 | |
| 184 | 64-bit Library Build on 64-bit Solaris |
| 185 | -------------------------------------- |
| 186 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 187 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 188 | |
| 189 | --host x86_64-pc-solaris CFLAGS='-O3 -m64' CXXFLAGS='-O3 -m64' LDFLAGS=-m64 |
| 190 | |
| 191 | to the configure command line. |
| 192 | |
| 193 | |
DRC | 7bac07b | 2010-04-10 05:53:35 +0000 | [diff] [blame] | 194 | 32-bit Library Build on 64-bit FreeBSD |
| 195 | -------------------------------------- |
| 196 | |
| 197 | Add |
| 198 | |
| 199 | --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CXX='g++ -B/usr/lib32' \ |
| 200 | CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS='-B/usr/lib32' |
| 201 | |
| 202 | to the configure command line. NASM 2.07 or later from FreeBSD ports must be |
| 203 | installed. |
| 204 | |
| 205 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 206 | Sun Studio |
| 207 | ---------- |
| 208 | |
| 209 | Add |
| 210 | |
| 211 | CC=cc CXX=CC |
| 212 | |
| 213 | to the configure command line. libjpeg-turbo will automatically be built with |
| 214 | the maximum optimization level (-xO5) unless you override CFLAGS and CXXFLAGS. |
| 215 | |
| 216 | To build a 64-bit version of libjpeg-turbo using Sun Studio, add |
| 217 | |
| 218 | --host x86_64-pc-solaris CC=cc CXX=CC CFLAGS='-xO5 -m64' \ |
| 219 | CXXFLAGS='-xO5 -m64' LDFLAGS=-m64 |
| 220 | |
| 221 | to the configure command line. |
| 222 | |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 223 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 224 | ******************************************************************************* |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 225 | ** Building on Windows (Visual C++, MinGW, or Cygwin) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 226 | ******************************************************************************* |
| 227 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 228 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 229 | ================== |
| 230 | Build Requirements |
| 231 | ================== |
| 232 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 233 | -- CMake (http://www.cmake.org) v2.6 or later |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 234 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 235 | -- Microsoft Visual C++ 2005 or later |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 236 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 237 | If you don't already have Visual C++, then the easiest way to get it is by |
| 238 | installing the Windows SDK: |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 239 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 240 | http://msdn.microsoft.com/en-us/windows/bb980924.aspx |
| 241 | |
| 242 | The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and |
| 243 | everything necessary to build libjpeg-turbo. |
| 244 | |
| 245 | * For 32-bit builds, you can also use Microsoft Visual C++ Express |
| 246 | Edition. Visual C++ Express Edition is a free download. |
| 247 | * If you intend to build libjpeg-turbo from the command line, then add the |
| 248 | appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH |
| 249 | environment variables. This is generally accomplished by executing |
| 250 | vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and |
| 251 | vcvars64.bat are part of Visual C++ and are located in the same directory |
| 252 | as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass |
| 253 | optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build |
| 254 | environment. |
| 255 | |
| 256 | ... OR ... |
| 257 | |
| 258 | -- MinGW or Cygwin |
| 259 | |
| 260 | GCC v4.1 or later recommended for best performance |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 261 | |
DRC | 377add7 | 2010-05-17 16:41:12 +0000 | [diff] [blame] | 262 | -- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for |
| 263 | a 64-bit build) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 264 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 265 | |
| 266 | ================== |
| 267 | Out-of-Tree Builds |
| 268 | ================== |
| 269 | |
| 270 | Binary objects, libraries, and executables are generated in the same directory |
| 271 | from which cmake was executed (the "binary directory"), and this directory need |
| 272 | not necessarily be the same as the libjpeg-turbo source directory. You can |
| 273 | create multiple independent binary directories, in which different versions of |
| 274 | libjpeg-turbo can be built from the same source tree using different compilers |
| 275 | or settings. In the sections below, {build_directory} refers to the binary |
| 276 | directory, whereas {source_directory} refers to the libjpeg-turbo source |
| 277 | directory. For in-tree builds, these directories are the same. |
| 278 | |
| 279 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 280 | ====================== |
| 281 | Building libjpeg-turbo |
| 282 | ====================== |
| 283 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 284 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 285 | Visual C++ (Command Line) |
| 286 | ------------------------- |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 287 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 288 | cd {build_directory} |
| 289 | cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory} |
| 290 | nmake |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 291 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 292 | This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending |
| 293 | on which version of cl.exe is in the PATH. |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 294 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 295 | The following files will be generated under {build_directory}: |
| 296 | |
| 297 | jpeg-static.lib |
| 298 | Static link library for libjpeg-turbo |
| 299 | sharedlib/jpeg{version}.dll |
| 300 | DLL for libjpeg-turbo |
| 301 | sharedlib/jpeg.lib |
| 302 | Import library for libjpeg-turbo DLL |
| 303 | turbojpeg-static.lib |
| 304 | Static link library for TurboJPEG/OSS |
| 305 | turbojpeg.dll |
| 306 | DLL for TurboJPEG/OSS |
| 307 | turbojpeg.lib |
| 308 | Import library for TurboJPEG/OSS DLL |
| 309 | |
| 310 | {version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or |
| 311 | v8b emulation is enabled. |
| 312 | |
| 313 | |
| 314 | Visual C++ (IDE) |
| 315 | ---------------- |
| 316 | |
| 317 | Choose the appropriate CMake generator option for your version of Visual Studio |
| 318 | (run "cmake" with no arguments for a list of available generators.) For |
| 319 | instance: |
| 320 | |
| 321 | cd {build_directory} |
| 322 | cmake -G "Visual Studio 9 2008" {source_directory} |
| 323 | |
| 324 | You can then open ALL_BUILD.vcproj in Visual Studio and build one of the |
| 325 | configurations in that project ("Debug", "Release", etc.) to generate a full |
| 326 | build of libjpeg-turbo. |
| 327 | |
| 328 | This will generate the following files under {build_directory}: |
| 329 | |
| 330 | {configuration}/jpeg-static.lib |
| 331 | Static link library for libjpeg-turbo |
| 332 | sharedlib/{configuration}/jpeg{version}.dll |
| 333 | DLL for libjpeg-turbo |
| 334 | sharedlib/{configuration}/jpeg.lib |
| 335 | Import library for libjpeg-turbo DLL |
| 336 | {configuration}/turbojpeg-static.lib |
| 337 | Static link library for TurboJPEG/OSS |
| 338 | {configuration}/turbojpeg.dll |
| 339 | DLL for TurboJPEG/OSS |
| 340 | {configuration}/turbojpeg.lib |
| 341 | Import library for TurboJPEG/OSS DLL |
| 342 | |
| 343 | {configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on |
| 344 | the configuration you built in the IDE, and {version} is 62, 7, or 8, |
| 345 | depending on whether libjpeg v6b (default), v7, or v8b emulation is enabled. |
| 346 | |
| 347 | |
| 348 | MinGW |
| 349 | ----- |
| 350 | |
| 351 | cd {build_directory} |
| 352 | cmake -G "MSYS Makefiles" {source_directory} |
| 353 | make |
| 354 | |
| 355 | This will generate the following files under {build_directory} |
| 356 | |
| 357 | libjpeg.a |
| 358 | Static link library for libjpeg-turbo |
| 359 | sharedlib/libjpeg-{version}.dll |
| 360 | DLL for libjpeg-turbo |
| 361 | sharedlib/libjpeg.dll.a |
| 362 | Import library for libjpeg-turbo DLL |
| 363 | libturbojpeg.a |
| 364 | Static link library for TurboJPEG/OSS |
| 365 | libturbojpeg.dll |
| 366 | DLL for TurboJPEG/OSS |
| 367 | libturbojpeg.dll.a |
| 368 | Import library for TurboJPEG/OSS DLL |
| 369 | |
| 370 | {version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or |
| 371 | v8b emulation is enabled. |
| 372 | |
| 373 | |
| 374 | Cygwin |
| 375 | ------ |
| 376 | |
| 377 | cd {build_directory} |
DRC | 1c73ce8 | 2010-10-16 21:02:54 +0000 | [diff] [blame] | 378 | cmake -G "Unix Makefiles" {source_directory} |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 379 | make |
| 380 | |
| 381 | This will generate the following files under {build_directory} |
| 382 | |
| 383 | libjpeg.a |
| 384 | Static link library for libjpeg-turbo |
| 385 | sharedlib/cygjpeg-{version}.dll |
| 386 | DLL for libjpeg-turbo |
| 387 | sharedlib/libjpeg.dll.a |
| 388 | Import library for libjpeg-turbo DLL |
| 389 | libturbojpeg.a |
| 390 | Static link library for TurboJPEG/OSS |
| 391 | cygturbojpeg.dll |
| 392 | DLL for TurboJPEG/OSS |
| 393 | libturbojpeg.dll.a |
| 394 | Import library for TurboJPEG/OSS DLL |
| 395 | |
| 396 | {version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or |
| 397 | v8b emulation is enabled. |
| 398 | |
| 399 | |
| 400 | Debug Build |
| 401 | ----------- |
| 402 | |
| 403 | Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with |
| 404 | NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with |
| 405 | NMake.) |
| 406 | |
| 407 | |
| 408 | libjpeg v7 or v8b Emulation |
| 409 | --------------------------- |
| 410 | |
| 411 | Add "-DWITH_JPEG7=1" to the cmake command line to build a version of |
| 412 | libjpeg-turbo that is compatible with libjpeg v7. Add "-DWITH_JPEG8=1" to the |
| 413 | cmake command to build a version of libjpeg-turbo that is compatible with |
| 414 | libjpeg v8. See README-turbo.txt for more information on libjpeg v7 and v8b |
| 415 | emulation. |
| 416 | |
| 417 | |
DRC | 2665843 | 2010-10-16 22:04:29 +0000 | [diff] [blame^] | 418 | ======================== |
| 419 | Installing libjpeg-turbo |
| 420 | ======================== |
| 421 | |
| 422 | You can use the build system to install libjpeg-turbo into a directory of your |
| 423 | choosing (as opposed to creating an installer.) To do this, add: |
| 424 | |
| 425 | -DCMAKE_INSTALL_PREFIX={install_directory} |
| 426 | |
| 427 | to the cmake command line. |
| 428 | |
| 429 | For example, |
| 430 | |
| 431 | cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \ |
| 432 | -DCMAKE_INSTALL_PREFIX=c:\libjpeg-turbo {source_directory} |
| 433 | nmake install |
| 434 | |
| 435 | will install the header files in c:\libjpeg-turbo\include, the library files |
| 436 | in c:\libjpeg-turbo\lib, the DLL's in c:\libjpeg-turbo\bin, and the |
| 437 | documentation in c:\libjpeg-turbo\doc. |
| 438 | |
| 439 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 440 | ============= |
| 441 | Build Recipes |
| 442 | ============= |
| 443 | |
| 444 | |
DRC | 1c73ce8 | 2010-10-16 21:02:54 +0000 | [diff] [blame] | 445 | 64-bit MinGW Build on Cygwin |
| 446 | ---------------------------- |
| 447 | |
| 448 | cd {build_directory} |
| 449 | CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ \ |
| 450 | cmake -G"Unix Makefiles" -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \ |
| 451 | -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory} |
| 452 | make |
| 453 | |
| 454 | This produces a 64-bit build of libjpeg-turbo that does not depend on |
| 455 | cygwin1.dll or other Cygwin DLL's. The mingw64-x86_64-gcc-core and |
| 456 | mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed. |
| 457 | |
| 458 | |
| 459 | 32-bit MinGW Build on Cygwin |
| 460 | ---------------------------- |
| 461 | |
| 462 | cd {build_directory} |
| 463 | CC=/usr/bin/i686-w64-mingw32-gcc CXX=/usr/bin/i686-w64-mingw32-g++ \ |
| 464 | cmake -G"Unix Makefiles" -DCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \ |
| 465 | -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory} |
| 466 | make |
| 467 | |
| 468 | This produces a 32-bit build of libjpeg-turbo that does not depend on |
| 469 | cygwin1.dll or other Cygwin DLL's. The mingw64-i686-gcc-core and |
| 470 | mingw64-i686-gcc-g++ packages (and their dependencies) must be installed. |
| 471 | |
| 472 | |
| 473 | MinGW-w64 Build on Windows |
| 474 | -------------------------- |
| 475 | |
| 476 | This produces a 64-bit build of libjpeg-turbo using the "native" MinGW-w64 |
| 477 | toolchain (which is faster than the Cygwin version): |
| 478 | |
| 479 | cd {build_directory} |
| 480 | CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \ |
| 481 | CXX={mingw-w64_binary_path}/x86_64-w64-mingw32-g++ \ |
| 482 | cmake -G"MSYS Makefiles" \ |
| 483 | -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \ |
| 484 | -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \ |
| 485 | {source_directory} |
| 486 | make |
| 487 | |
| 488 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 489 | MinGW Build on Linux |
| 490 | -------------------- |
| 491 | |
| 492 | cd {build_directory} |
| 493 | CC={mingw_binary_path}/i386-mingw32-gcc \ |
| 494 | CXX={mingw_binary_path}/i386-mingw32-g++ \ |
| 495 | cmake -G"Unix Makefiles" -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \ |
| 496 | -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \ |
| 497 | -DCMAKE_SYSTEM_NAME=Windows {source_directory} |
| 498 | make |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 499 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 500 | |
| 501 | ******************************************************************************* |
| 502 | ** Creating Release Packages |
| 503 | ******************************************************************************* |
| 504 | |
| 505 | The following commands can be used to create various types of release packages: |
| 506 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 507 | |
| 508 | Unix |
| 509 | ---- |
| 510 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 511 | make rpm |
| 512 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 513 | Create Red Hat-style binary RPM package. Requires RPM v4 or later. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 514 | |
| 515 | make srpm |
| 516 | |
| 517 | This runs 'make dist' to create a pristine source tarball, then creates a |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 518 | Red Hat-style source RPM package from the tarball. Requires RPM v4 or later. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 519 | |
| 520 | make deb |
| 521 | |
| 522 | Create Debian-style binary package. Requires dpkg. |
| 523 | |
| 524 | make dmg |
| 525 | |
| 526 | Create Macintosh package/disk image. This requires the PackageMaker |
| 527 | application, which must be installed in /Developer/Applications/Utilities. |
| 528 | |
| 529 | make udmg |
| 530 | |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 531 | On 64-bit OS X systems, this creates a version of the Macintosh package and |
| 532 | disk image which contains universal i386/x86-64 binaries. The 32-bit fork of |
| 533 | these binaries is backward compatible with OS X 10.4 and later. The 64-bit |
| 534 | fork can be made backward compatible as well by using the instructions in |
| 535 | the "Build Recipes" section. OS X 10.4 compatibility SDK required. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 536 | |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 537 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 538 | Windows |
| 539 | ------- |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 540 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 541 | If using NMake: |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 542 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 543 | cd {build_directory} |
| 544 | nmake installer |
| 545 | |
| 546 | If using MinGW or Cygwin: |
| 547 | |
| 548 | cd {build_directory} |
| 549 | make installer |
| 550 | |
| 551 | If using the Visual Studio IDE, build the "installer" project. |
| 552 | |
| 553 | The installer package (libjpeg-turbo[-gcc][64].exe) will be located under |
| 554 | {build_directory}. If building using the Visual Studio IDE, then the installer |
| 555 | package will be located in a subdirectory with the same name as the |
| 556 | configuration you built (such as {build_directory}\Debug\ or |
| 557 | {build_directory}\Release\). |
| 558 | |
| 559 | Building a Windows installer requires the Nullsoft Install System |
| 560 | (http://nsis.sourceforge.net/.) makensis.exe should be in your PATH. |