Unified CMake-based build system

See #56 for discussion.

Fixes #21, Fixes #29, Fixes #37, Closes #56, Fixes #58, Closes #73
Obviates #82

See also:
https://sourceforge.net/p/libjpeg-turbo/feature-requests/5/
https://sourceforge.net/p/libjpeg-turbo/patches/5/
This commit is contained in:
DRC
2016-11-15 08:47:43 -06:00
parent 9df7ac2e6a
commit 6abd39160c
158 changed files with 2386 additions and 3657 deletions

4
.gitattributes vendored Normal file
View File

@@ -0,0 +1,4 @@
/.travis.yml export-ignore
/appveyor.yml export-ignore
/ci export-ignore
/.gitattributes export-ignore

14
.gitignore vendored
View File

@@ -1,14 +0,0 @@
.DS_Store
Makefile.in
aclocal.m4
ar-lib
autom4te.cache
compile
config.guess
config.h.in
config.sub
configure
depcomp
install-sh
ltmain.sh
missing

View File

@@ -14,34 +14,37 @@ matrix:
dist: trusty
compiler: clang
env:
CFLAGS="-O1 -g -fsanitize=address -fno-omit-frame-pointer"
CONFIGURE_FLAGS="--disable-shared"
CMAKE_BUILD_TYPE=RelWithDebInfo
CFLAGS_RELWITHDEBINFO="-O1 -g -fsanitize=address -fno-omit-frame-pointer"
CMAKE_FLAGS="-DENABLE_SHARED=0"
ASAN_OPTIONS="detect_leaks=1 symbolize=1"
addons:
apt:
packages:
- nasm
- os: linux
dist: trusty
compiler: gcc
env: CONFIGURE_FLAGS="--with-12bit"
env: CMAKE_FLAGS="-DWITH_12BIT=1"
- os: linux
dist: trusty
compiler: gcc
env: CONFIGURE_FLAGS="--with-jpeg8"
env: CMAKE_FLAGS="-DWITH_JPEG8=1"
addons:
apt:
packages:
- nasm
- os: linux
dist: trusty
compiler: gcc
env: CONFIGURE_FLAGS="--without-simd"
env: CMAKE_FLAGS="-DWITH_SIMD=0"
before_install:
- if [ "${BUILD_OFFICIAL:-}" != "" ]; then
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
docker pull dcommander/buildljt;
fi &&
git clone --depth=1 https://github.com/libjpeg-turbo/buildscripts.git ~/src/buildscripts &&
git clone --depth=1 https://github.com/libjpeg-turbo/buildscripts.git -b $TRAVIS_BRANCH ~/src/buildscripts &&
openssl aes-256-cbc -K $encrypted_f92e8533f6f1_key -iv $encrypted_f92e8533f6f1_iv -in ci/keys.enc -out ci/keys -d &&
tar xf ci/keys &&
rm ci/keys &&
@@ -74,18 +77,16 @@ script:
fi
fi
- if [ "${BUILD_OFFICIAL:-}" == "" ]; then
autoreconf -fiv &&
mkdir build &&
pushd build &&
../configure ${CONFIGURE_FLAGS} &&
cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE "-DCMAKE_C_FLAGS_RELWITHDEBINFO=$CFLAGS_RELWITHDEBINFO" $CMAKE_FLAGS .. &&
make -j &&
if [[ "${CONFIGURE_FLAGS}" =~ "with-12bit" ||
"${CONFIGURE_FLAGS}" =~ "without-simd" ]]; then
make test FLOATTEST=32bit;
else
make test FLOATTEST=sse &&
JSIMD_FORCESSE2=1 make test FLOATTEST=sse &&
JSIMD_FORCENONE=1 make test FLOATTEST=32bit;
make test &&
if [[ ! "${CMAKE_FLAGS[0]}" =~ "WITH_12BIT" &&
! "${CMAKE_FLAGS[0]}" =~ "WITH_SIMD" ]]; then
JSIMD_FORCESSE2=1 make test &&
cmake -DFLOATTEST=32bit .. &&
JSIMD_FORCENONE=1 make test;
fi &&
popd;
fi

View File

