DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 1 | ******************************************************************************* |
DRC | f32640e | 2013-03-23 09:57:03 +0000 | [diff] [blame] | 2 | ** Building on Un*x Platforms (including Cygwin and OS X) |
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 | f32640e | 2013-03-23 09:57:03 +0000 | [diff] [blame] | 13 | * If using Xcode 4.3 or later on OS X, autoconf and automake are no longer |
| 14 | provided. The easiest way to obtain them is from MacPorts |
| 15 | (http://www.macports.org/). |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 16 | |
DRC | 939e466 | 2015-08-03 23:56:09 -0500 | [diff] [blame] | 17 | -- NASM or YASM (if building x86 or x86-64 SIMD extensions) |
| 18 | * NASM 0.98, or 2.01 or later is required for an x86 build (0.99 and 2.00 do |
| 19 | not work properly with libjpeg-turbo's x86 SIMD code.) |
| 20 | * NASM 2.00 or later is required for an x86-64 build. |
| 21 | * NASM 2.07, or 2.11.09 or later is required for an x86-64 Mac build |
| 22 | (2.11.08 does not work properly with libjpeg-turbo's x86-64 SIMD code when |
| 23 | building macho64 objects.) NASM or YASM can be obtained from MacPorts |
| 24 | (http://www.macports.org/). |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 25 | |
DRC | 254937b | 2011-04-16 13:35:35 +0000 | [diff] [blame] | 26 | The binary RPMs released by the NASM project do not work on older Linux |
| 27 | systems, such as Red Hat Enterprise Linux 4. On such systems, you can |
| 28 | easily build and install NASM from a source RPM by downloading one of the |
| 29 | SRPMs from |
| 30 | |
| 31 | http://www.nasm.us/pub/nasm/releasebuilds |
| 32 | |
| 33 | and executing the following as root: |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 34 | |
| 35 | ARCH=`uname -m` |
DRC | 254937b | 2011-04-16 13:35:35 +0000 | [diff] [blame] | 36 | rpmbuild --rebuild nasm-{version}.src.rpm |
| 37 | rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-{version}.$ARCH.rpm |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 38 | |
DRC | 254937b | 2011-04-16 13:35:35 +0000 | [diff] [blame] | 39 | NOTE: the NASM build will fail if texinfo is not installed. |
DRC | c3f4ac0 | 2010-02-19 21:51:26 +0000 | [diff] [blame] | 40 | |
DRC | 8f870c2 | 2010-02-24 00:30:00 +0000 | [diff] [blame] | 41 | -- GCC v4.1 or later recommended for best performance |
DRC | f32640e | 2013-03-23 09:57:03 +0000 | [diff] [blame] | 42 | * Beginning with Xcode 4, Apple stopped distributing GCC and switched to |
DRC | 08769b3 | 2013-03-23 21:35:41 +0000 | [diff] [blame] | 43 | the LLVM compiler. Xcode v4.0 through v4.6 provides a GCC front end |
| 44 | called LLVM-GCC. Unfortunately, as of this writing, neither LLVM-GCC nor |
| 45 | the LLVM (clang) compiler produces optimal performance with libjpeg-turbo. |
DRC | f32640e | 2013-03-23 09:57:03 +0000 | [diff] [blame] | 46 | Building libjpeg-turbo with LLVM-GCC v4.2 results in a 10% performance |
| 47 | degradation when compressing using 64-bit code, relative to building |
| 48 | libjpeg-turbo with GCC v4.2. Building libjpeg-turbo with LLVM (clang) |
| 49 | results in a 20% performance degradation when compressing using 64-bit |
| 50 | code, relative to building libjpeg-turbo with GCC v4.2. If you are |
| 51 | running Snow Leopard or earlier, it is suggested that you continue to use |
| 52 | Xcode v3.2.6, which provides GCC v4.2. If you are using Lion or later, it |
DRC | 06bf10d | 2015-06-20 16:21:33 +0000 | [diff] [blame] | 53 | is suggested that you install Apple GCC v4.2 or GCC v5 through MacPorts. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 54 | |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 55 | -- If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is |
DRC | 79241e3 | 2014-03-23 18:06:11 +0000 | [diff] [blame] | 56 | required. Some systems, such as Solaris 10 and later and Red Hat Enterprise |
| 57 | Linux 5 and later, have this pre-installed. On OS X 10.5 and later, it will |
| 58 | be necessary to install the Java Developer Package, which can be downloaded |
| 59 | from http://developer.apple.com/downloads (Apple ID required.) For systems |
| 60 | that do not have a JDK installed, you can obtain the Oracle Java Development |
| 61 | Kit from http://www.java.com. |
DRC | f8e0055 | 2011-02-04 11:06:36 +0000 | [diff] [blame] | 62 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 63 | |
| 64 | ================== |
| 65 | Out-of-Tree Builds |
| 66 | ================== |
| 67 | |
| 68 | Binary objects, libraries, and executables are generated in the same directory |
| 69 | from which configure was executed (the "binary directory"), and this directory |
| 70 | need not necessarily be the same as the libjpeg-turbo source directory. You |
| 71 | can create multiple independent binary directories, in which different versions |
| 72 | of libjpeg-turbo can be built from the same source tree using different |
| 73 | compilers or settings. In the sections below, {build_directory} refers to the |
| 74 | binary directory, whereas {source_directory} refers to the libjpeg-turbo source |
| 75 | directory. For in-tree builds, these directories are the same. |
| 76 | |
| 77 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 78 | ====================== |
| 79 | Building libjpeg-turbo |
| 80 | ====================== |
| 81 | |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 82 | The following procedure will build libjpeg-turbo on Linux, FreeBSD, Cygwin, and |
| 83 | Solaris/x86 systems (on Solaris, this generates a 32-bit library. See below |
| 84 | for 64-bit build instructions.) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 85 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 86 | cd {source_directory} |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 87 | autoreconf -fiv |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 88 | cd {build_directory} |
DRC | 98dbe91 | 2010-11-04 22:22:30 +0000 | [diff] [blame] | 89 | sh {source_directory}/configure [additional configure flags] |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 90 | make |
| 91 | |
DRC | 93eaa37 | 2015-06-20 16:27:51 +0000 | [diff] [blame] | 92 | NOTE: Running autoreconf in the source directory is not necessary if building |
| 93 | libjpeg-turbo from one of the official release tarballs. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 94 | |
| 95 | This will generate the following files under .libs/ |
| 96 | |
| 97 | libjpeg.a |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 98 | Static link library for the libjpeg API |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 99 | |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 100 | libjpeg.so.{version} (Linux, Unix) |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 101 | libjpeg.{version}.dylib (OS X) |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 102 | cygjpeg-{version}.dll (Cygwin) |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 103 | Shared library for the libjpeg API |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 104 | |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 105 | By default, {version} is 62.1.0, 7.1.0, or 8.0.2, depending on whether |
| 106 | libjpeg v6b (default), v7, or v8 emulation is enabled. If using Cygwin, |
| 107 | {version} is 62, 7, or 8. |
| 108 | |
| 109 | libjpeg.so (Linux, Unix) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 110 | libjpeg.dylib (OS X) |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 111 | Development symlink for the libjpeg API |
| 112 | |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 113 | libjpeg.dll.a (Cygwin) |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 114 | Import library for the libjpeg API |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 115 | |
| 116 | libturbojpeg.a |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 117 | Static link library for the TurboJPEG API |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 118 | |
DRC | 79241e3 | 2014-03-23 18:06:11 +0000 | [diff] [blame] | 119 | libturbojpeg.so.0.1.0 (Linux, Unix) |
| 120 | libturbojpeg.0.1.0.dylib (OS X) |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 121 | cygturbojpeg-0.dll (Cygwin) |
| 122 | Shared library for the TurboJPEG API |
| 123 | |
| 124 | libturbojpeg.so (Linux, Unix) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 125 | libturbojpeg.dylib (OS X) |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 126 | Development symlink for the TurboJPEG API |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 127 | |
| 128 | libturbojpeg.dll.a (Cygwin) |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 129 | Import library for the TurboJPEG API |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 130 | |
| 131 | |
DRC | 3091354 | 2012-01-27 09:53:33 +0000 | [diff] [blame] | 132 | libjpeg v7 or v8 API/ABI Emulation |
| 133 | ---------------------------------- |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 134 | |
| 135 | Add --with-jpeg7 to the configure command line to build a version of |
DRC | 3091354 | 2012-01-27 09:53:33 +0000 | [diff] [blame] | 136 | libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add --with-jpeg8 to |
| 137 | the configure command to build a version of libjpeg-turbo that is |
| 138 | API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information |
| 139 | on libjpeg v7 and v8 emulation. |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 140 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 141 | |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 142 | In-Memory Source/Destination Managers |
| 143 | ------------------------------------- |
| 144 | |
| 145 | When using libjpeg v6b or v7 API/ABI emulation, add --without-mem-srcdst to the |
| 146 | configure command line to build a version of libjpeg-turbo that lacks the |
| 147 | jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of |
| 148 | the original libjpeg v6b and v7 APIs, so removing them ensures strict |
| 149 | conformance with those APIs. See README-turbo.txt for more information. |
| 150 | |
| 151 | |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 152 | Arithmetic Coding Support |
| 153 | ------------------------- |
| 154 | |
| 155 | Since the patent on arithmetic coding has expired, this functionality has been |
| 156 | included in this release of libjpeg-turbo. libjpeg-turbo's implementation is |
DRC | f38eee0 | 2011-02-18 07:00:38 +0000 | [diff] [blame] | 157 | based on the implementation in libjpeg v8, but it works when emulating libjpeg |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 158 | v7 or v6b as well. The default is to enable both arithmetic encoding and |
| 159 | decoding, but those who have philosophical objections to arithmetic coding can |
| 160 | add --without-arith-enc or --without-arith-dec to the configure command line to |
| 161 | disable encoding or decoding (respectively.) |
| 162 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 163 | |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 164 | TurboJPEG Java Wrapper |
| 165 | ---------------------- |
DRC | 88f54a4 | 2011-04-01 01:21:22 +0000 | [diff] [blame] | 166 | Add --with-java to the configure command line to incorporate an optional Java |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 167 | Native Interface wrapper into the TurboJPEG shared library and build the Java |
| 168 | front-end classes to support it. This allows the TurboJPEG shared library to |
| 169 | be used directly from Java applications. See java/README for more details. |
DRC | 88f54a4 | 2011-04-01 01:21:22 +0000 | [diff] [blame] | 170 | |
| 171 | You can set the JAVAC, JAR, and JAVA configure variables to specify |
| 172 | alternate commands for javac, jar, and java (respectively.) You can also |
| 173 | set the JAVACFLAGS configure variable to specify arguments that should be |
| 174 | passed to the Java compiler when building the front-end classes, and JNI_CFLAGS |
| 175 | to specify arguments that should be passed to the C compiler when building the |
| 176 | JNI wrapper. Run 'configure --help' for more details. |
DRC | f8e0055 | 2011-02-04 11:06:36 +0000 | [diff] [blame] | 177 | |
| 178 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 179 | ======================== |
| 180 | Installing libjpeg-turbo |
| 181 | ======================== |
| 182 | |
| 183 | If you intend to install these libraries and the associated header files, then |
| 184 | replace 'make' in the instructions above with |
| 185 | |
| 186 | make install prefix={base dir} libdir={library directory} |
| 187 | |
| 188 | For example, |
| 189 | |
| 190 | make install prefix=/usr/local libdir=/usr/local/lib64 |
| 191 | |
| 192 | will install the header files in /usr/local/include and the library files in |
| 193 | /usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default |
| 194 | is to install the header files in /opt/libjpeg-turbo/include and the library |
DRC | d7a642b | 2013-04-24 06:40:25 +0000 | [diff] [blame] | 195 | files in /opt/libjpeg-turbo/lib32 (32-bit) or /opt/libjpeg-turbo/lib64 |
| 196 | (64-bit.) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 197 | |
| 198 | NOTE: You can specify a prefix of /usr and a libdir of, for instance, |
| 199 | /usr/lib64 to overwrite the system's version of libjpeg. If you do this, |
| 200 | however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before |
| 201 | overwriting it. It is recommended that you instead install libjpeg-turbo into |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 202 | a non-system directory and manipulate the LD_LIBRARY_PATH or create symlinks |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 203 | to force applications to use libjpeg-turbo instead of libjpeg. See |
| 204 | README-turbo.txt for more information. |
| 205 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 206 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 207 | ============= |
| 208 | Build Recipes |
| 209 | ============= |
| 210 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 211 | |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 212 | 32-bit Build on 64-bit Linux |
| 213 | ---------------------------- |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 214 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 215 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 216 | |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 217 | --host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32 |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 218 | |
| 219 | to the configure command line. |
| 220 | |
| 221 | |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 222 | 64-bit Build on 64-bit OS X |
| 223 | --------------------------- |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 224 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 225 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 226 | |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 227 | --host x86_64-apple-darwin NASM=/opt/local/bin/nasm |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 228 | |
DRC | 7bac07b | 2010-04-10 05:53:35 +0000 | [diff] [blame] | 229 | to the configure command line. NASM 2.07 or later from MacPorts must be |
| 230 | installed. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 231 | |
| 232 | |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 233 | 32-bit Build on 64-bit OS X |
| 234 | --------------------------- |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 235 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 236 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 237 | |
DRC | 5950c5d | 2012-06-28 23:22:03 +0000 | [diff] [blame] | 238 | --host i686-apple-darwin CFLAGS='-O3 -m32' LDFLAGS=-m32 |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 239 | |
| 240 | to the configure command line. |
| 241 | |
| 242 | |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 243 | 64-bit Backward-Compatible Build on 64-bit OS X |
| 244 | ----------------------------------------------- |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 245 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 246 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 247 | |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 248 | --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \ |
DRC | 79241e3 | 2014-03-23 18:06:11 +0000 | [diff] [blame] | 249 | CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \ |
| 250 | -mmacosx-version-min=10.5 -O3' \ |
| 251 | LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \ |
| 252 | -mmacosx-version-min=10.5' |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 253 | |
DRC | 79241e3 | 2014-03-23 18:06:11 +0000 | [diff] [blame] | 254 | to the configure command line. The OS X 10.5 SDK, and NASM 2.07 or later from |
DRC | 575c342 | 2010-07-08 07:01:20 +0000 | [diff] [blame] | 255 | MacPorts, must be installed. |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 256 | |
| 257 | |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 258 | 32-bit Backward-Compatible Build on OS X |
| 259 | ---------------------------------------- |
DRC | 0dedd1a | 2010-07-02 09:20:12 +0000 | [diff] [blame] | 260 | |
| 261 | Add |
| 262 | |
DRC | 5950c5d | 2012-06-28 23:22:03 +0000 | [diff] [blame] | 263 | --host i686-apple-darwin \ |
DRC | 79241e3 | 2014-03-23 18:06:11 +0000 | [diff] [blame] | 264 | CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \ |
| 265 | -mmacosx-version-min=10.5 -O3 -m32' \ |
| 266 | LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \ |
| 267 | -mmacosx-version-min=10.5 -m32' |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 268 | |
DRC | 79241e3 | 2014-03-23 18:06:11 +0000 | [diff] [blame] | 269 | to the configure command line. The OS X 10.5 SDK must be installed. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 270 | |
| 271 | |
| 272 | 64-bit Library Build on 64-bit Solaris |
| 273 | -------------------------------------- |
| 274 | |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 275 | Add |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 276 | |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 277 | --host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64 |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 278 | |
| 279 | to the configure command line. |
| 280 | |
| 281 | |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 282 | 32-bit Build on 64-bit FreeBSD |
| 283 | ------------------------------ |
DRC | 7bac07b | 2010-04-10 05:53:35 +0000 | [diff] [blame] | 284 | |
| 285 | Add |
| 286 | |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 287 | --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \ |
| 288 | LDFLAGS='-B/usr/lib32' |
DRC | 7bac07b | 2010-04-10 05:53:35 +0000 | [diff] [blame] | 289 | |
| 290 | to the configure command line. NASM 2.07 or later from FreeBSD ports must be |
| 291 | installed. |
| 292 | |
| 293 | |
DRC | 0559e94 | 2012-03-23 03:12:35 +0000 | [diff] [blame] | 294 | Oracle Solaris Studio |
| 295 | --------------------- |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 296 | |
| 297 | Add |
| 298 | |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 299 | CC=cc |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 300 | |
| 301 | to the configure command line. libjpeg-turbo will automatically be built with |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 302 | the maximum optimization level (-xO5) unless you override CFLAGS. |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 303 | |
DRC | 0559e94 | 2012-03-23 03:12:35 +0000 | [diff] [blame] | 304 | 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] | 305 | |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 306 | --host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64 |
DRC | ca5e7d1 | 2010-02-17 02:25:06 +0000 | [diff] [blame] | 307 | |
| 308 | to the configure command line. |
| 309 | |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 310 | |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 311 | MinGW Build on Cygwin |
| 312 | --------------------- |
| 313 | |
| 314 | Use CMake (see recipes below) |
| 315 | |
| 316 | |
DRC | 94755ce | 2011-10-19 05:13:27 +0000 | [diff] [blame] | 317 | =========== |
| 318 | ARM Support |
| 319 | =========== |
| 320 | |
| 321 | This release of libjpeg-turbo can use ARM NEON SIMD instructions to accelerate |
| 322 | JPEG compression/decompression by approximately 2-4x on ARMv7 and later |
| 323 | platforms. If libjpeg-turbo is configured on an ARM Linux platform, then the |
| 324 | build system will automatically include the NEON SIMD routines, if they are |
DRC | b0a9cca | 2014-05-06 21:03:35 +0000 | [diff] [blame] | 325 | supported. Build instructions for other ARM-based platforms follow. |
DRC | 94755ce | 2011-10-19 05:13:27 +0000 | [diff] [blame] | 326 | |
| 327 | |
| 328 | Building libjpeg-turbo for iOS |
| 329 | ------------------------------ |
| 330 | |
DRC | dab6b8a | 2014-05-06 20:53:25 +0000 | [diff] [blame] | 331 | iOS platforms, such as the iPhone and iPad, use ARM processors, some of which |
| 332 | support NEON instructions. Additional steps are required in order to build |
| 333 | libjpeg-turbo for these platforms. |
DRC | 94755ce | 2011-10-19 05:13:27 +0000 | [diff] [blame] | 334 | |
| 335 | Additional build requirements: |
| 336 | |
DRC | 8d55c88 | 2014-01-29 19:32:23 +0000 | [diff] [blame] | 337 | gas-preprocessor.pl |
DRC | a61fd32 | 2015-08-03 13:16:21 -0500 | [diff] [blame] | 338 | (https://raw.githubusercontent.com/libjpeg-turbo/gas-preprocessor/master/gas-preprocessor.pl) |
DRC | 8d55c88 | 2014-01-29 19:32:23 +0000 | [diff] [blame] | 339 | should be installed in your PATH. |
DRC | 94755ce | 2011-10-19 05:13:27 +0000 | [diff] [blame] | 340 | |
DRC | 6e6b28c | 2014-12-19 17:34:30 +0000 | [diff] [blame] | 341 | |
| 342 | ARM 32-bit Build (Xcode 4.6.x and earlier, LLVM-GCC): |
| 343 | |
DRC | 94755ce | 2011-10-19 05:13:27 +0000 | [diff] [blame] | 344 | Set the following shell variables for simplicity: |
| 345 | |
DRC | 0d0705f | 2014-03-27 03:35:21 +0000 | [diff] [blame] | 346 | Xcode 4.2 and earlier: |
DRC | 8d55c88 | 2014-01-29 19:32:23 +0000 | [diff] [blame] | 347 | IOS_PLATFORMDIR=/Developer/Platforms/iPhoneOS.platform |
DRC | 0d0705f | 2014-03-27 03:35:21 +0000 | [diff] [blame] | 348 | Xcode 4.3 and later: |
DRC | 8d55c88 | 2014-01-29 19:32:23 +0000 | [diff] [blame] | 349 | IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform |
DRC | 8d55c88 | 2014-01-29 19:32:23 +0000 | [diff] [blame] | 350 | |
DRC | 0d0705f | 2014-03-27 03:35:21 +0000 | [diff] [blame] | 351 | IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk |
DRC | 0d0705f | 2014-03-27 03:35:21 +0000 | [diff] [blame] | 352 | IOS_GCC=$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 |
DRC | a2a2cd6 | 2013-02-04 22:29:57 +0000 | [diff] [blame] | 353 | |
DRC | 6e6b28c | 2014-12-19 17:34:30 +0000 | [diff] [blame] | 354 | ARMv6 (code will run on all iOS devices, not SIMD-accelerated): |
DRC | a2a2cd6 | 2013-02-04 22:29:57 +0000 | [diff] [blame] | 355 | [NOTE: Requires Xcode 4.4.x or earlier] |
DRC | 94755ce | 2011-10-19 05:13:27 +0000 | [diff] [blame] | 356 | IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp" |
| 357 | |
DRC | 6e6b28c | 2014-12-19 17:34:30 +0000 | [diff] [blame] | 358 | ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer): |
DRC | 94755ce | 2011-10-19 05:13:27 +0000 | [diff] [blame] | 359 | IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon" |
| 360 | |
DRC | 6e6b28c | 2014-12-19 17:34:30 +0000 | [diff] [blame] | 361 | ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer): |
DRC | a2a2cd6 | 2013-02-04 22:29:57 +0000 | [diff] [blame] | 362 | [NOTE: Requires Xcode 4.5 or later] |
| 363 | IOS_CFLAGS="-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon" |
| 364 | |
DRC | 94755ce | 2011-10-19 05:13:27 +0000 | [diff] [blame] | 365 | Follow the procedure under "Building libjpeg-turbo" above, adding |
| 366 | |
DRC | ceb552a | 2014-12-19 10:44:09 +0000 | [diff] [blame] | 367 | --host arm-apple-darwin10 \ |
DRC | 94755ce | 2011-10-19 05:13:27 +0000 | [diff] [blame] | 368 | CC="$IOS_GCC" LD="$IOS_GCC" \ |
| 369 | CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \ |
| 370 | LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS" |
| 371 | |
DRC | 6e6b28c | 2014-12-19 17:34:30 +0000 | [diff] [blame] | 372 | to the configure command line. |
DRC | 0d0705f | 2014-03-27 03:35:21 +0000 | [diff] [blame] | 373 | |
DRC | 6e6b28c | 2014-12-19 17:34:30 +0000 | [diff] [blame] | 374 | |
| 375 | ARM 32-bit Build (Xcode 5.0.x and later, Clang): |
| 376 | |
| 377 | Set the following shell variables for simplicity: |
| 378 | |
| 379 | IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform |
| 380 | IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk |
| 381 | IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang |
| 382 | |
| 383 | ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer): |
| 384 | IOS_CFLAGS="-arch armv7" |
| 385 | |
| 386 | ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer): |
| 387 | IOS_CFLAGS="-arch armv7s" |
| 388 | |
| 389 | Follow the procedure under "Building libjpeg-turbo" above, adding |
| 390 | |
| 391 | --host arm-apple-darwin10 \ |
| 392 | CC="$IOS_GCC" LD="$IOS_GCC" \ |
| 393 | CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \ |
| 394 | LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS" \ |
DRC | 0d0705f | 2014-03-27 03:35:21 +0000 | [diff] [blame] | 395 | CCASFLAGS="-no-integrated-as $IOS_CFLAGS" |
| 396 | |
DRC | 94755ce | 2011-10-19 05:13:27 +0000 | [diff] [blame] | 397 | to the configure command line. |
| 398 | |
DRC | 6e6b28c | 2014-12-19 17:34:30 +0000 | [diff] [blame] | 399 | |
| 400 | ARMv8 64-bit Build (Xcode 5.0.x and later, Clang): |
| 401 | |
DRC | eb319ed | 2015-01-28 00:26:28 +0000 | [diff] [blame] | 402 | Code will run on iPhone 5S/iPad Mini 2/iPad Air and newer. |
DRC | 6e6b28c | 2014-12-19 17:34:30 +0000 | [diff] [blame] | 403 | |
| 404 | Set the following shell variables for simplicity: |
| 405 | |
| 406 | IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform |
| 407 | IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk |
| 408 | IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang |
| 409 | IOS_CFLAGS="-arch arm64" |
| 410 | |
| 411 | Follow the procedure under "Building libjpeg-turbo" above, adding |
| 412 | |
| 413 | --host aarch64-apple-darwin \ |
| 414 | CC="$IOS_GCC" LD="$IOS_GCC" \ |
| 415 | CFLAGS="-isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \ |
| 416 | LDFLAGS="-isysroot $IOS_SYSROOT $IOS_CFLAGS" |
| 417 | |
| 418 | to the configure command line. |
| 419 | |
| 420 | |
DRC | 0d0705f | 2014-03-27 03:35:21 +0000 | [diff] [blame] | 421 | NOTE: You can also add -miphoneos-version-min={version} to $IOS_CFLAGS above |
| 422 | in order to support older versions of iOS than the default version supported by |
| 423 | the SDK. |
| 424 | |
DRC | 6e6b28c | 2014-12-19 17:34:30 +0000 | [diff] [blame] | 425 | Once built, lipo can be used to combine the ARMv6, v7, v7s, and/or v8 variants |
DRC | a2a2cd6 | 2013-02-04 22:29:57 +0000 | [diff] [blame] | 426 | into a universal library. |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 427 | |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 428 | |
DRC | b0a9cca | 2014-05-06 21:03:35 +0000 | [diff] [blame] | 429 | Building libjpeg-turbo for Android |
| 430 | ---------------------------------- |
| 431 | |
| 432 | Building libjpeg-turbo for Android platforms requires the Android NDK |
| 433 | (https://developer.android.com/tools/sdk/ndk) and autotools. The following is |
| 434 | a general recipe script that can be modified for your specific needs. |
| 435 | |
| 436 | # Set these variables to suit your needs |
| 437 | NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/ndk} |
| 438 | BUILD_PLATFORM={the platform name for the NDK package you installed-- |
DRC | cbfa696 | 2016-02-01 11:28:55 -0600 | [diff] [blame] | 439 | for example, "windows-x86" or "linux-x86_64" or "darwin-x86_64"} |
| 440 | TOOLCHAIN_VERSION={"4.8", "4.9", "clang3.5", etc. This corresponds to a |
| 441 | toolchain directory under ${NDK_PATH}/toolchains/.} |
DRC | b0a9cca | 2014-05-06 21:03:35 +0000 | [diff] [blame] | 442 | ANDROID_VERSION={The minimum version of Android to support-- for example, |
DRC | cbfa696 | 2016-02-01 11:28:55 -0600 | [diff] [blame] | 443 | "16", "19", etc. "21" or later is required for a 64-bit build.} |
DRC | b0a9cca | 2014-05-06 21:03:35 +0000 | [diff] [blame] | 444 | |
DRC | cbfa696 | 2016-02-01 11:28:55 -0600 | [diff] [blame] | 445 | # 32-bit ARMv7 build |
DRC | b0a9cca | 2014-05-06 21:03:35 +0000 | [diff] [blame] | 446 | HOST=arm-linux-androideabi |
DRC | b0a9cca | 2014-05-06 21:03:35 +0000 | [diff] [blame] | 447 | SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm |
DRC | b0a9cca | 2014-05-06 21:03:35 +0000 | [diff] [blame] | 448 | ANDROID_CFLAGS="-march=armv7-a -mfloat-abi=softfp -fprefetch-loop-arrays \ |
DRC | cbfa696 | 2016-02-01 11:28:55 -0600 | [diff] [blame] | 449 | --sysroot=${SYSROOT}" |
| 450 | |
| 451 | # 64-bit ARMv8 build |
| 452 | HOST=aarch64-linux-android |
| 453 | SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm64 |
| 454 | ANDROID_CFLAGS="--sysroot=${SYSROOT}" |
| 455 | |
| 456 | TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM} |
| 457 | ANDROID_INCLUDES="-I${SYSROOT}/usr/include -I${TOOLCHAIN}/include" |
DRC | b0a9cca | 2014-05-06 21:03:35 +0000 | [diff] [blame] | 458 | export CPP=${TOOLCHAIN}/bin/${HOST}-cpp |
| 459 | export AR=${TOOLCHAIN}/bin/${HOST}-ar |
| 460 | export AS=${TOOLCHAIN}/bin/${HOST}-as |
| 461 | export NM=${TOOLCHAIN}/bin/${HOST}-nm |
| 462 | export CC=${TOOLCHAIN}/bin/${HOST}-gcc |
| 463 | export LD=${TOOLCHAIN}/bin/${HOST}-ld |
| 464 | export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib |
| 465 | export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump |
| 466 | export STRIP=${TOOLCHAIN}/bin/${HOST}-strip |
| 467 | cd {build_directory} |
| 468 | sh {source_directory}/configure --host=${HOST} \ |
DRC | cbfa696 | 2016-02-01 11:28:55 -0600 | [diff] [blame] | 469 | CFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS} -O3 -fPIE" \ |
DRC | b0a9cca | 2014-05-06 21:03:35 +0000 | [diff] [blame] | 470 | CPPFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS}" \ |
DRC | cbfa696 | 2016-02-01 11:28:55 -0600 | [diff] [blame] | 471 | LDFLAGS="${ANDROID_CFLAGS} -pie" --with-simd ${1+"$@"} |
DRC | b0a9cca | 2014-05-06 21:03:35 +0000 | [diff] [blame] | 472 | make |
| 473 | |
DRC | cbfa696 | 2016-02-01 11:28:55 -0600 | [diff] [blame] | 474 | If building for Android 4.0.x (API level < 16) or earlier, remove -fPIE from |
| 475 | CFLAGS and -pie from LDFLAGS. |
| 476 | |
DRC | b0a9cca | 2014-05-06 21:03:35 +0000 | [diff] [blame] | 477 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 478 | ******************************************************************************* |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 479 | ** Building on Windows (Visual C++ or MinGW) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 480 | ******************************************************************************* |
| 481 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 482 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 483 | ================== |
| 484 | Build Requirements |
| 485 | ================== |
| 486 | |
DRC | 4d2ff7d | 2014-04-18 02:46:59 +0000 | [diff] [blame] | 487 | -- CMake (http://www.cmake.org) v2.8.8 or later |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 488 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 489 | -- Microsoft Visual C++ 2005 or later |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 490 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 491 | If you don't already have Visual C++, then the easiest way to get it is by |
| 492 | installing the Windows SDK: |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 493 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 494 | http://msdn.microsoft.com/en-us/windows/bb980924.aspx |
| 495 | |
| 496 | The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and |
| 497 | everything necessary to build libjpeg-turbo. |
| 498 | |
DRC | 4d2ff7d | 2014-04-18 02:46:59 +0000 | [diff] [blame] | 499 | * You can also use Microsoft Visual Studio Express Edition, which is a free |
| 500 | download. (NOTE: versions prior to 2012 can only be used to build 32-bit |
| 501 | code.) |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 502 | * If you intend to build libjpeg-turbo from the command line, then add the |
| 503 | appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH |
| 504 | environment variables. This is generally accomplished by executing |
| 505 | vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and |
| 506 | vcvars64.bat are part of Visual C++ and are located in the same directory |
| 507 | as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass |
| 508 | optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build |
| 509 | environment. |
| 510 | |
| 511 | ... OR ... |
| 512 | |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 513 | -- MinGW |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 514 | |
DRC | 4d2ff7d | 2014-04-18 02:46:59 +0000 | [diff] [blame] | 515 | MinGW-builds (http://sourceforge.net/projects/mingwbuilds/) or |
| 516 | tdm-gcc (http://tdm-gcc.tdragon.net/) recommended if building on a Windows |
| 517 | machine. Both distributions install a Start Menu link that can be used to |
| 518 | launch a command prompt with the appropriate compiler paths automatically |
| 519 | set. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 520 | |
DRC | 377add7 | 2010-05-17 16:41:12 +0000 | [diff] [blame] | 521 | -- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for |
| 522 | a 64-bit build) |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 523 | |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 524 | -- If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This |
| 525 | can be downloaded from http://www.java.com. |
DRC | 218c0c1 | 2011-02-05 06:01:18 +0000 | [diff] [blame] | 526 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 527 | |
| 528 | ================== |
| 529 | Out-of-Tree Builds |
| 530 | ================== |
| 531 | |
| 532 | Binary objects, libraries, and executables are generated in the same directory |
| 533 | from which cmake was executed (the "binary directory"), and this directory need |
| 534 | not necessarily be the same as the libjpeg-turbo source directory. You can |
| 535 | create multiple independent binary directories, in which different versions of |
| 536 | libjpeg-turbo can be built from the same source tree using different compilers |
| 537 | or settings. In the sections below, {build_directory} refers to the binary |
| 538 | directory, whereas {source_directory} refers to the libjpeg-turbo source |
| 539 | directory. For in-tree builds, these directories are the same. |
| 540 | |
| 541 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 542 | ====================== |
| 543 | Building libjpeg-turbo |
| 544 | ====================== |
| 545 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 546 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 547 | Visual C++ (Command Line) |
| 548 | ------------------------- |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 549 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 550 | cd {build_directory} |
| 551 | cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory} |
| 552 | nmake |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 553 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 554 | This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending |
| 555 | on which version of cl.exe is in the PATH. |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 556 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 557 | The following files will be generated under {build_directory}: |
| 558 | |
| 559 | jpeg-static.lib |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 560 | Static link library for the libjpeg API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 561 | sharedlib/jpeg{version}.dll |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 562 | DLL for the libjpeg API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 563 | sharedlib/jpeg.lib |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 564 | Import library for the libjpeg API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 565 | turbojpeg-static.lib |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 566 | Static link library for the TurboJPEG API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 567 | turbojpeg.dll |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 568 | DLL for the TurboJPEG API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 569 | turbojpeg.lib |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 570 | Import library for the TurboJPEG API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 571 | |
| 572 | {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] | 573 | v8 emulation is enabled. |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 574 | |
| 575 | |
| 576 | Visual C++ (IDE) |
| 577 | ---------------- |
| 578 | |
| 579 | Choose the appropriate CMake generator option for your version of Visual Studio |
| 580 | (run "cmake" with no arguments for a list of available generators.) For |
| 581 | instance: |
| 582 | |
| 583 | cd {build_directory} |
DRC | 4d2ff7d | 2014-04-18 02:46:59 +0000 | [diff] [blame] | 584 | cmake -G "Visual Studio 10" {source_directory} |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 585 | |
DRC | dab6b8a | 2014-05-06 20:53:25 +0000 | [diff] [blame] | 586 | NOTE: Add "Win64" to the generator name (for example, "Visual Studio 10 |
| 587 | Win64") to build a 64-bit version of libjpeg-turbo. Recent versions of CMake |
| 588 | no longer document that. A separate build directory must be used for 32-bit |
| 589 | and 64-bit builds. |
DRC | d0c9f0c | 2014-04-18 07:50:17 +0000 | [diff] [blame] | 590 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 591 | You can then open ALL_BUILD.vcproj in Visual Studio and build one of the |
| 592 | configurations in that project ("Debug", "Release", etc.) to generate a full |
| 593 | build of libjpeg-turbo. |
| 594 | |
| 595 | This will generate the following files under {build_directory}: |
| 596 | |
| 597 | {configuration}/jpeg-static.lib |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 598 | Static link library for the libjpeg API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 599 | sharedlib/{configuration}/jpeg{version}.dll |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 600 | DLL for the libjpeg API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 601 | sharedlib/{configuration}/jpeg.lib |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 602 | Import library for the libjpeg API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 603 | {configuration}/turbojpeg-static.lib |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 604 | Static link library for the TurboJPEG API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 605 | {configuration}/turbojpeg.dll |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 606 | DLL for the TurboJPEG API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 607 | {configuration}/turbojpeg.lib |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 608 | Import library for the TurboJPEG API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 609 | |
| 610 | {configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on |
| 611 | 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] | 612 | depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled. |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 613 | |
| 614 | |
| 615 | MinGW |
| 616 | ----- |
| 617 | |
DRC | 4d2ff7d | 2014-04-18 02:46:59 +0000 | [diff] [blame] | 618 | NOTE: This assumes that you are building on a Windows machine. If you are |
| 619 | cross-compiling on a Linux/Unix machine, then see "Build Recipes" below. |
| 620 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 621 | cd {build_directory} |
DRC | 4d2ff7d | 2014-04-18 02:46:59 +0000 | [diff] [blame] | 622 | cmake -G "MinGW Makefiles" {source_directory} |
| 623 | mingw32-make |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 624 | |
| 625 | This will generate the following files under {build_directory} |
| 626 | |
| 627 | libjpeg.a |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 628 | Static link library for the libjpeg API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 629 | sharedlib/libjpeg-{version}.dll |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 630 | DLL for the libjpeg API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 631 | sharedlib/libjpeg.dll.a |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 632 | Import library for the libjpeg API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 633 | libturbojpeg.a |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 634 | Static link library for the TurboJPEG API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 635 | libturbojpeg.dll |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 636 | DLL for the TurboJPEG API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 637 | libturbojpeg.dll.a |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 638 | Import library for the TurboJPEG API |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 639 | |
| 640 | {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] | 641 | v8 emulation is enabled. |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 642 | |
| 643 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 644 | Debug Build |
| 645 | ----------- |
| 646 | |
| 647 | Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with |
| 648 | NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with |
| 649 | NMake.) |
| 650 | |
| 651 | |
DRC | 3091354 | 2012-01-27 09:53:33 +0000 | [diff] [blame] | 652 | libjpeg v7 or v8 API/ABI Emulation |
| 653 | ----------------------------------- |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 654 | |
| 655 | 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] | 656 | libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add "-DWITH_JPEG8=1" |
| 657 | to the cmake command to build a version of libjpeg-turbo that is |
| 658 | API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information |
| 659 | on libjpeg v7 and v8 emulation. |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 660 | |
| 661 | |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 662 | In-Memory Source/Destination Managers |
| 663 | ------------------------------------- |
| 664 | |
| 665 | When using libjpeg v6b or v7 API/ABI emulation, add -DWITH_MEM_SRCDST=0 to the |
| 666 | CMake command line to build a version of libjpeg-turbo that lacks the |
| 667 | jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of |
| 668 | the original libjpeg v6b and v7 APIs, so removing them ensures strict |
| 669 | conformance with those APIs. See README-turbo.txt for more information. |
| 670 | |
| 671 | |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 672 | Arithmetic Coding Support |
| 673 | ------------------------- |
| 674 | |
| 675 | Since the patent on arithmetic coding has expired, this functionality has been |
| 676 | included in this release of libjpeg-turbo. libjpeg-turbo's implementation is |
DRC | f38eee0 | 2011-02-18 07:00:38 +0000 | [diff] [blame] | 677 | based on the implementation in libjpeg v8, but it works when emulating libjpeg |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 678 | v7 or v6b as well. The default is to enable both arithmetic encoding and |
| 679 | decoding, but those who have philosophical objections to arithmetic coding can |
| 680 | add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to |
| 681 | disable encoding or decoding (respectively.) |
| 682 | |
| 683 | |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 684 | TurboJPEG Java Wrapper |
| 685 | ---------------------- |
DRC | 279bd34 | 2011-04-02 05:17:12 +0000 | [diff] [blame] | 686 | Add "-DWITH_JAVA=1" to the cmake command line to incorporate an optional Java |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 687 | Native Interface wrapper into the TurboJPEG shared library and build the Java |
| 688 | front-end classes to support it. This allows the TurboJPEG shared library to |
| 689 | be used directly from Java applications. See java/README for more details. |
DRC | 218c0c1 | 2011-02-05 06:01:18 +0000 | [diff] [blame] | 690 | |
DRC | db42506 | 2011-04-03 06:10:18 +0000 | [diff] [blame] | 691 | If you are using CMake 2.8, you can set the Java_JAVAC_EXECUTABLE, |
| 692 | Java_JAVA_EXECUTABLE, and Java_JAR_EXECUTABLE CMake variables to specify |
| 693 | alternate commands or locations for javac, jar, and java (respectively.) If |
| 694 | you are using CMake 2.6, set JAVA_COMPILE, JAVA_RUNTIME, and JAVA_ARCHIVE |
| 695 | instead. You can also set the JAVACFLAGS CMake variable to specify arguments |
| 696 | that should be passed to the Java compiler when building the front-end classes. |
| 697 | |
DRC | 218c0c1 | 2011-02-05 06:01:18 +0000 | [diff] [blame] | 698 | |
DRC | 2665843 | 2010-10-16 22:04:29 +0000 | [diff] [blame] | 699 | ======================== |
| 700 | Installing libjpeg-turbo |
| 701 | ======================== |
| 702 | |
| 703 | You can use the build system to install libjpeg-turbo into a directory of your |
| 704 | choosing (as opposed to creating an installer.) To do this, add: |
| 705 | |
| 706 | -DCMAKE_INSTALL_PREFIX={install_directory} |
| 707 | |
| 708 | to the cmake command line. |
| 709 | |
| 710 | For example, |
| 711 | |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 712 | cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \ |
DRC | 2665843 | 2010-10-16 22:04:29 +0000 | [diff] [blame] | 713 | -DCMAKE_INSTALL_PREFIX=c:\libjpeg-turbo {source_directory} |
| 714 | nmake install |
| 715 | |
| 716 | will install the header files in c:\libjpeg-turbo\include, the library files |
| 717 | in c:\libjpeg-turbo\lib, the DLL's in c:\libjpeg-turbo\bin, and the |
| 718 | documentation in c:\libjpeg-turbo\doc. |
| 719 | |
| 720 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 721 | ============= |
| 722 | Build Recipes |
| 723 | ============= |
| 724 | |
| 725 | |
DRC | 1c73ce8 | 2010-10-16 21:02:54 +0000 | [diff] [blame] | 726 | 64-bit MinGW Build on Cygwin |
| 727 | ---------------------------- |
| 728 | |
| 729 | cd {build_directory} |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 730 | CC=/usr/bin/x86_64-w64-mingw32-gcc \ |
DRC | 68bf3f2 | 2010-10-18 07:56:14 +0000 | [diff] [blame] | 731 | cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ |
DRC | 4d2ff7d | 2014-04-18 02:46:59 +0000 | [diff] [blame] | 732 | -DCMAKE_RC_COMPILER=/usr/bin/x86_64-w64-mingw32-windres.exe \ |
| 733 | {source_directory} |
DRC | 1c73ce8 | 2010-10-16 21:02:54 +0000 | [diff] [blame] | 734 | make |
| 735 | |
| 736 | This produces a 64-bit build of libjpeg-turbo that does not depend on |
| 737 | cygwin1.dll or other Cygwin DLL's. The mingw64-x86_64-gcc-core and |
| 738 | mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed. |
| 739 | |
| 740 | |
| 741 | 32-bit MinGW Build on Cygwin |
| 742 | ---------------------------- |
| 743 | |
| 744 | cd {build_directory} |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 745 | CC=/usr/bin/i686-w64-mingw32-gcc \ |
DRC | 68bf3f2 | 2010-10-18 07:56:14 +0000 | [diff] [blame] | 746 | cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ |
DRC | 4d2ff7d | 2014-04-18 02:46:59 +0000 | [diff] [blame] | 747 | -DCMAKE_RC_COMPILER=/usr/bin/i686-w64-mingw32-windres.exe \ |
| 748 | {source_directory} |
DRC | 1c73ce8 | 2010-10-16 21:02:54 +0000 | [diff] [blame] | 749 | make |
| 750 | |
| 751 | This produces a 32-bit build of libjpeg-turbo that does not depend on |
| 752 | cygwin1.dll or other Cygwin DLL's. The mingw64-i686-gcc-core and |
| 753 | mingw64-i686-gcc-g++ packages (and their dependencies) must be installed. |
| 754 | |
| 755 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 756 | MinGW Build on Linux |
| 757 | -------------------- |
| 758 | |
| 759 | cd {build_directory} |
| 760 | CC={mingw_binary_path}/i386-mingw32-gcc \ |
DRC | 68bf3f2 | 2010-10-18 07:56:14 +0000 | [diff] [blame] | 761 | cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ |
| 762 | -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \ |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 763 | -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \ |
DRC | 68bf3f2 | 2010-10-18 07:56:14 +0000 | [diff] [blame] | 764 | {source_directory} |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 765 | make |
DRC | 8b014d7 | 2010-02-18 13:03:41 +0000 | [diff] [blame] | 766 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 767 | |
| 768 | ******************************************************************************* |
| 769 | ** Creating Release Packages |
| 770 | ******************************************************************************* |
| 771 | |
| 772 | The following commands can be used to create various types of release packages: |
| 773 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 774 | |
DRC | d7a642b | 2013-04-24 06:40:25 +0000 | [diff] [blame] | 775 | Unix/Linux |
| 776 | ---------- |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 777 | |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 778 | make rpm |
| 779 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 780 | Create Red Hat-style binary RPM package. Requires RPM v4 or later. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 781 | |
| 782 | make srpm |
| 783 | |
| 784 | This runs 'make dist' to create a pristine source tarball, then creates a |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 785 | 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] | 786 | |
| 787 | make deb |
| 788 | |
| 789 | Create Debian-style binary package. Requires dpkg. |
| 790 | |
| 791 | make dmg |
| 792 | |
DRC | 377955e | 2014-03-25 05:27:16 +0000 | [diff] [blame] | 793 | Create Macintosh package/disk image. This requires pkgbuild and |
| 794 | productbuild, which are installed by default on OS X 10.7 and later and which |
| 795 | can be obtained by installing Xcode 3.2.6 (with the "Unix Development" |
| 796 | option) on OS X 10.6. Packages built in this manner can be installed on OS X |
| 797 | 10.5 and later, but they must be built on OS X 10.6 or later. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 798 | |
DRC | 9ef93db | 2010-10-18 08:24:42 +0000 | [diff] [blame] | 799 | make udmg [BUILDDIR32={32-bit build directory}] |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 800 | |
DRC | 20b734e | 2012-02-10 01:30:37 +0000 | [diff] [blame] | 801 | On 64-bit OS X systems, this creates a Macintosh package and disk image that |
| 802 | contains universal i386/x86-64 binaries. You should first configure a 32-bit |
| 803 | out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree |
| 804 | build, then run 'make udmg' from the 64-bit build directory. The build |
| 805 | system will look for the 32-bit build under {source_directory}/osxx86 by |
| 806 | default, but you can override this by setting the BUILDDIR32 variable on the |
| 807 | make command line as shown above. |
| 808 | |
| 809 | make iosdmg [BUILDDIR32={32-bit build directory}] \ |
DRC | 6e6b28c | 2014-12-19 17:34:30 +0000 | [diff] [blame] | 810 | [BUILDDIRARMV6={ARMv6 build directory}] \ |
| 811 | [BUILDDIRARMV7={ARMv7 build directory}] \ |
| 812 | [BUILDDIRARMV7S={ARMv7s build directory}] \ |
| 813 | [BUILDDIRARMV8={ARMv8 build directory}] |
DRC | 20b734e | 2012-02-10 01:30:37 +0000 | [diff] [blame] | 814 | |
| 815 | On OS X systems, this creates a Macintosh package and disk image in which the |
| 816 | libjpeg-turbo static libraries contain ARM architectures necessary to build |
| 817 | iOS applications. If building on an x86-64 system, the binaries will also |
| 818 | contain the i386 architecture, as with 'make udmg' above. You should first |
DRC | 6e6b28c | 2014-12-19 17:34:30 +0000 | [diff] [blame] | 819 | configure ARMv6, ARMv7, ARMv7s, and/or ARMv8 out-of-tree builds of |
| 820 | libjpeg-turbo (see "Building libjpeg-turbo for iOS" above.) If you are |
| 821 | building an x86-64 version of libjpeg-turbo, you should configure a 32-bit |
| 822 | out-of-tree build as well. Next, build libjpeg-turbo as you would normally, |
| 823 | using an out-of-tree build. When it is built, run 'make iosdmg' from the |
| 824 | build directory. The build system will look for the ARMv6 build under |
| 825 | {source_directory}/iosarmv6 by default, the ARMv7 build under |
| 826 | {source_directory}/iosarmv7 by default, the ARMv7s build under |
| 827 | {source_directory}/iosarmv7s by default, the ARMv8 build under |
| 828 | {source_directory}/iosarmv8 by default, and (if applicable) the 32-bit build |
| 829 | under {source_directory}/osxx86 by default, but you can override this by |
| 830 | setting the BUILDDIR32, BUILDDIRARMV6, BUILDDIRARMV7, BUILDDIRARMV7S, and/or |
| 831 | BUILDDIRARMV8 variables on the make command line as shown above. |
| 832 | |
| 833 | NOTE: If including an ARMv8 build in the package, then you may need to use |
| 834 | Xcode's version of lipo instead of the operating system's. To do this, pass |
| 835 | an argument of LIPO="xcrun lipo" on the make command line. |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 836 | |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 837 | make cygwinpkg |
| 838 | |
| 839 | Build a Cygwin binary package. |
| 840 | |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 841 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 842 | Windows |
| 843 | ------- |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 844 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 845 | If using NMake: |
DRC | 68fef83 | 2010-02-16 05:29:10 +0000 | [diff] [blame] | 846 | |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 847 | cd {build_directory} |
| 848 | nmake installer |
| 849 | |
DRC | 8154331 | 2010-10-18 07:23:58 +0000 | [diff] [blame] | 850 | If using MinGW: |
DRC | cc24374 | 2010-10-16 09:22:43 +0000 | [diff] [blame] | 851 | |
| 852 | cd {build_directory} |
| 853 | make installer |
| 854 | |
| 855 | If using the Visual Studio IDE, build the "installer" project. |
| 856 | |
| 857 | The installer package (libjpeg-turbo[-gcc][64].exe) will be located under |
| 858 | {build_directory}. If building using the Visual Studio IDE, then the installer |
| 859 | package will be located in a subdirectory with the same name as the |
| 860 | configuration you built (such as {build_directory}\Debug\ or |
| 861 | {build_directory}\Release\). |
| 862 | |
| 863 | Building a Windows installer requires the Nullsoft Install System |
| 864 | (http://nsis.sourceforge.net/.) makensis.exe should be in your PATH. |
DRC | 9cd4e4b | 2012-01-31 07:56:44 +0000 | [diff] [blame] | 865 | |
| 866 | |
| 867 | ******************************************************************************* |
| 868 | ** Regression testing |
| 869 | ******************************************************************************* |
| 870 | |
| 871 | The most common way to test libjpeg-turbo is by invoking 'make test' on |
| 872 | Unix/Linux platforms or 'ctest' on Windows platforms, once the build has |
| 873 | completed. This runs a series of tests to ensure that mathematical |
| 874 | compatibility has been maintained between libjpeg-turbo and libjpeg v6b. This |
| 875 | also invokes the TurboJPEG unit tests, which ensure that the colorspace |
| 876 | extensions, YUV encoding, decompression scaling, and other features of the |
| 877 | TurboJPEG C and Java APIs are working properly (and, by extension, that the |
| 878 | equivalent features of the underlying libjpeg API are also working.) |
| 879 | |
| 880 | Invoking 'make testclean' or 'nmake testclean' (if using NMake) or building |
| 881 | the 'testclean' target (if using the Visual Studio IDE) will clean up the |
| 882 | output images generated by 'make test'. |
| 883 | |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 884 | On Unix/Linux platforms, more extensive tests of the TurboJPEG C and Java |
DRC | 9cd4e4b | 2012-01-31 07:56:44 +0000 | [diff] [blame] | 885 | wrappers can be run by invoking 'make tjtest'. These extended TurboJPEG tests |
| 886 | essentially iterate through all of the available features of the TurboJPEG APIs |
| 887 | that are not covered by the TurboJPEG unit tests (this includes the lossless |
| 888 | transform options) and compare the images generated by each feature to images |
| 889 | generated using the equivalent feature in the libjpeg API. The extended |
| 890 | TurboJPEG tests are meant to test for regressions in the TurboJPEG wrappers, |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 891 | not in the underlying libjpeg API library. |