Add libjpeg dependency

This commit is contained in:
Jay Berkenbilt 2017-08-17 19:12:19 -04:00
parent 2d2f619665
commit a0a8f45a1c
5 changed files with 44 additions and 19 deletions

28
README
View File

@ -13,11 +13,11 @@ warranty.
Prerequisites Prerequisites
============= =============
QPDF depends on the external library "zlib". This are part of every QPDF depends on the external libraries "zlib" and "jpeg". These are
Linux distribution and is readily available. Download information part of every Linux distribution and are readily available. Download
appears in the documentation. For Windows, you can download pre-built information appears in the documentation. For Windows, you can
binary versions of this libraries for some compilers; see download pre-built binary versions of these libraries for some
README-windows.txt for additional details. compilers; see README-windows.txt for additional details.
QPDF requires a C++ compiler that works with STL. Your compiler must QPDF requires a C++ compiler that works with STL. Your compiler must
also support "long long". Almost all modern compilers do. If you are also support "long long". Almost all modern compilers do. If you are
@ -34,9 +34,10 @@ you had an otherwise working qpdf.
Licensing terms of embedded software Licensing terms of embedded software
==================================== ====================================
QPDF makes use of zlib for its functionality. This package can be QPDF makes use of zlib and jpeg libraries for its functionality. These
downloaded separately from its own download location, or it can be packages can be downloaded separately from their own download
downloaded in the external-libs area of the qpdf download site. locations, or they can be downloaded in the external-libs area of the
qpdf download site.
The Rijndael encryption implementation used as the basis for AES The Rijndael encryption implementation used as the basis for AES
encryption and decryption support comes from Philip J. Erdelsky's encryption and decryption support comes from Philip J. Erdelsky's
@ -147,10 +148,13 @@ sources to the user's manual can be found in the "manual" directory.
The software library is just libqpdf, and all the header files are in The software library is just libqpdf, and all the header files are in
the qpdf subdirectory. If you link statically with -lqpdf, then you the qpdf subdirectory. If you link statically with -lqpdf, then you
will also need to link with -lz. The shared qpdf library is linked will also need to link with -lz and -ljpeg. The shared qpdf library is
with -lz, and none of qpdf's public header files directly include linked with -lz and -ljpeg, none of qpdf's public header files
files from libz, so in many cases, qpdf's development files are self directly include files from libz, and only Pl_DCT.hh includes files
contained. from libjpeg, so for most cases, qpdf's development files are self
contained. If you need to use Pl_DCT in your application code, you
will need to have the header files for some libjpeg distribution in
your include path.
To learn about using the library, please read comments in the header To learn about using the library, please read comments in the header
files in include/qpdf, especially QPDF.hh, QPDFObjectHandle.hh, and files in include/qpdf, especially QPDF.hh, QPDFObjectHandle.hh, and

View File

@ -47,7 +47,10 @@ download.
If you want to build the external libraries on your own (for If you want to build the external libraries on your own (for
Windows or anything else), you can download this archive. In Windows or anything else), you can download this archive. In
addition to including an unmodified distribution zlib, it includes addition to including an unmodified distribution zlib and the jpeg
a README file and some scripts to help you build it for Windows. libary, it includes a README file and some scripts to help you
build it for Windows. qpdf was built using a binary distribution of
libjpeg-turbo for Windows. You will also have to provide those. See
README-windows.txt for details.
If you want to build on Windows, please see also README-windows.txt. If you want to build on Windows, please see also README-windows.txt.

View File