@@ -1,25 +1,24 @@
Un*x Platforms (including Mac and Cygwin)
=========================================
Building libjpeg-turbo
======================
Build Requirements
------------------
- autoconf 2.56 or later
- automake 1.7 or later
- libtool 1.4 or later
* If using Xcode 4.3 or later on OS X, autoconf and automake are no longer
provided. The easiest way to obtain them is from
[MacPorts](http://www.MacPorts.org) or [Homebrew](http://brew.sh/).
### All Systems
- [CMake](http://www.cmake.org) v2.8.12 or later
- [NASM](http://www.nasm.us) or [YASM](http://yasm.tortall.net)
(if building x86 or x86-64 SIMD extensions)
* If using NASM, 2.10 or later is required.
* If using NASM, 2.10 or later (except 2.11.08) is required for an x86-64
Mac build (2.11.08 does not work properly with libjpeg-turbo's x86-64 SIMD
code when building macho64 objects.) NASM or YASM can be obtained from
* If using NASM, 2.10 or later (except 2.11.08) is required for an x86-64 Mac
build (2.11.08 does not work properly with libjpeg-turbo's x86-64 SIMD code
when building macho64 objects.) NASM or YASM can be obtained from
[MacPorts](http://www.macports.org/) or [Homebrew](http://brew.sh/).
* If using YASM, 1.2.0 or later is required.
* If building on Windows, **nasm.exe**/**yasm.exe** should be in your `PATH`.
The binary RPMs released by the NASM project do not work on older Linux
systems, such as Red Hat Enterprise Linux 5. On such systems, you can easily
@@ -35,6 +34,9 @@ Build Requirements
NOTE: the NASM build will fail if texinfo is not installed.
### Un*x Platforms (including Linux, Mac, FreeBSD, Solaris, and Cygwin)
- GCC v4.1 (or later) or Clang recommended for best performance
- If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is
@@ -46,436 +48,7 @@ Build Requirements
<http://www.java.com>.
Out-of-Tree Builds
------------------
Binary objects, libraries, and executables are generated in the directory from
which `configure` is executed (the "binary directory"), and this directory need
not necessarily be the same as the libjpeg-turbo source directory. You can
create multiple independent binary directories, in which different versions of
libjpeg-turbo can be built from the same source tree using different compilers
or settings. In the sections below, *{build_directory}* refers to the binary
directory, whereas *{source_directory}* refers to the libjpeg-turbo source
directory. For in-tree builds, these directories are the same.
Build Procedure
---------------
The following procedure will build libjpeg-turbo on Unix and Unix-like systems.
(On Solaris, this generates a 32-bit build. See "Build Recipes" below for
64-bit build instructions.)
cd {source_directory}
autoreconf -fiv
cd {build_directory}
sh {source_directory}/configure [additional configure flags]
make
NOTE: Running autoreconf in the source directory is not necessary if building
libjpeg-turbo from one of the official release tarballs.
This will generate the following files under **.libs/**:
**libjpeg.a**<br>
Static link library for the libjpeg API
**libjpeg.so.{version}** (Linux, Unix)<br>
**libjpeg.{version}.dylib** (Mac)<br>
**cygjpeg-{version}.dll** (Cygwin)<br>
Shared library for the libjpeg API
By default, *{version}* is 62.2.0, 7.2.0, or 8.1.2, depending on whether
libjpeg v6b (default), v7, or v8 emulation is enabled. If using Cygwin,
*{version}* is 62, 7, or 8.
**libjpeg.so** (Linux, Unix)<br>
**libjpeg.dylib** (Mac)<br>
Development symlink for the libjpeg API
**libjpeg.dll.a** (Cygwin)<br>
Import library for the libjpeg API
**libturbojpeg.a**<br>
Static link library for the TurboJPEG API
**libturbojpeg.so.0.1.0** (Linux, Unix)<br>
**libturbojpeg.0.1.0.dylib** (Mac)<br>
**cygturbojpeg-0.dll** (Cygwin)<br>
Shared library for the TurboJPEG API
**libturbojpeg.so** (Linux, Unix)<br>
**libturbojpeg.dylib** (Mac)<br>
Development symlink for the TurboJPEG API
**libturbojpeg.dll.a** (Cygwin)<br>
Import library for the TurboJPEG API
### libjpeg v7 or v8 API/ABI Emulation
Add `--with-jpeg7` to the `configure` command line to build a version of
libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add `--with-jpeg8`
to the `configure` command to build a version of libjpeg-turbo that is
API/ABI-compatible with libjpeg v8. See [README.md](README.md) for more
information about libjpeg v7 and v8 emulation.
### In-Memory Source/Destination Managers
When using libjpeg v6b or v7 API/ABI emulation, add `--without-mem-srcdst` to
the `configure` command line to build a version of libjpeg-turbo that lacks the
`jpeg_mem_src()` and `jpeg_mem_dest()` functions. These functions were not
part of the original libjpeg v6b and v7 APIs, so removing them ensures strict
conformance with those APIs. See [README.md](README.md) for more information.
### Arithmetic Coding Support
Since the patent on arithmetic coding has expired, this functionality has been
included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
based on the implementation in libjpeg v8, but it works when emulating libjpeg
v7 or v6b as well. The default is to enable both arithmetic encoding and
decoding, but those who have philosophical objections to arithmetic coding can
add `--without-arith-enc` or `--without-arith-dec` to the `configure` command
line to disable encoding or decoding (respectively.)
### TurboJPEG Java Wrapper
Add `--with-java` to the `configure` command line to incorporate an optional
Java Native Interface (JNI) wrapper into the TurboJPEG shared library and build
the Java front-end classes to support it. This allows the TurboJPEG shared
library to be used directly from Java applications. See
[java/README](java/README) for more details.
You can set the `JAVAC`, `JAR`, and `JAVA` configure variables to specify
alternate commands for javac, jar, and java (respectively.) You can also
set the `JAVACFLAGS` configure variable to specify arguments that should be
passed to the Java compiler when building the TurboJPEG classes, and
`JNI_CFLAGS` to specify arguments that should be passed to the C compiler when
building the JNI wrapper. Run `configure --help` for more details.
Build Recipes
-------------
### 32-bit Build on 64-bit Linux
Add
--host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32
to the `configure` command line.
### 64-bit Build on 64-bit OS X
Add
--host x86_64-apple-darwin NASM=/opt/local/bin/nasm
to the `configure` command line. NASM 2.10 or later from MacPorts or Homebrew
must be installed. If using Homebrew, then replace `/opt/local` with
`/usr/local`.
### 32-bit Build on 64-bit OS X
Add
--host i686-apple-darwin CFLAGS='-O3 -m32' LDFLAGS=-m32
to the `configure` command line.
### 64-bit Backward-Compatible Build on 64-bit OS X
Add
--host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
CFLAGS='-mmacosx-version-min=10.5 -O3' \
LDFLAGS='-mmacosx-version-min=10.5'
to the `configure` command line. NASM 2.10 or later from MacPorts or Homebrew
must be installed. If using Homebrew, then replace `/opt/local` with
`/usr/local`.
### 32-bit Backward-Compatible Build on OS X
Add
--host i686-apple-darwin \
CFLAGS='-mmacosx-version-min=10.5 -O3 -m32' \
LDFLAGS='-mmacosx-version-min=10.5 -m32'
to the `configure` command line.
### 64-bit Build on 64-bit Solaris
Add
--host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64
to the `configure` command line.
### 32-bit Build on 64-bit FreeBSD
Add
--host i386-unknown-freebsd CFLAGS='-O3 -m32' LDFLAGS=-m32
to the `configure` command line. NASM 2.07 or later from FreeBSD ports must be
installed.
### Oracle Solaris Studio
Add
CC=cc
to the `configure` command line. libjpeg-turbo will automatically be built
with the maximum optimization level (-xO5) unless you override `CFLAGS`.
To build a 64-bit version of libjpeg-turbo using Oracle Solaris Studio, add
--host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64
to the `configure` command line.
### MinGW Build on Cygwin
Use CMake (see recipes below)
Building libjpeg-turbo for iOS
------------------------------
iOS platforms, such as the iPhone and iPad, use ARM processors, and all
currently supported models include NEON instructions. Thus, they can take
advantage of libjpeg-turbo's SIMD extensions to significantly accelerate JPEG
compression/decompression. This section describes how to build libjpeg-turbo
for these platforms.
### Additional build requirements
- For configurations that require [gas-preprocessor.pl]
(https://raw.githubusercontent.com/libjpeg-turbo/gas-preprocessor/master/gas-preprocessor.pl),
it should be installed in your `PATH`.
### ARMv7 (32-bit)
**gas-preprocessor.pl required**
The following scripts demonstrate how to build libjpeg-turbo to run on the
iPhone 3GS-4S/iPad 1st-3rd Generation and newer:
#### Xcode 4.2 and earlier (LLVM-GCC)
IOS_PLATFORMDIR=/Developer/Platforms/iPhoneOS.platform
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
export host_alias=arm-apple-darwin10
export CC=${IOS_PLATFORMDIR}/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
export CFLAGS="-mfloat-abi=softfp -isysroot ${IOS_SYSROOT[0]} -O3 -march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -miphoneos-version-min=3.0"
cd {build_directory}
sh {source_directory}/configure [additional configure flags]
make
#### Xcode 4.3-4.6 (LLVM-GCC)
Same as above, but replace the first line with:
IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
#### Xcode 5 and later (Clang)
IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
export host_alias=arm-apple-darwin10
export CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
export CFLAGS="-mfloat-abi=softfp -isysroot ${IOS_SYSROOT[0]} -O3 -arch armv7 -miphoneos-version-min=3.0"
export CCASFLAGS="$CFLAGS -no-integrated-as"
cd {build_directory}
sh {source_directory}/configure [additional configure flags]
make
### ARMv7s (32-bit)
**gas-preprocessor.pl required**
The following scripts demonstrate how to build libjpeg-turbo to run on the
iPhone 5/iPad 4th Generation and newer:
#### Xcode 4.5-4.6 (LLVM-GCC)
IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
export host_alias=arm-apple-darwin10
export CC=${IOS_PLATFORMDIR}/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
export CFLAGS="-mfloat-abi=softfp -isysroot ${IOS_SYSROOT[0]} -O3 -march=armv7s -mcpu=swift -mtune=swift -mfpu=neon -miphoneos-version-min=6.0"
cd {build_directory}
sh {source_directory}/configure [additional configure flags]
make
#### Xcode 5 and later (Clang)
Same as the ARMv7 build procedure for Xcode 5 and later, except replace the
compiler flags as follows:
export CFLAGS="-mfloat-abi=softfp -isysroot ${IOS_SYSROOT[0]} -O3 -arch armv7s -miphoneos-version-min=6.0"
### ARMv8 (64-bit)
**gas-preprocessor.pl required if using Xcode < 6**
The following script demonstrates how to build libjpeg-turbo to run on the
iPhone 5S/iPad Mini 2/iPad Air and newer.
IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
export host_alias=aarch64-apple-darwin
export CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
export CFLAGS="-isysroot ${IOS_SYSROOT[0]} -O3 -arch arm64 -miphoneos-version-min=7.0 -funwind-tables"
cd {build_directory}
sh {source_directory}/configure [additional configure flags]
make
Once built, lipo can be used to combine the ARMv7, v7s, and/or v8 variants into
a universal library.
Building libjpeg-turbo for Android
----------------------------------
Building libjpeg-turbo for Android platforms requires the
[Android NDK](https://developer.android.com/tools/sdk/ndk) and autotools.
### ARMv7 (32-bit)
The following is a general recipe script that can be modified for your specific
needs.
# Set these variables to suit your needs
NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/sdk/ndk-bundle}
BUILD_PLATFORM={the platform name for the NDK package you installed--
for example, "windows-x86" or "linux-x86_64" or "darwin-x86_64"}
TOOLCHAIN_VERSION={"4.8", "4.9", "clang3.5", etc. This corresponds to a
toolchain directory under ${NDK_PATH}/toolchains/.}
ANDROID_VERSION={The minimum version of Android to support-- for example,
"16", "19", etc.}
# It should not be necessary to modify the rest
HOST=arm-linux-androideabi
SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm
ANDROID_CFLAGS="-march=armv7-a -mfloat-abi=softfp -fprefetch-loop-arrays \
--sysroot=${SYSROOT}"
TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
export CPP=${TOOLCHAIN}/bin/${HOST}-cpp
export AR=${TOOLCHAIN}/bin/${HOST}-ar
export NM=${TOOLCHAIN}/bin/${HOST}-nm
export CC=${TOOLCHAIN}/bin/${HOST}-gcc
export LD=${TOOLCHAIN}/bin/${HOST}-ld
export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib
export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump
export STRIP=${TOOLCHAIN}/bin/${HOST}-strip
cd {build_directory}
sh {source_directory}/configure --host=${HOST} \
CFLAGS="${ANDROID_CFLAGS} -O3 -fPIE" \
CPPFLAGS="${ANDROID_CFLAGS}" \
LDFLAGS="${ANDROID_CFLAGS} -pie" --with-simd ${1+"$@"}
make
### ARMv8 (64-bit)
The following is a general recipe script that can be modified for your specific
needs.
# Set these variables to suit your needs
NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/sdk/ndk-bundle}
BUILD_PLATFORM={the platform name for the NDK package you installed--
for example, "windows-x86" or "linux-x86_64" or "darwin-x86_64"}
TOOLCHAIN_VERSION={"4.8", "4.9", "clang3.5", etc. This corresponds to a
toolchain directory under ${NDK_PATH}/toolchains/.}
ANDROID_VERSION={The minimum version of Android to support. "21" or later
is required for a 64-bit build.}
# It should not be necessary to modify the rest
HOST=aarch64-linux-android
SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm64
ANDROID_CFLAGS="--sysroot=${SYSROOT}"
TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
export CPP=${TOOLCHAIN}/bin/${HOST}-cpp
export AR=${TOOLCHAIN}/bin/${HOST}-ar
export NM=${TOOLCHAIN}/bin/${HOST}-nm
export CC=${TOOLCHAIN}/bin/${HOST}-gcc
export LD=${TOOLCHAIN}/bin/${HOST}-ld
export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib
export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump
export STRIP=${TOOLCHAIN}/bin/${HOST}-strip
cd {build_directory}
sh {source_directory}/configure --host=${HOST} \
CFLAGS="${ANDROID_CFLAGS} -O3 -fPIE" \
CPPFLAGS="${ANDROID_CFLAGS}" \
LDFLAGS="${ANDROID_CFLAGS} -pie" --with-simd ${1+"$@"}
make
If building for Android 4.0.x (API level < 16) or earlier, remove `-fPIE` from
`CFLAGS` and `-pie` from `LDFLAGS`.
Installing libjpeg-turbo
------------------------
To install libjpeg-turbo after it is built, replace `make` in the build
instructions with `make install`.
The `--prefix` argument to configure (or the `prefix` configure variable) can
be used to specify an installation directory of your choosing. If you don't
specify an installation directory, then the default is to install libjpeg-turbo
under **/opt/libjpeg-turbo** and to place the libraries in
**/opt/libjpeg-turbo/lib32** (32-bit) or **/opt/libjpeg-turbo/lib64** (64-bit.)
The `bindir`, `datadir`, `docdir`, `includedir`, `libdir`, and `mandir`
configure variables allow a finer degree of control over where specific files in
the libjpeg-turbo distribution should be installed. These variables can either
be specified at configure time or passed as arguments to `make install`.
Windows (Visual C++ or MinGW)
=============================
Build Requirements
------------------
- [CMake](http://www.cmake.org) v2.8.11 or later
- [NASM](http://www.nasm.us) or [YASM](http://yasm.tortall.net)
* If using NASM, 2.10 or later is required.
* If using YASM, 1.2.0 or later is required.
* **nasm.exe**/**yasm.exe** should be in your `PATH`.
### Windows
- Microsoft Visual C++ 2005 or later
@@ -531,6 +104,53 @@ line, but all of these procedures can be adapted to the CMake GUI as
well.
### Un*x
The following procedure will build libjpeg-turbo on Unix and Unix-like systems.
(On Solaris, this generates a 32-bit build. See "Build Recipes" below for
64-bit build instructions.)
cd {build_directory}
cmake -G"Unix Makefiles" [additional CMake flags] {source_directory}
make
This will generate the following files under *{build_directory}*:
**libjpeg.a**<br>
Static link library for the libjpeg API
**libjpeg.so.{version}** (Linux, Unix)<br>
**libjpeg.{version}.dylib** (Mac)<br>
**cygjpeg-{version}.dll** (Cygwin)<br>
Shared library for the libjpeg API
By default, *{version}* is 62.2.0, 7.2.0, or 8.1.2, depending on whether
libjpeg v6b (default), v7, or v8 emulation is enabled. If using Cygwin,
*{version}* is 62, 7, or 8.
**libjpeg.so** (Linux, Unix)<br>
**libjpeg.dylib** (Mac)<br>
Development symlink for the libjpeg API
**libjpeg.dll.a** (Cygwin)<br>
Import library for the libjpeg API
**libturbojpeg.a**<br>
Static link library for the TurboJPEG API
**libturbojpeg.so.0.1.0** (Linux, Unix)<br>
**libturbojpeg.0.1.0.dylib** (Mac)<br>
**cygturbojpeg-0.dll** (Cygwin)<br>
Shared library for the TurboJPEG API
**libturbojpeg.so** (Linux, Unix)<br>
**libturbojpeg.dylib** (Mac)<br>
Development symlink for the TurboJPEG API
**libturbojpeg.dll.a** (Cygwin)<br>
Import library for the TurboJPEG API
### Visual C++ (Command Line)
cd {build_directory}
@@ -545,10 +165,10 @@ The following files will be generated under *{build_directory}*:
**jpeg-static.lib**<br>
Static link library for the libjpeg API
**sharedlib/jpeg{version}.dll**<br>
**jpeg{version}.dll**<br>
DLL for the libjpeg API
**sharedlib/jpeg.lib**<br>
**jpeg.lib**<br>
Import library for the libjpeg API
**turbojpeg-static.lib**<br>
@@ -586,10 +206,10 @@ This will generate the following files under *{build_directory}*:
**{configuration}/jpeg-static.lib**<br>
Static link library for the libjpeg API
**sharedlib/{configuration}/jpeg{version}.dll**<br>
**{configuration}/jpeg{version}.dll**<br>
DLL for the libjpeg API
**sharedlib/{configuration}/jpeg.lib**<br>
**{configuration}/jpeg.lib**<br>
Import library for the libjpeg API
**{configuration}/turbojpeg-static.lib**<br>
@@ -621,10 +241,10 @@ This will generate the following files under *{build_directory}*:
**libjpeg.a**<br>
Static link library for the libjpeg API
**sharedlib/libjpeg-{version}.dll**<br>
**libjpeg-{version}.dll**<br>
DLL for the libjpeg API
**sharedlib/libjpeg.dll.a**<br>
**libjpeg.dll.a**<br>
Import library for the libjpeg API
**libturbojpeg.a**<br>
@@ -689,15 +309,42 @@ build/test libjpeg-turbo, then (prior to running CMake) set the `JAVA_HOME`
environment variable to the location of the JDK that you wish to use. The
`Java_JAVAC_EXECUTABLE`, `Java_JAVA_EXECUTABLE`, and `Java_JAR_EXECUTABLE`
CMake variables can also be used to specify alternate commands or locations for
javac, jar, and java (respectively.) You can also set the `JAVACFLAGS` CMake
javac, jar, and java (respectively.) You can also set the
`CMAKE_JAVA_COMPILE_FLAGS` CMake variable or the `JAVAFLAGS` environment
variable to specify arguments that should be passed to the Java compiler when
building the TurboJPEG classes.
building the TurboJPEG classes, and the `JAVAARGS` CMake variable to specify
arguments that should be passed to the JRE when running the TurboJPEG Java unit
tests.
Build Recipes
-------------
### 32-bit Build on 64-bit Linux/Unix/Mac
Use export/setenv to set the following environment variables before running
CMake:
CFLAGS=-m32
LDFLAGS=-m32
### 64-bit Build on Solaris
Use export/setenv to set the following environment variables before running
CMake:
CFLAGS=-m64
LDFLAGS=-m64
### Other Compilers
On Un*x systems, prior to running CMake, you can set the `CC` environment
variable to the command used to invoke the C compiler.
### 32-bit MinGW Build on Un*x (including Mac and Cygwin)
Create a file called **toolchain.cmake** under *{build_directory}*, with the
@@ -736,8 +383,235 @@ located (usually **/usr/bin**.) Next, execute the following commands:
make
Building libjpeg-turbo for iOS
------------------------------
iOS platforms, such as the iPhone and iPad, use ARM processors, and all
currently supported models include NEON instructions. Thus, they can take
advantage of libjpeg-turbo's SIMD extensions to significantly accelerate JPEG
compression/decompression. This section describes how to build libjpeg-turbo
for these platforms.
### Additional build requirements
- For configurations that require [gas-preprocessor.pl]
(https://raw.githubusercontent.com/libjpeg-turbo/gas-preprocessor/master/gas-preprocessor.pl),
it should be installed in your `PATH`.
### ARMv7 (32-bit)
**gas-preprocessor.pl required**
The following scripts demonstrate how to build libjpeg-turbo to run on the
iPhone 3GS-4S/iPad 1st-3rd Generation and newer:
#### Xcode 4.2 and earlier (LLVM-GCC)
IOS_PLATFORMDIR=/Developer/Platforms/iPhoneOS.platform
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
export CFLAGS="-mfloat-abi=softfp -march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -miphoneos-version-min=3.0"
cat <<EOF >toolchain.cmake
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_COMPILER ${IOS_PLATFORMDIR}/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2)
EOF
cd {build_directory}
cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake \
-DCMAKE_OSX_SYSROOT=${IOS_SYSROOT[0]} \
[additional CMake flags] {source_directory}
make
#### Xcode 4.3-4.6 (LLVM-GCC)
Same as above, but replace the first line with:
IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
#### Xcode 5 and later (Clang)
IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
export CFLAGS="--mfloat-abi=softfp -arch armv7 -miphoneos-version-min=3.0"
export ASMFLAGS="-no-integrated-as"
cat <<EOF >toolchain.cmake
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_COMPILER /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang)
EOF
cd {build_directory}
cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake \
-DCMAKE_OSX_SYSROOT=${IOS_SYSROOT[0]} \
[additional CMake flags] {source_directory}
make
### ARMv7s (32-bit)
**gas-preprocessor.pl required**
The following scripts demonstrate how to build libjpeg-turbo to run on the
iPhone 5/iPad 4th Generation and newer:
#### Xcode 4.5-4.6 (LLVM-GCC)
IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
export CFLAGS="-Wall -mfloat-abi=softfp -march=armv7s -mcpu=swift -mtune=swift -mfpu=neon -miphoneos-version-min=6.0"
cat <<EOF >toolchain.cmake
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_COMPILER ${IOS_PLATFORMDIR}/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2)
EOF
cd {build_directory}
cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake \
-DCMAKE_OSX_SYSROOT=${IOS_SYSROOT[0]} \
[additional CMake flags] {source_directory}
make
#### Xcode 5 and later (Clang)
Same as the ARMv7 build procedure for Xcode 5 and later, except replace the
compiler flags as follows:
export CFLAGS="-Wall -mfloat-abi=softfp -arch armv7s -miphoneos-version-min=6.0"
### ARMv8 (64-bit)
**gas-preprocessor.pl required if using Xcode < 6**
The following script demonstrates how to build libjpeg-turbo to run on the
iPhone 5S/iPad Mini 2/iPad Air and newer.
IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
export CFLAGS="-Wall -arch arm64 -miphoneos-version-min=7.0 -funwind-tables"
cat <<EOF >toolchain.cmake
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_C_COMPILER /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang)
EOF
cd {build_directory}
cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake \
-DCMAKE_OSX_SYSROOT=${IOS_SYSROOT[0]} \
[additional CMake flags] {source_directory}
make
Once built, lipo can be used to combine the ARMv7, v7s, and/or v8 variants into
a universal library.
Building libjpeg-turbo for Android
----------------------------------
Building libjpeg-turbo for Android platforms requires the
[Android NDK](https://developer.android.com/tools/sdk/ndk).
### ARMv7 (32-bit)
The following is a general recipe script that can be modified for your specific
needs.
# Set these variables to suit your needs
NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/sdk/ndk-bundle}
BUILD_PLATFORM={the platform name for the NDK package you installed--
for example, "windows-x86" or "linux-x86_64" or "darwin-x86_64"}
TOOLCHAIN_VERSION={"4.8", "4.9", "clang3.5", etc. This corresponds to a
toolchain directory under ${NDK_PATH}/toolchains/.}
ANDROID_VERSION={The minimum version of Android to support-- for example,
"16", "19", etc.}
# It should not be necessary to modify the rest
HOST=arm-linux-androideabi
SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm
export CFLAGS="-march=armv7-a -mfloat-abi=softfp -fprefetch-loop-arrays --sysroot=${SYSROOT}"
export LDFLAGS=-pie
TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
cat <<EOF >android.cmake
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_COMPILER ${TOOLCHAIN}/bin/${HOST}-gcc)
set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN}/${HOST})
EOF
cd {build_directory}
cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake \
-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
[additional CMake flags] {source_directory}
make
### ARMv8 (64-bit)
The following is a general recipe script that can be modified for your specific
needs.
# Set these variables to suit your needs
NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/sdk/ndk-bundle}
BUILD_PLATFORM={the platform name for the NDK package you installed--
for example, "windows-x86" or "linux-x86_64" or "darwin-x86_64"}
TOOLCHAIN_VERSION={"4.8", "4.9", "clang3.5", etc. This corresponds to a
toolchain directory under ${NDK_PATH}/toolchains/.}
ANDROID_VERSION={The minimum version of Android to support. "21" or later
is required for a 64-bit build.}
# It should not be necessary to modify the rest
HOST=aarch64-linux-android
SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm64
export CFLAGS="--sysroot ${SYSROOT}"
export LDFLAGS=-pie
TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
cat <<EOF >toolchain.cmake
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_C_COMPILER ${TOOLCHAIN}/bin/${HOST}-gcc)
set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN}/${HOST})
EOF
cd {build_directory}
cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake \
-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
[additional CMake flags] {source_directory}
make
If building for Android 4.0.x (API level < 16) or earlier, remove
`-DCMAKE_POSITION_INDEPENDENT_CODE=1` from the CMake arguments and `-pie` from
`LDFLAGS`.
Advanced CMake Options
----------------------
To list and configure other CMake options not specifically mentioned in this
guide, run
ccmake {source_directory}
or
cmake-gui {source_directory}
from the build directory after initially configuring the build. CCMake is a
text-based interactive version of CMake, and CMake-GUI is a GUI version. Both
will display all variables that are relevant to the libjpeg-turbo build, their
current values, and a help string describing what they do.
Installing libjpeg-turbo
------------------------
========================
You can use the build system to install libjpeg-turbo (as opposed to creating
an installer package.) To do this, run `make install` or `nmake install`
@@ -761,6 +635,14 @@ MinGW 32-bit build
**c:\libjpeg-turbo-gcc64**<br>
MinGW 64-bit build
**/opt/libjpeg-turbo**<br>
Un*x
The `BINDIR`, `DATADIR`, `DOCDIR`, `INCLUDEDIR`, `LIBDIR`, and `MANDIR`
CMake variables allow a finer degree of control over where specific files in
the libjpeg-turbo distribution should be installed.
Creating Distribution Packages
==============================
@@ -797,40 +679,31 @@ installing Xcode 3.2.6 (with the "Unix Development" option) on OS X 10.6.
Packages built in this manner can be installed on OS X 10.5 and later, but they
must be built on OS X 10.6 or later.
make udmg [BUILDDIR32={32-bit build directory}]
make udmg
On 64-bit OS X systems, this creates a Mac package/disk image that contains
universal i386/x86-64 binaries. You should first configure a 32-bit
out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree build,
then run `make udmg` from the 64-bit build directory. The build system will
look for the 32-bit build under *{source_directory}*/osxx86 by default, but you
can override this by setting the `BUILDDIR32` variable on the make command line
as shown above.
This creates a Mac package/disk image that contains universal x86-64/i386/ARM
binaries. The following CMake variables control which architectures are
included in the universal binaries. Setting any of these variables to an empty
string excludes that architecture from the package.
make iosdmg [BUILDDIR32={32-bit build directory}] \
[BUILDDIRARMV7={ARMv7 build directory}] \
[BUILDDIRARMV7S={ARMv7s build directory}] \
[BUILDDIRARMV8={ARMv8 build directory}]
* `OSX_32BIT_BUILD`: Directory containing an i386 (32-bit) Mac build of
libjpeg-turbo (default: *{source_directory}*/osxx86)
* `IOS_ARMV7_BUILD`: Directory containing an ARMv7 (32-bit) iOS build of
libjpeg-turbo (default: *{source_directory}*/iosarmv7)
* `IOS_ARMV7S_BUILD`: Directory containing an ARMv7s (32-bit) iOS build of
libjpeg-turbo (default: *{source_directory}*/iosarmv7s)
* `IOS_ARMV8_BUILD`: Directory containing an ARMv8 (64-bit) iOS build of
libjpeg-turbo (default: *{source_directory}*/iosarmv8)
This creates a Mac package/disk image in which the libjpeg-turbo libraries
contain ARM architectures necessary to build iOS applications. If building on
an x86-64 system, the binaries will also contain the i386 architecture, as with
`make udmg` above. You should first configure ARMv7, ARMv7s, and/or ARMv8
out-of-tree builds of libjpeg-turbo (see "Building libjpeg-turbo for iOS"
above.) If you are building an x86-64 version of libjpeg-turbo, you should
configure a 32-bit out-of-tree build as well. Next, build libjpeg-turbo as you
would normally, using an out-of-tree build. When it is built, run `make
iosdmg` from the build directory. The build system will look for the ARMv7
build under *{source_directory}*/iosarmv7 by default, the ARMv7s build under
*{source_directory}*/iosarmv7s by default, the ARMv8 build under
*{source_directory}*/iosarmv8 by default, and (if applicable) the 32-bit build
under *{source_directory}*/osxx86 by default, but you can override this by
setting the `BUILDDIR32`, `BUILDDIRARMV7`, `BUILDDIRARMV7S`, and/or
`BUILDDIRARMV8` variables on the `make` command line as shown above.
NOTE: If including an ARMv8 build in the package, then you may need to use
Xcode's version of lipo instead of the operating system's. To do this, pass
an argument of `LIPO="xcrun lipo"` on the make command line.
You should first use CMake to configure i386, ARMv7, ARMv7s, and/or ARMv8
sub-builds of libjpeg-turbo (see "Build Recipes" and "Building libjpeg-turbo
for iOS" above) in build directories that match those specified in the
aforementioned CMake variables. Next, configure the primary build of
libjpeg-turbo as an out-of-tree build, and build it. Once the primary build
has been built, run `make udmg` from the build directory. The packaging system
will build the sub-builds, use lipo to combine them into a single set of
universal binaries, then package the universal binaries in the same manner as
`make dmg`.
make cygwinpkg

File diff suppressed because it is too large Load Diff

View File

@@ -10,6 +10,29 @@ and 8-16% when using 32-bit code, and the decompression of RGB images by
approximately 6-15% when using 64-bit code and 4-12% when using 32-bit code.
(As tested on a 3 GHz Intel Core i7. Actual mileage may vary.)
2. Overhauled the build system to use CMake on all platforms, and removed the
autotools-based build system. This decision resulted from extensive
discussions within the libjpeg-turbo community. libjpeg-turbo traditionally
used CMake only for Windows builds, but there was an increasing amount of
demand to extend CMake support to other platforms. However, because of the
unique nature of our code base (the need to support different assemblers on
each platform, the need for Java support, etc.), providing dual build systems
as other OSS imaging libraries do (including libpng and libtiff) would have
created a maintenance burden. The use of CMake greatly simplifies some aspects
of our build system, owing to CMake's built-in support for various assemblers,
Java, and unit testing, as well as generally fewer quirks that have to be
worked around in order to implement our packaging system. Eliminating
autotools puts our project slightly at odds with the traditional practices of
the OSS community, since most "system libraries" tend to be built with
autotools, but it is believed that the benefits of this move outweigh the
risks. In addition to providing a unified build environment, switching to
CMake allows for the use of various build tools and IDEs that aren't supported
under autotools, including XCode, Ninja, and Eclipse. It also eliminates the
need to install autotools via MacPorts/Homebrew on OS X and allows
libjpeg-turbo to be configured without the use of a terminal/command prompt.
Extensive testing was conducted to ensure that all features provided by the
autotools-based build system are provided by the new build system.
1.5.2
=====

View File

@@ -12,7 +12,8 @@ libjpeg-turbo is covered by three compatible BSD-style open source licenses:
- The Modified (3-clause) BSD License, which is listed in
[turbojpeg.c](turbojpeg.c)
This license covers the TurboJPEG API library and associated programs.
This license covers the TurboJPEG API library and associated programs, as
well as the build system.
- The zlib License, which is listed in [simd/jsimdext.inc](simd/jsimdext.inc)

View File

@@ -1,792 +0,0 @@
lib_LTLIBRARIES = libjpeg.la
libjpeg_la_LDFLAGS = -version-info ${LIBTOOL_CURRENT}:${SO_MINOR_VERSION}:${SO_AGE} -no-undefined
include_HEADERS = jerror.h jmorecfg.h jpeglib.h
if WITH_TURBOJPEG
lib_LTLIBRARIES += libturbojpeg.la
libturbojpeg_la_LDFLAGS = -version-info 1:0:1 -no-undefined
include_HEADERS += turbojpeg.h
endif
nodist_include_HEADERS = jconfig.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = pkgscripts/libjpeg.pc
if WITH_TURBOJPEG
pkgconfig_DATA += pkgscripts/libturbojpeg.pc
endif
HDRS = jchuff.h jdct.h jdhuff.h jerror.h jinclude.h jmemsys.h jmorecfg.h \
jpegint.h jpeglib.h jversion.h jsimd.h jsimddct.h jpegcomp.h \
jpeg_nbits_table.h
libjpeg_la_SOURCES = $(HDRS) jcapimin.c jcapistd.c jccoefct.c jccolor.c \
jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
jcomapi.c jcparam.c jcphuff.c jcprepct.c jcsample.c jctrans.c \
jdapimin.c jdapistd.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c \
jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c \
jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c
if WITH_ARITH
libjpeg_la_SOURCES += jaricom.c
endif
if WITH_ARITH_ENC
libjpeg_la_SOURCES += jcarith.c
endif
if WITH_ARITH_DEC
libjpeg_la_SOURCES += jdarith.c
endif
SUBDIRS = java
if WITH_TURBOJPEG
libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) turbojpeg.c turbojpeg.h \
transupp.c transupp.h jdatadst-tj.c jdatasrc-tj.c
if WITH_JAVA
libturbojpeg_la_SOURCES += turbojpeg-jni.c
libturbojpeg_la_CFLAGS = ${JNI_CFLAGS}
TJMAPFILE = turbojpeg-mapfile.jni
else
TJMAPFILE = turbojpeg-mapfile
endif
libturbojpeg_la_SOURCES += $(TJMAPFILE)
if VERSION_SCRIPT
libturbojpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)$(srcdir)/$(TJMAPFILE)
endif
endif
if VERSION_SCRIPT
libjpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)libjpeg.map
endif
if WITH_SIMD
SUBDIRS += simd
libjpeg_la_LIBADD = simd/libsimd.la
libturbojpeg_la_LIBADD = simd/libsimd.la
else
libjpeg_la_SOURCES += jsimd_none.c
endif
bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom
noinst_PROGRAMS = jcstest
if WITH_TURBOJPEG
bin_PROGRAMS += tjbench
noinst_PROGRAMS += tjunittest
tjbench_SOURCES = tjbench.c bmp.h bmp.c tjutil.h tjutil.c rdbmp.c rdppm.c \
wrbmp.c wrppm.c
tjbench_LDADD = libturbojpeg.la libjpeg.la -lm
tjbench_CFLAGS = -DBMP_SUPPORTED -DPPM_SUPPORTED
tjunittest_SOURCES = tjunittest.c tjutil.h tjutil.c
tjunittest_LDADD = libturbojpeg.la
endif
cjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdgif.c rdppm.c rdswitch.c
if WITH_12BIT
else
cjpeg_SOURCES += rdbmp.c rdtarga.c
endif
cjpeg_LDADD = libjpeg.la
cjpeg_CFLAGS = -DGIF_SUPPORTED -DPPM_SUPPORTED
if WITH_12BIT
else
cjpeg_CFLAGS += -DBMP_SUPPORTED -DTARGA_SUPPORTED
endif
djpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c rdswitch.c \
wrgif.c wrppm.c
if WITH_12BIT
else
djpeg_SOURCES += wrbmp.c wrtarga.c
endif
djpeg_LDADD = libjpeg.la
djpeg_CFLAGS = -DGIF_SUPPORTED -DPPM_SUPPORTED
if WITH_12BIT
else
djpeg_CFLAGS += -DBMP_SUPPORTED -DTARGA_SUPPORTED
endif
jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c transupp.h
jpegtran_LDADD = libjpeg.la
rdjpgcom_SOURCES = rdjpgcom.c
rdjpgcom_LDADD = libjpeg.la
wrjpgcom_SOURCES = wrjpgcom.c
wrjpgcom_LDADD = libjpeg.la
jcstest_SOURCES = jcstest.c
jcstest_LDADD = libjpeg.la
dist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
DOCS= coderules.txt jconfig.txt change.log rdrle.c wrrle.c BUILDING.md \
ChangeLog.md
dist_doc_DATA = README.ijg README.md libjpeg.txt structure.txt usage.txt \
wizard.txt LICENSE.md
exampledir = $(docdir)
dist_example_DATA = example.c
EXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \
sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \
doxygen-extra.css jccolext.c jdcolext.c jdcol565.c jdmrgext.c jdmrg565.c \
jstdhuff.c jdcoefct.h jdmainct.h jdmaster.h jdsample.h wrppm.h \
md5/CMakeLists.txt
dist-hook:
rm -rf `find $(distdir) -name .svn`
SUBDIRS += md5
if WITH_12BIT
TESTORIG = testorig12.jpg
MD5_JPEG_RGB_ISLOW = 9620f424569594bb9242b48498ad801f
MD5_PPM_RGB_ISLOW = f3301d2219783b8b3d942b7239fa50c0
MD5_JPEG_422_IFAST_OPT = 7322e3bd2f127f7de4b40d4480ce60e4
MD5_PPM_422_IFAST = 79807fa552899e66a04708f533e16950
MD5_PPM_422M_IFAST = 07737bfe8a7c1c87aaa393a0098d16b0
MD5_JPEG_420_IFAST_Q100_PROG = a1da220b5604081863a504297ed59e55
MD5_PPM_420_Q100_IFAST = 1b3730122709f53d007255e8dfd3305e
MD5_PPM_420M_Q100_IFAST = 980a1a3c5bf9510022869d30b7d26566
MD5_JPEG_GRAY_ISLOW = 235c90707b16e2e069f37c888b2636d9
MD5_PPM_GRAY_ISLOW = 7213c10af507ad467da5578ca5ee1fca
MD5_PPM_GRAY_ISLOW_RGB = e96ee81c30a6ed422d466338bd3de65d
MD5_JPEG_420S_IFAST_OPT = 7af8e60be4d9c227ec63ac9b6630855e
MD5_JPEG_3x2_FLOAT_PROG_SSE = a8c17daf77b457725ec929e215b603f8
MD5_PPM_3x2_FLOAT_SSE = 42876ab9e5c2f76a87d08db5fbd57956
MD5_JPEG_3x2_FLOAT_PROG_32BIT = a8c17daf77b457725ec929e215b603f8
MD5_PPM_3x2_FLOAT_32BIT = 42876ab9e5c2f76a87d08db5fbd57956
MD5_PPM_3x2_FLOAT_64BIT = d6fbc71153b3d8ded484dbc17c7b9cf4
MD5_JPEG_3x2_FLOAT_PROG_387 = bc6dbbefac2872f6b9d6c4a0ae60c3c0
MD5_PPM_3x2_FLOAT_387 = bcc5723c61560463ac60f772e742d092
MD5_JPEG_3x2_IFAST_PROG = 1396cc2b7185cfe943d408c9d305339e
MD5_PPM_3x2_IFAST = 3975985ef6eeb0a2cdc58daa651ccc00
MD5_PPM_420M_ISLOW_2_1 = 4ca6be2a6f326ff9eaab63e70a8259c0
MD5_PPM_420M_ISLOW_15_8 = 12aa9f9534c1b3d7ba047322226365eb
MD5_PPM_420M_ISLOW_13_8 = f7e22817c7b25e1393e4ec101e9d4e96
MD5_PPM_420M_ISLOW_11_8 = 800a16f9f4dc9b293197bfe11be10a82
MD5_PPM_420M_ISLOW_9_8 = 06b7a92a9bc69f4dc36ec40f1937d55c
MD5_PPM_420M_ISLOW_7_8 = 3ec444a14a4ab4eab88ffc49c48eca43
MD5_PPM_420M_ISLOW_3_4 = 3e726b7ea872445b19437d1c1d4f0d93
MD5_PPM_420M_ISLOW_5_8 = a8a771abdc94301d20ffac119b2caccd
MD5_PPM_420M_ISLOW_1_2 = b419124dd5568b085787234866102866
MD5_PPM_420M_ISLOW_3_8 = 343d19015531b7bbe746124127244fa8
MD5_PPM_420M_ISLOW_1_4 = 35fd59d866e44659edfa3c18db2a3edb
MD5_PPM_420M_ISLOW_1_8 = ccaed48ac0aedefda5d4abe4013f4ad7
MD5_PPM_420_ISLOW_SKIP15_31 = 86664cd9dc956536409e44e244d20a97
MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 = 452a21656115a163029cfba5c04fa76a
MD5_PPM_444_ISLOW_SKIP1_6 = ef63901f71ef7a75cd78253fc0914f84
MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 = 15b173fb5872d9575572fbcc1b05956f
MD5_JPEG_CROP = cdb35ff4b4519392690ea040c56ea99c
else
TESTORIG = testorig.jpg
MD5_JPEG_RGB_ISLOW = 768e970dd57b340ff1b83c9d3d47c77b
MD5_PPM_RGB_ISLOW = 00a257f5393fef8821f2b88ac7421291
MD5_BMP_RGB_ISLOW_565 = f07d2e75073e4bb10f6c6f4d36e2e3be
MD5_BMP_RGB_ISLOW_565D = 4cfa0928ef3e6bb626d7728c924cfda4
MD5_JPEG_422_IFAST_OPT = 2540287b79d913f91665e660303ab2c8
MD5_PPM_422_IFAST = 35bd6b3f833bad23de82acea847129fa
MD5_PPM_422M_IFAST = 8dbc65323d62cca7c91ba02dd1cfa81d
MD5_BMP_422M_IFAST_565 = 3294bd4d9a1f2b3d08ea6020d0db7065
MD5_BMP_422M_IFAST_565D = da98c9c7b6039511be4a79a878a9abc1
MD5_JPEG_420_IFAST_Q100_PROG = 990cbe0329c882420a2094da7e5adade
MD5_PPM_420_Q100_IFAST = 5a732542015c278ff43635e473a8a294
MD5_PPM_420M_Q100_IFAST = ff692ee9323a3b424894862557c092f1
MD5_JPEG_GRAY_ISLOW = 72b51f894b8f4a10b3ee3066770aa38d
MD5_PPM_GRAY_ISLOW = 8d3596c56eace32f205deccc229aa5ed
MD5_PPM_GRAY_ISLOW_RGB = 116424ac07b79e5e801f00508eab48ec
MD5_BMP_GRAY_ISLOW_565 = 12f78118e56a2f48b966f792fedf23cc
MD5_BMP_GRAY_ISLOW_565D = bdbbd616441a24354c98553df5dc82db
MD5_JPEG_420S_IFAST_OPT = 388708217ac46273ca33086b22827ed8
# See README.md for more details on why this next bit is necessary.
MD5_JPEG_3x2_FLOAT_PROG_SSE = 343e3f8caf8af5986ebaf0bdc13b5c71
MD5_PPM_3x2_FLOAT_SSE = 1a75f36e5904d6fc3a85a43da9ad89bb
MD5_JPEG_3x2_FLOAT_PROG_32BIT = 9bca803d2042bd1eb03819e2bf92b3e5
MD5_PPM_3x2_FLOAT_32BIT = f6bfab038438ed8f5522fbd33595dcdc
MD5_PPM_3x2_FLOAT_64BIT = 0e917a34193ef976b679a6b069b1be26
MD5_JPEG_3x2_FLOAT_PROG_387 = 1657664a410e0822c924b54f6f65e6e9
MD5_PPM_3x2_FLOAT_387 = cb0a1f027f3d2917c902b5640214e025
MD5_JPEG_3x2_IFAST_PROG = 1ee5d2c1a77f2da495f993c8c7cceca5
MD5_PPM_3x2_IFAST = fd283664b3b49127984af0a7f118fccd
MD5_JPEG_420_ISLOW_ARI = e986fb0a637a8d833d96e8a6d6d84ea1
MD5_JPEG_444_ISLOW_PROGARI = 0a8f1c8f66e113c3cf635df0a475a617
MD5_PPM_420M_IFAST_ARI = 72b59a99bcf1de24c5b27d151bde2437
MD5_JPEG_420_ISLOW = 9a68f56bc76e466aa7e52f415d0f4a5f
MD5_PPM_420M_ISLOW_2_1 = 9f9de8c0612f8d06869b960b05abf9c9
MD5_PPM_420M_ISLOW_15_8 = b6875bc070720b899566cc06459b63b7
MD5_PPM_420M_ISLOW_13_8 = bc3452573c8152f6ae552939ee19f82f
MD5_PPM_420M_ISLOW_11_8 = d8cc73c0aaacd4556569b59437ba00a5
MD5_PPM_420M_ISLOW_9_8 = d25e61bc7eac0002f5b393aa223747b6
MD5_PPM_420M_ISLOW_7_8 = ddb564b7c74a09494016d6cd7502a946
MD5_PPM_420M_ISLOW_3_4 = 8ed8e68808c3fbc4ea764fc9d2968646
MD5_PPM_420M_ISLOW_5_8 = a3363274999da2366a024efae6d16c9b
MD5_PPM_420M_ISLOW_1_2 = e692a315cea26b988c8e8b29a5dbcd81
MD5_PPM_420M_ISLOW_3_8 = 79eca9175652ced755155c90e785a996
MD5_PPM_420M_ISLOW_1_4 = 79cd778f8bf1a117690052cacdd54eca
MD5_PPM_420M_ISLOW_1_8 = 391b3d4aca640c8567d6f8745eb2142f
MD5_BMP_420_ISLOW_256 = 4980185e3776e89bd931736e1cddeee6
MD5_BMP_420_ISLOW_565 = bf9d13e16c4923b92e1faa604d7922cb
MD5_BMP_420_ISLOW_565D = 6bde71526acc44bcff76f696df8638d2
MD5_BMP_420M_ISLOW_565 = 8dc0185245353cfa32ad97027342216f
MD5_BMP_420M_ISLOW_565D =d1be3a3339166255e76fa50a0d70d73e
MD5_PPM_420_ISLOW_SKIP15_31 = c4c65c1e43d7275cd50328a61e6534f0
MD5_PPM_420_ISLOW_ARI_SKIP16_139 = 087c6b123db16ac00cb88c5b590bb74a
MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 = 26eb36ccc7d1f0cb80cdabb0ac8b5d99
MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4 = 886c6775af22370257122f8b16207e6d
MD5_PPM_444_ISLOW_SKIP1_6 = 5606f86874cf26b8fcee1117a0a436a6
MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 = db87dc7ce26bcdc7a6b56239ce2b9d6c
MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0 = cb57b32bd6d03e35432362f7bf184b6d
MD5_JPEG_CROP = b4197f377e621c4e9b1d20471432610d
endif
.PHONY: test
test: tjquicktest tjbittest bittest
if CROSS_COMPILING
tjquicktest: testclean
else
tjquicktest: testclean all
endif
if WITH_TURBOJPEG
if WITH_JAVA
$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest
$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -bi
$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv
$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv -noyuvpad
$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv -bi
$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv -bi -noyuvpad
endif
./tjunittest
./tjunittest -alloc
./tjunittest -yuv
./tjunittest -yuv -alloc
./tjunittest -yuv -noyuvpad
endif
echo GREAT SUCCESS!
if CROSS_COMPILING
tjbittest: testclean
else
tjbittest: testclean all
endif
if WITH_TURBOJPEG
MD5_PPM_GRAY_TILE = 89d3ca21213d9d864b50b4e4e7de4ca6
MD5_PPM_420_8x8_TILE = 847fceab15c5b7b911cb986cf0f71de3
MD5_PPM_420_16x16_TILE = ca45552a93687e078f7137cc4126a7b0
MD5_PPM_420_32x32_TILE = d8676f1d6b68df358353bba9844f4a00
MD5_PPM_420_64x64_TILE = 4e4c1a3d7ea4bace4f868bcbe83b7050
MD5_PPM_420_128x128_TILE = f24c3429c52265832beab9df72a0ceae
MD5_PPM_420M_8x8_TILE = bc25320e1f4c31ce2e610e43e9fd173c
MD5_PPM_420M_TILE = 75ffdf14602258c5c189522af57fa605
MD5_PPM_422_8x8_TILE = d83dacd9fc73b0a6f10c09acad64eb1e
MD5_PPM_422_16x16_TILE = 35077fb610d72dd743b1eb0cbcfe10fb
MD5_PPM_422_32x32_TILE = e6902ed8a449ecc0f0d6f2bf945f65f7
MD5_PPM_422_64x64_TILE = 2b4502a8f316cedbde1da7bce3d2231e
MD5_PPM_422_128x128_TILE = f0b5617d578f5e13c8eee215d64d4877
MD5_PPM_422M_8x8_TILE = 828941d7f41cd6283abd6beffb7fd51d
MD5_PPM_422M_TILE = e877ae1324c4a280b95376f7f018172f
MD5_PPM_444_TILE = 7964e41e67cfb8d0a587c0aa4798f9c3
# Test compressing from/decompressing to an arbitrary subregion of a larger
# image buffer
cp $(srcdir)/testimages/testorig.ppm testout_tile.ppm
./tjbench testout_tile.ppm 95 -rgb -quiet -tile -benchtime 0.01 >/dev/null 2>&1
for i in 8 16 32 64 128; do \
md5/md5cmp $(MD5_PPM_GRAY_TILE) testout_tile_GRAY_Q95_$$i\x$$i.ppm; \
done
md5/md5cmp $(MD5_PPM_420_8x8_TILE) testout_tile_420_Q95_8x8.ppm
md5/md5cmp $(MD5_PPM_420_16x16_TILE) testout_tile_420_Q95_16x16.ppm
md5/md5cmp $(MD5_PPM_420_32x32_TILE) testout_tile_420_Q95_32x32.ppm
md5/md5cmp $(MD5_PPM_420_64x64_TILE) testout_tile_420_Q95_64x64.ppm
md5/md5cmp $(MD5_PPM_420_128x128_TILE) testout_tile_420_Q95_128x128.ppm
md5/md5cmp $(MD5_PPM_422_8x8_TILE) testout_tile_422_Q95_8x8.ppm
md5/md5cmp $(MD5_PPM_422_16x16_TILE) testout_tile_422_Q95_16x16.ppm
md5/md5cmp $(MD5_PPM_422_32x32_TILE) testout_tile_422_Q95_32x32.ppm
md5/md5cmp $(MD5_PPM_422_64x64_TILE) testout_tile_422_Q95_64x64.ppm
md5/md5cmp $(MD5_PPM_422_128x128_TILE) testout_tile_422_Q95_128x128.ppm
for i in 8 16 32 64 128; do \
md5/md5cmp $(MD5_PPM_444_TILE) testout_tile_444_Q95_$$i\x$$i.ppm; \
done
rm -f testout_tile_GRAY_* testout_tile_420_* testout_tile_422_* testout_tile_444_*
./tjbench testout_tile.ppm 95 -rgb -fastupsample -quiet -tile -benchtime 0.01 >/dev/null 2>&1
md5/md5cmp $(MD5_PPM_420M_8x8_TILE) testout_tile_420_Q95_8x8.ppm
for i in 16 32 64 128; do \
md5/md5cmp $(MD5_PPM_420M_TILE) testout_tile_420_Q95_$$i\x$$i.ppm; \
done
md5/md5cmp $(MD5_PPM_422M_8x8_TILE) testout_tile_422_Q95_8x8.ppm
for i in 16 32 64 128; do \
md5/md5cmp $(MD5_PPM_422M_TILE) testout_tile_422_Q95_$$i\x$$i.ppm; \
done
rm -f testout_tile_GRAY_* testout_tile_420_* testout_tile_422_* testout_tile_444_* testout_tile.ppm
echo GREAT SUCCESS!
endif
if CROSS_COMPILING
bittest: testclean
else
bittest: testclean all
endif
# These tests are carefully crafted to provide full coverage of as many of the
# underlying algorithms as possible (including all of the SIMD-accelerated
# ones.)
# CC: null SAMP: fullsize FDCT: islow ENT: huff
./cjpeg -rgb -dct int -outfile testout_rgb_islow.jpg $(srcdir)/testimages/testorig.ppm
md5/md5cmp $(MD5_JPEG_RGB_ISLOW) testout_rgb_islow.jpg
# CC: null SAMP: fullsize IDCT: islow ENT: huff
./djpeg -dct int -ppm -outfile testout_rgb_islow.ppm testout_rgb_islow.jpg
md5/md5cmp $(MD5_PPM_RGB_ISLOW) testout_rgb_islow.ppm
rm -f testout_rgb_islow.ppm
if WITH_12BIT
rm -f testout_rgb_islow.jpg
else
# CC: RGB->RGB565 SAMP: fullsize IDCT: islow ENT: huff
./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_rgb_islow_565.bmp testout_rgb_islow.jpg
md5/md5cmp $(MD5_BMP_RGB_ISLOW_565) testout_rgb_islow_565.bmp
rm -f testout_rgb_islow_565.bmp
# CC: RGB->RGB565 (dithered) SAMP: fullsize IDCT: islow ENT: huff
./djpeg -dct int -rgb565 -bmp -outfile testout_rgb_islow_565D.bmp testout_rgb_islow.jpg
md5/md5cmp $(MD5_BMP_RGB_ISLOW_565D) testout_rgb_islow_565D.bmp
rm -f testout_rgb_islow_565D.bmp testout_rgb_islow.jpg
endif
# CC: RGB->YCC SAMP: fullsize/h2v1 FDCT: ifast ENT: 2-pass huff
./cjpeg -sample 2x1 -dct fast -opt -outfile testout_422_ifast_opt.jpg $(srcdir)/testimages/testorig.ppm
md5/md5cmp $(MD5_JPEG_422_IFAST_OPT) testout_422_ifast_opt.jpg
# CC: YCC->RGB SAMP: fullsize/h2v1 fancy IDCT: ifast ENT: huff
./djpeg -dct fast -outfile testout_422_ifast.ppm testout_422_ifast_opt.jpg
md5/md5cmp $(MD5_PPM_422_IFAST) testout_422_ifast.ppm
rm -f testout_422_ifast.ppm
# CC: YCC->RGB SAMP: h2v1 merged IDCT: ifast ENT: huff
./djpeg -dct fast -nosmooth -outfile testout_422m_ifast.ppm testout_422_ifast_opt.jpg
md5/md5cmp $(MD5_PPM_422M_IFAST) testout_422m_ifast.ppm
rm -f testout_422m_ifast.ppm
if WITH_12BIT
rm -f testout_422_ifast_opt.jpg
else
# CC: YCC->RGB565 SAMP: h2v1 merged IDCT: ifast ENT: huff
./djpeg -dct int -nosmooth -rgb565 -dither none -bmp -outfile testout_422m_ifast_565.bmp testout_422_ifast_opt.jpg
md5/md5cmp $(MD5_BMP_422M_IFAST_565) testout_422m_ifast_565.bmp
rm -f testout_422m_ifast_565.bmp
# CC: YCC->RGB565 (dithered) SAMP: h2v1 merged IDCT: ifast ENT: huff
./djpeg -dct int -nosmooth -rgb565 -bmp -outfile testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg
md5/md5cmp $(MD5_BMP_422M_IFAST_565D) testout_422m_ifast_565D.bmp
rm -f testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg
endif
# CC: RGB->YCC SAMP: fullsize/h2v2 FDCT: ifast ENT: prog huff
./cjpeg -sample 2x2 -quality 100 -dct fast -prog -outfile testout_420_q100_ifast_prog.jpg $(srcdir)/testimages/testorig.ppm
md5/md5cmp $(MD5_JPEG_420_IFAST_Q100_PROG) testout_420_q100_ifast_prog.jpg
# CC: YCC->RGB SAMP: fullsize/h2v2 fancy IDCT: ifast ENT: prog huff
./djpeg -dct fast -outfile testout_420_q100_ifast.ppm testout_420_q100_ifast_prog.jpg
md5/md5cmp $(MD5_PPM_420_Q100_IFAST) testout_420_q100_ifast.ppm
rm -f testout_420_q100_ifast.ppm
# CC: YCC->RGB SAMP: h2v2 merged IDCT: ifast ENT: prog huff
./djpeg -dct fast -nosmooth -outfile testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg
md5/md5cmp $(MD5_PPM_420M_Q100_IFAST) testout_420m_q100_ifast.ppm
rm -f testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg
# CC: RGB->Gray SAMP: fullsize FDCT: islow ENT: huff
./cjpeg -gray -dct int -outfile testout_gray_islow.jpg $(srcdir)/testimages/testorig.ppm
md5/md5cmp $(MD5_JPEG_GRAY_ISLOW) testout_gray_islow.jpg
# CC: Gray->Gray SAMP: fullsize IDCT: islow ENT: huff
./djpeg -dct int -outfile testout_gray_islow.ppm testout_gray_islow.jpg
md5/md5cmp $(MD5_PPM_GRAY_ISLOW) testout_gray_islow.ppm
rm -f testout_gray_islow.ppm
# CC: Gray->RGB SAMP: fullsize IDCT: islow ENT: huff
./djpeg -dct int -rgb -outfile testout_gray_islow_rgb.ppm testout_gray_islow.jpg
md5/md5cmp $(MD5_PPM_GRAY_ISLOW_RGB) testout_gray_islow_rgb.ppm
rm -f testout_gray_islow_rgb.ppm
if WITH_12BIT
rm -f testout_gray_islow.jpg
else
# CC: Gray->RGB565 SAMP: fullsize IDCT: islow ENT: huff
./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_gray_islow_565.bmp testout_gray_islow.jpg
md5/md5cmp $(MD5_BMP_GRAY_ISLOW_565) testout_gray_islow_565.bmp
rm -f testout_gray_islow_565.bmp
# CC: Gray->RGB565 (dithered) SAMP: fullsize IDCT: islow ENT: huff
./djpeg -dct int -rgb565 -bmp -outfile testout_gray_islow_565D.bmp testout_gray_islow.jpg
md5/md5cmp $(MD5_BMP_GRAY_ISLOW_565D) testout_gray_islow_565D.bmp
rm -f testout_gray_islow_565D.bmp testout_gray_islow.jpg
endif
# CC: RGB->YCC SAMP: fullsize smooth/h2v2 smooth FDCT: islow
# ENT: 2-pass huff
./cjpeg -sample 2x2 -smooth 1 -dct int -opt -outfile testout_420s_ifast_opt.jpg $(srcdir)/testimages/testorig.ppm
md5/md5cmp $(MD5_JPEG_420S_IFAST_OPT) testout_420s_ifast_opt.jpg
rm -f testout_420s_ifast_opt.jpg
# The output of the floating point tests is not validated by default, because
# the output differs depending on the type of floating point math used, and
# this is only deterministic if the DCT/IDCT are implemented using SIMD
# instructions on a particular platform. Pass one of the following on the make
# command line to validate the floating point tests against one of the expected
# results:
#
# FLOATTEST=sse validate against the expected results from the libjpeg-turbo
# SSE SIMD extensions
# FLOATTEST=32bit validate against the expected results from the C code
# when running on a 32-bit FPU (or when SSE is being used for
# floating point math, which is generally the default with
# x86-64 compilers)
# FLOATTEST=64bit validate against the exepected results from the C code
# when running on a 64-bit FPU
# FLOATTEST=387 validate against the expected results from the C code when
# the 387 FPU is being used for floating point math (which is
# generally the default with x86 compilers)
# CC: RGB->YCC SAMP: fullsize/int FDCT: float ENT: prog huff
./cjpeg -sample 3x2 -dct float -prog -outfile testout_3x2_float_prog.jpg $(srcdir)/testimages/testorig.ppm
if [ "${FLOATTEST}" = "sse" ]; then \
md5/md5cmp $(MD5_JPEG_3x2_FLOAT_PROG_SSE) testout_3x2_float_prog.jpg; \
elif [ "${FLOATTEST}" = "32bit" -o "${FLOATTEST}" = "64bit" ]; then \
md5/md5cmp $(MD5_JPEG_3x2_FLOAT_PROG_32BIT) testout_3x2_float_prog.jpg; \
elif [ "${FLOATTEST}" = "387" ]; then \
md5/md5cmp $(MD5_JPEG_3x2_FLOAT_PROG_387) testout_3x2_float_prog.jpg; \
fi
# CC: YCC->RGB SAMP: fullsize/int IDCT: float ENT: prog huff
./djpeg -dct float -outfile testout_3x2_float.ppm testout_3x2_float_prog.jpg
if [ "${FLOATTEST}" = "sse" ]; then \
md5/md5cmp $(MD5_PPM_3x2_FLOAT_SSE) testout_3x2_float.ppm; \
elif [ "${FLOATTEST}" = "32bit" ]; then \
md5/md5cmp $(MD5_PPM_3x2_FLOAT_32BIT) testout_3x2_float.ppm; \
elif [ "${FLOATTEST}" = "64bit" ]; then \
md5/md5cmp $(MD5_PPM_3x2_FLOAT_64BIT) testout_3x2_float.ppm; \
elif [ "${FLOATTEST}" = "387" ]; then \
md5/md5cmp $(MD5_PPM_3x2_FLOAT_387) testout_3x2_float.ppm; \
fi
rm -f testout_3x2_float.ppm testout_3x2_float_prog.jpg
# CC: RGB->YCC SAMP: fullsize/int FDCT: ifast ENT: prog huff
./cjpeg -sample 3x2 -dct fast -prog -outfile testout_3x2_ifast_prog.jpg $(srcdir)/testimages/testorig.ppm
md5/md5cmp $(MD5_JPEG_3x2_IFAST_PROG) testout_3x2_ifast_prog.jpg
# CC: YCC->RGB SAMP: fullsize/int IDCT: ifast ENT: prog huff
./djpeg -dct fast -outfile testout_3x2_ifast.ppm testout_3x2_ifast_prog.jpg
md5/md5cmp $(MD5_PPM_3x2_IFAST) testout_3x2_ifast.ppm
rm -f testout_3x2_ifast.ppm testout_3x2_ifast_prog.jpg
if WITH_ARITH_ENC
# CC: YCC->RGB SAMP: fullsize/h2v2 FDCT: islow ENT: arith
./cjpeg -dct int -arithmetic -outfile testout_420_islow_ari.jpg $(srcdir)/testimages/testorig.ppm
md5/md5cmp $(MD5_JPEG_420_ISLOW_ARI) testout_420_islow_ari.jpg
rm -f testout_420_islow_ari.jpg
./jpegtran -arithmetic -outfile testout_420_islow_ari.jpg $(srcdir)/testimages/testimgint.jpg
md5/md5cmp $(MD5_JPEG_420_ISLOW_ARI) testout_420_islow_ari.jpg
rm -f testout_420_islow_ari.jpg
# CC: YCC->RGB SAMP: fullsize FDCT: islow ENT: prog arith
./cjpeg -sample 1x1 -dct int -prog -arithmetic -outfile testout_444_islow_progari.jpg $(srcdir)/testimages/testorig.ppm
md5/md5cmp $(MD5_JPEG_444_ISLOW_PROGARI) testout_444_islow_progari.jpg
rm -f testout_444_islow_progari.jpg
endif
if WITH_ARITH_DEC
# CC: RGB->YCC SAMP: h2v2 merged IDCT: ifast ENT: arith
./djpeg -fast -ppm -outfile testout_420m_ifast_ari.ppm $(srcdir)/testimages/testimgari.jpg
md5/md5cmp $(MD5_PPM_420M_IFAST_ARI) testout_420m_ifast_ari.ppm
rm -f testout_420m_ifast_ari.ppm
./jpegtran -outfile testout_420_islow.jpg $(srcdir)/testimages/testimgari.jpg
md5/md5cmp $(MD5_JPEG_420_ISLOW) testout_420_islow.jpg
rm -f testout_420_islow.jpg
endif
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 16x16 islow ENT: huff
./djpeg -dct int -scale 2/1 -nosmooth -ppm -outfile testout_420m_islow_2_1.ppm $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_PPM_420M_ISLOW_2_1) testout_420m_islow_2_1.ppm
rm -f testout_420m_islow_2_1.ppm
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 15x15 islow ENT: huff
./djpeg -dct int -scale 15/8 -nosmooth -ppm -outfile testout_420m_islow_15_8.ppm $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_PPM_420M_ISLOW_15_8) testout_420m_islow_15_8.ppm
rm -f testout_420m_islow_15_8.ppm
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 13x13 islow ENT: huff
./djpeg -dct int -scale 13/8 -nosmooth -ppm -outfile testout_420m_islow_13_8.ppm $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_PPM_420M_ISLOW_13_8) testout_420m_islow_13_8.ppm
rm -f testout_420m_islow_13_8.ppm
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 11x11 islow ENT: huff
./djpeg -dct int -scale 11/8 -nosmooth -ppm -outfile testout_420m_islow_11_8.ppm $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_PPM_420M_ISLOW_11_8) testout_420m_islow_11_8.ppm
rm -f testout_420m_islow_11_8.ppm
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 9x9 islow ENT: huff
./djpeg -dct int -scale 9/8 -nosmooth -ppm -outfile testout_420m_islow_9_8.ppm $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_PPM_420M_ISLOW_9_8) testout_420m_islow_9_8.ppm
rm -f testout_420m_islow_9_8.ppm
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 7x7 islow/14x14 islow ENT: huff
./djpeg -dct int -scale 7/8 -nosmooth -ppm -outfile testout_420m_islow_7_8.ppm $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_PPM_420M_ISLOW_7_8) testout_420m_islow_7_8.ppm
rm -f testout_420m_islow_7_8.ppm
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 6x6 islow/12x12 islow ENT: huff
./djpeg -dct int -scale 3/4 -nosmooth -ppm -outfile testout_420m_islow_3_4.ppm $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_PPM_420M_ISLOW_3_4) testout_420m_islow_3_4.ppm
rm -f testout_420m_islow_3_4.ppm
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 5x5 islow/10x10 islow ENT: huff
./djpeg -dct int -scale 5/8 -nosmooth -ppm -outfile testout_420m_islow_5_8.ppm $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_PPM_420M_ISLOW_5_8) testout_420m_islow_5_8.ppm
rm -f testout_420m_islow_5_8.ppm
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 4x4 islow/8x8 islow ENT: huff
./djpeg -dct int -scale 1/2 -nosmooth -ppm -outfile testout_420m_islow_1_2.ppm $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_PPM_420M_ISLOW_1_2) testout_420m_islow_1_2.ppm
rm -f testout_420m_islow_1_2.ppm
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 3x3 islow/6x6 islow ENT: huff
./djpeg -dct int -scale 3/8 -nosmooth -ppm -outfile testout_420m_islow_3_8.ppm $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_PPM_420M_ISLOW_3_8) testout_420m_islow_3_8.ppm
rm -f testout_420m_islow_3_8.ppm
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 2x2 islow/4x4 islow ENT: huff
./djpeg -dct int -scale 1/4 -nosmooth -ppm -outfile testout_420m_islow_1_4.ppm $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_PPM_420M_ISLOW_1_4) testout_420m_islow_1_4.ppm
rm -f testout_420m_islow_1_4.ppm
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 1x1 islow/2x2 islow ENT: huff
./djpeg -dct int -scale 1/8 -nosmooth -ppm -outfile testout_420m_islow_1_8.ppm $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_PPM_420M_ISLOW_1_8) testout_420m_islow_1_8.ppm
rm -f testout_420m_islow_1_8.ppm
if WITH_12BIT
else
# CC: YCC->RGB (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff
./djpeg -dct int -colors 256 -bmp -outfile testout_420_islow_256.bmp $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_BMP_420_ISLOW_256) testout_420_islow_256.bmp
rm -f testout_420_islow_256.bmp
# CC: YCC->RGB565 SAMP: h2v2 fancy IDCT: islow ENT: huff
./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_420_islow_565.bmp $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_BMP_420_ISLOW_565) testout_420_islow_565.bmp
rm -f testout_420_islow_565.bmp
# CC: YCC->RGB565 (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff
./djpeg -dct int -rgb565 -bmp -outfile testout_420_islow_565D.bmp $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_BMP_420_ISLOW_565D) testout_420_islow_565D.bmp
rm -f testout_420_islow_565D.bmp
# CC: YCC->RGB565 SAMP: h2v2 merged IDCT: islow ENT: huff
./djpeg -dct int -nosmooth -rgb565 -dither none -bmp -outfile testout_420m_islow_565.bmp $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_BMP_420M_ISLOW_565) testout_420m_islow_565.bmp
rm -f testout_420m_islow_565.bmp
# CC: YCC->RGB565 (dithered) SAMP: h2v2 merged IDCT: islow ENT: huff
./djpeg -dct int -nosmooth -rgb565 -bmp -outfile testout_420m_islow_565D.bmp $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_BMP_420M_ISLOW_565D) testout_420m_islow_565D.bmp
rm -f testout_420m_islow_565D.bmp
endif
# Partial decode tests. These tests are designed to cover all of the possible
# code paths in jpeg_skip_scanlines().
# Context rows: Yes Intra-iMCU row: Yes iMCU row prefetch: No ENT: huff
./djpeg -dct int -skip 15,31 -ppm -outfile testout_420_islow_skip15,31.ppm $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_PPM_420_ISLOW_SKIP15_31) testout_420_islow_skip15,31.ppm
rm -f testout_420_islow_skip15,31.ppm
# Context rows: Yes Intra-iMCU row: No iMCU row prefetch: Yes ENT: arith
if WITH_ARITH_DEC
./djpeg -dct int -skip 16,139 -ppm -outfile testout_420_islow_ari_skip16,139.ppm $(srcdir)/testimages/testimgari.jpg
md5/md5cmp $(MD5_PPM_420_ISLOW_ARI_SKIP16_139) testout_420_islow_ari_skip16,139.ppm
rm -f testout_420_islow_ari_skip16,139.ppm
endif
# Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: prog huff
./cjpeg -dct int -prog -outfile testout_420_islow_prog.jpg $(srcdir)/testimages/testorig.ppm
./djpeg -dct int -crop 62x62+71+71 -ppm -outfile testout_420_islow_prog_crop62x62,71,71.ppm testout_420_islow_prog.jpg
md5/md5cmp $(MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71) testout_420_islow_prog_crop62x62,71,71.ppm
rm -f testout_420_islow_prog_crop62x62,71,71.ppm testout_420_islow_prog.jpg
# Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: arith
if WITH_ARITH_DEC
./djpeg -dct int -crop 53x53+4+4 -ppm -outfile testout_420_islow_ari_crop53x53,4,4.ppm $(srcdir)/testimages/testimgari.jpg
md5/md5cmp $(MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4) testout_420_islow_ari_crop53x53,4,4.ppm
rm -f testout_420_islow_ari_crop53x53,4,4.ppm
endif
# Context rows: No Intra-iMCU row: Yes ENT: huff
./cjpeg -dct int -sample 1x1 -outfile testout_444_islow.jpg $(srcdir)/testimages/testorig.ppm
./djpeg -dct int -skip 1,6 -ppm -outfile testout_444_islow_skip1,6.ppm testout_444_islow.jpg
md5/md5cmp $(MD5_PPM_444_ISLOW_SKIP1_6) testout_444_islow_skip1,6.ppm
rm -f testout_444_islow_skip1,6.ppm testout_444_islow.jpg
# Context rows: No Intra-iMCU row: No ENT: prog huff
./cjpeg -dct int -prog -sample 1x1 -outfile testout_444_islow_prog.jpg $(srcdir)/testimages/testorig.ppm
./djpeg -dct int -crop 98x98+13+13 -ppm -outfile testout_444_islow_prog_crop98x98,13,13.ppm testout_444_islow_prog.jpg
md5/md5cmp $(MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13) testout_444_islow_prog_crop98x98,13,13.ppm
rm -f testout_444_islow_prog_crop98x98,13,13.ppm testout_444_islow_prog.jpg
# Context rows: No Intra-iMCU row: No ENT: arith
if WITH_ARITH_ENC
./cjpeg -dct int -arithmetic -sample 1x1 -outfile testout_444_islow_ari.jpg $(srcdir)/testimages/testorig.ppm
if WITH_ARITH_DEC
./djpeg -dct int -crop 37x37+0+0 -ppm -outfile testout_444_islow_ari_crop37x37,0,0.ppm testout_444_islow_ari.jpg
md5/md5cmp $(MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0) testout_444_islow_ari_crop37x37,0,0.ppm
rm -f testout_444_islow_ari_crop37x37,0,0.ppm
endif
rm -f testout_444_islow_ari.jpg
endif
./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testout_crop.jpg $(srcdir)/testimages/$(TESTORIG)
md5/md5cmp $(MD5_JPEG_CROP) testout_crop.jpg
rm -f testout_crop.jpg
echo GREAT SUCCESS!
testclean:
rm -f testout*
rm -f *_GRAY_*.bmp
rm -f *_GRAY_*.png
rm -f *_GRAY_*.ppm
rm -f *_GRAY_*.jpg
rm -f *_GRAY.yuv
rm -f *_420_*.bmp
rm -f *_420_*.png
rm -f *_420_*.ppm
rm -f *_420_*.jpg
rm -f *_420.yuv
rm -f *_422_*.bmp
rm -f *_422_*.png
rm -f *_422_*.ppm
rm -f *_422_*.jpg
rm -f *_422.yuv
rm -f *_444_*.bmp
rm -f *_444_*.png
rm -f *_444_*.ppm
rm -f *_444_*.jpg
rm -f *_444.yuv
rm -f *_440_*.bmp
rm -f *_440_*.png
rm -f *_440_*.ppm
rm -f *_440_*.jpg
rm -f *_440.yuv
rm -f *_411_*.bmp
rm -f *_411_*.png
rm -f *_411_*.ppm
rm -f *_411_*.jpg
rm -f *_411.yuv
tjtest:
sh ./tjbenchtest
sh ./tjbenchtest -alloc
sh ./tjbenchtest -yuv
sh ./tjbenchtest -yuv -alloc
if WITH_JAVA
sh ./tjbenchtest.java
sh ./tjbenchtest.java -yuv
endif
pkgscripts/libjpeg-turbo.spec: pkgscripts/libjpeg-turbo.spec.tmpl
cat pkgscripts/libjpeg-turbo.spec.tmpl | sed s@%{__prefix}@$(prefix)@g | \
sed s@%{__bindir}@$(bindir)@g | sed s@%{__datadir}@$(datadir)@g | \
sed s@%{__docdir}@$(docdir)@g | sed s@%{__includedir}@$(includedir)@g | \
sed s@%{__libdir}@$(libdir)@g | sed s@%{__mandir}@$(mandir)@g \
> pkgscripts/libjpeg-turbo.spec
rpm: all pkgscripts/libjpeg-turbo.spec
TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
mkdir -p $$TMPDIR/RPMS; \
ln -fs `pwd` $$TMPDIR/BUILD; \
rm -f ${PKGNAME}-${VERSION}.${RPMARCH}.rpm; \
rpmbuild -bb --define "_blddir $$TMPDIR/buildroot" \
--define "_topdir $$TMPDIR" \
--target ${RPMARCH} pkgscripts/libjpeg-turbo.spec; \
cp $$TMPDIR/RPMS/${RPMARCH}/${PKGNAME}-${VERSION}-${BUILD}.${RPMARCH}.rpm \
${PKGNAME}-${VERSION}.${RPMARCH}.rpm; \
rm -rf $$TMPDIR
srpm: dist-gzip pkgscripts/libjpeg-turbo.spec
TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
mkdir -p $$TMPDIR/RPMS; \
mkdir -p $$TMPDIR/SRPMS; \
mkdir -p $$TMPDIR/BUILD; \
mkdir -p $$TMPDIR/SOURCES; \
mkdir -p $$TMPDIR/SPECS; \
rm -f ${PKGNAME}-${VERSION}.src.rpm; \
cp ${PACKAGE_NAME}-${VERSION}.tar.gz $$TMPDIR/SOURCES; \
cat pkgscripts/libjpeg-turbo.spec | sed s/%{_blddir}/%{_tmppath}/g \
| sed s/#--\>//g \
> $$TMPDIR/SPECS/libjpeg-turbo.spec; \
rpmbuild -bs --define "_topdir $$TMPDIR" $$TMPDIR/SPECS/libjpeg-turbo.spec; \
cp $$TMPDIR/SRPMS/${PKGNAME}-${VERSION}-${BUILD}.src.rpm \
${PKGNAME}-${VERSION}.src.rpm; \
rm -rf $$TMPDIR
pkgscripts/makedpkg: pkgscripts/makedpkg.tmpl
cat pkgscripts/makedpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \
sed s@%{__docdir}@$(docdir)@g | sed s@%{__libdir}@$(libdir)@g \
> pkgscripts/makedpkg
deb: all pkgscripts/makedpkg
sh pkgscripts/makedpkg
pkgscripts/uninstall: pkgscripts/uninstall.tmpl
cat pkgscripts/uninstall.tmpl | sed s@%{__prefix}@$(prefix)@g | \
sed s@%{__bindir}@$(bindir)@g | sed s@%{__datadir}@$(datadir)@g | \
sed s@%{__includedir}@$(includedir)@g | sed s@%{__libdir}@$(libdir)@g | \
sed s@%{__mandir}@$(mandir)@g > pkgscripts/uninstall
pkgscripts/makemacpkg: pkgscripts/makemacpkg.tmpl
cat pkgscripts/makemacpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \
sed s@%{__bindir}@$(bindir)@g | sed s@%{__docdir}@$(docdir)@g | \
sed s@%{__libdir}@$(libdir)@g > pkgscripts/makemacpkg
if X86_64
udmg: all pkgscripts/makemacpkg pkgscripts/uninstall
sh pkgscripts/makemacpkg -build32 ${BUILDDIR32}
iosdmg: all pkgscripts/makemacpkg pkgscripts/uninstall
sh pkgscripts/makemacpkg -build32 ${BUILDDIR32} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S} -buildarmv8 ${BUILDDIRARMV8} -lipo "${LIPO}"
else
iosdmg: all pkgscripts/makemacpkg pkgscripts/uninstall
sh pkgscripts/makemacpkg -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S} -buildarmv8 ${BUILDDIRARMV8} -lipo "${LIPO}"
endif
dmg: all pkgscripts/makemacpkg pkgscripts/uninstall
sh pkgscripts/makemacpkg
pkgscripts/makecygwinpkg: pkgscripts/makecygwinpkg.tmpl
cat pkgscripts/makecygwinpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \
sed s@%{__docdir}@$(docdir)@g | sed s@%{__libdir}@$(libdir)@g \
> pkgscripts/makecygwinpkg
cygwinpkg: all pkgscripts/makecygwinpkg
sh pkgscripts/makecygwinpkg

