DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 1 | ******************************************************************************* |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 2 | ** Building on Unix Platforms (including Cygwin) |
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 | |
DRC | 94755ce | 2011-10-19 05:13:27 +0000 | [diff] [blame] | 14 | -- NASM (if building x86 or x86-64 SIMD extensions) |
DRC | 254937b | 2011-04-16 13:35:35 +0000 | [diff] [blame] | 15 | * 0.98, or 2.01 or later is required for a 32-bit build |
| 16 | * NASM 2.00 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 | 254937b | 2011-04-16 13:35:35 +0000 | [diff] [blame] | 20 | The binary RPMs released by the NASM project do not work on older Linux |
| 21 | systems, such as Red Hat Enterprise Linux 4. On such systems, you can |
| 22 | easily build and install NASM from a source RPM by downloading one of the |
| 23 | SRPMs from |
| 24 | |
| 25 | http://www.nasm.us/pub/nasm/releasebuilds |
| 26 | |
| 27 | and executing the following as root: |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 28 | |
| 29 | ARCH=`uname -m` |
DRC | 254937b | 2011-04-16 13:35:35 +0000 | [diff] [blame] | 30 | rpmbuild --rebuild nasm-{version}.src.rpm |
| 31 | rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-{version}.$ARCH.rpm |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 32 | |
DRC | 254937b | 2011-04-16 13:35:35 +0000 | [diff] [blame] | 33 | NOTE: the NASM build will fail if texinfo is not installed. |
DRC | c3f4ac0 | 2010-02-19 21:51:26 +0000 | [diff] [blame] | 34 | |
DRC | 8f870c2 | 2010-02-24 00:30:00 +0000 | [diff] [blame] | 35 | -- GCC v4.1 or later recommended for best performance |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 36 | |
DRC | 279bd34 | 2011-04-02 05:17:12 +0000 | [diff] [blame] | 37 | -- If building the TurboJPEG/OSS Java wrapper, JDK or OpenJDK 1.5 or later is |
| 38 | required. Some systems, such as OS X 10.4, Solaris 10 and later, and Red |
| 39 | Hat Enterprise Linux 5 and later, have this pre-installed. On OS X 10.5 and |
| 40 | later, it will be necessary to install the Java Developer Package, which can |
| 41 | be downloaded from http://connect.apple.com. For systems that do not have a |
| 42 | JDK installed, you can obtain the Oracle Java Development Kit from |
| 43 | http://www.java.com. |
DRC | f8e0055 | 2011-02-04 11:06:36 +0000 | [diff] [blame] | 44 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 45 | |
| 46 | ================== |
| 47 | Out-of-Tree Builds |
| 48 | ================== |
| 49 | |
| 50 | Binary objects, libraries, and executables are generated in the same directory |
| 51 | from which configure was executed (the "binary directory"), and this directory |
| 52 | need not necessarily be the same as the libjpeg-turbo source directory. You |
| 53 | can create multiple independent binary directories, in which different versions |
| 54 | of libjpeg-turbo can be built from the same source tree using different |
| 55 | compilers or settings. In the sections below, {build_directory} refers to the |
| 56 | binary directory, whereas {source_directory} refers to the libjpeg-turbo source |
| 57 | directory. For in-tree builds, these directories are the same. |
| 58 | |
| 59 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 60 | ====================== |
| 61 | Building libjpeg-turbo |
| 62 | ====================== |
| 63 | |
DRC | 4959787 | 2010-05-17 20:47:57 +0000 | [diff] [blame] | 64 | The following procedure will build libjpeg-turbo on Linux, FreeBSD, 32-bit |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 65 | OS X, Cygwin, and Solaris/x86 systems (on Solaris, this generates a 32-bit |
| 66 | library. See below for 64-bit build instructions.) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 67 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 68 | cd {source_directory} |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 69 | autoreconf -fiv |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 70 | cd {build_directory} |
DRC | 98dbe91 | 2010-11-04 22:22:30 +0000 | [diff] [blame] | 71 | sh {source_directory}/configure [additional configure flags] |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 72 | make |
| 73 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 74 | NOTE: Running autoreconf in the source directory is only necessary if building |
| 75 | libjpeg-turbo from the SVN repository. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 76 | |
| 77 | This will generate the following files under .libs/ |
| 78 | |
| 79 | libjpeg.a |
| 80 | Static link library for libjpeg-turbo |
| 81 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 82 | libjpeg.so.{version} (Linux, Solaris) |
| 83 | libjpeg.{version}.dylib (OS X) |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 84 | cygjpeg-{version}.dll (Cygwin) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 85 | Shared library for libjpeg-turbo |
| 86 | |
| 87 | libjpeg.so (Linux, Solaris) |
| 88 | libjpeg.dylib (OS X) |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 89 | libjpeg.dll.a (Cygwin) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 90 | Development stub for libjpeg-turbo shared library |
| 91 | |
| 92 | libturbojpeg.a |
| 93 | Static link library for TurboJPEG/OSS |
| 94 | |
| 95 | libturbojpeg.so (Linux, Solaris) |
| 96 | libturbojpeg.dylib (OS X) |
| 97 | Shared library and development stub for TurboJPEG/OSS |
| 98 | |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 99 | cygturbojpeg.dll (Cygwin) |
| 100 | Shared library for TurboJPEG/OSS |
| 101 | |
| 102 | libturbojpeg.dll.a (Cygwin) |
| 103 | Development stub for TurboJPEG/OSS shared library |
| 104 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 105 | {version} is 62.0.0, 7.0.0, or 8.0.2, depending on whether libjpeg v6b |
DRC | f38eee0 | 2011-02-18 07:00:38 +0000 | [diff] [blame] | 106 | (default), v7, or v8 emulation is enabled. If using Cygwin, {version} is |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 107 | 62, 7, or 8. |
| 108 | |
| 109 | |
DRC | 3091354 | 2012-01-27 09:53:33 +0000 | [diff] [blame] | 110 | libjpeg v7 or v8 API/ABI Emulation |
| 111 | ---------------------------------- |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 112 | |
| 113 | Add --with-jpeg7 to the configure command line to build a version of |
DRC | 3091354 | 2012-01-27 09:53:33 +0000 | [diff] [blame] | 114 | libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add --with-jpeg8 to |
| 115 | the configure command to build a version of libjpeg-turbo that is |
| 116 | API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information |
| 117 | on libjpeg v7 and v8 emulation. |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 118 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 119 | |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 120 | Arithmetic Coding Support |
| 121 | ------------------------- |
| 122 | |
| 123 | Since the patent on arithmetic coding has expired, this functionality has been |
| 124 | included in this release of libjpeg-turbo. libjpeg-turbo's implementation is |
DRC | f38eee0 | 2011-02-18 07:00:38 +0000 | [diff] [blame] | 125 | based on the implementation in libjpeg v8, but it works when emulating libjpeg |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 126 | v7 or v6b as well. The default is to enable both arithmetic encoding and |
| 127 | decoding, but those who have philosophical objections to arithmetic coding can |
| 128 | add --without-arith-enc or --without-arith-dec to the configure command line to |
| 129 | disable encoding or decoding (respectively.) |
| 130 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 131 | |
DRC | 279bd34 | 2011-04-02 05:17:12 +0000 | [diff] [blame] | 132 | TurboJPEG/OSS Java Wrapper |
| 133 | -------------------------- |
DRC | 88f54a4 | 2011-04-01 01:21:22 +0000 | [diff] [blame] | 134 | Add --with-java to the configure command line to incorporate an optional Java |
| 135 | Native Interface wrapper into the TurboJPEG/OSS dynamic library and build the |
| 136 | Java front-end classes to support it. This allows the TurboJPEG/OSS dynamic |
| 137 | library to be used directly from Java applications. See java/README for more |
| 138 | details. |
| 139 | |
| 140 | You can set the JAVAC, JAR, and JAVA configure variables to specify |
| 141 | alternate commands for javac, jar, and java (respectively.) You can also |
| 142 | set the JAVACFLAGS configure variable to specify arguments that should be |
| 143 | passed to the Java compiler when building the front-end classes, and JNI_CFLAGS |
| 144 | to specify arguments that should be passed to the C compiler when building the |
| 145 | JNI wrapper. Run 'configure --help' for more details. |
DRC | f8e0055 | 2011-02-04 11:06:36 +0000 | [diff] [blame] | 146 | |
| 147 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 148 | ======================== |
| 149 | Installing libjpeg-turbo |
| 150 | ======================== |
| 151 | |
| 152 | If you intend to install these libraries and the associated header files, then |
| 153 | replace 'make' in the instructions above with |
| 154 | |
| 155 | make install prefix={base dir} libdir={library directory} |
| 156 | |
| 157 | For example, |
| 158 | |
| 159 | make install prefix=/usr/local libdir=/usr/local/lib64 |
| 160 | |
| 161 | will install the header files in /usr/local/include and the library files in |
| 162 | /usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default |
| 163 | is to install the header files in /opt/libjpeg-turbo/include and the library |
| 164 | files in /opt/libjpeg-turbo/lib. |
| 165 | |
| 166 | NOTE: You can specify a prefix of /usr and a libdir of, for instance, |
| 167 | /usr/lib64 to overwrite the system's version of libjpeg. If you do this, |
| 168 | however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before |
| 169 | overwriting it. It is recommended that you instead install libjpeg-turbo into |
| 170 | a non-system directory and manipulate the LD_LIBRARY_PATH or create sym links |
| 171 | to force applications to use libjpeg-turbo instead of libjpeg. See |
| 172 | README-turbo.txt for more information. |
| 173 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 174 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 175 | ============= |
| 176 | Build Recipes |
| 177 | ============= |
| 178 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 179 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 180 | 32-bit Library Build on 64-bit Linux |
| 181 | ------------------------------------ |
| 182 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 183 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 184 | |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 185 | --host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32 |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 186 | |
| 187 | to the configure command line. |
| 188 | |
| 189 | |
DRC | 9026b37 | 2011-04-16 13:37:22 +0000 | [diff] [blame] | 190 | 64-bit Library Build on 64-bit OS X |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 191 | ----------------------------------- |
| 192 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 193 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 194 | |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 195 | --host x86_64-apple-darwin NASM=/opt/local/bin/nasm |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 196 | |
DRC | 7bac07b | 2010-04-10 05:53:35 +0000 | [diff] [blame] | 197 | to the configure command line. NASM 2.07 or later from MacPorts must be |
| 198 | installed. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 199 | |
| 200 | |
DRC | 9026b37 | 2011-04-16 13:37:22 +0000 | [diff] [blame] | 201 | 32-bit Library Build on 64-bit OS X |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 202 | ----------------------------------- |
| 203 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 204 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 205 | |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 206 | CFLAGS='-O3 -m32' LDFLAGS=-m32 |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 207 | |
| 208 | to the configure command line. |
| 209 | |
| 210 | |
DRC | 9026b37 | 2011-04-16 13:37:22 +0000 | [diff] [blame] | 211 | 64-bit Backward-Compatible Library Build on 64-bit OS X |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 212 | ------------------------------------------------------- |
| 213 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 214 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 215 | |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 216 | --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \ |
| 217 | CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ |
| 218 | -mmacosx-version-min=10.4 -O3' \ |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 219 | LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ |
| 220 | -mmacosx-version-min=10.4' |
| 221 | |
DRC | 575c342 | 2010-07-08 07:01:20 +0000 | [diff] [blame] | 222 | to the configure command line. The OS X 10.4 SDK, and NASM 2.07 or later from |
| 223 | MacPorts, must be installed. |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 224 | |
| 225 | |
DRC | 9026b37 | 2011-04-16 13:37:22 +0000 | [diff] [blame] | 226 | 32-bit Backward-Compatible Library Build on OS X |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 227 | ------------------------------------------------ |
| 228 | |
| 229 | Add |
| 230 | |
DRC | 485cd80 | 2010-02-23 23:23:42 +0000 | [diff] [blame] | 231 | CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ |
| 232 | -mmacosx-version-min=10.4 -O3 -m32' \ |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 233 | LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ |
| 234 | -mmacosx-version-min=10.4 -m32' |
| 235 | |
| 236 | to the configure command line. The OS X 10.4 SDK must be installed. |
| 237 | |
| 238 | |
| 239 | 64-bit Library Build on 64-bit Solaris |
| 240 | -------------------------------------- |
| 241 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 242 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 243 | |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 244 | --host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64 |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 245 | |
| 246 | to the configure command line. |
| 247 | |
| 248 | |
DRC | 7bac07b | 2010-04-10 05:53:35 +0000 | [diff] [blame] | 249 | 32-bit Library Build on 64-bit FreeBSD |
| 250 | -------------------------------------- |
| 251 | |
| 252 | Add |
| 253 | |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 254 | --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \ |
| 255 | LDFLAGS='-B/usr/lib32' |
DRC | 7bac07b | 2010-04-10 05:53:35 +0000 | [diff] [blame] | 256 | |
| 257 | to the configure command line. NASM 2.07 or later from FreeBSD ports must be |
| 258 | installed. |
| 259 | |
| 260 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 261 | Sun Studio |
| 262 | ---------- |
| 263 | |
| 264 | Add |
| 265 | |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 266 | CC=cc |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 267 | |
| 268 | to the configure command line. libjpeg-turbo will automatically be built with |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 269 | the maximum optimization level (-xO5) unless you override CFLAGS. |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 270 | |
| 271 | To build a 64-bit version of libjpeg-turbo using Sun Studio, add |
| 272 | |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 273 | --host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64 |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 274 | |
| 275 | to the configure command line. |
| 276 | |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 277 | |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 278 | MinGW Build on Cygwin |
| 279 | --------------------- |
| 280 | |
| 281 | Use CMake (see recipes below) |
| 282 | |
| 283 | |
DRC | 94755ce | 2011-10-19 05:13:27 +0000 | [diff] [blame] | 284 | =========== |
| 285 | ARM Support |
| 286 | =========== |
| 287 | |
| 288 | This release of libjpeg-turbo can use ARM NEON SIMD instructions to accelerate |
| 289 | JPEG compression/decompression by approximately 2-4x on ARMv7 and later |
| 290 | platforms. If libjpeg-turbo is configured on an ARM Linux platform, then the |
| 291 | build system will automatically include the NEON SIMD routines, if they are |
| 292 | supported. |
| 293 | |
| 294 | |
| 295 | Building libjpeg-turbo for iOS |
| 296 | ------------------------------ |
| 297 | |
| 298 | iOS platforms, such as the iPhone and iPad, also use ARM processors, some of |
| 299 | which support NEON instructions. Additional steps are required to build |
| 300 | libjpeg-turbo for these platforms. The steps below assume iOS SDK v4.3. If |
| 301 | you are using a different SDK version, then you will need to modify the |
| 302 | examples accordingly. |
| 303 | |
| 304 | Additional build requirements: |
| 305 | |
| 306 | gas-preprocessor.pl (https://github.com/yuvi/gas-preprocessor) should be |
| 307 | installed in your PATH. |
| 308 | |
| 309 | Set the following shell variables for simplicity: |
| 310 | |
| 311 | IOS_PLATFORMDIR="/Developer/Platforms/iPhoneOS.platform" |
| 312 | IOS_SYSROOT="$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS4.3.sdk" |
| 313 | IOS_GCC="$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2" |
| 314 | |
| 315 | ARM v6 only (up to and including iPhone 3G): |
| 316 | IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp" |
| 317 | |
| 318 | ARM v7 only (iPhone 3GS and newer, iPad): |
| 319 | IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon" |
| 320 | |
| 321 | Follow the procedure under "Building libjpeg-turbo" above, adding |
| 322 | |
DRC | 89c59dd | 2011-10-27 20:40:21 +0000 | [diff] [blame] | 323 | --host arm-apple-darwin10 --enable-static --disable-shared \ |
DRC | 94755ce | 2011-10-19 05:13:27 +0000 | [diff] [blame] | 324 | CC="$IOS_GCC" LD="$IOS_GCC" \ |
| 325 | CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \ |
| 326 | LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS" |
| 327 | |
| 328 | to the configure command line. |
| 329 | |
| 330 | Once built, lipo can be used to combine the ARM v6 and v7 variants into a |
| 331 | universal library. |
| 332 | |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 333 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 334 | ******************************************************************************* |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 335 | ** Building on Windows (Visual C++ or MinGW) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 336 | ******************************************************************************* |
| 337 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 338 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 339 | ================== |
| 340 | Build Requirements |
| 341 | ================== |
| 342 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 343 | -- CMake (http://www.cmake.org) v2.6 or later |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 344 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 345 | -- Microsoft Visual C++ 2005 or later |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 346 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 347 | If you don't already have Visual C++, then the easiest way to get it is by |
| 348 | installing the Windows SDK: |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 349 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 350 | http://msdn.microsoft.com/en-us/windows/bb980924.aspx |
| 351 | |
| 352 | The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and |
| 353 | everything necessary to build libjpeg-turbo. |
| 354 | |
| 355 | * For 32-bit builds, you can also use Microsoft Visual C++ Express |
| 356 | Edition. Visual C++ Express Edition is a free download. |
| 357 | * If you intend to build libjpeg-turbo from the command line, then add the |
| 358 | appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH |
| 359 | environment variables. This is generally accomplished by executing |
| 360 | vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and |
| 361 | vcvars64.bat are part of Visual C++ and are located in the same directory |
| 362 | as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass |
| 363 | optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build |
| 364 | environment. |
| 365 | |
| 366 | ... OR ... |
| 367 | |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 368 | -- MinGW |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 369 | |
| 370 | GCC v4.1 or later recommended for best performance |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 371 | |
DRC | 377add7 | 2010-05-17 16:41:12 +0000 | [diff] [blame] | 372 | -- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for |
| 373 | a 64-bit build) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 374 | |
DRC | 279bd34 | 2011-04-02 05:17:12 +0000 | [diff] [blame] | 375 | -- If building the TurboJPEG/OSS Java wrapper, JDK 1.5 or later is required. |
| 376 | This can be downloaded from http://www.java.com. |
DRC | 218c0c1 | 2011-02-05 06:01:18 +0000 | [diff] [blame] | 377 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 378 | |
| 379 | ================== |
| 380 | Out-of-Tree Builds |
| 381 | ================== |
| 382 | |
| 383 | Binary objects, libraries, and executables are generated in the same directory |
| 384 | from which cmake was executed (the "binary directory"), and this directory need |
| 385 | not necessarily be the same as the libjpeg-turbo source directory. You can |
| 386 | create multiple independent binary directories, in which different versions of |
| 387 | libjpeg-turbo can be built from the same source tree using different compilers |
| 388 | or settings. In the sections below, {build_directory} refers to the binary |
| 389 | directory, whereas {source_directory} refers to the libjpeg-turbo source |
| 390 | directory. For in-tree builds, these directories are the same. |
| 391 | |
| 392 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 393 | ====================== |
| 394 | Building libjpeg-turbo |
| 395 | ====================== |
| 396 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 397 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 398 | Visual C++ (Command Line) |
| 399 | ------------------------- |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 400 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 401 | cd {build_directory} |
| 402 | cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory} |
| 403 | nmake |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 404 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 405 | This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending |
| 406 | on which version of cl.exe is in the PATH. |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 407 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 408 | The following files will be generated under {build_directory}: |
| 409 | |
| 410 | jpeg-static.lib |
| 411 | Static link library for libjpeg-turbo |
| 412 | sharedlib/jpeg{version}.dll |
| 413 | DLL for libjpeg-turbo |
| 414 | sharedlib/jpeg.lib |
| 415 | Import library for libjpeg-turbo DLL |
| 416 | turbojpeg-static.lib |
| 417 | Static link library for TurboJPEG/OSS |
| 418 | turbojpeg.dll |
| 419 | DLL for TurboJPEG/OSS |
| 420 | turbojpeg.lib |
| 421 | Import library for TurboJPEG/OSS DLL |
| 422 | |
| 423 | {version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or |
DRC | f38eee0 | 2011-02-18 07:00:38 +0000 | [diff] [blame] | 424 | v8 emulation is enabled. |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 425 | |
| 426 | |
| 427 | Visual C++ (IDE) |
| 428 | ---------------- |
| 429 | |
| 430 | Choose the appropriate CMake generator option for your version of Visual Studio |
| 431 | (run "cmake" with no arguments for a list of available generators.) For |
| 432 | instance: |
| 433 | |
| 434 | cd {build_directory} |
| 435 | cmake -G "Visual Studio 9 2008" {source_directory} |
| 436 | |
| 437 | You can then open ALL_BUILD.vcproj in Visual Studio and build one of the |
| 438 | configurations in that project ("Debug", "Release", etc.) to generate a full |
| 439 | build of libjpeg-turbo. |
| 440 | |
| 441 | This will generate the following files under {build_directory}: |
| 442 | |
| 443 | {configuration}/jpeg-static.lib |
| 444 | Static link library for libjpeg-turbo |
| 445 | sharedlib/{configuration}/jpeg{version}.dll |
| 446 | DLL for libjpeg-turbo |
| 447 | sharedlib/{configuration}/jpeg.lib |
| 448 | Import library for libjpeg-turbo DLL |
| 449 | {configuration}/turbojpeg-static.lib |
| 450 | Static link library for TurboJPEG/OSS |
| 451 | {configuration}/turbojpeg.dll |
| 452 | DLL for TurboJPEG/OSS |
| 453 | {configuration}/turbojpeg.lib |
| 454 | Import library for TurboJPEG/OSS DLL |
| 455 | |
| 456 | {configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on |
| 457 | the configuration you built in the IDE, and {version} is 62, 7, or 8, |
DRC | f38eee0 | 2011-02-18 07:00:38 +0000 | [diff] [blame] | 458 | depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled. |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 459 | |
| 460 | |
| 461 | MinGW |
| 462 | ----- |
| 463 | |
| 464 | cd {build_directory} |
| 465 | cmake -G "MSYS Makefiles" {source_directory} |
| 466 | make |
| 467 | |
| 468 | This will generate the following files under {build_directory} |
| 469 | |
| 470 | libjpeg.a |
| 471 | Static link library for libjpeg-turbo |
| 472 | sharedlib/libjpeg-{version}.dll |
| 473 | DLL for libjpeg-turbo |
| 474 | sharedlib/libjpeg.dll.a |
| 475 | Import library for libjpeg-turbo DLL |
| 476 | libturbojpeg.a |
| 477 | Static link library for TurboJPEG/OSS |
| 478 | libturbojpeg.dll |
| 479 | DLL for TurboJPEG/OSS |
| 480 | libturbojpeg.dll.a |
| 481 | Import library for TurboJPEG/OSS DLL |
| 482 | |
| 483 | {version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or |
DRC | f38eee0 | 2011-02-18 07:00:38 +0000 | [diff] [blame] | 484 | v8 emulation is enabled. |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 485 | |
| 486 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 487 | Debug Build |
| 488 | ----------- |
| 489 | |
| 490 | Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with |
| 491 | NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with |
| 492 | NMake.) |
| 493 | |
| 494 | |
DRC | 3091354 | 2012-01-27 09:53:33 +0000 | [diff] [blame] | 495 | libjpeg v7 or v8 API/ABI Emulation |
| 496 | ----------------------------------- |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 497 | |
| 498 | Add "-DWITH_JPEG7=1" to the cmake command line to build a version of |
DRC | 3091354 | 2012-01-27 09:53:33 +0000 | [diff] [blame] | 499 | libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add "-DWITH_JPEG8=1" |
| 500 | to the cmake command to build a version of libjpeg-turbo that is |
| 501 | API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information |
| 502 | on libjpeg v7 and v8 emulation. |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 503 | |
| 504 | |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 505 | Arithmetic Coding Support |
| 506 | ------------------------- |
| 507 | |
| 508 | Since the patent on arithmetic coding has expired, this functionality has been |
| 509 | included in this release of libjpeg-turbo. libjpeg-turbo's implementation is |
DRC | f38eee0 | 2011-02-18 07:00:38 +0000 | [diff] [blame] | 510 | based on the implementation in libjpeg v8, but it works when emulating libjpeg |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 511 | v7 or v6b as well. The default is to enable both arithmetic encoding and |
| 512 | decoding, but those who have philosophical objections to arithmetic coding can |
| 513 | add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to |
| 514 | disable encoding or decoding (respectively.) |
| 515 | |
| 516 | |
DRC | 279bd34 | 2011-04-02 05:17:12 +0000 | [diff] [blame] | 517 | TurboJPEG/OSS Java Wrapper |
| 518 | -------------------------- |
| 519 | Add "-DWITH_JAVA=1" to the cmake command line to incorporate an optional Java |
| 520 | Native Interface wrapper into the TurboJPEG/OSS dynamic library and build the |
| 521 | Java front-end classes to support it. This allows the TurboJPEG/OSS dynamic |
| 522 | library to be used directly from Java applications. See java/README for more |
| 523 | details. |
DRC | 218c0c1 | 2011-02-05 06:01:18 +0000 | [diff] [blame] | 524 | |
DRC | db42506 | 2011-04-03 06:10:18 +0000 | [diff] [blame] | 525 | If you are using CMake 2.8, you can set the Java_JAVAC_EXECUTABLE, |
| 526 | Java_JAVA_EXECUTABLE, and Java_JAR_EXECUTABLE CMake variables to specify |
| 527 | alternate commands or locations for javac, jar, and java (respectively.) If |
| 528 | you are using CMake 2.6, set JAVA_COMPILE, JAVA_RUNTIME, and JAVA_ARCHIVE |
| 529 | instead. You can also set the JAVACFLAGS CMake variable to specify arguments |
| 530 | that should be passed to the Java compiler when building the front-end classes. |
| 531 | |
DRC | 218c0c1 | 2011-02-05 06:01:18 +0000 | [diff] [blame] | 532 | |
DRC | 2665843 | 2010-10-16 22:04:29 +0000 | [diff] [blame] | 533 | ======================== |
| 534 | Installing libjpeg-turbo |
| 535 | ======================== |
| 536 | |
| 537 | You can use the build system to install libjpeg-turbo into a directory of your |
| 538 | choosing (as opposed to creating an installer.) To do this, add: |
| 539 | |
| 540 | -DCMAKE_INSTALL_PREFIX={install_directory} |
| 541 | |
| 542 | to the cmake command line. |
| 543 | |
| 544 | For example, |
| 545 | |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 546 | cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \ |
DRC | 2665843 | 2010-10-16 22:04:29 +0000 | [diff] [blame] | 547 | -DCMAKE_INSTALL_PREFIX=c:\libjpeg-turbo {source_directory} |
| 548 | nmake install |
| 549 | |
| 550 | will install the header files in c:\libjpeg-turbo\include, the library files |
| 551 | in c:\libjpeg-turbo\lib, the DLL's in c:\libjpeg-turbo\bin, and the |
| 552 | documentation in c:\libjpeg-turbo\doc. |
| 553 | |
| 554 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 555 | ============= |
| 556 | Build Recipes |
| 557 | ============= |
| 558 | |
| 559 | |
DRC | 1c73ce8 | 2010-10-16 21:02:54 +0000 | [diff] [blame] | 560 | 64-bit MinGW Build on Cygwin |
| 561 | ---------------------------- |
| 562 | |
| 563 | cd {build_directory} |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 564 | CC=/usr/bin/x86_64-w64-mingw32-gcc \ |
DRC | 68bf3f2 | 2010-10-18 07:56:14 +0000 | [diff] [blame] | 565 | cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ |
| 566 | -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \ |
DRC | 1c73ce8 | 2010-10-16 21:02:54 +0000 | [diff] [blame] | 567 | -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory} |
| 568 | make |
| 569 | |
| 570 | This produces a 64-bit build of libjpeg-turbo that does not depend on |
| 571 | cygwin1.dll or other Cygwin DLL's. The mingw64-x86_64-gcc-core and |
| 572 | mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed. |
| 573 | |
| 574 | |
| 575 | 32-bit MinGW Build on Cygwin |
| 576 | ---------------------------- |
| 577 | |
| 578 | cd {build_directory} |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 579 | CC=/usr/bin/i686-w64-mingw32-gcc \ |
DRC | 68bf3f2 | 2010-10-18 07:56:14 +0000 | [diff] [blame] | 580 | cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ |
| 581 | -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \ |
DRC | 1c73ce8 | 2010-10-16 21:02:54 +0000 | [diff] [blame] | 582 | -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory} |
| 583 | make |
| 584 | |
| 585 | This produces a 32-bit build of libjpeg-turbo that does not depend on |
| 586 | cygwin1.dll or other Cygwin DLL's. The mingw64-i686-gcc-core and |
| 587 | mingw64-i686-gcc-g++ packages (and their dependencies) must be installed. |
| 588 | |
| 589 | |
| 590 | MinGW-w64 Build on Windows |
| 591 | -------------------------- |
| 592 | |
| 593 | This produces a 64-bit build of libjpeg-turbo using the "native" MinGW-w64 |
| 594 | toolchain (which is faster than the Cygwin version): |
| 595 | |
| 596 | cd {build_directory} |
| 597 | CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \ |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 598 | cmake -G "MSYS Makefiles" \ |
DRC | 1c73ce8 | 2010-10-16 21:02:54 +0000 | [diff] [blame] | 599 | -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \ |
| 600 | -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \ |
| 601 | {source_directory} |
| 602 | make |
| 603 | |
| 604 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 605 | MinGW Build on Linux |
| 606 | -------------------- |
| 607 | |
| 608 | cd {build_directory} |
| 609 | CC={mingw_binary_path}/i386-mingw32-gcc \ |
DRC | 68bf3f2 | 2010-10-18 07:56:14 +0000 | [diff] [blame] | 610 | cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ |
| 611 | -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \ |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 612 | -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \ |
DRC | 68bf3f2 | 2010-10-18 07:56:14 +0000 | [diff] [blame] | 613 | {source_directory} |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 614 | make |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 615 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 616 | |
| 617 | ******************************************************************************* |
| 618 | ** Creating Release Packages |
| 619 | ******************************************************************************* |
| 620 | |
| 621 | The following commands can be used to create various types of release packages: |
| 622 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 623 | |
| 624 | Unix |
| 625 | ---- |
| 626 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 627 | make rpm |
| 628 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 629 | Create Red Hat-style binary RPM package. Requires RPM v4 or later. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 630 | |
| 631 | make srpm |
| 632 | |
| 633 | This runs 'make dist' to create a pristine source tarball, then creates a |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 634 | 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] | 635 | |
| 636 | make deb |
| 637 | |
| 638 | Create Debian-style binary package. Requires dpkg. |
| 639 | |
| 640 | make dmg |
| 641 | |
| 642 | Create Macintosh package/disk image. This requires the PackageMaker |
| 643 | application, which must be installed in /Developer/Applications/Utilities. |
| 644 | |
DRC | 9ef93db | 2010-10-18 08:24:42 +0000 | [diff] [blame] | 645 | make udmg [BUILDDIR32={32-bit build directory}] |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 646 | |
DRC | bbaf4c9 | 2012-02-10 01:24:26 +0000 | [diff] [blame^] | 647 | On 64-bit OS X systems, this creates a Macintosh package and disk image that |
| 648 | contains universal i386/x86-64 binaries. You should first configure a 32-bit |
| 649 | out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree |
| 650 | build, then run 'make udmg' from the 64-bit build directory. The build |
| 651 | system will look for the 32-bit build under {source_directory}/osxx86 by |
| 652 | default, but you can override this by setting the BUILDDIR32 variable on the |
| 653 | make command line as shown above. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 654 | |
DRC | 1fbae84 | 2012-02-09 09:23:30 +0000 | [diff] [blame] | 655 | make iosdmg [BUILDDIR32={32-bit build directory}] \ |
| 656 | [BUILDDIRARMV6={ARM v6 build directory}] \ |
| 657 | [BUILDDIRARMV7={ARM v7 build directory}] \ |
| 658 | |
DRC | bbaf4c9 | 2012-02-10 01:24:26 +0000 | [diff] [blame^] | 659 | On OS X systems, this creates a Macintosh package and disk image in which the |
| 660 | libjpeg-turbo static libraries contain ARM architectures necessary to build |
| 661 | iOS applications. If building on an x86-64 system, the binaries will also |
| 662 | contain the i386 architecture, as with 'make udmg' above. You should first |
| 663 | configure ARM v6 and ARM v7 out-of-tree builds of libjpeg-turbo (see |
| 664 | "Building libjpeg-turbo for iOS" above.) If you are building an x86-64 |
| 665 | version of libjpeg-turbo, you should configure a 32-bit out-of-tree build as |
| 666 | well. Next, build libjpeg-turbo as you would normally, using an out-of-tree |
| 667 | build. When it is built, run 'make iosdmg' from the build directory. The |
| 668 | build system will look for the ARM v6 build under {source_directory}/iosarmv6 |
| 669 | by default, the ARM v7 build under {source_directory}/iosarmv7 by default, |
| 670 | and (if applicable) the 32-bit build under {source_directory}/osxx86 by |
| 671 | default, but you can override this by setting the BUILDDIR32, BUILDDIRARMV6, |
| 672 | and/or BUILDDIRARMV7 variables on the make command line as shown above. |
DRC | 1fbae84 | 2012-02-09 09:23:30 +0000 | [diff] [blame] | 673 | |
DRC | 0f53df8 | 2010-10-21 19:47:06 +0000 | [diff] [blame] | 674 | make sunpkg |
| 675 | |
| 676 | Build a Solaris package. This requires pkgmk, pkgtrans, and bzip2. |
| 677 | |
| 678 | make csunpkg [BUILDDIR32={32-bit build directory}] |
| 679 | |
DRC | 80803ae | 2011-12-15 13:12:59 +0000 | [diff] [blame] | 680 | On 64-bit Solaris systems, this creates a combined package that contains |
DRC | 0f53df8 | 2010-10-21 19:47:06 +0000 | [diff] [blame] | 681 | both 32-bit and 64-bit libraries. You should first configure a 32-bit |
| 682 | out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree |
| 683 | build, then run 'make csunpkg' from the 64-bit build directory. The build |
| 684 | system will look for the 32-bit build under {source_directory}/solx86 by |
| 685 | default, but you can override this by setting the BUILDDIR32 variable on the |
| 686 | make command line as shown above. |
| 687 | |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 688 | make cygwinpkg |
| 689 | |
| 690 | Build a Cygwin binary package. |
| 691 | |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 692 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 693 | Windows |
| 694 | ------- |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 695 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 696 | If using NMake: |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 697 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 698 | cd {build_directory} |
| 699 | nmake installer |
| 700 | |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 701 | If using MinGW: |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 702 | |
| 703 | cd {build_directory} |
| 704 | make installer |
| 705 | |
| 706 | If using the Visual Studio IDE, build the "installer" project. |
| 707 | |
| 708 | The installer package (libjpeg-turbo[-gcc][64].exe) will be located under |
| 709 | {build_directory}. If building using the Visual Studio IDE, then the installer |
| 710 | package will be located in a subdirectory with the same name as the |
| 711 | configuration you built (such as {build_directory}\Debug\ or |
| 712 | {build_directory}\Release\). |
| 713 | |
| 714 | Building a Windows installer requires the Nullsoft Install System |
| 715 | (http://nsis.sourceforge.net/.) makensis.exe should be in your PATH. |
DRC | cb6157b | 2012-01-31 11:38:13 +0000 | [diff] [blame] | 716 | |
| 717 | |
| 718 | ******************************************************************************* |
| 719 | ** Regression testing |
| 720 | ******************************************************************************* |
| 721 | |
| 722 | The most common way to test libjpeg-turbo is by invoking 'make test' on |
| 723 | Unix/Linux platforms or 'ctest' on Windows platforms, once the build has |
| 724 | completed. This runs a series of tests to ensure that mathematical |
| 725 | compatibility has been maintained between libjpeg-turbo and libjpeg v6b. This |
| 726 | also invokes the TurboJPEG unit tests, which ensure that the colorspace |
| 727 | extensions, YUV encoding, decompression scaling, and other features of the |
| 728 | TurboJPEG C and Java APIs are working properly (and, by extension, that the |
| 729 | equivalent features of the underlying libjpeg API are also working.) |
| 730 | |
| 731 | Invoking 'make testclean' or 'nmake testclean' (if using NMake) or building |
| 732 | the 'testclean' target (if using the Visual Studio IDE) will clean up the |
| 733 | output images generated by 'make test'. |
| 734 | |
| 735 | On Unix/Linux platforms, more extensive tests of the TurboJPEG/OSS C and Java |
| 736 | wrappers can be run by invoking 'make tjtest'. These extended TurboJPEG tests |
| 737 | essentially iterate through all of the available features of the TurboJPEG APIs |
| 738 | that are not covered by the TurboJPEG unit tests (this includes the lossless |
| 739 | transform options) and compare the images generated by each feature to images |
| 740 | generated using the equivalent feature in the libjpeg API. The extended |
| 741 | TurboJPEG tests are meant to test for regressions in the TurboJPEG wrappers, |
| 742 | not in the underlying libjpeg-turbo library. |