From a0a8f45a1c8ca7952e4596785ad399ec47b7a0af Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Thu, 17 Aug 2017 19:12:19 -0400 Subject: [PATCH] Add libjpeg dependency --- README | 28 ++++++++++++++++------------ README-what-to-download.txt | 7 +++++-- configure.ac | 12 +++++++++++- libqpdf.pc.in | 2 +- manual/qpdf-manual.xml | 14 +++++++++++--- 5 files changed, 44 insertions(+), 19 deletions(-) diff --git a/README b/README index 9e7b885c..c8431988 100644 --- a/README +++ b/README @@ -13,11 +13,11 @@ warranty. Prerequisites ============= -QPDF depends on the external library "zlib". This are part of every -Linux distribution and is readily available. Download information -appears in the documentation. For Windows, you can download pre-built -binary versions of this libraries for some compilers; see -README-windows.txt for additional details. +QPDF depends on the external libraries "zlib" and "jpeg". These are +part of every Linux distribution and are readily available. Download +information appears in the documentation. For Windows, you can +download pre-built binary versions of these libraries for some +compilers; see README-windows.txt for additional details. QPDF requires a C++ compiler that works with STL. Your compiler must 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 ==================================== -QPDF makes use of zlib for its functionality. This package can be -downloaded separately from its own download location, or it can be -downloaded in the external-libs area of the qpdf download site. +QPDF makes use of zlib and jpeg libraries for its functionality. These +packages can be downloaded separately from their own download +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 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 qpdf subdirectory. If you link statically with -lqpdf, then you -will also need to link with -lz. The shared qpdf library is linked -with -lz, and none of qpdf's public header files directly include -files from libz, so in many cases, qpdf's development files are self -contained. +will also need to link with -lz and -ljpeg. The shared qpdf library is +linked with -lz and -ljpeg, none of qpdf's public header files +directly include files from libz, and only Pl_DCT.hh includes files +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 files in include/qpdf, especially QPDF.hh, QPDFObjectHandle.hh, and diff --git a/README-what-to-download.txt b/README-what-to-download.txt index 97500399..7fae0d2f 100644 --- a/README-what-to-download.txt +++ b/README-what-to-download.txt @@ -47,7 +47,10 @@ download. If you want to build the external libraries on your own (for Windows or anything else), you can download this archive. In - addition to including an unmodified distribution zlib, it includes - a README file and some scripts to help you build it for Windows. + addition to including an unmodified distribution zlib and the jpeg + 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. diff --git a/configure.ac b/configure.ac index 36119999..8d8e2d15 100644 --- a/configure.ac +++ b/configure.ac @@ -102,6 +102,8 @@ fi if test "$BUILD_INTERNAL_LIBS" = "0"; then 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_CHECK_HEADER(jpeglib.h,,[MISSING_JPEG_H=1; MISSING_ANY=1]) + AC_SEARCH_LIBS(jpeg_destroy,jpeg,,[MISSING_JPEG=1; MISSING_ANY=1]) fi 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)) 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 AC_MSG_WARN(docbook fo stylesheets are required to build PDF documentation) fi @@ -507,7 +517,7 @@ if test "$USE_EXTERNAL_LIBS" = "1"; then # much trouble getting it to work with a different compiler. CPPFLAGS="$CPPFLAGS -Iexternal-libs/include" LDFLAGS="$LDFLAGS -Lexternal-libs/lib-$BUILDRULES$WINDOWS_WORDSIZE" - LIBS="$LIBS -lz" + LIBS="$LIBS -lz -ljpeg" fi AC_OUTPUT diff --git a/libqpdf.pc.in b/libqpdf.pc.in index 8ece4873..d45df49e 100644 --- a/libqpdf.pc.in +++ b/libqpdf.pc.in @@ -6,6 +6,6 @@ includedir=@includedir@ Name: libqpdf Description: PDF transformation library Version: @PACKAGE_VERSION@ -Requires.private: zlib +Requires.private: zlib, libjpeg Libs: -L${libdir} -lqpdf Cflags: -I${includedir} diff --git a/manual/qpdf-manual.xml b/manual/qpdf-manual.xml index 0266a1dc..ac1de4c6 100644 --- a/manual/qpdf-manual.xml +++ b/manual/qpdf-manual.xml @@ -93,14 +93,22 @@ System Requirements - The qpdf package has only one external dependencies. In - order to build qpdf, the following packages are required: + The qpdf package has few external dependencies. In order to build + qpdf, the following packages are required: zlib: http://www.zlib.net/ + + + jpeg: http://www.ijg.org/files/ + or https://libjpeg-turbo.org/ + + gnu make 3.81 or newer: http://www.gnu.org/software/make @@ -1509,7 +1517,7 @@ outfile.pdf When linking against the qpdf static library, you may also need to - specify -lz on your link command. If + specify -lz -ljpeg on your link command. If your system understands how to read libtool .la files, this may not be necessary.