View File

@@ -1,254 +0,0 @@
# AC_PROG_NASM
# --------------------------
# Check that NASM exists and determine flags
AC_DEFUN([AC_PROG_NASM],[
AC_ARG_VAR(NASM, [NASM command (used to build the x86/x86-64 SIMD code)])
if test "x$NASM" = "x"; then
AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
test -z "$NASM" && AC_MSG_ERROR([no nasm (Netwide Assembler) found])
fi
AC_MSG_CHECKING([for object file format of host system])
case "$host_os" in
cygwin* | mingw* | pw32* | interix*)
case "$host_cpu" in
x86_64)
objfmt='Win64-COFF'
;;
*)
objfmt='Win32-COFF'
;;
esac
;;
msdosdjgpp* | go32*)
objfmt='COFF'
;;
os2-emx*) # not tested
objfmt='MSOMF' # obj
;;
linux*coff* | linux*oldld*)
objfmt='COFF' # ???
;;
linux*aout*)
objfmt='a.out'
;;
linux*)
case "$host_cpu" in
x86_64)
objfmt='ELF64'
;;
*)
objfmt='ELF'
;;
esac
;;
kfreebsd* | freebsd* | netbsd* | openbsd*)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
objfmt='BSD-a.out'
else
case "$host_cpu" in
x86_64 | amd64)
objfmt='ELF64'
;;
*)
objfmt='ELF'
;;
esac
fi
;;
solaris* | sunos* | sysv* | sco*)
case "$host_cpu" in
x86_64)
objfmt='ELF64'
;;
*)
objfmt='ELF'
;;
esac
;;
darwin* | rhapsody* | nextstep* | openstep* | macos*)
case "$host_cpu" in
x86_64)
objfmt='Mach-O64'
;;
*)
objfmt='Mach-O'
;;
esac
;;
*)
objfmt='ELF ?'
;;
esac
AC_MSG_RESULT([$objfmt])
if test "$objfmt" = 'ELF ?'; then
objfmt='ELF'
AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
fi
AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
case "$objfmt" in
MSOMF) NAFLAGS='-fobj -DOBJ32';;
Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;
Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;
COFF) NAFLAGS='-fcoff -DCOFF';;
a.out) NAFLAGS='-faout -DAOUT';;
BSD-a.out) NAFLAGS='-faoutb -DAOUT';;
ELF) NAFLAGS='-felf -DELF';;
ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';;
RDF) NAFLAGS='-frdf -DRDF';;
Mach-O) NAFLAGS='-fmacho -DMACHO';;
Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;
esac
AC_MSG_RESULT([$NAFLAGS])
AC_SUBST([NAFLAGS])
AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
cat > conftest.asm <<EOF
[%line __oline__ "configure"
section .text
global _main,main
_main:
main: xor eax,eax
ret
]EOF
try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
AC_MSG_RESULT(yes)
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.asm >&AC_FD_CC
rm -rf conftest*
AC_MSG_RESULT(no)
AC_MSG_ERROR([installation or configuration problem: assembler cannot create object files.])
fi
AC_MSG_CHECKING([whether the linker accepts assembler output])
try_nasm='${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.o $LIBS 1>&AC_FD_CC'
if AC_TRY_EVAL(try_nasm) && test -s conftest${ac_exeext}; then
rm -rf conftest*
AC_MSG_RESULT(yes)
else
rm -rf conftest*
AC_MSG_RESULT(no)
AC_MSG_ERROR([configuration problem: maybe object file format mismatch.])
fi
])
# AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE
# --------------------------
# Test whether the assembler is suitable and supports NEON instructions
AC_DEFUN([AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE],[
ac_good_gnu_arm_assembler=no
ac_save_CC="$CC"
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CCASFLAGS -x assembler-with-cpp"
CC="$CCAS"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
.text
.fpu neon
.arch armv7a
.object_arch armv4
.arm
pld [r0]
vmovn.u16 d0, q0]])], ac_good_gnu_arm_assembler=yes)
ac_use_gas_preprocessor=no
if test "x$ac_good_gnu_arm_assembler" = "xno" ; then
CC="gas-preprocessor.pl $CCAS"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
.text
.fpu neon
.arch armv7a
.object_arch armv4
.arm
pld [r0]
vmovn.u16 d0, q0]])], ac_use_gas_preprocessor=yes)
fi
CFLAGS="$ac_save_CFLAGS"
CC="$ac_save_CC"
if test "x$ac_use_gas_preprocessor" = "xyes" ; then
CCAS="gas-preprocessor.pl $CCAS"
AC_SUBST([CCAS])
ac_good_gnu_arm_assembler=yes
fi
if test "x$ac_good_gnu_arm_assembler" = "xyes" ; then
$1
else
$2
fi
])
# AC_CHECK_COMPATIBLE_MIPSEL_ASSEMBLER_IFELSE
# --------------------------
# Test whether the assembler is suitable and supports MIPS instructions
AC_DEFUN([AC_CHECK_COMPATIBLE_MIPS_ASSEMBLER_IFELSE],[
have_mips_dspr2=no
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CCASFLAGS -mdspr2"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
int main ()
{
int c = 0, a = 0, b = 0;
__asm__ __volatile__ (
"precr.qb.ph %[c], %[a], %[b] \n\t"
: [c] "=r" (c)
: [a] "r" (a), [b] "r" (b)
);
return c;
}
]])], have_mips_dspr2=yes)
CFLAGS=$ac_save_CFLAGS
if test "x$have_mips_dspr2" = "xyes" ; then
$1
else
$2
fi
])
AC_DEFUN([AC_CHECK_COMPATIBLE_ARM64_ASSEMBLER_IFELSE],[
ac_good_gnu_arm_assembler=no
ac_save_CC="$CC"
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CCASFLAGS -x assembler-with-cpp"
CC="$CCAS"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
.text
MYVAR .req x0
movi v0.16b, #100
mov MYVAR, #100
.unreq MYVAR]])], ac_good_gnu_arm_assembler=yes)
ac_use_gas_preprocessor=no
if test "x$ac_good_gnu_arm_assembler" = "xno" ; then
CC="gas-preprocessor.pl $CCAS"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
.text
MYVAR .req x0
movi v0.16b, #100
mov MYVAR, #100
.unreq MYVAR]])], ac_use_gas_preprocessor=yes)
fi
CFLAGS="$ac_save_CFLAGS"
CC="$ac_save_CC"
if test "x$ac_use_gas_preprocessor" = "xyes" ; then
CCAS="gas-preprocessor.pl $CCAS"
AC_SUBST([CCAS])
ac_good_gnu_arm_assembler=yes
fi
if test "x$ac_good_gnu_arm_assembler" = "xyes" ; then
$1
else
$2
fi
])

