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