@ -102,6 +102,8 @@ fi
if test "$BUILD_INTERNAL_LIBS" = "0"; then if test "$BUILD_INTERNAL_LIBS" = "0"; then
AC_CHECK_HEADER(zlib.h,,[MISSING_ZLIB_H=1; MISSING_ANY=1]) AC_CHECK_HEADER(zlib.h,,[MISSING_ZLIB_H=1; MISSING_ANY=1])
AC_SEARCH_LIBS(deflate,z zlib,,[MISSING_ZLIB=1; MISSING_ANY=1]) AC_SEARCH_LIBS(deflate,z zlib,,[MISSING_ZLIB=1; MISSING_ANY=1])
AC_CHECK_HEADER(jpeglib.h,,[MISSING_JPEG_H=1; MISSING_ANY=1])
AC_SEARCH_LIBS(jpeg_destroy,jpeg,,[MISSING_JPEG=1; MISSING_ANY=1])
fi fi
if test "x$qpdf_OS_SECURE_RANDOM" = "x1"; then if test "x$qpdf_OS_SECURE_RANDOM" = "x1"; then
@ -471,6 +473,14 @@ if test "$MISSING_ZLIB" = "1"; then
AC_MSG_WARN(unable to find required library z (or zlib)) AC_MSG_WARN(unable to find required library z (or zlib))
fi fi
if test "$MISSING_JPEG_H" = "1"; then
AC_MSG_WARN(unable to find required header jpeglib.h)
fi
if test "$MISSING_JPEG" = "1"; then
AC_MSG_WARN(unable to find required library jpeg)
fi
if test "$MISSING_DOCBOOK_FO" = "1"; then if test "$MISSING_DOCBOOK_FO" = "1"; then
AC_MSG_WARN(docbook fo stylesheets are required to build PDF documentation) AC_MSG_WARN(docbook fo stylesheets are required to build PDF documentation)
fi fi
@ -507,7 +517,7 @@ if test "$USE_EXTERNAL_LIBS" = "1"; then
# much trouble getting it to work with a different compiler. # much trouble getting it to work with a different compiler.
CPPFLAGS="$CPPFLAGS -Iexternal-libs/include" CPPFLAGS="$CPPFLAGS -Iexternal-libs/include"
LDFLAGS="$LDFLAGS -Lexternal-libs/lib-$BUILDRULES$WINDOWS_WORDSIZE" LDFLAGS="$LDFLAGS -Lexternal-libs/lib-$BUILDRULES$WINDOWS_WORDSIZE"
LIBS="$LIBS -lz" LIBS="$LIBS -lz -ljpeg"
fi fi
AC_OUTPUT AC_OUTPUT

View File

@ -6,6 +6,6 @@ includedir=@includedir@
Name: libqpdf Name: libqpdf
Description: PDF transformation library Description: PDF transformation library
Version: @PACKAGE_VERSION@ Version: @PACKAGE_VERSION@
Requires.private: zlib Requires.private: zlib, libjpeg
Libs: -L${libdir} -lqpdf Libs: -L${libdir} -lqpdf
Cflags: -I${includedir} Cflags: -I${includedir}

View File

@ -93,14 +93,22 @@
<sect1 id="ref.prerequisites"> <sect1 id="ref.prerequisites">
<title>System Requirements</title> <title>System Requirements</title>
<para> <para>
The qpdf package has only one external dependencies. In The qpdf package has few external dependencies. In order to build
order to build qpdf, the following packages are required: qpdf, the following packages are required:
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para> <para>
zlib: <ulink url="http://www.zlib.net/">http://www.zlib.net/</ulink> zlib: <ulink url="http://www.zlib.net/">http://www.zlib.net/</ulink>
</para> </para>
</listitem> </listitem>
<listitem>
<para>
jpeg: <ulink
url="http://www.ijg.org/files/">http://www.ijg.org/files/</ulink>
or <ulink
url="https://libjpeg-turbo.org/">https://libjpeg-turbo.org/</ulink>
</para>
</listitem>
<listitem> <listitem>
<para> <para>
gnu make 3.81 or newer: <ulink url="http://www.gnu.org/software/make">http://www.gnu.org/software/make</ulink> gnu make 3.81 or newer: <ulink url="http://www.gnu.org/software/make">http://www.gnu.org/software/make</ulink>
@ -1509,7 +1517,7 @@ outfile.pdf</option>
</para> </para>
<para> <para>
When linking against the qpdf static library, you may also need to When linking against the qpdf static library, you may also need to
specify <literal>-lz</literal> on your link command. If specify <literal>-lz -ljpeg</literal> on your link command. If
your system understands how to read libtool your system understands how to read libtool
<filename>.la</filename> files, this may not be necessary. <filename>.la</filename> files, this may not be necessary.
</para> </para>