View File

@@ -16,11 +16,11 @@ install:
set MSYSTEM=MINGW32
bash -c "pacman --noconfirm -S autoconf automake libtool zip"
bash -c "pacman --noconfirm -S zip"
mklink /d "%ProgramData%\Oracle\Java32" "c:\Program Files (x86)\Java\jdk1.6.0"
git clone --depth=1 https://github.com/libjpeg-turbo/buildscripts.git c:/buildscripts
git clone --depth=1 https://github.com/libjpeg-turbo/buildscripts.git -b %APPVEYOR_REPO_BRANCH% c:/buildscripts
build_script:
- cmd: >-

View File

@@ -0,0 +1,173 @@
# This file is included from the top-level CMakeLists.txt. We just store it
# here to avoid cluttering up that file.
set(PKGNAME ${CMAKE_PROJECT_NAME} CACHE STRING
"Distribution package name (default: ${CMAKE_PROJECT_NAME})")
set(PKGVENDOR "The ${CMAKE_PROJECT_NAME} Project" CACHE STRING
"Vendor name to be included in distribution package descriptions (default: The ${CMAKE_PROJECT_NAME} Project)")
set(PKGURL "http://www.${CMAKE_PROJECT_NAME}.org" CACHE STRING
"URL of project web site to be included in distribution package descriptions (default: http://www.${CMAKE_PROJECT_NAME}.org)")
set(PKGEMAIL "information@${CMAKE_PROJECT_NAME}.org" CACHE STRING
"E-mail of project maintainer to be included in distribution package descriptions (default: information@${CMAKE_PROJECT_NAME}.org")
set(PKGID "com.${CMAKE_PROJECT_NAME}.${PKGNAME}" CACHE STRING
"Globally unique package identifier (reverse DNS notation) (default: com.${CMAKE_PROJECT_NAME}.${PKGNAME})")
###############################################################################
# Linux RPM and DEB
###############################################################################
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(RPMARCH ${CMAKE_SYSTEM_PROCESSOR})
if(CPU_TYPE STREQUAL "x86_64")
set(DEBARCH amd64)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "armv7*")
set(DEBARCH armhf)
elseif(CPU_TYPE STREQUAL "arm64")
set(DEBARCH ${CPU_TYPE})
elseif(CPU_TYPE STREQUAL "arm")
set(DEBARCH armel)
else()
set(DEBARCH ${CMAKE_SYSTEM_PROCESSOR})
endif()
message(STATUS "RPM architecture = ${RPMARCH}, DEB architecture = ${DEBARCH}")
# Re-set CMAKE_POSITION_INDEPENDENT_CODE so that the RPM spec file works
# properly
boolean_number(CMAKE_POSITION_INDEPENDENT_CODE)
configure_file(release/makerpm.in pkgscripts/makerpm)
configure_file(release/${CMAKE_PROJECT_NAME}.spec.in
pkgscripts/${CMAKE_PROJECT_NAME}.spec @ONLY)
add_custom_target(rpm sh pkgscripts/makerpm
SOURCES pkgscripts/makerpm)
configure_file(release/makesrpm.in pkgscripts/makesrpm)
add_custom_target(srpm sh pkgscripts/makesrpm
SOURCES pkgscripts/makesrpm
DEPENDS dist)
configure_file(release/makedpkg.in pkgscripts/makedpkg)
configure_file(release/deb-control.in pkgscripts/deb-control)
add_custom_target(deb sh pkgscripts/makedpkg
SOURCES pkgscripts/makedpkg)
endif() # Linux
###############################################################################
# Windows installer (NullSoft Installer)
###############################################################################
if(WIN32)
if(MSVC)
set(INST_PLATFORM "Visual C++")
set(INST_NAME ${CMAKE_PROJECT_NAME}-${VERSION}-vc)
set(INST_REG_NAME ${CMAKE_PROJECT_NAME})
elseif(MINGW)
set(INST_PLATFORM GCC)
set(INST_NAME ${CMAKE_PROJECT_NAME}-${VERSION}-gcc)
set(INST_REG_NAME ${CMAKE_PROJECT_NAME}-gcc)
set(INST_DEFS -DGCC)
endif()
if(BITS EQUAL 64)
set(INST_PLATFORM "${INST_PLATFORM} 64-bit")
set(INST_NAME ${INST_NAME}64)
set(INST_REG_NAME ${INST_DIR}64)
set(INST_DEFS ${INST_DEFS} -DWIN64)
endif()
if(WITH_JAVA)
set(INST_DEFS ${INST_DEFS} -DJAVA)
endif()
if(MSVC_IDE)
set(INST_DEFS ${INST_DEFS} "-DBUILDDIR=${CMAKE_CFG_INTDIR}\\")
else()
set(INST_DEFS ${INST_DEFS} "-DBUILDDIR=")
endif()
STRING(REGEX REPLACE "/" "\\\\" INST_DIR ${CMAKE_INSTALL_PREFIX})
configure_file(release/${CMAKE_PROJECT_NAME}.nsi.in ${CMAKE_PROJECT_NAME}.nsi @ONLY)
if(WITH_JAVA)
set(JAVA_DEPEND java)
endif()
add_custom_target(installer
makensis -nocd ${INST_DEFS} ${CMAKE_PROJECT_NAME}.nsi
DEPENDS jpeg jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom
cjpeg djpeg jpegtran tjbench ${JAVA_DEPEND}
SOURCES ${CMAKE_PROJECT_NAME}.nsi)
endif() # WIN32
###############################################################################
# Cygwin Package
###############################################################################
if(CYGWIN)
configure_file(release/makecygwinpkg.in pkgscripts/makecygwinpkg)
add_custom_target(cygwinpkg sh pkgscripts/makecygwinpkg)
endif() # CYGWIN
###############################################################################
# Mac DMG
###############################################################################
if(APPLE)
set(DEFAULT_OSX_32BIT_BUILD ${CMAKE_SOURCE_DIR}/osxx86)
set(OSX_32BIT_BUILD ${DEFAULT_OSX_32BIT_BUILD} CACHE PATH
"Directory containing 32-bit (i386) Mac build to include in universal binaries (default: ${DEFAULT_OSX_32BIT_BUILD})")
set(DEFAULT_IOS_ARMV7_BUILD ${CMAKE_SOURCE_DIR}/iosarmv7)
set(IOS_ARMV7_BUILD ${DEFAULT_IOS_ARMV7_BUILD} CACHE PATH
"Directory containing ARMv7 iOS build to include in universal binaries (default: ${DEFAULT_IOS_ARMV7_BUILD})")
set(DEFAULT_IOS_ARMV7S_BUILD ${CMAKE_SOURCE_DIR}/iosarmv7s)
set(IOS_ARMV7S_BUILD ${DEFAULT_IOS_ARMV7S_BUILD} CACHE PATH
"Directory containing ARMv7s iOS build to include in universal binaries (default: ${DEFAULT_IOS_ARMV7S_BUILD})")
set(DEFAULT_IOS_ARMV8_BUILD ${CMAKE_SOURCE_DIR}/iosarmv8)
set(IOS_ARMV8_BUILD ${DEFAULT_IOS_ARMV8_BUILD} CACHE PATH
"Directory containing ARMv8 iOS build to include in universal binaries (default: ${DEFAULT_IOS_ARMV8_BUILD})")
configure_file(release/makemacpkg.in pkgscripts/makemacpkg)
configure_file(release/Distribution.xml.in pkgscripts/Distribution.xml)
configure_file(release/uninstall.in pkgscripts/uninstall)
add_custom_target(dmg sh pkgscripts/makemacpkg
SOURCES pkgscripts/makemacpkg)
add_custom_target(udmg sh pkgscripts/makemacpkg universal
SOURCES pkgscripts/makemacpkg)
endif() # APPLE
###############################################################################
# Generic
###############################################################################
add_custom_target(dist
COMMAND git archive --prefix=${CMAKE_PROJECT_NAME}-${VERSION}/ HEAD |
gzip > ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar.gz
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
configure_file(release/maketarball.in pkgscripts/maketarball)
add_custom_target(tarball sh pkgscripts/maketarball
SOURCES pkgscripts/maketarball)
configure_file(release/libjpeg.pc.in pkgscripts/libjpeg.pc @ONLY)
configure_file(release/libturbojpeg.pc.in pkgscripts/libturbojpeg.pc @ONLY)

View File

@@ -1,611 +0,0 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.56])
AC_INIT([libjpeg-turbo], [1.5.80])
AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])
AC_PREFIX_DEFAULT(/opt/libjpeg-turbo)
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Checks for programs.
SAVED_CFLAGS=${CFLAGS}
SAVED_CPPFLAGS=${CPPFLAGS}
AC_PROG_CPP
AC_PROG_CC
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AM_PROG_AS
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_LN_S
AC_ARG_WITH([build-date], [Use custom build string to enable reproducible builds (default: YYMMDD)],
[BUILD="$with_build_date"],
[BUILD=`date +%Y%m%d`])
PKG_PROG_PKG_CONFIG
# When the prefix is /opt/libjpeg-turbo, we assume that an "official" binary is
# being created, and thus we install things into specific locations.
old_prefix=${prefix}
if test "x$prefix" = "xNONE" -a "x$ac_default_prefix" != "x"; then
prefix=$ac_default_prefix
fi
DATADIR=`eval echo ${datadir}`
DATADIR=`eval echo $DATADIR`
if test "$DATADIR" = "/opt/libjpeg-turbo/share"; then
datadir='${prefix}'
fi
DATADIR=`eval echo ${datarootdir}`
DATADIR=`eval echo $DATADIR`
if test "$DATADIR" = "/opt/libjpeg-turbo/share"; then
datarootdir='${prefix}'
fi
DOCDIR=`eval echo ${docdir}`
DOCDIR=`eval echo $DOCDIR`
if test "$DOCDIR" = "/opt/libjpeg-turbo/doc/libjpeg-turbo"; then
docdir='${datadir}/doc'
fi
old_exec_prefix=${exec_prefix}
if test "x$exec_prefix" = "xNONE"; then
exec_prefix=${prefix}
fi
AC_CHECK_SIZEOF(size_t)
if test "x${libdir}" = 'x${exec_prefix}/lib' -o "x${libdir}" = 'x${prefix}/lib'; then
LIBDIR=`eval echo ${libdir}`
LIBDIR=`eval echo $LIBDIR`
if test "$LIBDIR" = "/opt/libjpeg-turbo/lib"; then
case $host_os in
darwin*)
;;
*)
if test "${ac_cv_sizeof_size_t}" = "8"; then
libdir='${exec_prefix}/lib64'
elif test "${ac_cv_sizeof_size_t}" = "4"; then
libdir='${exec_prefix}/lib32'
fi
;;
esac
fi
fi
exec_prefix=${old_exec_prefix}
prefix=${old_prefix}
# Check whether compiler supports pointers to undefined structures
AC_MSG_CHECKING(whether compiler supports pointers to undefined structures)
AC_TRY_COMPILE([ typedef struct undefined_structure *undef_struct_ptr; ], ,
AC_MSG_RESULT(yes),
[AC_MSG_RESULT(no)
AC_DEFINE([INCOMPLETE_TYPES_BROKEN], [1],
[Compiler does not support pointers to undefined structures.])])
if test "x${GCC}" = "xyes"; then
if test "x${SAVED_CFLAGS}" = "x"; then
CFLAGS=-O3
fi
if test "x${SAVED_CPPFLAGS}" = "x"; then
CPPFLAGS=-Wall
fi
fi
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
if test "x${SUNCC}" = "xyes"; then
if test "x${SAVED_CFLAGS}" = "x"; then
CFLAGS=-xO5
fi
fi
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stddef.h stdlib.h locale.h string.h])
AC_CHECK_HEADER([sys/types.h],
AC_DEFINE([NEED_SYS_TYPES_H], 1, [Define if you need to include <sys/types.h> to get size_t.]))
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_CHAR_UNSIGNED
AC_C_INLINE
AC_TYPE_SIZE_T
AC_CHECK_TYPES([unsigned char, unsigned short])
AC_MSG_CHECKING([if right shift is signed])
AC_TRY_RUN(
[#include <stdio.h>
int is_shifting_signed (long arg) {
long res = arg >> 4;
if (res == -0x7F7E80CL)
return 1; /* right shift is signed */
/* see if unsigned-shift hack will fix it. */
/* we can't just test exact value since it depends on width of long... */
res |= (~0L) << (32-4);
if (res == -0x7F7E80CL)
return 0; /* right shift is unsigned */
printf("Right shift isn't acting as I expect it to.\n");
printf("I fear the JPEG software will not work at all.\n\n");
return 0; /* try it with unsigned anyway */
}
int main (void) {
exit(is_shifting_signed(-0x7F7E80B1L));
}],
[AC_MSG_RESULT(no)
AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], 1,
[Define if your (broken) compiler shifts signed values as if they were unsigned.])],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(Assuming that right shift is signed on target machine.)])
# Checks for library functions.
AC_CHECK_FUNCS([memset memcpy], [],
[AC_DEFINE([NEED_BSD_STRINGS], 1,
[Define if you have BSD-like bzero and bcopy in <strings.h> rather than memset/memcpy in <string.h>.])])
AC_MSG_CHECKING([libjpeg API version])
AC_ARG_VAR(JPEG_LIB_VERSION, [libjpeg API version (62, 70, or 80)])
if test "x$JPEG_LIB_VERSION" = "x"; then
AC_ARG_WITH([jpeg7],
AC_HELP_STRING([--with-jpeg7],
[Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b.)]))
AC_ARG_WITH([jpeg8],
AC_HELP_STRING([--with-jpeg8],
[Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b.)]))
if test "x${with_jpeg8}" = "xyes"; then
JPEG_LIB_VERSION=80
else
if test "x${with_jpeg7}" = "xyes"; then
JPEG_LIB_VERSION=70
else
JPEG_LIB_VERSION=62
fi
fi
fi
JPEG_LIB_VERSION_DECIMAL=`expr $JPEG_LIB_VERSION / 10`.`expr $JPEG_LIB_VERSION % 10`
AC_SUBST(JPEG_LIB_VERSION_DECIMAL)
AC_MSG_RESULT([$JPEG_LIB_VERSION_DECIMAL])
AC_DEFINE_UNQUOTED(JPEG_LIB_VERSION, [$JPEG_LIB_VERSION],
[libjpeg API version])
AC_ARG_VAR(SO_MAJOR_VERSION,
[Major version of the libjpeg-turbo shared library (default is determined by the API version)])
AC_ARG_VAR(SO_MINOR_VERSION,
[Minor version of the libjpeg-turbo shared library (default is determined by the API version)])
if test "x$SO_MAJOR_VERSION" = "x"; then
case "$JPEG_LIB_VERSION" in
62) SO_MAJOR_VERSION=$JPEG_LIB_VERSION ;;
*) SO_MAJOR_VERSION=`expr $JPEG_LIB_VERSION / 10` ;;
esac
fi
if test "x$SO_MINOR_VERSION" = "x"; then
case "$JPEG_LIB_VERSION" in
80) SO_MINOR_VERSION=2 ;;
*) SO_MINOR_VERSION=0 ;;
esac
fi
RPM_CONFIG_ARGS=
# Memory source/destination managers
SO_AGE=1
MEM_SRCDST_FUNCTIONS=
if test "x${with_jpeg8}" != "xyes"; then
AC_MSG_CHECKING([whether to include in-memory source/destination managers])
AC_ARG_WITH([mem-srcdst],
AC_HELP_STRING([--without-mem-srcdst],
[Do not include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI]))
if test "x$with_mem_srcdst" != "xno"; then
AC_MSG_RESULT(yes)
AC_DEFINE([MEM_SRCDST_SUPPORTED], [1],
[Support in-memory source/destination managers])
SO_AGE=2
MEM_SRCDST_FUNCTIONS="global: jpeg_mem_dest; jpeg_mem_src;";
else
AC_MSG_RESULT(no)
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-mem-srcdst"
fi
fi
AC_MSG_CHECKING([libjpeg shared library version])
AC_MSG_RESULT([$SO_MAJOR_VERSION.$SO_AGE.$SO_MINOR_VERSION])
LIBTOOL_CURRENT=`expr $SO_MAJOR_VERSION + $SO_AGE`
AC_SUBST(LIBTOOL_CURRENT)
AC_SUBST(SO_MAJOR_VERSION)
AC_SUBST(SO_MINOR_VERSION)
AC_SUBST(SO_AGE)
AC_SUBST(MEM_SRCDST_FUNCTIONS)
AC_DEFINE_UNQUOTED(LIBJPEG_TURBO_VERSION, [$VERSION], [libjpeg-turbo version])
m4_define(version_triplet,m4_split(AC_PACKAGE_VERSION,[[.]]))
m4_define(version_major,m4_argn(1,version_triplet))
m4_define(version_minor,m4_argn(2,version_triplet))
m4_define(version_revision,m4_argn(3,version_triplet))
VERSION_MAJOR=version_major
VERSION_MINOR=version_minor
VERSION_REVISION=version_revision
LIBJPEG_TURBO_VERSION_NUMBER=`printf "%d%03d%03d" $VERSION_MAJOR $VERSION_MINOR $VERSION_REVISION`
AC_DEFINE_UNQUOTED(LIBJPEG_TURBO_VERSION_NUMBER, [$LIBJPEG_TURBO_VERSION_NUMBER], [libjpeg-turbo version in integer form])
VERSION_SCRIPT=yes
AC_ARG_ENABLE([ld-version-script],
AS_HELP_STRING([--disable-ld-version-script],
[Disable linker version script for libjpeg-turbo (default is to use linker version script if the linker supports it)]),
[VERSION_SCRIPT=$enableval], [])
AC_MSG_CHECKING([whether the linker supports version scripts])
SAVED_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--version-script,conftest.map"
cat > conftest.map <<EOF
VERS_1 {
global: *;
};
EOF
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[VERSION_SCRIPT_FLAG=-Wl,--version-script,;
AC_MSG_RESULT([yes (GNU style)])],
[])
if test "x$VERSION_SCRIPT_FLAG" = "x"; then
LDFLAGS="$SAVED_LDFLAGS -Wl,-M,conftest.map"
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[VERSION_SCRIPT_FLAG=-Wl,-M,;
AC_MSG_RESULT([yes (Sun style)])],
[])
fi
if test "x$VERSION_SCRIPT_FLAG" = "x"; then
VERSION_SCRIPT=no
AC_MSG_RESULT(no)
fi
LDFLAGS="$SAVED_LDFLAGS"
AC_MSG_CHECKING([whether to use version script when building libjpeg-turbo])
AC_MSG_RESULT($VERSION_SCRIPT)
AM_CONDITIONAL(VERSION_SCRIPT, test "x$VERSION_SCRIPT" = "xyes")
AC_SUBST(VERSION_SCRIPT_FLAG)
# Check for non-broken inline under various spellings
AC_MSG_CHECKING(for inline)
ljt_cv_inline=""
AC_TRY_COMPILE(, [} inline __attribute__((always_inline)) int foo() { return 0; }
int bar() { return foo();], ljt_cv_inline="inline __attribute__((always_inline))",
AC_TRY_COMPILE(, [} __inline__ int foo() { return 0; }
int bar() { return foo();], ljt_cv_inline="__inline__",
AC_TRY_COMPILE(, [} __inline int foo() { return 0; }
int bar() { return foo();], ljt_cv_inline="__inline",
AC_TRY_COMPILE(, [} inline int foo() { return 0; }
int bar() { return foo();], ljt_cv_inline="inline"))))
AC_MSG_RESULT($ljt_cv_inline)
AC_DEFINE_UNQUOTED([INLINE],[$ljt_cv_inline],[How to obtain function inlining.])
# Arithmetic coding support
AC_MSG_CHECKING([whether to include arithmetic encoding support])
AC_ARG_WITH([arith-enc],
AC_HELP_STRING([--without-arith-enc],
[Do not include arithmetic encoding support when emulating the libjpeg v6b API/ABI]))
if test "x$with_12bit" = "xyes"; then
with_arith_enc=no
fi
if test "x${with_jpeg8}" = "xyes" -o "x${with_jpeg7}" = "xyes"; then
with_arith_enc=yes
fi
if test "x$with_arith_enc" = "xno"; then
AC_MSG_RESULT(no)
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-enc"
else
AC_DEFINE([C_ARITH_CODING_SUPPORTED], [1], [Support arithmetic encoding])
AC_MSG_RESULT(yes)
fi
AM_CONDITIONAL([WITH_ARITH_ENC], [test "x$with_arith_enc" != "xno"])
AC_MSG_CHECKING([whether to include arithmetic decoding support])
AC_ARG_WITH([arith-dec],
AC_HELP_STRING([--without-arith-dec],
[Do not include arithmetic decoding support when emulating the libjpeg v6b API/ABI]))
if test "x$with_12bit" = "xyes"; then
with_arith_dec=no
fi
if test "x${with_jpeg8}" = "xyes" -o "x${with_jpeg7}" = "xyes"; then
with_arith_dec=yes
fi
if test "x$with_arith_dec" = "xno"; then
AC_MSG_RESULT(no)
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-dec"
else
AC_DEFINE([D_ARITH_CODING_SUPPORTED], [1], [Support arithmetic decoding])
AC_MSG_RESULT(yes)
fi
AM_CONDITIONAL([WITH_ARITH_DEC], [test "x$with_arith_dec" != "xno"])
AM_CONDITIONAL([WITH_ARITH],
[test "x$with_arith_dec" != "xno" -o "x$with_arith_enc" != "xno"])
# 12-bit component support
AC_MSG_CHECKING([whether to use 12-bit samples])
AC_ARG_WITH([12bit],
AC_HELP_STRING([--with-12bit], [Encode/decode JPEG images with 12-bit samples (implies --without-simd --without-turbojpeg --without-arith-dec --without-arith-enc)]))
if test "x$with_12bit" = "xyes"; then
AC_DEFINE([BITS_IN_JSAMPLE], [12], [use 8 or 12])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL([WITH_12BIT], [test "x$with_12bit" = "xyes"])
# TurboJPEG support
AC_MSG_CHECKING([whether to build TurboJPEG C wrapper])
AC_ARG_WITH([turbojpeg],
AC_HELP_STRING([--without-turbojpeg],
[Do not include the TurboJPEG wrapper library and associated test programs]))
if test "x$with_12bit" = "xyes"; then
with_turbojpeg=no
fi
if test "x$with_turbojpeg" = "xno"; then
AC_MSG_RESULT(no)
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-turbojpeg"
else
AC_MSG_RESULT(yes)
fi
# Java support
AC_ARG_VAR(JAVAC, [Java compiler command (default: javac)])
if test "x$JAVAC" = "x"; then
JAVAC=javac
fi
AC_SUBST(JAVAC)
AC_ARG_VAR(JAVACFLAGS, [Java compiler flags])
AC_SUBST(JAVACFLAGS)
AC_ARG_VAR(JAR, [Java archive command (default: jar)])
if test "x$JAR" = "x"; then
JAR=jar
fi
AC_SUBST(JAR)
AC_ARG_VAR(JAVA, [Java runtime command (default: java)])
if test "x$JAVA" = "x"; then
JAVA=java
fi
AC_SUBST(JAVA)
AC_ARG_VAR(JNI_CFLAGS,
[C compiler flags needed to include jni.h (default: -I/System/Library/Frameworks/JavaVM.framework/Headers on OS X, '-I/usr/java/include -I/usr/java/include/solaris' on Solaris, and '-I/usr/java/default/include -I/usr/java/default/include/linux' on Linux)])
AC_MSG_CHECKING([whether to build TurboJPEG Java wrapper])
AC_ARG_WITH([java],
AC_HELP_STRING([--with-java], [Build Java wrapper for the TurboJPEG library]))
if test "x$with_12bit" = "xyes" -o "x$with_turbojpeg" = "xno"; then
with_java=no
fi
WITH_JAVA=0
if test "x$with_java" = "xyes"; then
AC_MSG_RESULT(yes)
case $host_os in
darwin*)
DEFAULT_JNI_CFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers
;;
solaris*)
DEFAULT_JNI_CFLAGS='-I/usr/java/include -I/usr/java/include/solaris'
;;
linux*)
DEFAULT_JNI_CFLAGS='-I/usr/java/default/include -I/usr/java/default/include/linux'
;;
esac
if test "x$JNI_CFLAGS" = "x"; then
JNI_CFLAGS=$DEFAULT_JNI_CFLAGS
fi
SAVE_CPPFLAGS=${CPPFLAGS}
CPPFLAGS="${CPPFLAGS} ${JNI_CFLAGS}"
AC_CHECK_HEADERS([jni.h], [DUMMY=1],
[AC_MSG_ERROR([Could not find JNI header file])])
CPPFLAGS=${SAVE_CPPFLAGS}
AC_SUBST(JNI_CFLAGS)
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --with-java"
JAVA_RPM_CONTENTS_1='%dir %{_datadir}/classes'
JAVA_RPM_CONTENTS_2=%{_datadir}/classes/turbojpeg.jar
WITH_JAVA=1
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL([WITH_JAVA], [test "x$with_java" = "xyes"])
AC_SUBST(WITH_JAVA)
AC_SUBST(JAVA_RPM_CONTENTS_1)
AC_SUBST(JAVA_RPM_CONTENTS_2)
# optionally force using gas-preprocessor.pl for compatibility testing
AC_ARG_WITH([gas-preprocessor],
AC_HELP_STRING([--with-gas-preprocessor],
[Force using gas-preprocessor.pl on ARM.]))
if test "x${with_gas_preprocessor}" = "xyes"; then
case $host_os in
darwin*)
CCAS="gas-preprocessor.pl -fix-unreq $CC"
;;
*)
CCAS="gas-preprocessor.pl -no-fix-unreq $CC"
;;
esac
AC_SUBST([CCAS])
fi
# SIMD is optional
AC_ARG_WITH([simd],
AC_HELP_STRING([--without-simd], [Do not include SIMD extensions]))
if test "x$with_12bit" = "xyes"; then
with_simd=no
fi
if test "x${with_simd}" != "xno"; then
require_simd=no
if test "x${with_simd}" = "xyes"; then
require_simd=yes
fi
# Check if we're on a supported CPU
AC_MSG_CHECKING([if we have SIMD optimisations for cpu type])
case "$host_cpu" in
x86_64 | amd64)
AC_MSG_RESULT([yes (x86_64)])
AC_PROG_NASM
simd_arch=x86_64
;;
i*86 | x86 | ia32)
AC_MSG_RESULT([yes (i386)])
AC_PROG_NASM
simd_arch=i386
;;
arm*)
AC_MSG_RESULT([yes (arm)])
AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])
AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE(
[if test "x$ac_use_gas_preprocessor" = "xyes"; then
AC_MSG_RESULT([yes (with gas-preprocessor)])
else
AC_MSG_RESULT([yes])
fi
simd_arch=arm],
[AC_MSG_RESULT([no])
with_simd=no])
if test "x${with_simd}" = "xno"; then
if test "x${require_simd}" = "xyes"; then
AC_MSG_ERROR([SIMD support can't be enabled.])
else
AC_MSG_WARN([SIMD support can't be enabled. Performance will suffer.])
fi
fi
;;
aarch64*)
AC_MSG_RESULT([yes (arm64)])
AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])
AC_CHECK_COMPATIBLE_ARM64_ASSEMBLER_IFELSE(
[if test "x$ac_use_gas_preprocessor" = "xyes"; then
AC_MSG_RESULT([yes (with gas-preprocessor)])
else
AC_MSG_RESULT([yes])
fi
simd_arch=aarch64],
[AC_MSG_RESULT([no])
with_simd=no])
if test "x${with_simd}" = "xno"; then
if test "x${require_simd}" = "xyes"; then
AC_MSG_ERROR([SIMD support can't be enabled.])
else
AC_MSG_WARN([SIMD support can't be enabled. Performance will suffer.])
fi
fi
;;
mips*)
AC_MSG_RESULT([yes (mips)])
AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])
AC_CHECK_COMPATIBLE_MIPS_ASSEMBLER_IFELSE(
[AC_MSG_RESULT([yes])
simd_arch=mips],
[AC_MSG_RESULT([no])
with_simd=no])
if test "x${with_simd}" = "xno"; then
if test "x${require_simd}" = "xyes"; then
AC_MSG_ERROR([SIMD support can't be enabled.])
else
AC_MSG_WARN([SIMD support can't be enabled. Performance will suffer.])
fi
fi
;;
powerpc*)
AC_MSG_RESULT([yes (powerpc)])
simd_arch=powerpc
;;
*)
AC_MSG_RESULT([no ("$host_cpu")])
with_simd=no;
if test "x${require_simd}" = "xyes"; then
AC_MSG_ERROR([SIMD support not available for this CPU.])
else
AC_MSG_WARN([SIMD support not available for this CPU. Performance will suffer.])
fi
;;
esac
if test "x${with_simd}" != "xno"; then
AC_DEFINE([WITH_SIMD], [1], [Use accelerated SIMD routines.])
fi
else
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-simd"
fi
AM_CONDITIONAL([WITH_SIMD], [test "x$with_simd" != "xno"])
AM_CONDITIONAL([WITH_SSE_FLOAT_DCT], [test "x$simd_arch" = "xx86_64" -o "x$simd_arch" = "xi386"])
AM_CONDITIONAL([SIMD_I386], [test "x$simd_arch" = "xi386"])
AM_CONDITIONAL([SIMD_X86_64], [test "x$simd_arch" = "xx86_64"])
AM_CONDITIONAL([SIMD_ARM], [test "x$simd_arch" = "xarm"])
AM_CONDITIONAL([SIMD_ARM_64], [test "x$simd_arch" = "xaarch64"])
AM_CONDITIONAL([SIMD_MIPS], [test "x$simd_arch" = "xmips"])
AM_CONDITIONAL([SIMD_POWERPC], [test "x$simd_arch" = "xpowerpc"])
AM_CONDITIONAL([X86_64], [test "x$host_cpu" = "xx86_64" -o "x$host_cpu" = "xamd64"])
AM_CONDITIONAL([WITH_TURBOJPEG], [test "x$with_turbojpeg" != "xno"])
AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" = "xyes"])
AC_ARG_VAR(PKGNAME, [distribution package name (default: libjpeg-turbo)])
if test "x$PKGNAME" = "x"; then
PKGNAME=$PACKAGE_NAME
fi
AC_SUBST(PKGNAME)
case "$host_cpu" in
x86_64)
RPMARCH=x86_64
DEBARCH=amd64
;;
i*86 | x86 | ia32)
RPMARCH=i386
DEBARCH=i386
;;
*)
RPMARCH=`uname -m`
DEBARCH=$RPMARCH
;;
esac
if test "${docdir}" = ""; then
docdir=${datadir}/doc
AC_SUBST(docdir)
fi
AC_SUBST(RPMARCH)
AC_SUBST(RPM_CONFIG_ARGS)
AC_SUBST(DEBARCH)
AC_SUBST(BUILD)
AC_DEFINE_UNQUOTED([BUILD], "$BUILD", [libjpeg-turbo build number])
# NOTE: autoheader automatically modifies the input file of the first
# invocation of AC_CONFIG_HEADERS, so we put config.h first to prevent
# jconfig.h.in from being clobbered. config.h is used only internally, whereas
# jconfig.h contains macros that are relevant to external programs (macros that
# specify which features were built into the library.)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_HEADERS([jconfig.h])
AC_CONFIG_HEADERS([jconfigint.h])
AC_CONFIG_FILES([pkgscripts/libjpeg-turbo.spec.tmpl:release/libjpeg-turbo.spec.in])
AC_CONFIG_FILES([pkgscripts/makecygwinpkg.tmpl:release/makecygwinpkg.in])
AC_CONFIG_FILES([pkgscripts/makedpkg.tmpl:release/makedpkg.in])
AC_CONFIG_FILES([pkgscripts/makemacpkg.tmpl:release/makemacpkg.in])
AC_CONFIG_FILES([pkgscripts/uninstall.tmpl:release/uninstall.in])
AC_CONFIG_FILES([pkgscripts/libjpeg.pc:release/libjpeg.pc.in])
AC_CONFIG_FILES([pkgscripts/libturbojpeg.pc:release/libturbojpeg.pc.in])
if test "x$with_turbojpeg" != "xno"; then
AC_CONFIG_FILES([tjbenchtest])
fi
if test "x$with_java" = "xyes"; then
AC_CONFIG_FILES([tjbenchtest.java])
AC_CONFIG_FILES([tjexampletest])
fi
AC_CONFIG_FILES([libjpeg.map])
AC_CONFIG_FILES([Makefile simd/Makefile])
AC_CONFIG_FILES([java/Makefile])
AC_CONFIG_FILES([md5/Makefile])
AC_OUTPUT

View File

@@ -1,57 +1,57 @@
set(JAR_FILE turbojpeg.jar)
set(MANIFEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/MANIFEST.MF)
find_package(Java REQUIRED)
find_package(JNI REQUIRED)
set(JAVA_CLASSNAMES org/libjpegturbo/turbojpeg/TJ
org/libjpegturbo/turbojpeg/TJCompressor
org/libjpegturbo/turbojpeg/TJCustomFilter
org/libjpegturbo/turbojpeg/TJDecompressor
org/libjpegturbo/turbojpeg/TJException
org/libjpegturbo/turbojpeg/TJScalingFactor
org/libjpegturbo/turbojpeg/TJTransform
org/libjpegturbo/turbojpeg/TJTransformer
org/libjpegturbo/turbojpeg/YUVImage
TJUnitTest
TJExample
TJBench)
if(MSVC_IDE)
set(OBJDIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
else()
set(OBJDIR ${CMAKE_CURRENT_BINARY_DIR})
# Allow the Java compiler flags to be set using an environment variable
if(NOT DEFINED CMAKE_JAVA_COMPILE_FLAGS AND DEFINED ENV{JAVAFLAGS})
set(CMAKE_JAVA_COMPILE_FLAGS $ENV{JAVAFLAGS})
endif()
include(UseJava)
set(CMAKE_JAVA_COMPILE_FLAGS "${CMAKE_JAVA_COMPILE_FLAGS} -J-Dfile.encoding=UTF8")
message(STATUS "CMAKE_JAVA_COMPILE_FLAGS = ${CMAKE_JAVA_COMPILE_FLAGS}")
string(REGEX REPLACE " " ";" CMAKE_JAVA_COMPILE_FLAGS "${CMAKE_JAVA_COMPILE_FLAGS}")
set(JAVAARGS "" CACHE STRING "Additional arguments to pass to java when running unit tests (example: -d32)")
message(STATUS "JAVAARGS = ${JAVAARGS}")
set(JAVA_SOURCES org/libjpegturbo/turbojpeg/TJ.java
org/libjpegturbo/turbojpeg/TJCompressor.java
org/libjpegturbo/turbojpeg/TJCustomFilter.java
org/libjpegturbo/turbojpeg/TJDecompressor.java
org/libjpegturbo/turbojpeg/TJException.java
org/libjpegturbo/turbojpeg/TJScalingFactor.java
org/libjpegturbo/turbojpeg/TJTransform.java
org/libjpegturbo/turbojpeg/TJTransformer.java
org/libjpegturbo/turbojpeg/YUVImage.java
TJUnitTest.java
TJExample.java
TJBench.java)
set(TURBOJPEG_DLL_NAME "turbojpeg")
if(MINGW)
set(TURBOJPEG_DLL_NAME "libturbojpeg")
endif()
configure_file(org/libjpegturbo/turbojpeg/TJLoader.java.in
${CMAKE_CURRENT_BINARY_DIR}/org/libjpegturbo/turbojpeg/TJLoader.java)
set(JAVA_SOURCES "")
set(JAVA_CLASSES "")
set(JAVA_CLASSES_FULL "")
foreach(class ${JAVA_CLASSNAMES})
set(JAVA_SOURCES ${JAVA_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/${class}.java)
set(JAVA_CLASSES ${JAVA_CLASSES} ${class}.class)
set(JAVA_CLASSES_FULL ${JAVA_CLASSES_FULL} ${OBJDIR}/${class}.class)
endforeach()
if(WIN32)
configure_file(org/libjpegturbo/turbojpeg/TJLoader-win.java.in
${CMAKE_CURRENT_BINARY_DIR}/org/libjpegturbo/turbojpeg/TJLoader.java)
else()
configure_file(org/libjpegturbo/turbojpeg/TJLoader-unix.java.in
${CMAKE_CURRENT_BINARY_DIR}/org/libjpegturbo/turbojpeg/TJLoader.java)
endif()
set(JAVA_SOURCES ${JAVA_SOURCES}
${CMAKE_CURRENT_BINARY_DIR}/org/libjpegturbo/turbojpeg/TJLoader.java)
set(JAVA_CLASSES ${JAVA_CLASSES}
org/libjpegturbo/turbojpeg/TJLoader.class)
set(JAVA_CLASSES_FULL ${JAVA_CLASSES_FULL}
${OBJDIR}/org/libjpegturbo/turbojpeg/TJLoader.class)
string(REGEX REPLACE " " ";" JAVACFLAGS "${JAVACFLAGS}")
add_custom_command(OUTPUT ${JAVA_CLASSES_FULL} DEPENDS ${JAVA_SOURCES}
COMMAND ${JAVA_COMPILE} ARGS ${JAVACFLAGS} -d ${OBJDIR} ${JAVA_SOURCES})
add_custom_command(OUTPUT ${JAR_FILE} DEPENDS ${JAVA_CLASSES_FULL}
${MANIFEST_FILE}
COMMAND ${JAVA_ARCHIVE} cfm ${JAR_FILE} ${MANIFEST_FILE} ${JAVA_CLASSES}
WORKING_DIRECTORY ${OBJDIR})
add_custom_target(java ALL DEPENDS ${JAR_FILE})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${JAR_FILE} DESTINATION classes)
if(MSYS)
# UGLY HACK ALERT: If we don't do this, then UseJava.cmake will separate
# class path members with a semicolon, which is interpreted as a command
# separator by the MSYS shell.
set(CMAKE_HOST_SYSTEM_NAME_BAK ${CMAKE_HOST_SYSTEM_NAME})
set(CMAKE_HOST_SYSTEM_NAME "MSYS")
endif()
add_jar(turbojpeg-java ${JAVA_SOURCES} OUTPUT_NAME turbojpeg
ENTRY_POINT TJExample)
if(MSYS)
set(CMAKE_HOST_SYSTEM_NAME ${CMAKE_HOST_SYSTEM_NAME})
endif()
install_jar(turbojpeg-java ${DATADIR}/classes)

View File

@@ -1,75 +0,0 @@
JAVAROOT = .
org/libjpegturbo/turbojpeg/TJLoader.java: $(srcdir)/org/libjpegturbo/turbojpeg/TJLoader.java.tmpl
mkdir -p org/libjpegturbo/turbojpeg; \
cat $(srcdir)/org/libjpegturbo/turbojpeg/TJLoader.java.tmpl | \
sed s@%{__libdir}@$(libdir)@g > org/libjpegturbo/turbojpeg/TJLoader.java
JAVASOURCES = org/libjpegturbo/turbojpeg/TJ.java \
org/libjpegturbo/turbojpeg/TJCompressor.java \
org/libjpegturbo/turbojpeg/TJCustomFilter.java \
org/libjpegturbo/turbojpeg/TJDecompressor.java \
org/libjpegturbo/turbojpeg/TJException.java \
org/libjpegturbo/turbojpeg/TJScalingFactor.java \
org/libjpegturbo/turbojpeg/TJTransform.java \
org/libjpegturbo/turbojpeg/TJTransformer.java \
org/libjpegturbo/turbojpeg/YUVImage.java \
TJExample.java \
TJUnitTest.java \
TJBench.java
JNIHEADERS = org_libjpegturbo_turbojpeg_TJ.h \
org_libjpegturbo_turbojpeg_TJCompressor.h \
org_libjpegturbo_turbojpeg_TJDecompressor.h \
org_libjpegturbo_turbojpeg_TJTransformer.h
if WITH_JAVA
nodist_noinst_JAVA = ${JAVASOURCES} org/libjpegturbo/turbojpeg/TJLoader.java
JAVA_CLASSES = org/libjpegturbo/turbojpeg/TJ.class \
org/libjpegturbo/turbojpeg/TJCompressor.class \
org/libjpegturbo/turbojpeg/TJCustomFilter.class \
org/libjpegturbo/turbojpeg/TJDecompressor.class \
org/libjpegturbo/turbojpeg/TJException.class \
org/libjpegturbo/turbojpeg/TJLoader.class \
org/libjpegturbo/turbojpeg/TJScalingFactor.class \
org/libjpegturbo/turbojpeg/TJTransform.class \
org/libjpegturbo/turbojpeg/TJTransformer.class \
org/libjpegturbo/turbojpeg/YUVImage.class \
TJExample.class \
TJUnitTest.class \
TJBench.class
all: all-am turbojpeg.jar
turbojpeg.jar: classnoinst.stamp ${srcdir}/MANIFEST.MF
$(JAR) cfm turbojpeg.jar ${srcdir}/MANIFEST.MF $(JAVA_CLASSES)
clean-local:
rm -f turbojpeg.jar
install-exec-local: turbojpeg.jar
mkdir -p $(DESTDIR)/$(datadir)/classes
$(INSTALL) -m 644 turbojpeg.jar $(DESTDIR)/$(datadir)/classes/
uninstall-local:
rm -f $(DESTDIR)/$(datadir)/classes/turbojpeg.jar
if [ -d $(DESTDIR)/$(datadir)/classes ]; then rmdir $(DESTDIR)/$(datadir)/classes; fi
headers: all
javah -d ${srcdir} org.libjpegturbo.turbojpeg.TJ; \
javah -d ${srcdir} org.libjpegturbo.turbojpeg.TJCompressor; \
javah -d ${srcdir} org.libjpegturbo.turbojpeg.TJDecompressor; \
javah -d ${srcdir} org.libjpegturbo.turbojpeg.TJTransformer
docs: all
mkdir -p ${srcdir}/doc; \
javadoc -notimestamp -d ${srcdir}/doc -sourcepath ${srcdir} org.libjpegturbo.turbojpeg
endif
EXTRA_DIST = MANIFEST.MF ${JAVASOURCES} ${JNIHEADERS} doc CMakeLists.txt \
org/libjpegturbo/turbojpeg/TJLoader.java.tmpl \
org/libjpegturbo/turbojpeg/TJLoader.java.in

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C)2011-2013 D. R. Commander. All Rights Reserved.
* Copyright (C)2011-2013, 2016 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -36,19 +36,19 @@ final class TJLoader {
String os = System.getProperty("os.name").toLowerCase();
if (os.indexOf("mac") >= 0) {
try {
System.load("%{__libdir}/libturbojpeg.jnilib");
System.load("@LIBDIR@/libturbojpeg.jnilib");
} catch (java.lang.UnsatisfiedLinkError e2) {
System.load("/usr/lib/libturbojpeg.jnilib");
}
} else {
try {
System.load("%{__libdir}/libturbojpeg.so");
System.load("@LIBDIR@/libturbojpeg.so");
} catch (java.lang.UnsatisfiedLinkError e3) {
String libdir = "%{__libdir}";
if (libdir.equals("/opt/libjpeg-turbo/lib64")) {
System.load("/opt/libjpeg-turbo/lib32/libturbojpeg.so");
} else if (libdir.equals("/opt/libjpeg-turbo/lib32")) {
System.load("/opt/libjpeg-turbo/lib64/libturbojpeg.so");
String libdir = "@LIBDIR@";
if (libdir.equals("@DEFAULT_CMAKE_INSTALL_PREFIX@/lib64")) {
System.load("@DEFAULT_CMAKE_INSTALL_PREFIX@/lib32/libturbojpeg.so");
} else if (libdir.equals("@DEFAULT_CMAKE_INSTALL_PREFIX@/lib32")) {
System.load("@DEFAULT_CMAKE_INSTALL_PREFIX@/lib64/libturbojpeg.so");
} else {
throw e3;
}

View File

@@ -1,19 +1,25 @@
/* Version ID for the JPEG library.
* Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
*/
#define JPEG_LIB_VERSION 62 /* Version 6b */
#define JPEG_LIB_VERSION @JPEG_LIB_VERSION@
/* libjpeg-turbo version */
#define LIBJPEG_TURBO_VERSION 0
#define LIBJPEG_TURBO_VERSION @VERSION@
/* libjpeg-turbo version in integer form */
#define LIBJPEG_TURBO_VERSION_NUMBER 0
#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
/* Support arithmetic encoding */
#undef C_ARITH_CODING_SUPPORTED
#cmakedefine C_ARITH_CODING_SUPPORTED
/* Support arithmetic decoding */
#undef D_ARITH_CODING_SUPPORTED
#cmakedefine D_ARITH_CODING_SUPPORTED
/* Support in-memory source/destination managers */
#cmakedefine MEM_SRCDST_SUPPORTED
/* Use accelerated SIMD routines. */
#cmakedefine WITH_SIMD
/*
* Define BITS_IN_JSAMPLE as either
@@ -24,50 +30,44 @@
* We do not support run-time selection of data precision, sorry.
*/
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
#cmakedefine HAVE_LOCALE_H
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
#cmakedefine HAVE_STDDEF_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
#cmakedefine HAVE_STDLIB_H
/* Define to 1 if the system has the type `unsigned char'. */
#undef HAVE_UNSIGNED_CHAR
/* Define to 1 if the system has the type `unsigned short'. */
#undef HAVE_UNSIGNED_SHORT
/* Compiler does not support pointers to undefined structures. */
#undef INCOMPLETE_TYPES_BROKEN
/* Support in-memory source/destination managers */
#undef MEM_SRCDST_SUPPORTED
/* Define if you need to include <sys/types.h> to get size_t. */
#cmakedefine NEED_SYS_TYPES_H
/* Define if you have BSD-like bzero and bcopy in <strings.h> rather than
memset/memcpy in <string.h>. */
#undef NEED_BSD_STRINGS
#cmakedefine NEED_BSD_STRINGS
/* Define if you need to include <sys/types.h> to get size_t. */
#undef NEED_SYS_TYPES_H
/* Define to 1 if the system has the type `unsigned char'. */
#cmakedefine HAVE_UNSIGNED_CHAR
/* Define to 1 if the system has the type `unsigned short'. */
#cmakedefine HAVE_UNSIGNED_SHORT
/* Compiler does not support pointers to undefined structures. */
#cmakedefine INCOMPLETE_TYPES_BROKEN
/* Define if your (broken) compiler shifts signed values as if they were
unsigned. */
#undef RIGHT_SHIFT_IS_UNSIGNED
/* Use accelerated SIMD routines. */
#undef WITH_SIMD
#cmakedefine RIGHT_SHIFT_IS_UNSIGNED
/* Define to 1 if type `char' is unsigned and you are not using gcc. */
#ifndef __CHAR_UNSIGNED__
# undef __CHAR_UNSIGNED__
#cmakedefine __CHAR_UNSIGNED__
#endif
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* #undef const */
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
/* #undef size_t */

View File

@@ -1,14 +1,18 @@
/* libjpeg-turbo build number */
#undef BUILD
#define BUILD "@BUILD@"
/* How to obtain function inlining. */
#undef INLINE
#define INLINE @INLINE@
/* Define to the full name of this package. */
#undef PACKAGE_NAME
#define PACKAGE_NAME "@CMAKE_PROJECT_NAME@"
/* Version number of package */
#undef VERSION
#define VERSION "@VERSION@"
#ifndef _WIN32
/* The size of `size_t', as computed by sizeof. */
#undef SIZEOF_SIZE_T
#define SIZEOF_SIZE_T @SIZE_T@
#endif

View File

@@ -1,4 +0,0 @@
noinst_PROGRAMS = md5cmp
md5cmp_SOURCES = md5cmp.c md5.c md5hl.c md5.h
md5cmp_CFLAGS = -I$(srcdir)

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
<title>libjpeg-turbo</title>
<title>@CMAKE_PROJECT_NAME@</title>
<welcome file="Welcome.rtf" />
<readme file="ReadMe.txt" />
<license file="License.rtf" />
@@ -12,13 +12,13 @@
<options customize="never" />
<choices-outline>
<line choice="default">
<line choice="com.libjpeg-turbo.libjpeg-turbo"/>
<line choice="@PKGID@"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="com.libjpeg-turbo.libjpeg-turbo" visible="false">
<pkg-ref id="com.libjpeg-turbo.libjpeg-turbo"/>
<choice id="@PKGID@" visible="false">
<pkg-ref id="@PKGID@"/>
</choice>
<pkg-ref auth="root"
id="com.libjpeg-turbo.libjpeg-turbo">libjpeg-turbo.pkg</pkg-ref>
id="@PKGID@">@PKGNAME@.pkg</pkg-ref>
</installer-gui-script>

View File

@@ -1,11 +1,11 @@
Package: {__PKGNAME}
Version: {__VERSION}-{__BUILD}
Version: @VERSION@-@BUILD@
Section: misc
Priority: optional
Architecture: {__ARCH}
Essential: no
Maintainer: The libjpeg-turbo Project <information@libjpeg-turbo.org>
Homepage: http://www.libjpeg-turbo.org
Maintainer: @PKGVENDOR@ <@PKGEMAIL@>
Homepage: @PKGURL@
Installed-Size: {__SIZE}
Description: A SIMD-accelerated JPEG codec that provides both the libjpeg and TurboJPEG APIs
libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,

View File

@@ -46,13 +46,13 @@ Section "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ (required)"
File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg.dll"
!endif
!ifdef GCC
File "/oname=libjpeg-@DLL_VERSION@.dll" "@CMAKE_BINARY_DIR@\sharedlib\libjpeg-*.dll"
File "@CMAKE_BINARY_DIR@\libjpeg-@SO_MAJOR_VERSION@.dll"
!else
File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}jpeg@DLL_VERSION@.dll"
File "@CMAKE_BINARY_DIR@\${BUILDDIR}jpeg@SO_MAJOR_VERSION@.dll"
!endif
File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}cjpeg.exe"
File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}djpeg.exe"
File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}jpegtran.exe"
File "@CMAKE_BINARY_DIR@\${BUILDDIR}cjpeg.exe"
File "@CMAKE_BINARY_DIR@\${BUILDDIR}djpeg.exe"
File "@CMAKE_BINARY_DIR@\${BUILDDIR}jpegtran.exe"
File "@CMAKE_BINARY_DIR@\${BUILDDIR}tjbench.exe"
File "@CMAKE_BINARY_DIR@\${BUILDDIR}rdjpgcom.exe"
File "@CMAKE_BINARY_DIR@\${BUILDDIR}wrjpgcom.exe"
@@ -60,17 +60,17 @@ Section "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ (required)"
!ifdef GCC
File "@CMAKE_BINARY_DIR@\libturbojpeg.dll.a"
File "@CMAKE_BINARY_DIR@\libturbojpeg.a"
File "@CMAKE_BINARY_DIR@\sharedlib\libjpeg.dll.a"
File "@CMAKE_BINARY_DIR@\libjpeg.dll.a"
File "@CMAKE_BINARY_DIR@\libjpeg.a"
!else
File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg.lib"
File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg-static.lib"
File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}jpeg.lib"
File "@CMAKE_BINARY_DIR@\${BUILDDIR}jpeg.lib"
File "@CMAKE_BINARY_DIR@\${BUILDDIR}jpeg-static.lib"
!endif
!ifdef JAVA
SetOutPath $INSTDIR\classes
File "@CMAKE_BINARY_DIR@\java\${BUILDDIR}turbojpeg.jar"
File "@CMAKE_BINARY_DIR@\java\turbojpeg.jar"
!endif
SetOutPath $INSTDIR\include
File "@CMAKE_BINARY_DIR@\jconfig.h"
@@ -110,7 +110,7 @@ Section "Uninstall"
DeleteRegKey HKLM "SOFTWARE\@INST_REG_NAME@ @VERSION@"
!ifdef GCC
Delete $INSTDIR\bin\libjpeg-@DLL_VERSION@.dll
Delete $INSTDIR\bin\libjpeg-@SO_MAJOR_VERSION@.dll
Delete $INSTDIR\bin\libturbojpeg.dll
Delete $SYSDIR\libturbojpeg.dll
Delete $INSTDIR\lib\libturbojpeg.dll.a"
@@ -118,7 +118,7 @@ Section "Uninstall"
Delete $INSTDIR\lib\libjpeg.dll.a"
Delete $INSTDIR\lib\libjpeg.a"
!else
Delete $INSTDIR\bin\jpeg@DLL_VERSION@.dll
Delete $INSTDIR\bin\jpeg@SO_MAJOR_VERSION@.dll
Delete $INSTDIR\bin\turbojpeg.dll
Delete $SYSDIR\turbojpeg.dll
Delete $INSTDIR\lib\jpeg.lib

View File

@@ -1,35 +1,20 @@
# Path under which libjpeg-turbo should be installed
%define _prefix %{__prefix}
# Path under which executables should be installed
%define _bindir %{__bindir}
# Path under which Java classes and man pages should be installed
%define _datadir %{__datadir}
# Path under which docs should be installed
%define _docdir /usr/share/doc/%{name}-%{version}
# Path under which headers should be installed
%define _includedir %{__includedir}
# _libdir is set to %{_prefix}/%{_lib} by default
%ifarch x86_64
%define _lib lib64
%else
%if "%{_prefix}" == "/opt/libjpeg-turbo"
%define _lib lib32
%endif
%endif
# Path under which man pages should be installed
%define _mandir %{__mandir}
%define _prefix @CMAKE_INSTALL_PREFIX@
%define _bindir @BINDIR@
%define _datadir @DATADIR@
%define _docdir %{_defaultdocdir}/%{name}-%{version}
%define _includedir @INCLUDEDIR@
%define _libdir @LIBDIR@
%define _mandir @MANDIR@
%define _enable_static @ENABLE_STATIC@
%define _enable_shared @ENABLE_SHARED@
%define _with_turbojpeg @WITH_TURBOJPEG@
%define _with_java @WITH_JAVA@
Summary: A SIMD-accelerated JPEG codec that provides both the libjpeg and TurboJPEG APIs
Name: @PKGNAME@
Version: @VERSION@
Vendor: The libjpeg-turbo Project
URL: http://www.libjpeg-turbo.org
Vendor: @PKGVENDOR@
URL: @PKGURL@
Group: System Environment/Libraries
#-->Source0: http://prdownloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-%{version}.tar.gz
Release: @BUILD@
@@ -37,9 +22,9 @@ License: BSD-style
BuildRoot: %{_blddir}/%{name}-buildroot-%{version}-%{release}
Prereq: /sbin/ldconfig
%ifarch x86_64
Provides: %{name} = %{version}-%{release}, @PACKAGE_NAME@ = %{version}-%{release}, libturbojpeg.so()(64bit)
Provides: %{name} = %{version}-%{release}, @CMAKE_PROJECT_NAME@ = %{version}-%{release}, libturbojpeg.so()(64bit)
%else
Provides: %{name} = %{version}-%{release}, @PACKAGE_NAME@ = %{version}-%{release}, libturbojpeg.so
Provides: %{name} = %{version}-%{release}, @CMAKE_PROJECT_NAME@ = %{version}-%{release}, libturbojpeg.so
%endif
%description
@@ -65,35 +50,74 @@ of making high-speed JPEG compression/decompression technology available to a
broader range of users and developers.
#-->%prep
#-->%setup -q -n libjpeg-turbo-%{version}
#-->%setup -q -n @CMAKE_PROJECT_NAME@-%{version}
#-->%build
#-->./configure prefix=%{_prefix} bindir=%{_bindir} datadir=%{_datadir} \
#--> docdir=%{_docdir} includedir=%{_includedir} libdir=%{_libdir} \
#--> mandir=%{_mandir} JPEG_LIB_VERSION=@JPEG_LIB_VERSION@ \
#--> SO_MAJOR_VERSION=@SO_MAJOR_VERSION@ SO_MINOR_VERSION=@SO_MINOR_VERSION@ \
#--> --with-pic @RPM_CONFIG_ARGS@
#-->cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ \
#--> -DCMAKE_INSTALL_PREFIX=%{_prefix} \
#--> -DCMAKE_POSITION_INDEPENDENT_CODE=@CMAKE_POSITION_INDEPENDENT_CODE@ \
#--> -DBINDIR=%{_bindir} -DBUILD=%{release} -DDATADIR=%{_datadir} \
#--> -DDOCDIR=%{_docdir} \
#--> -DSO_MAJOR_VERSION=@SO_MAJOR_VERSION@ \
#--> -DSO_MINOR_VERSION=@SO_MINOR_VERSION@ \
#--> -DENABLE_SHARED=@ENABLE_SHARED@ -DENABLE_STATIC=@ENABLE_STATIC@ \
#--> -DINCLUDEDIR=%{_includedir} -DJPEG_LIB_VERSION=@JPEG_LIB_VERSION@ \
#--> -DLIBDIR=%{_libdir} -DMANDIR=%{_mandir} \
#--> -DREQUIRE_SIMD=@REQUIRE_SIMD@ \
#--> -DWITH_12BIT=@WITH_12BIT@ -DWITH_ARITH_DEC=@WITH_ARITH_DEC@ \
#--> -DWITH_ARITH_ENC=@WITH_ARITH_ENC@ -DWITH_JAVA=@WITH_JAVA@ \
#--> -DWITH_JPEG7=@WITH_JPEG7@ -DWITH_JPEG8=@WITH_JPEG8@ \
#--> -DWITH_MEM_SRCDST=@WITH_MEM_SRCDST@ -DWITH_SIMD=@WITH_SIMD@ \
#--> -DWITH_TURBOJPEG=@WITH_TURBOJPEG@ .
#-->make DESTDIR=$RPM_BUILD_ROOT
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT docdir=%{_docdir} exampledir=%{_docdir}
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
make install DESTDIR=$RPM_BUILD_ROOT
/sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
#-->%if 0
LJT_LIBDIR=%{__libdir}
if [ ! "$LJT_LIBDIR" = "%{_libdir}" ]; then
echo ERROR: libjpeg-turbo must be configured with libdir=%{_prefix}/%{_lib} when generating an in-tree RPM for this architecture.
exit 1
# This is only needed to support in-tree RPM generation via 'make rpm'. When
# building from a SRPM, we control where things are installed via CMake
# variables.
safedirmove ()
{
if [ "$1" = "$2" ]; then
return 0
fi
if [ "$1" = "" -o ! -d "$1" ]; then
echo safedirmove: source dir $1 is not valid
return 1
fi
if [ "$2" = "" -o -e "$2" ]; then
echo safedirmove: dest dir $2 is not valid
return 1
fi
if [ "$3" = "" -o -e "$3" ]; then
echo safedirmove: tmp dir $3 is not valid
return 1
fi
mkdir -p $3
mv $1/* $3/
rmdir $1
mkdir -p $2
mv $3/* $2/
rmdir $3
return 0
}
LJT_DOCDIR=@DOCDIR@
if [ ! "$LJT_DOCDIR" = "%{_docdir}" ]; then
safedirmove $RPM_BUILD_ROOT/$LJT_DOCDIR $RPM_BUILD_ROOT/%{_docdir} $RPM_BUILD_ROOT/__tmpdoc
fi
#-->%endif
LJT_DOCDIR=%{__docdir}
if [ "%{_prefix}" = "/opt/libjpeg-turbo" -a "$LJT_DOCDIR" = "/opt/libjpeg-turbo/doc" ]; then
LJT_DOCDIR=@DOCDIR@
if [ "%{_prefix}" = "@DEFAULT_CMAKE_INSTALL_PREFIX@" -a "$LJT_DOCDIR" = "@DEFAULT_CMAKE_INSTALL_PREFIX@/doc" ]; then
ln -fs %{_docdir} $RPM_BUILD_ROOT/$LJT_DOCDIR
fi
@@ -109,34 +133,48 @@ rm -rf $RPM_BUILD_ROOT
%dir %{_docdir}
%doc %{_docdir}/*
%dir %{_prefix}
%if "%{_prefix}" == "/opt/libjpeg-turbo" && "%{_docdir}" != "%{_prefix}/doc"
%if "%{_prefix}" == "@DEFAULT_CMAKE_INSTALL_PREFIX@" && "%{_docdir}" != "%{_prefix}/doc"
%{_prefix}/doc
%endif
%dir %{_bindir}
%{_bindir}/cjpeg
%{_bindir}/djpeg
%{_bindir}/jpegtran
%{_bindir}/tjbench
%if "%{_with_turbojpeg}" == "1"
%{_bindir}/tjbench
%endif
%{_bindir}/rdjpgcom
%{_bindir}/wrjpgcom
%dir %{_libdir}
%{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@.@SO_AGE@.@SO_MINOR_VERSION@
%{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@
%{_libdir}/libjpeg.so
%{_libdir}/libjpeg.a
%if "%{_enable_shared}" == "1"
%{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@.@SO_AGE@.@SO_MINOR_VERSION@
%{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@
%{_libdir}/libjpeg.so
%endif
%if "%{_enable_static}" == "1"
%{_libdir}/libjpeg.a
%endif
%{_libdir}/pkgconfig
%{_libdir}/pkgconfig/libjpeg.pc
%{_libdir}/libturbojpeg.so.0.1.0
%{_libdir}/libturbojpeg.so.0
%{_libdir}/libturbojpeg.so
%{_libdir}/libturbojpeg.a
%{_libdir}/pkgconfig/libturbojpeg.pc
%if "%{_with_turbojpeg}" == "1"
%if "%{_enable_shared}" == "1" || "%{_with_java}" == "1"
%{_libdir}/libturbojpeg.so.@TURBOJPEG_SO_VERSION@
%{_libdir}/libturbojpeg.so.@TURBOJPEG_SO_MAJOR_VERSION@
%{_libdir}/libturbojpeg.so
%endif
%if "%{_enable_static}" == "1"
%{_libdir}/libturbojpeg.a
%endif
%{_libdir}/pkgconfig/libturbojpeg.pc
%endif
%dir %{_includedir}
%{_includedir}/jconfig.h
%{_includedir}/jerror.h
%{_includedir}/jmorecfg.h
%{_includedir}/jpeglib.h
%{_includedir}/turbojpeg.h
%if "%{_with_turbojpeg}" == "1"
%{_includedir}/turbojpeg.h
%endif
%dir %{_mandir}
%dir %{_mandir}/man1
%{_mandir}/man1/cjpeg.1*
@@ -147,7 +185,8 @@ rm -rf $RPM_BUILD_ROOT
%if "%{_prefix}" != "%{_datadir}"
%dir %{_datadir}
%endif
@JAVA_RPM_CONTENTS_1@
@JAVA_RPM_CONTENTS_2@
%if "%{_with_java}" == "1"
%dir %{_datadir}/classes
%{_datadir}/classes/turbojpeg.jar
%endif
%changelog

View File

@@ -1,10 +1,10 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=@LIBDIR@
includedir=@INCLUDEDIR@
Name: libjpeg
Description: A SIMD-accelerated JPEG codec that provides the libjpeg API
Version: @PACKAGE_VERSION@
Version: @VERSION@
Libs: -L${libdir} -ljpeg
Cflags: -I${includedir}

View File

@@ -1,10 +1,10 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=@LIBDIR@
includedir=@INCLUDEDIR@
Name: libturbojpeg
Description: A SIMD-accelerated JPEG codec that provides the TurboJPEG API
Version: @PACKAGE_VERSION@
Version: @VERSION@
Libs: -L${libdir} -lturbojpeg
Cflags: -I${includedir}

View File

@@ -15,23 +15,47 @@ onexit()
fi
}
safedirmove ()
{
if [ "$1" = "$2" ]; then
return 0
fi
if [ "$1" = "" -o ! -d "$1" ]; then
echo safedirmove: source dir $1 is not valid
return 1
fi
if [ "$2" = "" -o -e "$2" ]; then
echo safedirmove: dest dir $2 is not valid
return 1
fi
if [ "$3" = "" -o -e "$3" ]; then
echo safedirmove: tmp dir $3 is not valid
return 1
fi
mkdir -p $3
mv $1/* $3/
rmdir $1
mkdir -p $2
mv $3/* $2/
rmdir $3
return 0
}
PACKAGE_NAME=@PKGNAME@
VERSION=@VERSION@
BUILD=@BUILD@
SRCDIR=@abs_top_srcdir@
PREFIX=%{__prefix}
DOCDIR=%{__docdir}
LIBDIR=%{__libdir}
PREFIX=@CMAKE_INSTALL_PREFIX@
DOCDIR=@DOCDIR@
LIBDIR=@LIBDIR@
umask 022
rm -f $PACKAGE_NAME-$VERSION-$BUILD.tar.bz2
TMPDIR=`mktemp -d /tmp/ljtbuild.XXXXXX`
__PWD=`pwd`
make install DESTDIR=$TMPDIR/pkg docdir=/usr/share/doc/$PACKAGE_NAME-$VERSION \
exampledir=/usr/share/doc/$PACKAGE_NAME-$VERSION
rm $TMPDIR/pkg$LIBDIR/*.la
if [ "$PREFIX" = "/opt/libjpeg-turbo" -a "$DOCDIR" = "/opt/libjpeg-turbo/doc" ]; then
make install DESTDIR=$TMPDIR/pkg
if [ "$PREFIX" = "@DEFAULT_CMAKE_INSTALL_PREFIX@" -a "$DOCDIR" = "@DEFAULT_CMAKE_INSTALL_PREFIX@/doc" ]; then
safedirmove $TMPDIR/pkg$DOCDIR $TMPDIR/pkg/usr/share/doc/$PACKAGE_NAME-$VERSION $TMPDIR/__tmpdoc
ln -fs /usr/share/doc/$PACKAGE_NAME-$VERSION $TMPDIR/pkg$DOCDIR
fi
cd $TMPDIR/pkg

View File

@@ -21,6 +21,32 @@ uid()
id | cut -f2 -d = | cut -f1 -d \(;
}
safedirmove ()
{
if [ "$1" = "$2" ]; then
return 0
fi
if [ "$1" = "" -o ! -d "$1" ]; then
echo safedirmove: source dir $1 is not valid
return 1
fi
if [ "$2" = "" -o -e "$2" ]; then
echo safedirmove: dest dir $2 is not valid
return 1
fi
if [ "$3" = "" -o -e "$3" ]; then
echo safedirmove: tmp dir $3 is not valid
return 1
fi
mkdir -p $3
mv $1/* $3/
rmdir $1
mkdir -p $2
mv $3/* $2/
rmdir $3
return 0
}
makedeb()
{
SUPPLEMENT=$1
@@ -37,26 +63,29 @@ makedeb()
mkdir $TMPDIR/DEBIAN
if [ $SUPPLEMENT = 1 ]; then
make install DESTDIR=$TMPDIR bindir=/dummy/bin datadir=/dummy/data \
docdir=/dummy/doc includedir=/dummy/include mandir=/dummy/man
rm -f $TMPDIR$LIBDIR/*.la
rm -rf $TMPDIR/dummy
make install DESTDIR=$TMPDIR
rm -rf $TMPDIR$BINDIR
if [ "$DATADIR" != "$PREFIX" ]; then
rm -rf $TMPDIR$DATADIR
else
rm -rf $TMPDIR$PREFIX/classes
fi
rm -rf $TMPDIR$DOCDIR
rm -rf $TMPDIR$INCLUDEDIR
rm -rf $TMPDIR$MANDIR
else
make install DESTDIR=$TMPDIR docdir=/usr/share/doc/$DIRNAME-$VERSION \
exampledir=/usr/share/doc/$DIRNAME-$VERSION
rm -f $TMPDIR$LIBDIR/*.la
if [ "$PREFIX" = "/opt/libjpeg-turbo" -a "$DOCDIR" = "/opt/libjpeg-turbo/doc" ]; then
make install DESTDIR=$TMPDIR
if [ "$PREFIX" = "@DEFAULT_CMAKE_INSTALL_PREFIX@" -a "$DOCDIR" = "@DEFAULT_CMAKE_INSTALL_PREFIX@/doc" ]; then
safedirmove $TMPDIR/$DOCDIR $TMPDIR/usr/share/doc/$PACKAGE_NAME-$VERSION $TMPDIR/__tmpdoc
ln -fs /usr/share/doc/$DIRNAME-$VERSION $TMPDIR$DOCDIR
fi
fi
SIZE=`du -s $TMPDIR | cut -f1`
(cat $SRCDIR/release/deb-control.tmpl | sed s/{__PKGNAME}/$PACKAGE_NAME/g \
| sed s/{__VERSION}/$VERSION/g | sed s/{__BUILD}/$BUILD/g \
(cat pkgscripts/deb-control | sed s/{__PKGNAME}/$PACKAGE_NAME/g \
| sed s/{__ARCH}/$DEBARCH/g | sed s/{__SIZE}/$SIZE/g \
> $TMPDIR/DEBIAN/control)
/sbin/ldconfig -n $TMPDIR$LIBDIR
$SUDO chown -Rh root:root $TMPDIR/*
@@ -65,12 +94,14 @@ makedeb()
PACKAGE_NAME=@PKGNAME@
VERSION=@VERSION@
BUILD=@BUILD@
DEBARCH=@DEBARCH@
SRCDIR=@abs_top_srcdir@
PREFIX=%{__prefix}
DOCDIR=%{__docdir}
LIBDIR=%{__libdir}
PREFIX=@CMAKE_INSTALL_PREFIX@
BINDIR=@BINDIR@
DATADIR=@DATADIR@
DOCDIR=@DOCDIR@
INCLUDEDIR=@INCLUDEDIR@
LIBDIR=@LIBDIR@
MANDIR=@MANDIR@
if [ ! `uid` -eq 0 ]; then
SUDO=sudo

View File

@@ -15,76 +15,63 @@ onexit()
fi
}
safedirmove ()
{
if [ "$1" = "$2" ]; then
return 0
fi
if [ "$1" = "" -o ! -d "$1" ]; then
echo safedirmove: source dir $1 is not valid
return 1
fi
if [ "$2" = "" -o -e "$2" ]; then
echo safedirmove: dest dir $2 is not valid
return 1
fi
if [ "$3" = "" -o -e "$3" ]; then
echo safedirmove: tmp dir $3 is not valid
return 1
fi
mkdir -p $3
mv $1/* $3/
rmdir $1
mkdir -p $2
mv $3/* $2/
rmdir $3
return 0
}
usage()
{
echo "$0 [-build32 [32-bit build dir]] [-buildarmv6 [ARMv6 build dir]] [-buildarmv7 [ARMv7 build dir]] [-buildarmv7s [ARMv7s build dir] [-buildarmv8 [ARMv8 build dir]] [-lipo [path to lipo]]"
echo "$0 [universal] [-lipo [path to lipo]]"
exit 1
}
UNIVERSAL=0
PACKAGE_NAME=@PKGNAME@
VERSION=@VERSION@
BUILD=@BUILD@
SRCDIR=@abs_top_srcdir@
BUILDDIR32=@abs_top_srcdir@/osxx86
BUILD32=0
BUILDDIRARMV6=@abs_top_srcdir@/iosarmv6
BUILDARMV6=0
BUILDDIRARMV7=@abs_top_srcdir@/iosarmv7
BUILDARMV7=0
BUILDDIRARMV7S=@abs_top_srcdir@/iosarmv7s
BUILDARMV7S=0
BUILDDIRARMV8=@abs_top_srcdir@/iosarmv8
BUILDARMV8=0
SRCDIR=@CMAKE_SOURCE_DIR@
BUILDDIR32=@OSX_32BIT_BUILD@
BUILDDIRARMV7=@IOS_ARMV7_BUILD@
BUILDDIRARMV7S=@IOS_ARMV7S_BUILD@
BUILDDIRARMV8=@IOS_ARMV8_BUILD@
WITH_JAVA=@WITH_JAVA@
LIPO=lipo
PREFIX=%{__prefix}
BINDIR=%{__bindir}
DOCDIR=%{__docdir}
LIBDIR=%{__libdir}
PREFIX=@CMAKE_INSTALL_PREFIX@
BINDIR=@BINDIR@
DOCDIR=@DOCDIR@
LIBDIR=@LIBDIR@
LIBJPEG_DSO_NAME=libjpeg.@SO_MAJOR_VERSION@.@SO_AGE@.@SO_MINOR_VERSION@.dylib
TURBOJPEG_DSO_NAME=libturbojpeg.@TURBOJPEG_SO_VERSION@.dylib
while [ $# -gt 0 ]; do
case $1 in
-h*) usage 0 ;;
-build32)
BUILD32=1
if [ $# -gt 1 ]; then
if [[ ! "$2" =~ -.* ]]; then
BUILDDIR32=$2; shift
fi
fi
;;
-buildarmv6)
BUILDARMV6=1
if [ $# -gt 1 ]; then
if [[ ! "$2" =~ -.* ]]; then
BUILDDIRARMV6=$2; shift
fi
fi
;;
-buildarmv7)
BUILDARMV7=1
if [ $# -gt 1 ]; then
if [[ ! "$2" =~ -.* ]]; then
BUILDDIRARMV7=$2; shift
fi
fi
;;
-buildarmv7s)
BUILDARMV7S=1
if [ $# -gt 1 ]; then
if [[ ! "$2" =~ -.* ]]; then
BUILDDIRARMV7S=$2; shift
fi
fi
;;
-buildarmv8)
BUILDARMV8=1
if [ $# -gt 1 ]; then
if [[ ! "$2" =~ -.* ]]; then
BUILDDIRARMV8=$2; shift
fi
fi
-h*)
usage 0
;;
-lipo)
if [ $# -gt 1 ]; then
@@ -93,6 +80,9 @@ while [ $# -gt 0 ]; do
fi
fi
;;
universal)
UNIVERSAL=1
;;
esac
shift
done
@@ -105,15 +95,16 @@ umask 022
TMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`
PKGROOT=$TMPDIR/pkg/Package_Root
mkdir -p $PKGROOT
make install DESTDIR=$PKGROOT docdir=/Library/Documentation/$PACKAGE_NAME \
exampledir=/Library/Documentation/$PACKAGE_NAME
rm -f $PKGROOT$LIBDIR/*.la
if [ "$PREFIX" = "/opt/libjpeg-turbo" -a "$DOCDIR" = "/opt/libjpeg-turbo/doc" ]; then
ln -fs /Library/Documentation/$PACKAGE_NAME $PKGROOT$DOCDIR
make install DESTDIR=$PKGROOT
if [ "$PREFIX" = "@DEFAULT_CMAKE_INSTALL_PREFIX@" -a "$DOCDIR" = "@DEFAULT_CMAKE_INSTALL_PREFIX@/doc" ]; then
mkdir -p $PKGROOT/Library/Documentation
safedirmove $PKGROOT$DOCDIR $PKGROOT/Library/Documentation/@CMAKE_PROJECT_NAME@ $TMPDIR/__tmpdoc
ln -fs /Library/Documentation/@CMAKE_PROJECT_NAME@ $PKGROOT$DOCDIR
fi
if [ $BUILD32 = 1 ]; then
if [ $UNIVERSAL = 1 -a "$BUILDDIR32" != "" ]; then
if [ ! -d $BUILDDIR32 ]; then
echo ERROR: 32-bit build directory $BUILDDIR32 does not exist
exit 1
@@ -126,27 +117,18 @@ if [ $BUILD32 = 1 ]; then
pushd $BUILDDIR32
make install DESTDIR=$TMPDIR/dist.x86
popd
if [ ! -h $TMPDIR/dist.x86/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib -a \
! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib ]; then
$LIPO -create \
-arch i386 $TMPDIR/dist.x86/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \
-arch x86_64 $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \
-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib
elif [ ! -h $TMPDIR/dist.x86/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib -a \
! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib ]; then
$LIPO -create \
-arch i386 $TMPDIR/dist.x86/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \
-arch x86_64 $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \
-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib
fi
$LIPO -create \
-arch i386 $TMPDIR/dist.x86/$LIBDIR/$LIBJPEG_DSO_NAME \
-arch x86_64 $PKGROOT/$LIBDIR/$LIBJPEG_DSO_NAME \
-output $PKGROOT/$LIBDIR/$LIBJPEG_DSO_NAME
$LIPO -create \
-arch i386 $TMPDIR/dist.x86/$LIBDIR/libjpeg.a \
-arch x86_64 $PKGROOT/$LIBDIR/libjpeg.a \
-output $PKGROOT/$LIBDIR/libjpeg.a
$LIPO -create \
-arch i386 $TMPDIR/dist.x86/$LIBDIR/libturbojpeg.0.dylib \
-arch x86_64 $PKGROOT/$LIBDIR/libturbojpeg.0.dylib \
-output $PKGROOT/$LIBDIR/libturbojpeg.0.dylib
-arch i386 $TMPDIR/dist.x86/$LIBDIR/$TURBOJPEG_DSO_NAME \
-arch x86_64 $PKGROOT/$LIBDIR/$TURBOJPEG_DSO_NAME \
-output $PKGROOT/$LIBDIR/$TURBOJPEG_DSO_NAME
$LIPO -create \
-arch i386 $TMPDIR/dist.x86/$LIBDIR/libturbojpeg.a \
-arch x86_64 $PKGROOT/$LIBDIR/libturbojpeg.a \
@@ -175,272 +157,88 @@ if [ $BUILD32 = 1 ]; then
-arch i386 $TMPDIR/dist.x86/$BINDIR/wrjpgcom \
-arch x86_64 $PKGROOT/$BINDIR/wrjpgcom \
-output $PKGROOT/$BINDIR/wrjpgcom
fi
if [ $BUILDARMV6 = 1 ]; then
if [ ! -d $BUILDDIRARMV6 ]; then
echo ERROR: ARMv6 build directory $BUILDDIRARMV6 does not exist
install_ios()
{
BUILDDIR=$1
ARCHNAME=$2
DIRNAME=$3
LIPOARCH=$4
if [ ! -d $BUILDDIR ]; then
echo ERROR: $ARCHNAME build directory $BUILDDIR does not exist
exit 1
fi
if [ ! -f $BUILDDIRARMV6/Makefile ]; then
echo ERROR: ARMv6 build directory $BUILDDIRARMV6 is not configured
if [ ! -f $BUILDDIR/Makefile ]; then
echo ERROR: $ARCHNAME build directory $BUILDDIR is not configured
exit 1
fi
mkdir -p $TMPDIR/dist.armv6
pushd $BUILDDIRARMV6
make install DESTDIR=$TMPDIR/dist.armv6
mkdir -p $TMPDIR/dist.$DIRNAME
pushd $BUILDDIR
make install DESTDIR=$TMPDIR/dist.$DIRNAME
popd
if [ ! -h $TMPDIR/dist.armv6/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib -a \
! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib ]; then
$LIPO -create \
$PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \
-arch arm $TMPDIR/dist.armv6/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \
-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib
elif [ ! -h $TMPDIR/dist.armv6/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib -a \
! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib ]; then
$LIPO -create \
$PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \
-arch arm $TMPDIR/dist.armv6/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \
-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib
fi
$LIPO -create \
$PKGROOT/$LIBDIR/$LIBJPEG_DSO_NAME \
-arch $LIPOARCH $TMPDIR/dist.$DIRNAME/$LIBDIR/$LIBJPEG_DSO_NAME \
-output $PKGROOT/$LIBDIR/$LIBJPEG_DSO_NAME
$LIPO -create \
$PKGROOT/$LIBDIR/libjpeg.a \
-arch arm $TMPDIR/dist.armv6/$LIBDIR/libjpeg.a \
-arch $LIPOARCH $TMPDIR/dist.$DIRNAME/$LIBDIR/libjpeg.a \
-output $PKGROOT/$LIBDIR/libjpeg.a
$LIPO -create \
$PKGROOT/$LIBDIR/libturbojpeg.0.dylib \
-arch arm $TMPDIR/dist.armv6/$LIBDIR/libturbojpeg.0.dylib \
-output $PKGROOT/$LIBDIR/libturbojpeg.0.dylib
$PKGROOT/$LIBDIR/$TURBOJPEG_DSO_NAME \
-arch $LIPOARCH $TMPDIR/dist.$DIRNAME/$LIBDIR/$TURBOJPEG_DSO_NAME \
-output $PKGROOT/$LIBDIR/$TURBOJPEG_DSO_NAME
$LIPO -create \
$PKGROOT/$LIBDIR/libturbojpeg.a \
-arch arm $TMPDIR/dist.armv6/$LIBDIR/libturbojpeg.a \
-arch $LIPOARCH $TMPDIR/dist.$DIRNAME/$LIBDIR/libturbojpeg.a \
-output $PKGROOT/$LIBDIR/libturbojpeg.a
$LIPO -create \
$PKGROOT/$BINDIR/cjpeg \
-arch arm $TMPDIR/dist.armv6/$BINDIR/cjpeg \
-arch $LIPOARCH $TMPDIR/dist.$DIRNAME/$BINDIR/cjpeg \
-output $PKGROOT/$BINDIR/cjpeg
$LIPO -create \
$PKGROOT/$BINDIR/djpeg \
-arch arm $TMPDIR/dist.armv6/$BINDIR/djpeg \
-arch $LIPOARCH $TMPDIR/dist.$DIRNAME/$BINDIR/djpeg \
-output $PKGROOT/$BINDIR/djpeg
$LIPO -create \
$PKGROOT/$BINDIR/jpegtran \
-arch arm $TMPDIR/dist.armv6/$BINDIR/jpegtran \
-arch $LIPOARCH $TMPDIR/dist.$DIRNAME/$BINDIR/jpegtran \
-output $PKGROOT/$BINDIR/jpegtran
$LIPO -create \
$PKGROOT/$BINDIR/tjbench \
-arch arm $TMPDIR/dist.armv6/$BINDIR/tjbench \
-arch $LIPOARCH $TMPDIR/dist.$DIRNAME/$BINDIR/tjbench \
-output $PKGROOT/$BINDIR/tjbench
$LIPO -create \
$PKGROOT/$BINDIR/rdjpgcom \
-arch arm $TMPDIR/dist.armv6/$BINDIR/rdjpgcom \
-arch $LIPOARCH $TMPDIR/dist.$DIRNAME/$BINDIR/rdjpgcom \
-output $PKGROOT/$BINDIR/rdjpgcom
$LIPO -create \
$PKGROOT/$BINDIR/wrjpgcom \
-arch arm $TMPDIR/dist.armv6/$BINDIR/wrjpgcom \
-arch $LIPOARCH $TMPDIR/dist.$DIRNAME/$BINDIR/wrjpgcom \
-output $PKGROOT/$BINDIR/wrjpgcom
}
if [ $UNIVERSAL = 1 -a "$BUILDDIRARMV7" != "" ]; then
install_ios $BUILDDIRARMV7 ARMv7 armv7 arm
fi
if [ $BUILDARMV7 = 1 ]; then
if [ ! -d $BUILDDIRARMV7 ]; then
echo ERROR: ARMv7 build directory $BUILDDIRARMV7 does not exist
exit 1
fi
if [ ! -f $BUILDDIRARMV7/Makefile ]; then
echo ERROR: ARMv7 build directory $BUILDDIRARMV7 is not configured
exit 1
fi
mkdir -p $TMPDIR/dist.armv7
pushd $BUILDDIRARMV7
make install DESTDIR=$TMPDIR/dist.armv7
popd
if [ ! -h $TMPDIR/dist.armv7/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib -a \
! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib ]; then
$LIPO -create \
$PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \
-arch arm $TMPDIR/dist.armv7/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \
-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib
elif [ ! -h $TMPDIR/dist.armv7/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib -a \
! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib ]; then
$LIPO -create \
$PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \
-arch arm $TMPDIR/dist.armv7/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \
-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib
fi
$LIPO -create \
$PKGROOT/$LIBDIR/libjpeg.a \
-arch arm $TMPDIR/dist.armv7/$LIBDIR/libjpeg.a \
-output $PKGROOT/$LIBDIR/libjpeg.a
$LIPO -create \
$PKGROOT/$LIBDIR/libturbojpeg.0.dylib \
-arch arm $TMPDIR/dist.armv7/$LIBDIR/libturbojpeg.0.dylib \
-output $PKGROOT/$LIBDIR/libturbojpeg.0.dylib
$LIPO -create \
$PKGROOT/$LIBDIR/libturbojpeg.a \
-arch arm $TMPDIR/dist.armv7/$LIBDIR/libturbojpeg.a \
-output $PKGROOT/$LIBDIR/libturbojpeg.a
$LIPO -create \
$PKGROOT/$BINDIR/cjpeg \
-arch arm $TMPDIR/dist.armv7/$BINDIR/cjpeg \
-output $PKGROOT/$BINDIR/cjpeg
$LIPO -create \
$PKGROOT/$BINDIR/djpeg \
-arch arm $TMPDIR/dist.armv7/$BINDIR/djpeg \
-output $PKGROOT/$BINDIR/djpeg
$LIPO -create \
$PKGROOT/$BINDIR/jpegtran \
-arch arm $TMPDIR/dist.armv7/$BINDIR/jpegtran \
-output $PKGROOT/$BINDIR/jpegtran
$LIPO -create \
$PKGROOT/$BINDIR/tjbench \
-arch arm $TMPDIR/dist.armv7/$BINDIR/tjbench \
-output $PKGROOT/$BINDIR/tjbench
$LIPO -create \
$PKGROOT/$BINDIR/rdjpgcom \
-arch arm $TMPDIR/dist.armv7/$BINDIR/rdjpgcom \
-output $PKGROOT/$BINDIR/rdjpgcom
$LIPO -create \
$PKGROOT/$BINDIR/wrjpgcom \
-arch arm $TMPDIR/dist.armv7/$BINDIR/wrjpgcom \
-output $PKGROOT/$BINDIR/wrjpgcom
if [ $UNIVERSAL = 1 -a "$BUILDDIRARMV7S" != "" ]; then
install_ios $BUILDDIRARMV7S ARMv7s armv7s arm
fi
if [ $BUILDARMV7S = 1 ]; then
if [ ! -d $BUILDDIRARMV7S ]; then
echo ERROR: ARMv7s build directory $BUILDDIRARMV7S does not exist
exit 1
fi
if [ ! -f $BUILDDIRARMV7S/Makefile ]; then
echo ERROR: ARMv7s build directory $BUILDDIRARMV7S is not configured
exit 1
fi
mkdir -p $TMPDIR/dist.armv7s
pushd $BUILDDIRARMV7S
make install DESTDIR=$TMPDIR/dist.armv7s
popd
if [ ! -h $TMPDIR/dist.armv7s/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib -a \
! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib ]; then
$LIPO -create \
$PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \
-arch arm $TMPDIR/dist.armv7s/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \
-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib
elif [ ! -h $TMPDIR/dist.armv7s/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib -a \
! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib ]; then
$LIPO -create \
$PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \
-arch arm $TMPDIR/dist.armv7s/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \
-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib
fi
$LIPO -create \
$PKGROOT/$LIBDIR/libjpeg.a \
-arch arm $TMPDIR/dist.armv7s/$LIBDIR/libjpeg.a \
-output $PKGROOT/$LIBDIR/libjpeg.a
$LIPO -create \
$PKGROOT/$LIBDIR/libturbojpeg.0.dylib \
-arch arm $TMPDIR/dist.armv7s/$LIBDIR/libturbojpeg.0.dylib \
-output $PKGROOT/$LIBDIR/libturbojpeg.0.dylib
$LIPO -create \
$PKGROOT/$LIBDIR/libturbojpeg.a \
-arch arm $TMPDIR/dist.armv7s/$LIBDIR/libturbojpeg.a \
-output $PKGROOT/$LIBDIR/libturbojpeg.a
$LIPO -create \
$PKGROOT/$BINDIR/cjpeg \
-arch arm $TMPDIR/dist.armv7s/$BINDIR/cjpeg \
-output $PKGROOT/$BINDIR/cjpeg
$LIPO -create \
$PKGROOT/$BINDIR/djpeg \
-arch arm $TMPDIR/dist.armv7s/$BINDIR/djpeg \
-output $PKGROOT/$BINDIR/djpeg
$LIPO -create \
$PKGROOT/$BINDIR/jpegtran \
-arch arm $TMPDIR/dist.armv7s/$BINDIR/jpegtran \
-output $PKGROOT/$BINDIR/jpegtran
$LIPO -create \
$PKGROOT/$BINDIR/tjbench \
-arch arm $TMPDIR/dist.armv7s/$BINDIR/tjbench \
-output $PKGROOT/$BINDIR/tjbench
$LIPO -create \
$PKGROOT/$BINDIR/rdjpgcom \
-arch arm $TMPDIR/dist.armv7s/$BINDIR/rdjpgcom \
-output $PKGROOT/$BINDIR/rdjpgcom
$LIPO -create \
$PKGROOT/$BINDIR/wrjpgcom \
-arch arm $TMPDIR/dist.armv7s/$BINDIR/wrjpgcom \
-output $PKGROOT/$BINDIR/wrjpgcom
if [ $UNIVERSAL = 1 -a "BUILDDIRARMV8" != "" ]; then
install_ios $BUILDDIRARMV8 ARMv8 armv8 arm64
fi
if [ $BUILDARMV8 = 1 ]; then
if [ ! -d $BUILDDIRARMV8 ]; then
echo ERROR: ARMv8 build directory $BUILDDIRARMV8 does not exist
exit 1
fi
if [ ! -f $BUILDDIRARMV8/Makefile ]; then
echo ERROR: ARMv8 build directory $BUILDDIRARMV8 is not configured
exit 1
fi
mkdir -p $TMPDIR/dist.armv8
pushd $BUILDDIRARMV8
make install DESTDIR=$TMPDIR/dist.armv8
popd
if [ ! -h $TMPDIR/dist.armv8/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib -a \
! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib ]; then
$LIPO -create \
$PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \
-arch arm64 $TMPDIR/dist.armv8/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \
-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib
elif [ ! -h $TMPDIR/dist.armv8/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib -a \
! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib ]; then
$LIPO -create \
$PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \
-arch arm64 $TMPDIR/dist.armv8/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \
-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib
fi
$LIPO -create \
$PKGROOT/$LIBDIR/libjpeg.a \
-arch arm64 $TMPDIR/dist.armv8/$LIBDIR/libjpeg.a \
-output $PKGROOT/$LIBDIR/libjpeg.a
$LIPO -create \
$PKGROOT/$LIBDIR/libturbojpeg.0.dylib \
-arch arm64 $TMPDIR/dist.armv8/$LIBDIR/libturbojpeg.0.dylib \
-output $PKGROOT/$LIBDIR/libturbojpeg.0.dylib
$LIPO -create \
$PKGROOT/$LIBDIR/libturbojpeg.a \
-arch arm64 $TMPDIR/dist.armv8/$LIBDIR/libturbojpeg.a \
-output $PKGROOT/$LIBDIR/libturbojpeg.a
$LIPO -create \
$PKGROOT/$BINDIR/cjpeg \
-arch arm64 $TMPDIR/dist.armv8/$BINDIR/cjpeg \
-output $PKGROOT/$BINDIR/cjpeg
$LIPO -create \
$PKGROOT/$BINDIR/djpeg \
-arch arm64 $TMPDIR/dist.armv8/$BINDIR/djpeg \
-output $PKGROOT/$BINDIR/djpeg
$LIPO -create \
$PKGROOT/$BINDIR/jpegtran \
-arch arm64 $TMPDIR/dist.armv8/$BINDIR/jpegtran \
-output $PKGROOT/$BINDIR/jpegtran
$LIPO -create \
$PKGROOT/$BINDIR/tjbench \
-arch arm64 $TMPDIR/dist.armv8/$BINDIR/tjbench \
-output $PKGROOT/$BINDIR/tjbench
$LIPO -create \
$PKGROOT/$BINDIR/rdjpgcom \
-arch arm64 $TMPDIR/dist.armv8/$BINDIR/rdjpgcom \
-output $PKGROOT/$BINDIR/rdjpgcom
$LIPO -create \
$PKGROOT/$BINDIR/wrjpgcom \
-arch arm64 $TMPDIR/dist.armv8/$BINDIR/wrjpgcom \
-output $PKGROOT/$BINDIR/wrjpgcom
fi
install_name_tool -id $LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib
install_name_tool -id $LIBDIR/libturbojpeg.0.dylib $PKGROOT/$LIBDIR/libturbojpeg.0.dylib
install_name_tool -id $LIBDIR/$LIBJPEG_DSO_NAME $PKGROOT/$LIBDIR/$LIBJPEG_DSO_NAME
install_name_tool -id $LIBDIR/$TURBOJPEG_DSO_NAME $PKGROOT/$LIBDIR/$TURBOJPEG_DSO_NAME
if [ $WITH_JAVA = 1 ]; then
ln -fs libturbojpeg.0.dylib $PKGROOT/$LIBDIR/libturbojpeg.jnilib
ln -fs $TURBOJPEG_DSO_NAME $PKGROOT/$LIBDIR/libturbojpeg.jnilib
fi
if [ "$PREFIX" = "/opt/libjpeg-turbo" -a "$LIBDIR" = "/opt/libjpeg-turbo/lib" ]; then
if [ "$PREFIX" = "@DEFAULT_CMAKE_INSTALL_PREFIX@" -a "$LIBDIR" = "@DEFAULT_CMAKE_INSTALL_PREFIX@/lib" ]; then
if [ ! -h $PKGROOT/$PREFIX/lib32 ]; then
ln -fs lib $PKGROOT/$PREFIX/lib32
fi
@@ -458,9 +256,9 @@ find $PKGROOT -type f | while read file; do xattr -c $file; done
cp $SRCDIR/release/License.rtf $SRCDIR/release/Welcome.rtf $SRCDIR/release/ReadMe.txt $TMPDIR/pkg/
mkdir $TMPDIR/dmg
pkgbuild --root $PKGROOT --version $VERSION.$BUILD \
--identifier com.libjpeg-turbo.libjpeg-turbo $TMPDIR/pkg/$PACKAGE_NAME.pkg
productbuild --distribution $SRCDIR/release/Distribution.xml \
pkgbuild --root $PKGROOT --version $VERSION.$BUILD --identifier @PKGID@ \
$TMPDIR/pkg/$PACKAGE_NAME.pkg
productbuild --distribution pkgscripts/Distribution.xml \
--package-path $TMPDIR/pkg/ --resources $TMPDIR/pkg/ \
$TMPDIR/dmg/$PACKAGE_NAME.pkg
hdiutil create -fs HFS+ -volname $PACKAGE_NAME-$VERSION \

30
release/makerpm.in Normal file
View File

@@ -0,0 +1,30 @@
#!/bin/sh
set -u
set -e
trap onexit INT
trap onexit TERM
trap onexit EXIT
TMPDIR=
onexit()
{
if [ ! "$TMPDIR" = "" ]; then
rm -rf $TMPDIR
fi
}
if [ -f @PKGNAME@-@VERSION@.@RPMARCH@.rpm ]; then
rm -f @PKGNAME@-@VERSION@.@RPMARCH@.rpm
fi
umask 022
TMPDIR=`mktemp -d /tmp/@CMAKE_PROJECT_NAME@-build.XXXXXX`
mkdir -p $TMPDIR/RPMS
ln -fs `pwd` $TMPDIR/BUILD
rpmbuild -bb --define "_blddir $TMPDIR/buildroot" --define "_topdir $TMPDIR" \
--target @RPMARCH@ pkgscripts/@CMAKE_PROJECT_NAME@.spec; \
cp $TMPDIR/RPMS/@RPMARCH@/@PKGNAME@-@VERSION@-@BUILD@.@RPMARCH@.rpm \
@PKGNAME@-@VERSION@.@RPMARCH@.rpm

48
release/makesrpm.in Normal file
View File

@@ -0,0 +1,48 @@
#!/bin/sh
set -u
set -e
trap onexit INT
trap onexit TERM
trap onexit EXIT
TMPDIR=
onexit()
{
if [ ! "$TMPDIR" = "" ]; then
rm -rf $TMPDIR
fi
}
PKGNAME=@PKGNAME@
PROJECT=@CMAKE_PROJECT_NAME@
VERSION=@VERSION@
BUILD=@BUILD@
if [ -f $PKGNAME-$VERSION.src.rpm ]; then
rm -f $PKGNAME-$VERSION.src.rpm
fi
umask 022
TMPDIR=`mktemp -d /tmp/$PKGNAME-build.XXXXXX`
mkdir -p $TMPDIR/RPMS
mkdir -p $TMPDIR/SRPMS
mkdir -p $TMPDIR/BUILD
mkdir -p $TMPDIR/SOURCES
mkdir -p $TMPDIR/SPECS
if [ ! -f $PROJECT-$VERSION.tar.gz ]; then
echo "ERROR: $PROJECT-$VERSION.tar.gz does not exist."
fi
cp $PROJECT-$VERSION.tar.gz $TMPDIR/SOURCES/$PROJECT-$VERSION.tar.gz
cat pkgscripts/$PROJECT.spec | sed s/%{_blddir}/%{_tmppath}/g \
| sed s/#--\>//g > $TMPDIR/SPECS/$PROJECT.spec
rpmbuild -bs --define "_topdir $TMPDIR" $TMPDIR/SPECS/$PROJECT.spec
mv $TMPDIR/SRPMS/$PKGNAME-$VERSION-$BUILD.src.rpm $PKGNAME-$VERSION.src.rpm
exit

43
release/maketarball.in Normal file
View File

@@ -0,0 +1,43 @@
#!/bin/sh
set -u
set -e
trap onexit INT
trap onexit TERM
trap onexit EXIT
TMPDIR=
SUDO=
onexit()
{
if [ ! "$TMPDIR" = "" ]; then
$SUDO rm -rf $TMPDIR
fi
}
uid()
{
id | cut -f2 -d = | cut -f1 -d \(;
}
PACKAGE_NAME=@PKGNAME@
VERSION=@VERSION@
ARCH=@CPU_TYPE@
OS=@CMAKE_SYSTEM_NAME@
PREFIX=@CMAKE_INSTALL_PREFIX@
if [ ! `uid` -eq 0 ]; then
SUDO=sudo
fi
umask 022
rm -f $PACKAGE_NAME-$VERSION-$OS-$ARCH.tar.bz2
TMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`
mkdir -p $TMPDIR/install
make install DESTDIR=$TMPDIR/install
$SUDO chown -Rh root:root $TMPDIR/install
tar cf - -C $TMPDIR/install .$PREFIX | bzip2 -c >$PACKAGE_NAME-$VERSION-$OS-$ARCH.tar.bz2
exit

View File

@@ -32,7 +32,7 @@ if [ ! "`id -u`" = "0" ]; then
fi
PACKAGE=@PKGNAME@
MACPACKAGE=com.$PACKAGE.$PACKAGE
MACPACKAGE=@PKGID@
RECEIPT=/Library/Receipts/$PACKAGE.pkg
LSBOM=
@@ -56,12 +56,12 @@ done
popd
echo Removing package directories ...
PREFIX=%{__prefix}
BINDIR=%{__bindir}
DATADIR=%{__datadir}
INCLUDEDIR=%{__includedir}
LIBDIR=%{__libdir}
MANDIR=%{__mandir}
PREFIX=@CMAKE_INSTALL_PREFIX@
BINDIR=@BINDIR@
DATADIR=@DATADIR@
INCLUDEDIR=@INCLUDEDIR@
LIBDIR=@LIBDIR@
MANDIR=@MANDIR@
if [ -d $BINDIR ]; then
rmdir $BINDIR 2>&1 || EXITSTATUS=-1
@@ -75,7 +75,7 @@ fi
if [ -d $INCLUDEDIR ]; then
rmdir $INCLUDEDIR 2>&1 || EXITSTATUS=-1
fi
if [ "$PREFIX" = "/opt/libjpeg-turbo" -a "$LIBDIR" = "/opt/libjpeg-turbo/lib" ]; then
if [ "$PREFIX" = "@DEFAULT_CMAKE_INSTALL_PREFIX@" -a "$LIBDIR" = "@DEFAULT_CMAKE_INSTALL_PREFIX@/lib" ]; then
if [ -h $LIBDIR\32 ]; then
rm $LIBDIR\32 2>&1 || EXITSTATUS=-1
fi
@@ -95,11 +95,11 @@ fi
if [ -d $DATADIR -a "$DATADIR" != "$PREFIX" ]; then
rmdir $DATADIR 2>&1 || EXITSTATUS=-1
fi
if [ "$PREFIX" = "/opt/libjpeg-turbo" -a -h "$PREFIX/doc" ]; then
if [ "$PREFIX" = "@DEFAULT_CMAKE_INSTALL_PREFIX@" -a -h "$PREFIX/doc" ]; then
rm $PREFIX/doc 2>&1 || EXITSTATUS=-1
fi
rmdir $PREFIX 2>&1 || EXITSTATUS=-1
rmdir /Library/Documentation/$PACKAGE 2>&1 || EXITSTATUS=-1
rmdir /Library/Documentation/@CMAKE_PROJECT_NAME@ 2>&1 || EXITSTATUS=-1
if [ -d $RECEIPT ]; then
echo Removing package receipt ...

View File

@@ -5,6 +5,10 @@
# better yet, provide a friendly way of configuring a Windows target to use the
# static C library.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
if(MSVC)
# Build all configurations against shared C library
foreach(var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
@@ -19,33 +23,42 @@ foreach(src ${JPEG_SOURCES})
set(JPEG_SRCS ${JPEG_SRCS} ${CMAKE_SOURCE_DIR}/${src})
endforeach()
if(WITH_SIMD)
if(WITH_SIMD AND MSVC_IDE)
# This tells CMake that the "source" files haven't been generated yet
set_source_files_properties(${SIMD_OBJS} PROPERTIES GENERATED 1)
endif()
if(WITH_MEM_SRCDST AND NOT WITH_JPEG8)
add_library(jpeg SHARED ${JPEG_SRCS} ${SIMD_OBJS}
${CMAKE_SOURCE_DIR}/win/jpeg${DLL_VERSION}-memsrcdst.def)
else()
add_library(jpeg SHARED ${JPEG_SRCS} ${SIMD_OBJS}
${CMAKE_SOURCE_DIR}/win/jpeg${DLL_VERSION}.def)
if(WIN32)
if(WITH_MEM_SRCDST)
set(DEFFILE ${CMAKE_SOURCE_DIR}/win/jpeg${SO_MAJOR_VERSION}-memsrcdst.def)
else()
set(DEFFILE ${CMAKE_SOURCE_DIR}/win/jpeg${SO_MAJOR_VERSION}.def)
endif()
endif()
add_library(jpeg SHARED ${JPEG_SRCS} ${DEFFILE} $<TARGET_OBJECTS:simd>
${SIMD_OBJS})
set_target_properties(jpeg PROPERTIES SOVERSION ${SO_MAJOR_VERSION}
VERSION ${SO_MAJOR_VERSION}.${SO_AGE}.${SO_MINOR_VERSION})
if(MAPFLAG)
set_target_properties(jpeg PROPERTIES
LINK_FLAGS "${MAPFLAG}${CMAKE_BINARY_DIR}/libjpeg.map")
endif()
set_target_properties(jpeg PROPERTIES SOVERSION ${DLL_VERSION}
VERSION ${FULLVERSION})
if(MSVC)
set_target_properties(jpeg PROPERTIES SUFFIX ${DLL_VERSION}.dll)
elseif(MINGW OR CYGWIN)
set_target_properties(jpeg PROPERTIES SUFFIX -${DLL_VERSION}.dll)
endif(MSVC)
if(WITH_SIMD)
add_dependencies(jpeg simd)
set_target_properties(jpeg PROPERTIES SUFFIX ${SO_MAJOR_VERSION}.dll)
# The jsimd_*.c file is built using /MT, so this prevents a linker warning.
set_target_properties(jpeg PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT /NODEFAULTLIB:LIBCMTD")
elseif(MINGW)
set_target_properties(jpeg PROPERTIES SUFFIX -${SO_MAJOR_VERSION}.dll)
endif()
if(WIN32)
set(USE_SETMODE "-DUSE_SETMODE")
endif()
if(WITH_12BIT)
set(COMPILE_FLAGS "-DGIF_SUPPORTED -DPPM_SUPPORTED -DUSE_SETMODE")
set(COMPILE_FLAGS "-DGIF_SUPPORTED -DPPM_SUPPORTED ${USE_SETMODE}")
else()
set(COMPILE_FLAGS "-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE")
set(COMPILE_FLAGS "-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED ${USE_SETMODE}")
set(CJPEG_BMP_SOURCES ../rdbmp.c ../rdtarga.c)
set(DJPEG_BMP_SOURCES ../wrbmp.c ../wrtarga.c)
endif()
@@ -62,12 +75,12 @@ target_link_libraries(djpeg jpeg)
add_executable(jpegtran ../jpegtran.c ../cdjpeg.c ../rdswitch.c ../transupp.c)
target_link_libraries(jpegtran jpeg)
set_property(TARGET jpegtran PROPERTY COMPILE_FLAGS "-DUSE_SETMODE")
set_property(TARGET jpegtran PROPERTY COMPILE_FLAGS "${USE_SETMODE}")
add_executable(jcstest ../jcstest.c)
target_link_libraries(jcstest jpeg)
install(TARGETS jpeg cjpeg djpeg jpegtran
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
ARCHIVE DESTINATION ${LIBDIR}
LIBRARY DESTINATION ${LIBDIR}
RUNTIME DESTINATION ${BINDIR})

View File

@@ -1,83 +1,297 @@
if(NOT DEFINED NASM)
find_program(NASM NAMES nasm yasm DOC "Path to NASM/YASM executable")
endif()
message(STATUS "NASM = ${NASM}")
if(SIMD_X86_64)
set(NAFLAGS -fwin64 -DWIN64 -D__x86_64__)
else()
if(BORLAND)
set(NAFLAGS -fobj -DOBJ32)
macro(simd_fail message)
if(REQUIRE_SIMD)
message(FATAL_ERROR "${message}.")
else()
set(NAFLAGS -fwin32 -DWIN32)
message(WARNING "${message}. Performance will suffer.")
set(WITH_SIMD 0 PARENT_SCOPE)
endif()
endmacro()
###############################################################################
# x86[-64] (NASM)
###############################################################################
if(CPU_TYPE STREQUAL "x86_64" OR CPU_TYPE STREQUAL "i386")
set(CMAKE_ASM_NASM_FLAGS_DEBUG_INIT "-g")
set(CMAKE_ASM_NASM_FLAGS_RELWITHDEBINFO_INIT "-g")
# Allow the location of the NASM executable to be specified using the ASM_NASM
# environment variable. This should happen automatically, but unfortunately
# enable_language(ASM_NASM) doesn't parse the ASM_NASM environment variable
# until after CMAKE_ASM_NASM_COMPILER has been populated with the results of
# searching for NASM or YASM in the PATH.
if(NOT DEFINED CMAKE_ASM_NASM_COMPILER AND DEFINED ENV{ASM_NASM})
set(CMAKE_ASM_NASM_COMPILER $ENV{ASM_NASM})
endif()
if(CPU_TYPE STREQUAL "x86_64")
if(CYGWIN)
set(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
endif()
elseif(CPU_TYPE STREQUAL "i386")
if(BORLAND)
set(CMAKE_ASM_NASM_OBJECT_FORMAT obj)
elseif(CYGWIN)
set(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
endif()
endif()
set(NAFLAGS ${NAFLAGS} -I${CMAKE_SOURCE_DIR}/win/ -I${CMAKE_CURRENT_SOURCE_DIR}/)
# This only works if building from the command line. There is currently no way
# to set a variable's value based on the build type when using the MSVC IDE.
if(CMAKE_BUILD_TYPE STREQUAL "Debug"
OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(NAFLAGS ${NAFLAGS} -g)
enable_language(ASM_NASM)
message(STATUS "CMAKE_ASM_NASM_COMPILER = ${CMAKE_ASM_NASM_COMPILER}")
if(CMAKE_ASM_NASM_OBJECT_FORMAT MATCHES "macho*")
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -DMACHO")
elseif(CMAKE_ASM_NASM_OBJECT_FORMAT MATCHES "elf*")
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -DELF")
endif()
if(CPU_TYPE STREQUAL "x86_64")
if(WIN32 OR CYGWIN)
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -DWIN64")
endif()
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -D__x86_64__")
elseif(CPU_TYPE STREQUAL "i386")
if(BORLAND)
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -DOBJ32")
elseif(WIN32 OR CYGWIN)
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -DWIN32")
endif()
endif()
if(SIMD_X86_64)
set(SIMD_BASENAMES jsimdcpu-64 jfdctflt-sse-64 jccolor-sse2-64 jcgray-sse2-64
jchuff-sse2-64 jcsample-sse2-64 jdcolor-sse2-64 jdmerge-sse2-64
jdsample-sse2-64 jfdctfst-sse2-64 jfdctint-sse2-64 jidctflt-sse2-64
jidctfst-sse2-64 jidctint-sse2-64 jidctred-sse2-64 jquantf-sse2-64
jquanti-sse2-64 jccolor-avx2-64 jcgray-avx2-64 jcsample-avx2-64
jdcolor-avx2-64 jdmerge-avx2-64 jdsample-avx2-64 jquanti-avx2-64)
message(STATUS "Building x86_64 SIMD extensions")
message(STATUS "CMAKE_ASM_NASM_OBJECT_FORMAT = ${CMAKE_ASM_NASM_OBJECT_FORMAT}")
if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
simd_fail("SIMD extensions disabled: could not determine NASM object format")
return()
endif()
if(NOT WIN32 AND (CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED))
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -DPIC")
endif()
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC)
set(EFFECTIVE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} ${CMAKE_ASM_NASM_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
message(STATUS "CMAKE_ASM_NASM_FLAGS = ${EFFECTIVE_ASM_NASM_FLAGS}")
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -I\"${CMAKE_CURRENT_SOURCE_DIR}/nasm/\" -I\"${CMAKE_CURRENT_SOURCE_DIR}/${CPU_TYPE}/\"")
if(WIN32)
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -I\"${CMAKE_SOURCE_DIR}/win/\"")
set(JSIMDCFG_INC ${CMAKE_SOURCE_DIR}/win/jsimdcfg.inc)
else()
set(SIMD_BASENAMES jsimdcpu jfdctflt-3dn jidctflt-3dn jquant-3dn jccolor-mmx
jcgray-mmx jcsample-mmx jdcolor-mmx jdmerge-mmx jdsample-mmx jfdctfst-mmx
jfdctint-mmx jidctfst-mmx jidctint-mmx jidctred-mmx jquant-mmx jfdctflt-sse
jidctflt-sse jquant-sse jccolor-sse2 jcgray-sse2 jchuff-sse2 jcsample-sse2
jdcolor-sse2 jdmerge-sse2 jdsample-sse2 jfdctfst-sse2 jfdctint-sse2
jidctflt-sse2 jidctfst-sse2 jidctint-sse2 jidctred-sse2 jquantf-sse2
jquanti-sse2 jccolor-avx2 jcgray-avx2 jcsample-avx2 jdcolor-avx2
jdmerge-avx2 jdsample-avx2 jquanti-avx2)
message(STATUS "Building i386 SIMD extensions")
set(GREP grep)
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
set(GREP ggrep)
endif()
add_custom_command(OUTPUT jsimdcfg.inc
COMMAND ${CMAKE_C_COMPILER} -E -I${CMAKE_BINARY_DIR} -I${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/jsimdcfg.inc.h | ${GREP} -E '^[\;%]|^\ %' | sed 's%_cpp_protection_%%' | sed 's@% define@%define@g' >jsimdcfg.inc)
set(JSIMDCFG_INC ${CMAKE_CURRENT_BINARY_DIR}/jsimdcfg.inc)
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -I\"${CMAKE_CURRENT_BINARY_DIR}/\"")
endif()
if(CPU_TYPE STREQUAL "x86_64")
set(SIMD_SOURCES x86_64/jsimdcpu.asm x86_64/jfdctflt-sse.asm
x86_64/jccolor-sse2.asm x86_64/jcgray-sse2.asm x86_64/jchuff-sse2.asm
x86_64/jcsample-sse2.asm x86_64/jdcolor-sse2.asm x86_64/jdmerge-sse2.asm
x86_64/jdsample-sse2.asm x86_64/jfdctfst-sse2.asm x86_64/jfdctint-sse2.asm
x86_64/jidctflt-sse2.asm x86_64/jidctfst-sse2.asm x86_64/jidctint-sse2.asm
x86_64/jidctred-sse2.asm x86_64/jquantf-sse2.asm x86_64/jquanti-sse2.asm
x86_64/jccolor-avx2.asm x86_64/jcgray-avx2.asm x86_64/jcsample-avx2.asm
x86_64/jdcolor-avx2.asm x86_64/jdmerge-avx2.asm x86_64/jdsample-avx2.asm
x86_64/jquanti-avx2.asm)
else()
set(SIMD_SOURCES i386/jsimdcpu.asm i386/jfdctflt-3dn.asm
i386/jidctflt-3dn.asm i386/jquant-3dn.asm
i386/jccolor-mmx.asm i386/jcgray-mmx.asm i386/jcsample-mmx.asm
i386/jdcolor-mmx.asm i386/jdmerge-mmx.asm i386/jdsample-mmx.asm
i386/jfdctfst-mmx.asm i386/jfdctint-mmx.asm i386/jidctfst-mmx.asm
i386/jidctint-mmx.asm i386/jidctred-mmx.asm i386/jquant-mmx.asm
i386/jfdctflt-sse.asm i386/jidctflt-sse.asm i386/jquant-sse.asm
i386/jccolor-sse2.asm i386/jcgray-sse2.asm i386/jchuff-sse2.asm
i386/jcsample-sse2.asm i386/jdcolor-sse2.asm i386/jdmerge-sse2.asm
i386/jdsample-sse2.asm i386/jfdctfst-sse2.asm i386/jfdctint-sse2.asm
i386/jidctflt-sse2.asm i386/jidctfst-sse2.asm i386/jidctint-sse2.asm
i386/jidctred-sse2.asm i386/jquantf-sse2.asm i386/jquanti-sse2.asm
i386/jccolor-avx2.asm i386/jcgray-avx2.asm i386/jcsample-avx2.asm
i386/jdcolor-avx2.asm i386/jdmerge-avx2.asm i386/jdsample-avx2.asm
i386/jquanti-avx2.asm)
endif()
if(MSVC_IDE)
set(OBJDIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
else()
set(OBJDIR ${CMAKE_CURRENT_BINARY_DIR})
string(REGEX REPLACE " " ";" CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS}")
endif()
file(GLOB INC_FILES *.inc)
file(GLOB INC_FILES nasm/*.inc)
foreach(file ${SIMD_BASENAMES})
set(DEPFILE "")
set(SIMD_SRC ${CMAKE_CURRENT_SOURCE_DIR}/${file}.asm)
foreach(file ${SIMD_SOURCES})
set(OBJECT_DEPENDS "")
if(${file} MATCHES jccolor)
set(DEPFILE ${file})
string(REGEX REPLACE "jccolor" "jccolext" DEPFILE ${DEPFILE})
set(DEPFILE ${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE}.asm)
string(REGEX REPLACE "jccolor" "jccolext" DEPFILE ${file})
set(OBJECT_DEPENDS ${OBJECT_DEPENDS}
${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE})
endif()
if(${file} MATCHES jcgray)
set(DEPFILE ${file})
string(REGEX REPLACE "jcgray" "jcgryext" DEPFILE ${DEPFILE})
set(DEPFILE ${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE}.asm)
string(REGEX REPLACE "jcgray" "jcgryext" DEPFILE ${file})
set(OBJECT_DEPENDS ${OBJECT_DEPENDS}
${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE})
endif()
if(${file} MATCHES jdcolor)
set(DEPFILE ${file})
string(REGEX REPLACE "jdcolor" "jdcolext" DEPFILE ${DEPFILE})
set(DEPFILE ${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE}.asm)
string(REGEX REPLACE "jdcolor" "jdcolext" DEPFILE ${file})
set(OBJECT_DEPENDS ${OBJECT_DEPENDS}
${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE})
endif()
if(${file} MATCHES jdmerge)
set(DEPFILE ${file})
string(REGEX REPLACE "jdmerge" "jdmrgext" DEPFILE ${DEPFILE})
set(DEPFILE ${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE}.asm)
string(REGEX REPLACE "jdmerge" "jdmrgext" DEPFILE ${file})
set(OBJECT_DEPENDS ${OBJECT_DEPENDS}
${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE})
endif()
set(OBJECT_DEPENDS ${OBJECT_DEPENDS} ${INC_FILES} ${JSIMDCFG_INC})
if(MSVC_IDE)
# The CMake Visual Studio generators do not work properly with the ASM_NASM
# language, so we have to go rogue here and use a custom command like we
# did in prior versions of libjpeg-turbo. (This is why we can't have nice
# things.)
string(REGEX REPLACE "${CPU_TYPE}/" "" filename ${file})
set(SIMD_OBJ ${OBJDIR}/${filename}.obj)
add_custom_command(OUTPUT ${SIMD_OBJ} DEPENDS ${file} ${OBJECT_DEPENDS}
COMMAND ${CMAKE_ASM_NASM_COMPILER} -f${CMAKE_ASM_NASM_OBJECT_FORMAT}
${CMAKE_ASM_NASM_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/${file}
-o${SIMD_OBJ})
set(SIMD_OBJS ${SIMD_OBJS} ${SIMD_OBJ})
else()
set_source_files_properties(${file} PROPERTIES OBJECT_DEPENDS
"${OBJECT_DEPENDS}")
endif()
set(SIMD_OBJ ${OBJDIR}/${file}.obj)
add_custom_command(OUTPUT ${SIMD_OBJ}
DEPENDS ${SIMD_SRC} ${DEPFILE} ${INC_FILES}
COMMAND ${NASM} ${NAFLAGS} ${SIMD_SRC} -o${SIMD_OBJ})
set(SIMD_OBJS ${SIMD_OBJS} ${SIMD_OBJ})
endforeach()
set(SIMD_OBJS ${SIMD_OBJS} PARENT_SCOPE)
add_custom_target(simd DEPENDS ${SIMD_OBJS})
if(MSVC_IDE)
set(SIMD_OBJS ${SIMD_OBJS} PARENT_SCOPE)
add_library(simd OBJECT ${CPU_TYPE}/jsimd.c)
add_custom_target(simd-objs DEPENDS ${SIMD_OBJS})
add_dependencies(simd simd-objs)
else()
add_library(simd OBJECT ${SIMD_SOURCES} ${CPU_TYPE}/jsimd.c)
endif()
if(NOT WIN32 AND (CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED))
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
endif()
###############################################################################
# ARM (GAS)
###############################################################################
elseif(CPU_TYPE STREQUAL "arm64" OR CPU_TYPE STREQUAL "arm")
enable_language(ASM)
set(CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS}${CMAKE_ASM_FLAGS})
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC)
set(EFFECTIVE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${CMAKE_ASM_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
message(STATUS "CMAKE_ASM_FLAGS = ${EFFECTIVE_ASM_FLAGS}")
# Test whether we need gas-preprocessor.pl
if(CPU_TYPE STREQUAL "arm")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gastest.S "
.text
.fpu neon
.arch armv7a
.object_arch armv4
.arm
pld [r0]
vmovn.u16 d0, q0")
else()
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gastest.S "
.text
MYVAR .req x0
movi v0.16b, #100
mov MYVAR, #100
.unreq MYVAR")
endif()
separate_arguments(CMAKE_ASM_FLAGS_SEP UNIX_COMMAND "${CMAKE_ASM_FLAGS}")
execute_process(COMMAND ${CMAKE_ASM_COMPILER} ${CMAKE_ASM_FLAGS_SEP}
-x assembler-with-cpp -c ${CMAKE_CURRENT_BINARY_DIR}/gastest.S
RESULT_VARIABLE RESULT OUTPUT_VARIABLE OUTPUT ERROR_VARIABLE ERROR)
if(NOT RESULT EQUAL 0)
message(STATUS "GAS appears to be broken. Trying gas-preprocessor.pl ...")
execute_process(COMMAND gas-preprocessor.pl ${CMAKE_ASM_COMPILER}
${CMAKE_ASM_FLAGS_SEP} -x assembler-with-cpp -c
${CMAKE_CURRENT_BINARY_DIR}/gastest.S
RESULT_VARIABLE RESULT OUTPUT_VARIABLE OUTPUT ERROR_VARIABLE ERROR)
if(NOT RESULT EQUAL 0)
simd_fail("SIMD extensions disabled: GAS is not working properly")
return()
else()
message(STATUS "Using gas-preprocessor.pl")
set(CMAKE_REAL_ASM_COMPILER ${CMAKE_ASM_COMPILER})
set(CMAKE_ASM_COMPILER gas-preprocessor.pl)
set(CMAKE_ASM_FLAGS "${CMAKE_REAL_ASM_COMPILER} ${CMAKE_ASM_FLAGS}")
endif()
else()
message(STATUS "GAS is working properly")
endif()
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/gastest.S)
add_library(simd OBJECT ${CPU_TYPE}/jsimd_neon.S ${CPU_TYPE}/jsimd.c)
if(CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED)
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
endif()
###############################################################################
# MIPS (GAS)
###############################################################################
elseif(CPU_TYPE STREQUAL "mips")
enable_language(ASM)
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC)
set(EFFECTIVE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${CMAKE_ASM_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
message(STATUS "CMAKE_ASM_FLAGS = ${EFFECTIVE_ASM_FLAGS}")
add_library(simd OBJECT ${CPU_TYPE}/jsimd_dspr2.S ${CPU_TYPE}/jsimd.c)
if(CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED)
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
endif()
###############################################################################
# PowerPC (Intrinsics)
###############################################################################
elseif(CPU_TYPE STREQUAL "powerpc")
set(SIMD_SOURCES powerpc/jccolor-altivec.c powerpc/jcgray-altivec.c
powerpc/jcsample-altivec.c powerpc/jdcolor-altivec.c
powerpc/jdmerge-altivec.c powerpc/jdsample-altivec.c
powerpc/jfdctfst-altivec.c powerpc/jfdctint-altivec.c
powerpc/jidctfst-altivec.c powerpc/jidctint-altivec.c
powerpc/jquanti-altivec.c powerpc/jsimd.c)
add_definitions(-maltivec)
add_library(simd OBJECT ${SIMD_SOURCES})
if(CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED)
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
endif()
###############################################################################
# None
###############################################################################
else()
simd_fail("SIMD extensions not available for this CPU (${CMAKE_SYSTEM_PROCESSOR})")
endif() # CPU_TYPE

View File

@@ -1,121 +0,0 @@
noinst_LTLIBRARIES = libsimd.la
BUILT_SOURCES = jsimdcfg.inc
EXTRA_DIST = nasm_lt.sh CMakeLists.txt \
jccolext-mmx.asm jcgryext-mmx.asm jdcolext-mmx.asm jdmrgext-mmx.asm \
jccolext-sse2.asm jcgryext-sse2.asm jdcolext-sse2.asm jdmrgext-sse2.asm \
jccolext-avx2.asm jcgryext-avx2.asm jdcolext-avx2.asm jdmrgext-avx2.asm \
jccolext-sse2-64.asm jcgryext-sse2-64.asm jdcolext-sse2-64.asm \
jdmrgext-sse2-64.asm \
jccolext-avx2-64.asm jcgryext-avx2-64.asm jdcolext-avx2-64.asm \
jdmrgext-avx2-64.asm \
jccolext-altivec.c jcgryext-altivec.c jdcolext-altivec.c \
jdmrgext-altivec.c
if SIMD_X86_64
libsimd_la_SOURCES = jsimd_x86_64.c jsimd.h jsimdcfg.inc.h jsimdext.inc \
jcolsamp.inc jdct.inc jpeg_nbits_table.inc jsimdcpu-64.asm \
jfdctflt-sse-64.asm \
jccolor-sse2-64.asm jcgray-sse2-64.asm jchuff-sse2-64.asm \
jcsample-sse2-64.asm jdcolor-sse2-64.asm jdmerge-sse2-64.asm \
jdsample-sse2-64.asm jfdctfst-sse2-64.asm jfdctint-sse2-64.asm \
jidctflt-sse2-64.asm jidctfst-sse2-64.asm jidctint-sse2-64.asm \
jidctred-sse2-64.asm jquantf-sse2-64.asm jquanti-sse2-64.asm \
jccolor-avx2-64.asm jcgray-avx2-64.asm jcsample-avx2-64.asm \
jdcolor-avx2-64.asm jdmerge-avx2-64.asm jdsample-avx2-64.asm \
jquanti-avx2-64.asm
jccolor-sse2-64.lo: jccolext-sse2-64.asm
jcgray-sse2-64.lo: jcgryext-sse2-64.asm
jdcolor-sse2-64.lo: jdcolext-sse2-64.asm
jdmerge-sse2-64.lo: jdmrgext-sse2-64.asm
jccolor-avx2-64.lo: jccolext-avx2-64.asm
jcgray-avx2-64.lo: jcgryext-avx2-64.asm
jdcolor-avx2-64.lo: jdcolext-avx2-64.asm
jdmerge-avx2-64.lo: jdmrgext-avx2-64.asm
endif
if SIMD_I386
libsimd_la_SOURCES = jsimd_i386.c jsimd.h jsimdcfg.inc.h jsimdext.inc \
jcolsamp.inc jdct.inc jpeg_nbits_table.inc jsimdcpu.asm \
jfdctflt-3dn.asm jidctflt-3dn.asm jquant-3dn.asm \
jccolor-mmx.asm jcgray-mmx.asm jcsample-mmx.asm \
jdcolor-mmx.asm jdmerge-mmx.asm jdsample-mmx.asm \
jfdctfst-mmx.asm jfdctint-mmx.asm jidctfst-mmx.asm \
jidctint-mmx.asm jidctred-mmx.asm jquant-mmx.asm \
jfdctflt-sse.asm jidctflt-sse.asm jquant-sse.asm \
jccolor-sse2.asm jcgray-sse2.asm jchuff-sse2.asm \
jcsample-sse2.asm jdcolor-sse2.asm jdmerge-sse2.asm \
jdsample-sse2.asm jfdctfst-sse2.asm jfdctint-sse2.asm \
jidctflt-sse2.asm jidctfst-sse2.asm jidctint-sse2.asm \
jidctred-sse2.asm jquantf-sse2.asm jquanti-sse2.asm \
jccolor-avx2.asm jcgray-avx2.asm jcsample-avx2.asm \
jdcolor-avx2.asm jdmerge-avx2.asm jdsample-avx2.asm \
jquanti-avx2.asm
jccolor-mmx.lo: jccolext-mmx.asm
jcgray.-mmx.lo: jcgryext-mmx.asm
jdcolor-mmx.lo: jdcolext-mmx.asm
jdmerge-mmx.lo: jdmrgext-mmx.asm
jccolor-sse2.lo: jccolext-sse2.asm
jcgray-sse2.lo: jcgryext-sse2.asm
jdcolor-sse2.lo: jdcolext-sse2.asm
jdmerge-sse2.lo: jdmrgext-sse2.asm
jccolor-avx2.lo: jccolext-avx2.asm
jcgray-avx2.lo: jcgryext-avx2.asm
jdcolor-avx2.lo: jdcolext-avx2.asm
jdmerge-avx2.lo: jdmrgext-avx2.asm
endif
if SIMD_ARM
libsimd_la_SOURCES = jsimd_arm.c jsimd_arm_neon.S
endif
if SIMD_ARM_64
libsimd_la_SOURCES = jsimd_arm64.c jsimd_arm64_neon.S
endif
if SIMD_MIPS
libsimd_la_SOURCES = jsimd_mips.c jsimd_mips_dspr2_asm.h jsimd_mips_dspr2.S
endif
if SIMD_POWERPC
noinst_LTLIBRARIES += libsimd_altivec.la
libsimd_altivec_la_SOURCES = \
jccolor-altivec.c jcgray-altivec.c jcsample-altivec.c \
jdcolor-altivec.c jdmerge-altivec.c jdsample-altivec.c \
jfdctfst-altivec.c jfdctint-altivec.c \
jidctfst-altivec.c jidctint-altivec.c \
jquanti-altivec.c
libsimd_altivec_la_CFLAGS = -maltivec
jccolor-altivec.lo: jccolext-altivec.c
jcgray-altivec.lo: jcgryext-altivec.c
jdcolor-altivec.lo: jdcolext-altivec.c
jdmerge-altivec.lo: jdmrgext-altivec.c
libsimd_la_SOURCES = jsimd_powerpc.c jsimd_altivec.h jcsample.h
libsimd_la_LIBADD = libsimd_altivec.la
endif
AM_CPPFLAGS = -I$(top_srcdir)
.asm.lo:
$(AM_V_GEN) $(LIBTOOL) $(AM_V_lt) --mode=compile --tag NASM $(srcdir)/nasm_lt.sh $(AM_V_lt) $(NASM) $(NAFLAGS) -I$(srcdir) -I. $< -o $@
jsimdcfg.inc: $(srcdir)/jsimdcfg.inc.h ../jpeglib.h ../jconfig.h ../jmorecfg.h
$(AM_V_GEN) $(CPP) -I$(top_builddir) -I$(top_builddir)/simd $(srcdir)/jsimdcfg.inc.h | $(EGREP) "^[\;%]|^\ %" | sed 's%_cpp_protection_%%' | sed 's@% define@%define@g' > $@

View File

@@ -15,12 +15,12 @@
*/
#define JPEG_INTERNALS
#include "../jinclude.h"
#include "../jpeglib.h"
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../jsimd.h"
#include "../jdct.h"
#include "../jsimddct.h"
#include "jsimd.h"
#include <stdio.h>
#include <string.h>

View File

@@ -15,12 +15,12 @@
*/
#define JPEG_INTERNALS
#include "../jinclude.h"
#include "../jpeglib.h"
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../jsimd.h"
#include "../jdct.h"
#include "../jsimddct.h"
#include "jsimd.h"
#include <stdio.h>
#include <string.h>

View File

@@ -15,12 +15,12 @@
*/
#define JPEG_INTERNALS
#include "../jinclude.h"
#include "../jpeglib.h"
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../jsimd.h"
#include "../jdct.h"
#include "../jsimddct.h"
#include "jsimd.h"
/*
* In the PIC cases, we have no guarantee that constants will keep

View File

@@ -16,12 +16,12 @@
*/
#define JPEG_INTERNALS
#include "../jinclude.h"
#include "../jpeglib.h"
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../jsimd.h"
#include "../jdct.h"
#include "../jsimddct.h"
#include "jsimd.h"
#include <stdio.h>
#include <string.h>

View File

@@ -23,7 +23,7 @@
* 3. This notice may not be removed or altered from any source distribution.
*/
#include "jsimd_mips_dspr2_asm.h"
#include "jsimd_dspr2_asm.h"
/*****************************************************************************/
LEAF_MIPS_DSPR2(jsimd_c_null_convert_mips_dspr2)
@@ -4484,4 +4484,3 @@ LEAF_MIPS_DSPR2(jsimd_convsamp_float_mips_dspr2)
END(jsimd_convsamp_float_mips_dspr2)
/*****************************************************************************/

View File

@@ -281,5 +281,3 @@ LEAF_MIPS32R2(symbol) \
addiu sp, sp, \stack_offset
.endif
.endm

Some files were not shown because too many files have changed in this diff Show More